Files
site/node_modules/@sveltia/cms/dist/sveltia-cms.mjs
T
site-admin 3ac81d5a52
deploy / build-and-publish (push) Successful in 1m37s
the editable site (validation-lab)
2026-11-21 08:03:55 +01:00

3635 lines
2.5 MiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n)),u=o((e=>{
/**
* @license React
* react.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},ee=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function te(e,t){return E(e.type,t,e.props)}function ne(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function re(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ie=/\/+/g;function ae(e,t){return typeof e==`object`&&e&&e.key!=null?re(``+e.key):t.toString(36)}function oe(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function se(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,se(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ae(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(ie,`$&/`)+`/`),se(o,r,i,``,function(e){return e})):o!=null&&(ne(o)&&(o=te(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ie,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+ae(a,u),c+=se(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+ae(a,u++),c+=se(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return se(oe(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function ce(e,t,n){if(e==null)return e;var r=[],i=0;return se(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function le(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var ue=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function de(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,ue)}catch(e){ue(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function fe(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else de(fe.bind(null,e))}var pe={map:ce,forEach:function(e,t,n){ce(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ce(e,function(){t++}),t},toArray:function(e){return ce(e,function(e){return e})||[]},only:function(e){if(!ne(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=pe,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=fe,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!ee.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)ee.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=ne,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:le}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=de,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.1`})),d=o(((e,t)=>{t.exports=u()})),f=o(((e,t)=>{
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
var n=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function a(e){if(e==null)throw TypeError(`Object.assign cannot be called with null or undefined`);return Object(e)}function o(){try{if(!Object.assign)return!1;var e=new String(`abc`);if(e[5]=`de`,Object.getOwnPropertyNames(e)[0]===`5`)return!1;for(var t={},n=0;n<10;n++)t[`_`+String.fromCharCode(n)]=n;if(Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(``)!==`0123456789`)return!1;var r={};return`abcdefghijklmnopqrst`.split(``).forEach(function(e){r[e]=e}),Object.keys(Object.assign({},r)).join(``)===`abcdefghijklmnopqrst`}catch{return!1}}t.exports=o()?Object.assign:function(e,t){for(var o,s=a(e),c,l=1;l<arguments.length;l++){for(var u in o=Object(arguments[l]),o)r.call(o,u)&&(s[u]=o[u]);if(n){c=n(o);for(var d=0;d<c.length;d++)i.call(o,c[d])&&(s[c[d]]=o[c[d]])}}return s}})),p=o(((e,t)=>{var n=f(),r={};function i(e,t,n,r,i,a,o,s){if(!e){var c;if(t===void 0)c=Error(`Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.`);else{var l=[n,r,i,a,o,s],u=0;c=Error(t.replace(/%s/g,function(){return l[u++]})),c.name=`Invariant Violation`}throw c.framesToPop=1,c}}var a=`mixins`;function o(e){return e}function s(e,t,s){var c=[],l={mixins:`DEFINE_MANY`,statics:`DEFINE_MANY`,propTypes:`DEFINE_MANY`,contextTypes:`DEFINE_MANY`,childContextTypes:`DEFINE_MANY`,getDefaultProps:`DEFINE_MANY_MERGED`,getInitialState:`DEFINE_MANY_MERGED`,getChildContext:`DEFINE_MANY_MERGED`,render:`DEFINE_ONCE`,componentWillMount:`DEFINE_MANY`,componentDidMount:`DEFINE_MANY`,componentWillReceiveProps:`DEFINE_MANY`,shouldComponentUpdate:`DEFINE_ONCE`,componentWillUpdate:`DEFINE_MANY`,componentDidUpdate:`DEFINE_MANY`,componentWillUnmount:`DEFINE_MANY`,UNSAFE_componentWillMount:`DEFINE_MANY`,UNSAFE_componentWillReceiveProps:`DEFINE_MANY`,UNSAFE_componentWillUpdate:`DEFINE_MANY`,updateComponent:`OVERRIDE_BASE`},u={getDerivedStateFromProps:`DEFINE_MANY_MERGED`},d={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var n=0;n<t.length;n++)p(e,t[n])},childContextTypes:function(e,t){e.childContextTypes=n({},e.childContextTypes,t)},contextTypes:function(e,t){e.contextTypes=n({},e.contextTypes,t)},getDefaultProps:function(e,t){e.getDefaultProps=e.getDefaultProps?g(e.getDefaultProps,t):t},propTypes:function(e,t){e.propTypes=n({},e.propTypes,t)},statics:function(e,t){m(e,t)},autobind:function(){}};function f(e,t){var n=l.hasOwnProperty(t)?l[t]:null;S.hasOwnProperty(t)&&i(n===`OVERRIDE_BASE`,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t),e&&i(n===`DEFINE_MANY`||n===`DEFINE_MANY_MERGED`,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t)}function p(e,n){if(n){i(typeof n!=`function`,`ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object.`),i(!t(n),`ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.`);var r=e.prototype,o=r.__reactAutoBindPairs;for(var s in n.hasOwnProperty(a)&&d.mixins(e,n.mixins),n)if(n.hasOwnProperty(s)&&s!==a){var c=n[s],u=r.hasOwnProperty(s);if(f(u,s),d.hasOwnProperty(s))d[s](e,c);else{var p=l.hasOwnProperty(s);if(typeof c==`function`&&!p&&!u&&n.autobind!==!1)o.push(s,c),r[s]=c;else if(u){var m=l[s];i(p&&(m===`DEFINE_MANY_MERGED`||m===`DEFINE_MANY`),`ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.`,m,s),m===`DEFINE_MANY_MERGED`?r[s]=g(r[s],c):m===`DEFINE_MANY`&&(r[s]=_(r[s],c))}else r[s]=c}}}}function m(e,t){if(t)for(var n in t){var r=t[n];if(t.hasOwnProperty(n)){if(i(!(n in d),'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',n),n in e){i((u.hasOwnProperty(n)?u[n]:null)===`DEFINE_MANY_MERGED`,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n),e[n]=g(e[n],r);return}e[n]=r}}}function h(e,t){for(var n in i(e&&t&&typeof e==`object`&&typeof t==`object`,`mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.`),t)t.hasOwnProperty(n)&&(i(e[n]===void 0,"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",n),e[n]=t[n]);return e}function g(e,t){return function(){var n=e.apply(this,arguments),r=t.apply(this,arguments);if(n==null)return r;if(r==null)return n;var i={};return h(i,n),h(i,r),i}}function _(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function v(e,t){return t.bind(e)}function y(e){for(var t=e.__reactAutoBindPairs,n=0;n<t.length;n+=2){var r=t[n],i=t[n+1];e[r]=v(e,i)}}var b={componentDidMount:function(){this.__isMounted=!0}},x={componentWillUnmount:function(){this.__isMounted=!1}},S={replaceState:function(e,t){this.updater.enqueueReplaceState(this,e,t)},isMounted:function(){return!!this.__isMounted}},C=function(){};n(C.prototype,e.prototype,S);function w(e){var t=o(function(e,n,a){this.__reactAutoBindPairs.length&&y(this),this.props=e,this.context=n,this.refs=r,this.updater=a||s,this.state=null;var o=this.getInitialState?this.getInitialState():null;i(typeof o==`object`&&!Array.isArray(o),`%s.getInitialState(): must return an object or null`,t.displayName||`ReactCompositeComponent`),this.state=o});for(var n in t.prototype=new C,t.prototype.constructor=t,t.prototype.__reactAutoBindPairs=[],c.forEach(p.bind(null,t)),p(t,b),p(t,e),p(t,x),t.getDefaultProps&&(t.defaultProps=t.getDefaultProps()),i(t.prototype.render,"createClass(...): Class specification must implement a `render` method."),l)t.prototype[n]||(t.prototype[n]=null);return t}return w}t.exports=s})),m=l(o(((e,t)=>{var n=d(),r=p();if(n===void 0)throw Error(`create-react-class could not find the React object. If you are using script tags, make sure that React is being loaded before create-react-class.`);var i=new n.Component().updater;t.exports=r(n.Component,n.isValidElement,i)}))(),1);
/*! @license DOMPurify 3.4.17 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.17/LICENSE */
function h(e,t){this.v=e,this.k=t}function g(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function _(e){if(Array.isArray(e))return e}function v(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function y(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
function b(e,t){return _(e)||v(e,t)||x(e,t)||y()}function x(e,t){if(e){if(typeof e==`string`)return g(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(e,t):void 0}}function S(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof h;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}S.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},S.prototype.next=function(e){return this._invoke(`next`,e)},S.prototype.throw=function(e){return this._invoke(`throw`,e)},S.prototype.return=function(e){return this._invoke(`return`,e)};var C=Object.entries,w=Object.setPrototypeOf,T=Object.isFrozen,ee=Object.getPrototypeOf,E=Object.getOwnPropertyDescriptor,te=Object.freeze,ne=Object.seal,re=Object.create,ie=typeof Reflect<`u`&&Reflect,ae=ie.apply,oe=ie.construct;te||=function(e){return e},ne||=function(e){return e},ae||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},oe||=function(e){return new e(...[...arguments].slice(1))};var se=je(Array.prototype.forEach);Array.prototype.indexOf;var ce=je(Array.prototype.lastIndexOf),le=je(Array.prototype.pop),ue=je(Array.prototype.push),de=je(Array.prototype.slice),fe=je(Array.prototype.splice),pe=Array.isArray,me=Me(Set),he=je(Set.prototype.add),ge=je(Set.prototype.has),_e=je(String.prototype.toLowerCase),ve=je(String.prototype.toString),ye=je(String.prototype.match),be=je(String.prototype.replace),xe=je(String.prototype.indexOf),Se=je(String.prototype.trim),Ce=je(Number.prototype.toString),we=je(Boolean.prototype.toString),Te=typeof BigInt>`u`?null:je(BigInt.prototype.toString),Ee=typeof Symbol>`u`?null:je(Symbol.prototype.toString),De=je(Object.prototype.hasOwnProperty),Oe=je(Object.prototype.toString),ke=je(RegExp.prototype.test),Ae=Me(TypeError);function je(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return ae(e,t,n)}}function Me(e){return function(){return oe(e,[...arguments])}}function Ne(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:_e;if(w&&w(e,null),!pe(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(T(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Pe(e){for(let t=0;t<e.length;t++)De(e,t)||(e[t]=null);return e}function Fe(e){let t=re(null);for(let r of C(e)){var n=b(r,2);let i=n[0],a=n[1];De(e,i)&&(t[i]=pe(a)?Pe(a):a&&typeof a==`object`&&a.constructor===Object?Fe(a):a)}return t}function Ie(e){switch(typeof e){case`string`:return e;case`number`:return Ce(e);case`boolean`:return we(e);case`bigint`:return Te?Te(e):`0`;case`symbol`:return Ee?Ee(e):`Symbol()`;case`undefined`:return Oe(e);case`function`:case`object`:{if(e===null)return Oe(e);let t=e,n=Le(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:Oe(e)}return Oe(e)}default:return Oe(e)}}function Le(e,t){for(;e!==null;){let n=E(e,t);if(n){if(n.get)return je(n.get);if(typeof n.value==`function`)return je(n.value)}e=ee(e)}function n(){return null}return n}function Re(e,t){for(;e!==null;){let n=E(e,t);if(n)return n.get?je(n.get):null;e=ee(e)}return null}function ze(e){try{return ke(e,``),!0}catch{return!1}}var Be=te(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Ve=te(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),He=te([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),Ue=te([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),We=te(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),eee=te([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Ge=te([`#text`]),Ke=te(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),qe=te(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),Je=te(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),Ye=te([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Xe=ne(/{{[\w\W]*|^[\w\W]*}}/g),Ze=ne(/<%[\w\W]*|^[\w\W]*%>/g),Qe=ne(/\${[\w\W]*/g),$e=ne(/^data-[\-\w.\u00B7-\uFFFF]+$/),tee=ne(/^aria-[\-\w]+$/),et=ne(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),tt=ne(/^(?:\w+script|data):/i),nee=ne(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ree=ne(/^html$/i),iee=ne(/^[a-z][.\w]*(-[.\w]+)+$/i),nt=ne(/<[/\w!]/g),rt=ne(/<[/\w]/g),aee=ne(/<\/no(script|embed|frames)/i),it=ne(/\/>/i),at={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},oee=te(Ne({},[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`])),see=function(){return typeof window>`u`?null:window},cee=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},lee=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},ot=function(e,t,n,r){return De(e,t)&&pe(e[t])?Ne(r.base?Fe(r.base):{},e[t],r.transform):n},st=function(e,t,n){let r=De(e,t)?e[t]:void 0;return r&&typeof r==`object`?Fe(r):n()};function ct(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:see(),t=e=>ct(e);if(t.version=`3.4.17`,t.removed=[],!e||!e.document||e.document.nodeType!==at.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=Le(d,`cloneNode`),p=Le(d,`remove`),m=Le(d,`removeAttributeNode`),h=Le(d,`nextSibling`),g=Le(d,`childNodes`),_=Le(d,`parentNode`),v=Le(d,`shadowRoot`),y=Le(d,`attributes`),b=o&&o.prototype?Le(o.prototype,`nodeType`):null,x=o&&o.prototype?Le(o.prototype,`nodeName`):null,S=o&&o.prototype?Le(o.prototype,`ownerDocument`):null,w=function(e){return b?b(e):e.nodeType},T=function(e){return x?x(e):e.nodeName},ee=Re(d,`namespaceURI`),E=function(e){return ee?ee(e):e.namespaceURI};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let ie,ae=``,oe,Ce=!1,we=0,Te=function(){if(we>0)throw Ae(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},Ee=function(e){Te(),we++;try{return ie.createHTML(e)}finally{we--}},Oe=function(e){Te(),we++;try{return ie.createScriptURL(e)}finally{we--}},je=function(){return Ce||=(oe=cee(u,i),!0),oe},Me=n,Pe=Me.implementation,lt=Me.createNodeIterator,ut=Me.createDocumentFragment,dt=Me.getElementsByTagName,ft=r.importNode,pt=lee();t.isSupported=typeof C==`function`&&typeof _==`function`&&Pe&&Pe.createHTMLDocument!==void 0;let mt=Xe,ht=Ze,gt=Qe,_t=$e,vt=tee,yt=tt,bt=nee,xt=iee,St=et,Ct=null,wt=Ne({},[...Be,...Ve,...He,...We,...Ge]),Tt=null,Et=Ne({},[...Ke,...qe,...Je,...Ye]),Dt=Object.seal(re(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ot=null,kt=null,At=Object.seal(re(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),jt=!0,Mt=!0,Nt=!1,Pt=!0,Ft=!1,It=!0,Lt=!1,Rt=!1,zt=null,Bt=null,Vt=!1,Ht=!1,Ut=!1,Wt=!1,Gt=!0,Kt=!1,qt=`user-content-`,Jt=!0,Yt=!1,Xt=null,Zt={},Qt=null,$t=Ne({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),en=null,tn=Ne({},[`audio`,`video`,`img`,`source`,`image`,`track`]),nn=null,rn=Ne({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),an=`http://www.w3.org/1998/Math/MathML`,on=`http://www.w3.org/2000/svg`,sn=`http://www.w3.org/1999/xhtml`,cn=sn,ln=!1,un=null,dn=Ne({},[an,on,sn],ve),fn=te([`mi`,`mo`,`mn`,`ms`,`mtext`]),pn=Ne({},fn),mn=te([`annotation-xml`]),hn=Ne({},mn),gn=Ne({},[`title`,`style`,`font`,`a`,`script`]),_n=null,vn=[`application/xhtml+xml`,`text/html`],yn=null,bn=null,xn=n.createElement(`form`),Sn=function(e){return e instanceof RegExp||e instanceof Function},Cn=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(bn&&bn===e)return;e&&typeof e==`object`||(e={}),e=Fe(e),_n=vn.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,yn=_n===`application/xhtml+xml`?ve:_e,Ct=ot(e,`ALLOWED_TAGS`,wt,{transform:yn}),Tt=ot(e,`ALLOWED_ATTR`,Et,{transform:yn}),un=ot(e,`ALLOWED_NAMESPACES`,dn,{transform:ve}),nn=ot(e,`ADD_URI_SAFE_ATTR`,rn,{transform:yn,base:rn}),en=ot(e,`ADD_DATA_URI_TAGS`,tn,{transform:yn,base:tn}),Qt=ot(e,`FORBID_CONTENTS`,$t,{transform:yn}),Ot=ot(e,`FORBID_TAGS`,Fe({}),{transform:yn}),kt=ot(e,`FORBID_ATTR`,Fe({}),{transform:yn}),Zt=De(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?Fe(e.USE_PROFILES):e.USE_PROFILES:!1,jt=e.ALLOW_ARIA_ATTR!==!1,Mt=e.ALLOW_DATA_ATTR!==!1,Nt=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Pt=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ft=e.SAFE_FOR_TEMPLATES||!1,It=e.SAFE_FOR_XML!==!1,Lt=e.WHOLE_DOCUMENT||!1,Ht=e.RETURN_DOM||!1,Ut=e.RETURN_DOM_FRAGMENT||!1,Wt=e.RETURN_TRUSTED_TYPE||!1,Vt=e.FORCE_BODY||!1,Gt=e.SANITIZE_DOM!==!1,Kt=e.SANITIZE_NAMED_PROPS||!1,Jt=e.KEEP_CONTENT!==!1,Yt=e.IN_PLACE||!1,St=ze(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:et,cn=typeof e.NAMESPACE==`string`?e.NAMESPACE:sn,pn=st(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>Ne({},fn)),hn=st(e,`HTML_INTEGRATION_POINTS`,()=>Ne({},mn));let t=st(e,`CUSTOM_ELEMENT_HANDLING`,()=>re(null));if(Dt=re(null),De(t,`tagNameCheck`)&&Sn(t.tagNameCheck)&&(Dt.tagNameCheck=t.tagNameCheck),De(t,`attributeNameCheck`)&&Sn(t.attributeNameCheck)&&(Dt.attributeNameCheck=t.attributeNameCheck),De(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(Dt.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),ne(Dt),Ft&&(Mt=!1),Ut&&(Ht=!0),Zt&&(Ct=Ne({},Ge),Tt=re(null),Zt.html===!0&&(Ne(Ct,Be),Ne(Tt,Ke)),Zt.svg===!0&&(Ne(Ct,Ve),Ne(Tt,qe),Ne(Tt,Ye)),Zt.svgFilters===!0&&(Ne(Ct,He),Ne(Tt,qe),Ne(Tt,Ye)),Zt.mathMl===!0&&(Ne(Ct,We),Ne(Tt,Je),Ne(Tt,Ye))),At.tagCheck=null,At.attributeCheck=null,De(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?At.tagCheck=e.ADD_TAGS:pe(e.ADD_TAGS)&&(Ct===wt&&(Ct=Fe(Ct)),Ne(Ct,e.ADD_TAGS,yn))),De(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?At.attributeCheck=e.ADD_ATTR:pe(e.ADD_ATTR)&&(Tt===Et&&(Tt=Fe(Tt)),Ne(Tt,e.ADD_ATTR,yn))),De(e,`ADD_FORBID_CONTENTS`)&&pe(e.ADD_FORBID_CONTENTS)&&(Qt===$t&&(Qt=Fe(Qt)),Ne(Qt,e.ADD_FORBID_CONTENTS,yn)),Jt&&(Ct[`#text`]=!0),Lt&&Ne(Ct,[`html`,`head`,`body`]),Ct.table&&(Ne(Ct,[`tbody`]),delete Ot.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw Ae(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw Ae(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=ie;ie=e.TRUSTED_TYPES_POLICY;try{ae=Ee(``)}catch(e){throw ie=t,e}}else e.TRUSTED_TYPES_POLICY===null?(ie=void 0,ae=``):(ie===void 0&&(ie=je()),ie&&typeof ae==`string`&&(ae=Ee(``)));te&&te(e),bn=e},wn=Ne({},[...Ve,...He,...Ue]),Tn=Ne({},[...We,...eee]),En=function(e,t,n){return t.namespaceURI===sn?e===`svg`:t.namespaceURI===an?e===`svg`&&(n===`annotation-xml`||pn[n]):!!wn[e]},uee=function(e,t,n){return t.namespaceURI===sn?e===`math`:t.namespaceURI===on?e===`math`&&hn[n]:!!Tn[e]},dee=function(e,t,n){return t.namespaceURI===on&&!hn[n]||t.namespaceURI===an&&!pn[n]?!1:!Tn[e]&&(gn[e]||!wn[e])},Dn=function(e){let t=E(e),n=_e(T(e)),r=_(e),i,a;return r&&w(r)===at.element?(i={namespaceURI:E(r)},a=_e(T(r))):(i={namespaceURI:cn},a=`template`),un[t]?t===on?En(n,i,a):t===an?uee(n,i,a):t===sn?dee(n,i,a):!!(_n===`application/xhtml+xml`&&un[t]):!1},On=function(e){ue(t.removed,{element:e});try{_(e).removeChild(e)}catch{if(p(e),!_(e))throw Ae(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},kn=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},An=function(e){Pn(e);let t=g(e);t&&se(de(t),e=>{try{p(e)}catch{}});let n=w(e)===at.element?y(e):null;if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&kn(e,r,i)}},jn=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}ue(t.removed,{attribute:r||null,from:n});try{r?m(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(Ht||Ut)try{On(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},Mn=function(e){let t=y(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||Tt[yn(i)]||kn(e,r,i)}},Nn=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=[e];for(;r.length>0;){let e=r.pop();if(t(e)===!1)continue;if(n&&w(e)===at.element){let t=v(e);Yn(t)&&r.push(t)}let i=g(e);if(i)for(let e=i.length-1;e>=0;--e)r.push(i[e])}},Pn=function(e){Nn(e,e=>{w(e)===at.element&&Mn(e)})},Fn=function(e){let t=[];return Nn(e,e=>{t.push(e)},!0),t},In=function(e,t){let n=me();se(Fn(e),e=>{w(e)===at.element&&he(n,e)}),se(t,e=>{w(e)===at.element&&!ge(n,e)&&Mn(e)})},Ln=function(e,n){let r=!1;return se(t.removed,t=>{t.element&&(r||=t.element===e,Pn(t.element))}),In(e,n),r},Rn=function(e,t){let n=Xt,r=null,i=()=>(r||(r=me(),se(t,e=>{he(r,e)})),r);for(let t=0;;t++){let r=Fn(e),a=[e],o=!1;if(se(r,e=>{w(e)===at.documentFragment?ue(a,e):!o&&!ge(n,e)&&(o=ge(i(),e))}),!o)return;if(t>=8)throw Ae(`the tree kept changing during in-place sanitization; refusing to return it`);se(a,(t,n)=>{zn(t,n>0,e,i())})}},zn=function(e,t,n,r){let i=Wn(e),a;for(;a=i.nextNode();)ge(r,a)&&!ge(Xt,a)&&(t&&Zn(pt.uponSanitizeShadowNode,a,null),rr(a,n),ur(a,n),Yn(a.content)&&dr(a.content))},Bn=function(e){Xt&&he(Xt,e)},Vn=function(e,t){return It?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},Hn=function(e){It&&Nn(e,e=>{let t=w(e);if(t===at.processingInstruction||t===at.comment&&ke(rt,e.data)){try{p(e)}catch{}return!1}if(t===at.element){let t=e,n=yn(T(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&Vn(`for`,n)&&t.removeAttribute(`for`)}catch{}}return!0})},Un=function(e){let t=null,r=null;if(Vt)e=`<remove></remove>`+e;else{let t=ye(e,/^[\r\n\t ]+/);r=t&&t[0]}_n===`application/xhtml+xml`&&cn===sn&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=ie?Ee(e):e;if(cn===sn)try{t=new l().parseFromString(i,_n)}catch{}if(!t||!t.documentElement){t=Pe.createDocument(cn,`template`,null);try{t.documentElement.innerHTML=ln?ae:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),cn===sn?dt.call(t,Lt?`html`:`body`)[0]:Lt?t.documentElement:a},Wn=function(e){let t=S?S(e):e.ownerDocument;return lt.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Gn=function(e){return e=be(e,mt,` `),e=be(e,ht,` `),e=be(e,gt,` `),e},Kn=function(e){qn(e);let t=e.querySelectorAll?.call(e,`template`);t&&se(t,e=>{Yn(e.content)&&Kn(e.content)})},qn=function(e){e.normalize();let t=S?S(e):e.ownerDocument,n=lt.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=Gn(r.data),r=n.nextNode()},Jn=function(e){let t=x?x(e):null;return typeof t!=`string`||yn(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==y(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==b(e)||e.childNodes!==g(e)},Yn=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return b(e)===at.documentFragment}catch{return!1}},Xn=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return typeof b(e)==`number`}catch{return!1}};function Zn(e,n,r){e.length!==0&&se(e,e=>{e.call(t,n,r,bn)})}let Qn=function(e,t){return!!(It&&e.hasChildNodes()&&!Xn(e.firstElementChild)&&ke(nt,e.textContent)&&ke(nt,e.innerHTML)||It&&oee[t]&&w(e)===at.element&&E(e)===sn&&(Xn(e.firstElementChild)||typeof e.textContent==`string`&&ke(nt,e.textContent))||e.nodeType===at.processingInstruction||It&&e.nodeType===at.comment&&ke(rt,e.data))},$n=function(e,t){return e instanceof RegExp?ke(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},er=function(e,t,n){if(!Ot[t]&&or(t)&&$n(Dt.tagNameCheck,t))return!1;if(Jt&&!Qt[t]&&!Qt[_e(t)]){let t=_(e),r=g(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,h(e))}}}return On(e),!0},tr=function(e,t,n,r){return e.length===0?t:t===n||t===r?Fe(t):t},nr=function(e,t){return e===t||_(e)!==null?!1:(Yt&&Pn(e),!0)},rr=function(e,n){if(Bn(e),Zn(pt.beforeSanitizeElements,e,null),nr(e,n))return!0;if(Jn(e))return On(e),!0;let r=yn(T(e));if(Ct=tr(pt.uponSanitizeElement,Ct,wt,zt),Zn(pt.uponSanitizeElement,e,{tagName:r,allowedTags:Ct}),nr(e,n))return!0;if(Qn(e,r))return On(e),!0;if(Ot[r]||!(At.tagCheck instanceof Function&&At.tagCheck(r))&&!Ct[r]){let t=er(e,r,n);return t===!1&&(Zn(pt.afterSanitizeElements,e,null),nr(e,n))?!0:t}if(w(e)===at.element&&!Dn(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&ke(aee,e.innerHTML))return On(e),!0;if(Ft&&e.nodeType===at.text){let n=Gn(e.textContent);e.textContent!==n&&(ue(t.removed,{element:e.cloneNode()}),e.textContent=n)}return Zn(pt.afterSanitizeElements,e,null),nr(e,n)},ir=function(e,t,r){if(kt[t]||Vn(t,e)||Gt&&(t===`id`||t===`name`)&&(r in n||r in xn))return!1;let i=Tt[t]||At.attributeCheck instanceof Function&&At.attributeCheck(t,e);return Mt&&ke(_t,t)||jt&&ke(vt,t)?!0:i?nn[t]||ke(St,be(r,bt,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&xe(r,`data:`)===0&&en[e]||Nt&&!ke(yt,be(r,bt,``))?!0:!r:or(e)&&$n(Dt.tagNameCheck,e)&&$n(Dt.attributeNameCheck,t,e)||t===`is`&&Dt.allowCustomizedBuiltInElements&&$n(Dt.tagNameCheck,r)},ar=Ne({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),or=function(e){return!ar[_e(e)]&&ke(xt,e)},sr=function(e,t,n,r){if(ie&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return Ee(r);case`TrustedScriptURL`:return Oe(r)}return r},cr=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!Jn(e)||(On(e),!1)}catch{return jn(t,e),!1}},lr=function(e,t){return It&&ke(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,t)?!0:_e(e)===`attributename`&&ye(t,`href`)!==null},ur=function(e,n){if(Zn(pt.beforeSanitizeAttributes,e,null),nr(e,n))return;let r=e.attributes;if(!r||Jn(e))return;Tt=tr(pt.uponSanitizeAttribute,Tt,Et,Bt);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:Tt,forceKeepAttr:void 0},a=r.length,o=yn(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=yn(s),d=l,f=s===`value`?d:Se(d),p=!1;i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,Zn(pt.uponSanitizeAttribute,e,i),f=i.attrValue,Kt&&(u===`id`||u===`name`)&&xe(f,qt)!==0&&(jn(s,e,n),f=qt+f,p=!0),lr(s,f)?jn(s,e,n):i.forceKeepAttr||(i.keepAttr?!Pt&&ke(it,f)?jn(s,e,n):(Ft&&(f=Gn(f)),ir(o,u,f)?(f=sr(o,u,c,f),f!==d&&cr(e,s,c,f)&&p&&le(t.removed)):jn(s,e,n)):jn(s,e,n))}Zn(pt.afterSanitizeAttributes,e,null),nr(e,n)},dr=function(e){let t=null,n=Wn(e);for(Zn(pt.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(Zn(pt.uponSanitizeShadowNode,t,null),rr(t,e),ur(t,e),Yn(t.content)&&dr(t.content),w(t)===at.element){let e=v(t);Yn(e)&&(fr(e),dr(e))}Ft&&qn(e),Zn(pt.afterSanitizeShadowDOM,e,null)},fr=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){dr(e.shadow);continue}let n=e.node,r=w(n)===at.element,i=g(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=x?x(n):null;if(typeof e==`string`&&yn(e)===`template`){let e=n.content;Yn(e)&&t.push({node:e,shadow:null})}}if(r){let e=v(n);Yn(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(ln=!e,ln&&(e=`<!-->`),typeof e!=`string`&&!Xn(e)&&(e=Ie(e),typeof e!=`string`))throw Ae(`dirty is not a string, aborting`);if(!t.isSupported)return e;Rt?(Ct=zt,Tt=Bt):Cn(n),(pt.uponSanitizeElement.length>0||pt.uponSanitizeAttribute.length>0)&&(Ct=Fe(Ct)),pt.uponSanitizeAttribute.length>0&&(Tt=Fe(Tt)),t.removed=[];let c=Yt&&typeof e!=`string`&&Xn(e),l=[],u=Xt;if(c){Hn(e);let t=T(e);if(typeof t==`string`){let n=yn(t);if(!Ct[n]||Ot[n])throw An(e),Ae(`root node is forbidden and cannot be sanitized in-place`)}if(Jn(e))throw An(e),Ae(`root node is clobbered and cannot be sanitized in-place`);l=Fn(e),Xt=me()}else if(Xn(e))i=Un(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===at.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),fr(i);else{if(!Ht&&!Ft&&!Lt&&e.indexOf(`<`)===-1)return ie&&Wt?Ee(e):e;if(i=Un(e),!i)return Ht?null:Wt?ae:``}i&&Vt&&On(i.firstChild);let d=c?e:i;try{c&&fr(e);let t=Wn(d);for(;o=t.nextNode();)rr(o,d),ur(o,d),Yn(o.content)&&dr(o.content);c&&Rn(e,l)}catch(t){throw c&&(An(e),Ln(e,l)),t}finally{Xt=u}if(c){if(Ln(e,l))throw Ae(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return Ft&&Kn(e),e}if(Ht){if(Ft&&Kn(i),Ut)for(s=ut.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(Tt.shadowroot||Tt.shadowrootmode)&&(s=ft.call(r,s,!0)),s}let f=Lt?i.outerHTML:i.innerHTML;return Lt&&Ct[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&ke(ree,i.ownerDocument.doctype.name)&&(f=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
`+f),Ft&&(f=Gn(f)),ie&&Wt?Ee(f):f},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Cn(e),Rt=!0,zt=Ct,Bt=Tt},t.clearConfig=function(){bn=null,Rt=!1,zt=null,Bt=null,ie=oe,ae=``},t.isValidAttribute=function(e,t,n){bn||Cn({});let r=yn(e),i=yn(t);return typeof n==`string`&&(lr(t,n)||!Pt&&ke(it,n))?!1:ir(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&De(pt,e)&&ue(pt[e],t)},t.removeHook=function(e,t){if(De(pt,e)){if(t!==void 0){let n=ce(pt[e],t);return n===-1?void 0:fe(pt[e],n,1)[0]}return le(pt[e])}},t.removeHooks=function(e){De(pt,e)&&(pt[e]=[])},t.removeAllHooks=function(){pt=lee()},t}var lt=ct(),ut=lt,dt=lt.sanitize.bind(lt);lt.isSupported,lt.addHook.bind(lt),lt.removeHook.bind(lt),lt.removeHooks.bind(lt),lt.removeAllHooks.bind(lt),lt.setConfig.bind(lt),lt.clearConfig.bind(lt),lt.isValidAttribute.bind(lt),lt.version,lt.removed;function ft(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var pt=ft();function mt(e){pt=e}var ht={exec:()=>null};function gt(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function _t(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(yt.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var vt=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),yt={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,listInterruptsParagraph:/^ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+)[ \t]*)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,blockquoteMarkerWhitespace:/^( {0,3}>)([ \t]+)/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\][ \t]+\S/,listReplaceTask:/^\[[ xX]\][ \t]+/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,numericCharacterReferenceOrAmpersand:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:gt(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:gt(e=>RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:gt(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:gt(e=>RegExp(`^ {0,${e}}#{1,6}(?:\\s|$)`)),pedanticHeadingBeginRegex:gt(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:gt(e=>RegExp(`^ {0,${e}}(?:</?(?:${Pt})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`,`i`)),blockquoteBeginRegex:gt(e=>RegExp(`^ {0,${e}}>`)),nestedContainerMarkers:/^(?: {0,3}(?:(?:[*+-]|\d{1,9}[.)])[ \t]+|>[ \t]?))+/},bt=/^(?:[ \t]*(?:\n|$))+/,xt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,St=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}(?:(?=`)\1`*|(?=~)\1~*) *(?=\n|$)|$)/,Ct=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,wt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Tt=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Et=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+)[ \t]*(?:\n+|$)/,Dt=_t(Et).replace(/bull/g,Tt).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),Ot=_t(Et).replace(/bull/g,Tt).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),kt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,At=/^[^\n]+/,jt=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\\n]|\n(?![ \t]*\n))+/,Mt=_t(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,jt).replace(`title`,/(?:"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\\n]|\n(?!\n))*'|\((?:\\[\s\S]|[^()\\])*\))/).getRegex(),Nt=_t(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Tt).getRegex(),Pt=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,Ft=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,It=_t(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?:[ \\t]+|\\n|/?>|$)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,Ft).replace(`tag`,Pt).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Lt=e=>_t(kt).replace(`hr`,Ct).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,` {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`).replace(`tag`,Pt).getRegex(),Rt=Lt(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),zt=Lt(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Bt={blockquote:_t(/^( {0,3}> ?(?:(?![ \t]*(?:\n|$))(paragraph)|[^\n]*)(?:\n|$))+/).replace(`paragraph`,zt).getRegex(),code:xt,def:Mt,fences:St,heading:wt,hr:Ct,html:It,lheading:Dt,list:Nt,newline:bt,paragraph:Rt,table:ht,text:At},Vt=_t(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,Ct).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,` {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`).replace(`tag`,Pt).getRegex(),Ht={...Bt,lheading:Ot,table:Vt,paragraph:_t(kt).replace(`hr`,Ct).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,Vt).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,` {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`).replace(`tag`,Pt).getRegex()},Ut={...Bt,html:_t(`^ *(?:comment(?: *\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1>(?: *\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?>(?: *\\n{2,}|\\s*$))`).replace(`comment`,Ft).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ht,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:_t(kt).replace(`hr`,Ct).replace(`heading`,` *#{1,6} *[^
]`).replace(`lheading`,Dt).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},Wt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Gt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Kt=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,qt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Jt=/[\p{P}\p{S}]/u,Yt=/[\s\p{P}\p{S}]/u,Xt=/[^\s\p{P}\p{S}]/u,Zt=_t(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,Yt).getRegex(),Qt=/[\p{Pi}\p{Ps}"']/u,$t=/(?!~)[\p{P}\p{S}]/u,en=/(?!~)[\s\p{P}\p{S}]/u,tn=/(?:[^\s\p{P}\p{S}]|~)/u,nn=_t(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,vt?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),rn=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,an=_t(rn,`u`).replace(/punct/g,Jt).getRegex(),on=_t(rn,`u`).replace(/punct/g,$t).getRegex(),sn=_t(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,Qt).replace(/punct/g,Jt).getRegex(),cn=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,ln=_t(cn,`gu`).replace(/notPunctSpace/g,Xt).replace(/punctSpace/g,Yt).replace(/punct/g,Jt).getRegex(),un=_t(cn,`gu`).replace(/notPunctSpace/g,tn).replace(/punctSpace/g,en).replace(/punct/g,$t).getRegex(),dn=_t(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,Xt).replace(/punctSpace/g,Yt).replace(/punct/g,Jt).getRegex(),fn=_t(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,Xt).replace(/punctSpace/g,Yt).replace(/punct/g,Jt).getRegex(),pn=_t(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,Xt).replace(/punctSpace/g,Yt).replace(/punct/g,Jt).getRegex(),mn=_t(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,Jt).getRegex(),hn=_t(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,Xt).replace(/punctSpace/g,Yt).replace(/punct/g,Jt).getRegex(),gn=_t(/\\(punct)/,`gu`).replace(/punct/g,Jt).getRegex(),_n=_t(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/,`gu`).replace(/punct/g,Jt).getRegex(),vn=_t(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),yn=_t(Ft).replace(`(?:-->|$)`,`-->`).getRegex(),bn=_t(`^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,yn).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),xn=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,Sn=_t(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace(`brackets`,xn).getRegex(),Cn=_t(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace(`label`,Sn).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*'|\((?:\\[\s\S]|[^)\\])*\)/).getRegex(),wn=_t(/^!?\[(label)\]\[(ref)\]/).replace(`label`,Sn).replace(`ref`,jt).getRegex(),Tn=_t(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,jt).getRegex(),En=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,uee=_t(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace(`brackets`,xn).getRegex(),dee=_t(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,_t(/^!?\[(label)\]\[(ref)\]/).replace(`label`,uee).replace(`ref`,En).getRegex()).replace(`nolink`,_t(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,En).getRegex()).getRegex(),Dn=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,On=_t(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),kn={_backpedal:ht,anyPunctuation:gn,anyPunctuationOutsideCode:_n,autolink:vn,blockSkip:nn,br:Kt,code:Gt,del:ht,delLDelim:ht,delRDelim:ht,emStrongLDelim:an,emStrongRDelimAst:ln,emStrongRDelimUnd:fn,escape:Wt,link:Cn,nolink:Tn,punctuation:Zt,reflink:wn,reflinkSearch:dee,tag:bn,text:qt,url:ht},An={...kn,emStrongLDelim:sn,emStrongRDelimAst:dn,emStrongRDelimUnd:pn,link:_t(/^!?\[(label)\]\((.*?)\)/).replace(`label`,Sn).getRegex(),reflink:_t(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,Sn).getRegex()},jn={...kn,emStrongRDelimAst:un,emStrongLDelim:on,delLDelim:mn,delRDelim:hn,url:_t(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`emailProtocol`,On).replace(`protocol`,Dn).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:_t(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|wwwStart|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace(`protocol`,Dn).replace(/emailProtocol/g,/(?:mailto|xmpp):/).replace(`wwwStart`,vt?`(?<![^\\s*_~(])www\\.`:`www\\.`).getRegex()},Mn={...jn,br:_t(Kt).replace(`{2,}`,`*`).getRegex(),text:_t(jn.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},Nn={normal:Bt,gfm:Ht,pedantic:Ut},Pn={normal:kn,gfm:jn,breaks:Mn,pedantic:An},Fn={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},In=e=>Fn[e];function Ln(e,t){if(t){if(yt.escapeTest.test(e))return e.replace(yt.escapeReplace,In)}else if(yt.escapeTestNoEncode.test(e))return e.replace(yt.escapeReplaceNoEncode,In);return e}function Rn(e){return yt.numericCharacterReference.test(e)?e.replace(yt.numericCharacterReferenceOrAmpersand,(e,t,n)=>{if(t===void 0&&n===void 0)return`&amp;`;let r=t===void 0?Number.parseInt(n,16):Number.parseInt(t,10);return r===0||r>1114111||r>=55296&&r<=57343?`�`:r===38?`&amp;`:String.fromCodePoint(r)}):e}function zn(e){try{e=encodeURI(e).replace(yt.percentDecode,`%`)}catch{return null}return e}function Bn(e,t){let n=e.replace(yt.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(yt.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(yt.slashPipe,`|`);return n}function Vn(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function Hn(e){let t=e.split(`
`),n=t.length-1;for(;n>=0&&yt.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
`)}function Un(e){return e.trim().replace(yt.multipleSpaceGlobal,` `).toLowerCase().toUpperCase().toLowerCase()}function Wn(e,t){if(e.indexOf(t[0])===-1&&e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}var Gn=new WeakMap;function Kn(e){let t={"*":-1,_:-1},n=-1,r=e.length;for(let i=0;i<r;i++){let a=e[i];if(a!==`*`&&a!==`_`&&a!==`~`)continue;let o=i===0?`
`:e[i-1],s=i+1;for(;s<r&&e[s]===a;)s++;o!==` `&&o!==` `&&o!==`
`&&o!==`\r`&&o!==`\f`&&(a===`~`?n=i:t[a]=i),i=s-1}return{maskedSrc:e,lastPossibleEmStrongCloserIndex:t,lastPossibleDelCloserIndex:n}}function qn(e,t){let n=Kn(t),r=Gn.get(e);r?r.push(n):Gn.set(e,[n])}function Jn(e){let t=Gn.get(e);t&&(t.pop(),t.length===0&&Gn.delete(e))}function Yn(e,t,n){let r=Gn.get(e)?.at(-1);return r&&r.maskedSrc===t?r.lastPossibleEmStrongCloserIndex[n]:Kn(t).lastPossibleEmStrongCloserIndex[n]}function Xn(e,t){let n=Gn.get(e)?.at(-1);return n&&n.maskedSrc===t?n.lastPossibleDelCloserIndex:Kn(t).lastPossibleDelCloserIndex}function Zn(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function Qn(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`),c=e[0].charAt(0)===`!`,l=r.state.inLink,u=r.state.linkEmitted,d=r.state.inRawBlock;r.state.inLink=!0,r.state.linkEmitted=!1;let f=r.inlineTokens(s),p=r.state.linkEmitted;if(r.state.linkEmitted=u,r.state.inLink=l,!c){if(p){r.state.inRawBlock=d;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:f}}function $n(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
`).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return e.slice(Math.min(r.length,i.length))}).join(`
`)}function er(e,t,n,r){if(!t.includes(`<`))return!1;for(let i=0;i<t.length;i++){if(t[i]===`\\`){i++;continue}if(t[i]==="`"){let e=r.inline.code.exec(t.slice(i));if(e){i+=e[0].length-1;continue}}if(t[i]!==`<`)continue;let a=e.slice(n+i),o=r.inline.tag.exec(a)||r.inline.autolink.exec(a);if(o){if(o[0].length>t.length-i)return!0;i+=o[0].length-1}}return!1}var tr=class{options;rules;lexer;constructor(e){this.options=e||pt}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:Hn(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=$n(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=Vn(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:Vn(t[0],`
`),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:Vn(t[0],`
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=Vn(t[0],`
`).split(`
`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
`),c=s.replace(this.rules.other.blockquoteMarkerWhitespace,(e,t,n)=>t+Zn(n,t.length)).replace(this.rules.other.blockquoteSetextReplace,`
$1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
${s}`:s,r=r?`${r}
${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`||u?.type===`heading`||u?.type===`hr`||u?.type===`html`||u?.type===`table`)break;if(u?.type===`blockquote`){let t=u,a=e.join(`
`),o=t.raw+`
`+a.replace(this.rules.other.blockquoteSetextReplace2,``),s=this.blockquote(o);i[i.length-1]=s;let c=o.substring(s.raw.length).replace(/^\n/,``),l=c?c.split(`
`).length:0,d=l?e.slice(0,-l):e;if(d.length>0&&(n=`${n}
${d.join(`
`)}`),r=r.substring(0,r.length-t.text.length)+s.text,e=e.slice(d.length),e.length>0&&this.rules.other.blockquoteStart.test(e[0]))continue;break}if(u?.type===`list`){let t=u,a=t.raw+`
`+e.join(`
`),o=this.list(a);i[i.length-1]=o;let s=o.raw.length>t.raw.length?a.slice(t.raw.length+1,o.raw.length).split(`
`).length:0;if(s>0){let t=e.slice(0,s).join(`
`);n=`${n}
${t}`,r=`${r}
${t}`}e=e.slice(s)}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){if(!this.options.pedantic&&this.lexer.state.lastToken?.type===`text`&&!this.rules.other.listInterruptsParagraph.test(e))return;let n=e,r=()=>n.length-e.length,i=t[1].trim(),a=i.length>1,o={type:`list`,raw:``,ordered:a,start:a?+i.slice(0,-1):``,loose:!1,items:[]};i=a?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=a?i:`[*+-]`);let s=this.rules.other.listItemRegex(i),c=!1;for(;e;){let i=!1,a=``;if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;let l=r();e=e.substring(t[0].length);let u=t[2].split(`
`,1)[0],d=t[1].length,f=this.options.pedantic?Zn(u,d):u.replace(this.rules.other.leadingSpaceTab,e=>Zn(e,d)),p=e.split(`
`,1)[0],m=!f.trim(),h=0;if(this.options.pedantic?(h=2,a=f.trimStart()):m?h=d+1:(h=f.search(this.rules.other.nonSpaceChar),h=h>4?1:h,a=f.slice(h),h+=d),m&&this.rules.other.blankLine.test(p)&&(e=e.substring(p.length+1),i=!0),!i){let t=this.rules.other.nextBulletRegex(h),n=this.rules.other.hrRegex(h),r=this.rules.other.fencesBeginRegex(h),i=this.options.pedantic?this.rules.other.pedanticHeadingBeginRegex(h):this.rules.other.headingBeginRegex(h),o=this.rules.other.htmlBeginRegex(h),s=this.rules.other.blockquoteBeginRegex(h),c=!1;for(;e;){let l=e.split(`
`,1)[0],u;if(p=l,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting,` `),u=p):u=p.replace(this.rules.other.leadingSpaceTab,e=>Zn(e)),r.test(p)||i.test(p)||o.test(p)||s.test(p)||t.test(p)||n.test(p))break;if(u.search(this.rules.other.nonSpaceChar)>=h||!p.trim())a+=`
`+u.slice(h),c=!1;else{if(m||f.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||r.test(f)||i.test(f)||o.test(f)||n.test(f))break;if(!this.options.pedantic&&!c){let e=f.replace(this.rules.other.nestedContainerMarkers,``);if(this.rules.block.fences.test(e)||this.rules.block.heading.test(e)||this.rules.block.hr.test(e))break}let e=!this.options.pedantic&&/^ {0,3}(?:=+|-+) *$/.test(p)&&this.rules.block.lheading.test(`${f}
${p}`)?` ${u.replace(/^ {0,3}/,``)}`:p;a+=`
`+e,c=!0}m=!p.trim(),e=e.substring(l.length+1),f=u.slice(h)}}let g=n.slice(l,r());o.loose||(c?o.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(c=!0)),o.items.push({type:`list_item`,raw:g,task:!!this.options.gfm&&this.rules.other.listIsTask.test(a),loose:!1,text:a,tokens:[]})}let l=o.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;o.raw=n.slice(0,r()).trimEnd();for(let e of o.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!o.loose){let t=e.tokens.filter(e=>e.type===`space`);o.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of o.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,o.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(o.loose)for(let e of o.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return o}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=Hn(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){if(!this.rules.other.startAngleBracket.test(t[2])&&Wn(t[2],`()`)!==-1)return;let e=Un(t[1]),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:Vn(t[0],`
`),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Bn(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
`):[],a={type:`table`,raw:Vn(t[0],`
`),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(Bn(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:Vn(t[0],`
`),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){if(this.lexer.state.linkParenPossible===!1)return;let t=this.rules.inline.link.exec(e);if(t){let n=t[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&er(e,t[1],n,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=Vn(r.slice(0,-1),`\\`);if((r.length-e.length)%2==0)return}else{let e=Wn(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let i=Vn(t[0].slice(0,-1),`\\`);if((t[0].length-i.length)%2==0)return;let a=t[2],o=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(a);e&&(a=e[1],o=e[3])}else o=t[3]?t[3].slice(1,-1):``;return a=a.trim(),this.rules.other.startAngleBracket.test(a)&&(a=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?a.slice(1):a.slice(1,-1)),Qn(t,{href:a&&a.replace(this.rules.inline.anyPunctuation,`$1`),title:o&&o.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=n[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&er(e,n[1],r,this.rules))return;let i=t[Un(n[2]||n[1])];if(!i){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return Qn(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||!r[1]&&!r[2]&&!r[3]&&!r[4])return;let i=r[0][0],a=n===i,o=t.length-e.length,s=o;for(;!this.options.pedantic&&s>0&&t[s-1]===i;)s--;let c=[...t.slice(Math.max(0,s-2),s)].at(-1)??``,l=c===`*`||c===`_`||!!this.rules.inline.punctuation.exec(c);s<o&&(n=c);let u=s<o?l:n===`*`||n===`_`||!!this.rules.inline.punctuation.exec(n);if(r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))return;let d=r[1]||r[3]||``;if(!d||!n||u){let n=[...r[0]].length-1,u,f,p=n,m=0,h=o-s+n,g=!this.options.pedantic&&!!c.trim()&&(!!d||i===`*`&&!l);if(i!==`*`&&i!==`_`)return;let _=i===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd,v=Yn(this,t,i),y=t.length-e.length+n;if(v<y)return;t=t.slice(-1*e.length+n);let b=v-y;for(_.lastIndex=0;(r=_.exec(t))!==null&&!(r.index>b);){if(u=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!u)continue;if(f=[...u].length,r[3]||r[4]){p+=f;continue}if(r[5]||r[6]||g){if(a&&(r[5]||r[6]))break;if(h%3&&!((h+f)%3)){m+=f;continue}}if(p-=f,p>0)continue;f=Math.min(f,f+p+m);let t=[...r[0]][0].length,i=e.slice(0,n+r.index+t+f);if(Math.min(n,f)%2){let e=i.slice(1,-1);return{type:`em`,raw:i,text:e,tokens:this.lexer.inlineTokens(e)}}let o=i.slice(2,-2);return{type:`strong`,raw:i,text:o,tokens:this.lexer.inlineTokens(o)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim,c=Xn(this,t),l=t.length-e.length+n;if(c<l)return;t=t.slice(-1*e.length+n);let u=c-l;for(s.lastIndex=0;(r=s.exec(t))!==null&&!(r.index>u);){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:e?t[0]:Rn(t[0]),escaped:e}}}},nr=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||pt,this.options.tokenizer=this.options.tokenizer||new tr,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let t={other:yt,block:Nn.normal,inline:Pn.normal};this.options.pedantic?(t.block=Nn.pedantic,t.inline=Pn.pedantic):this.options.gfm&&(t.block=Nn.gfm,t.inline=this.options.breaks?Pn.breaks:Pn.gfm),this.tokenizer.rules=t}static get rules(){return{block:Nn,inline:Pn}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(yt.carriageReturn,`
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.state.inRawBlock=!1,this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this;let r=this.state.lastToken;this.options.pedantic&&(e=e.replace(yt.tabCharGlobal,` `).replace(yt.spaceLine,``));let i=1/0;for(;e;){if(e.length<i)i=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}this.state.lastToken=t.at(-1);let r;if(this.options.extensions?.block?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);r.raw.length===1&&n!==void 0?n.raw+=`
`:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
`)?``:`
`)+r.raw,n.text+=`
`+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if((r=this.tokenizer.fences(e))||(r=this.tokenizer.heading(e))||(r=this.tokenizer.hr(e))||(r=this.tokenizer.blockquote(e))||(r=this.tokenizer.list(e))||(r=this.tokenizer.html(e))){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
`)?``:`
`)+r.raw,n.text+=`
`+r.raw,this.inlineQueue.at(-1).src=n.text):(this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title}),t.push(r));continue}if((r=this.tokenizer.table(e))||(r=this.tokenizer.lheading(e))){e=e.substring(r.raw.length),t.push(r);continue}let a=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(a))){let i=t.at(-1);n&&i?.type===`paragraph`?(i.raw+=(i.raw.endsWith(`
`)?``:`
`)+r.raw,i.text+=`
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):t.push(r),n=a.length!==e.length,e=e.substring(r.raw.length)}else if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
`)?``:`
`)+r.raw,n.text+=`
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,this.state.lastToken=r,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,Un(e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=this.state.linkParenPossible;this.state.linkParenPossible=n&&e.includes(`)`);try{return this.#e(e,t)}finally{this.state.linkParenPossible=n}}#e(e,t){let n=e.includes(`*`)||e.includes(`_`)||e.includes(`~`)||this.options.hooks?.emStrongMask||this.tokenizer.emStrong!==tr.prototype.emStrong||this.tokenizer.del!==tr.prototype.del?this.#r(e):e;qn(this.tokenizer,n);try{return this.#t(e,n,t)}finally{Jn(this.tokenizer)}}#t(e,t,n){let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(t=>(o=t.call({lexer:this},e,n))?(e=e.substring(o.raw.length),n.push(o),!0):!1))continue;if((o=this.tokenizer.escape(e))||(o=this.tokenizer.tag(e))||(o=this.tokenizer.link(e))){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let t=n.at(-1);o.type===`text`&&t?.type===`text`?(t.raw+=o.raw,t.text+=o.text):n.push(o);continue}if((o=this.tokenizer.emStrong(e,t,i))||(o=this.tokenizer.codespan(e))||(o=this.tokenizer.br(e))||(o=this.tokenizer.del(e,t,i))||(o=this.tokenizer.autolink(e))||!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),n.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let t=n.at(-1);t?.type===`text`?(t.raw+=o.raw,t.text+=o.text):n.push(o)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return n}#n(e){let{blockSkip:t,tag:n,autolink:r}=this.tokenizer.rules.inline,i=``,a=0,o;for(t.lastIndex=0;o=t.exec(e);){let s=o.index+(o[2]?o[2].length:0),c=o.index+o[0].length;if(e.charAt(s)===`<`){let i=e.slice(s),a=n.exec(i)||r.exec(i);if(!a){t.lastIndex=s+1;continue}c=s+a[0].length,t.lastIndex=c}i+=e.slice(a,s)+`[`+`a`.repeat(c-s-2)+`]`,a=c}return i+e.slice(a)}#r(e){let t=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,n=t=>{let r=t.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,Un(t.slice(r+1,-1))))return t;if(r>1&&t.charAt(0)!==`!`){let i=t.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,n)+`][`+`a`.repeat(t.length-r-2)+`]`}return`[`+`a`.repeat(t.length-2)+`]`};t=t.replace(e,n)}return t=t.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode,(e,t,n)=>n?`+`.repeat(e.length):t?t+e.slice(t.length,-t.length).replace(/`/g,`+`)+t:e),t=this.#n(t),t=this.options.hooks?.emStrongMask?.call({lexer:this},t)??t,t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},rr=class{options;parser;constructor(e){this.options=e||pt}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(yt.notSpaceStart)?.[0],i=e?e.replace(yt.endingNewline,``)+`
`:``;return r?`<pre><code class="language-`+Ln(r)+`">`+(n?i:Ln(i,!0))+`</code></pre>
`:`<pre><code>`+(n?i:Ln(i,!0))+`</code></pre>
`}blockquote({tokens:e}){return`<blockquote>
${this.parser.parse(e)}</blockquote>
`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
`}hr(e){return`<hr>
`}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
`+r+`</`+i+`>
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
`}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
`}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
<thead>
`+t+`</thead>
`+r+`</table>
`}tablerow({text:e}){return`<tr>
${e}</tr>
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Ln(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let a=i?Ln(n,!0):this.parser.parseInline(r),o=zn(e);if(o===null)return a;e=Ln(o,i);let s=`<a href="`+e+`"`;return t&&(s+=` title="`+Ln(t)+`"`),s+=`>`+a+`</a>`,s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=zn(e);if(i===null)return Ln(n);e=i;let a=`<img src="${Ln(e)}" alt="${Ln(n)}"`;return t&&(a+=` title="${Ln(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:Ln(e.text)}},ir=class{parser;strong({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}em({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}codespan({text:e}){return e}del({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}html({text:e}){return e}text({text:e}){return e}link({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}image({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}br(){return`
`}checkbox({raw:e}){return e}},ar=class e{options;renderer;textRenderer;constructor(e){this.options=e||pt,this.options.renderer=this.options.renderer||new rr,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ir,this.textRenderer.parser=this}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n===!1?``:n??``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e===!1?``:e??``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},or=class{options;block;constructor(e){this.options=e||pt}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?nr.lex:nr.lexInline}provideParser(e=this.block){return e?ar.parse:ar.parseInline}};function sr(e,t){if(Array.isArray(t))for(let n=0;n<t.length;n++)e.push(t[n]);else e.push(t)}var cr=class{defaults=ft();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=ar;Renderer=rr;TextRenderer=ir;Lexer=nr;Tokenizer=tr;Hooks=or;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(sr(n,t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)sr(n,this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)sr(n,this.walkTokens(e.tokens,t));break}case`list`:{let e=r;sr(n,this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);sr(n,this.walkTokens(i,t))}):e.tokens&&sr(n,this.walkTokens(e.tokens,t))}}return n}use(...e){let t=this.defaults.extensions||{renderers:Object.create(null),childTokens:Object.create(null)};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new rr(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n===!1?``:n??``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new tr(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new or;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=or.passThroughHooks.has(n)?e=>{if(t.options.async&&or.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(t.options.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return sr(n,r.call(this,e)),t&&sr(n,t.call(this,e)),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return nr.lex(e,t??this.defaults)}parser(e,t){return ar.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?nr.lex:nr.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?ar.parse:ar.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?nr.lex:nr.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?ar.parse:ar.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+Ln(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},lr=new cr;function ur(e,t){return lr.parse(e,t)}ur.options=ur.setOptions=function(e){return lr.setOptions(e),ur.defaults=lr.defaults,mt(ur.defaults),ur},ur.getDefaults=ft,ur.defaults=pt;function dr(...e){return lr.use(...e),ur.defaults=lr.defaults,mt(ur.defaults),ur}ur.use=dr,ur.walkTokens=function(e,t){return lr.walkTokens(e,t)},ur.parseInline=lr.parseInline,ur.Parser=ar,ur.parser=ar.parse,ur.Renderer=rr,ur.TextRenderer=ir,ur.Lexer=nr,ur.lexer=nr.lex,ur.Tokenizer=tr,ur.Hooks=or,ur.parse=ur,ur.options,ur.setOptions,ur.walkTokens;var fr=ur.parseInline,pr=ur;ar.parse;var fee=nr.lex,mr=l(d(),1),hr={},gr=Symbol(`uninitialized`),_r=Array.isArray,pee=Array.prototype.indexOf,vr=Array.prototype.includes,yr=Array.from,mee=Object.defineProperty,br=Object.getOwnPropertyDescriptor,hee=Object.getOwnPropertyDescriptors,gee=Object.prototype,_ee=Array.prototype,xr=Object.getPrototypeOf,vee=Object.isExtensible;function Sr(e){return typeof e==`function`}var Cr=()=>{};function yee(e){return typeof e?.then==`function`}function bee(e){for(var t=0;t<e.length;t++)e[t]()}function wr(){var e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function Tr(e,t,n=!1){return e===void 0?n?t():t:e}function Er(e,t){if(Array.isArray(e))return e;if(t===void 0||!(Symbol.iterator in e))return Array.from(e);let n=[];for(let r of e)if(n.push(r),n.length===t)break;return n}var Dr=Symbol(`$state`),Or=Symbol(`component`),kr=Symbol(`legacy props`),xee=Symbol(``),Ar=Symbol(`attributes`),jr=Symbol(`class`),Mr=Symbol(`style`),Nr=Symbol(`text`),Pr=Symbol(`form reset`),Fr=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"},Ir=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`);function See(){console.warn(`https://svelte.dev/e/derived_inert`)}function Lr(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function Cee(){console.warn(`https://svelte.dev/e/select_multiple_invalid_value`)}function wee(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var Rr=!1;function zr(e){Rr=e}var Br;function Vr(e){if(e===null)throw Lr(),hr;return Br=e}function Hr(){return Vr(oa(Br))}function D(e){if(Rr){if(oa(Br)!==null)throw Lr(),hr;Br=e}}function Ur(e=1){if(Rr){for(var t=e,n=Br;t--;)n=oa(n);Br=n}}function Wr(e=!0){for(var t=0,n=Br;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else(r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=oa(n);e&&n.remove(),n=i}}function Gr(e){if(!e||e.nodeType!==8)throw Lr(),hr;return e.data}function Kr(e){return e===this.v}function Tee(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function qr(e){return!Tee(e,this.v)}function Jr(e){throw Error(`https://svelte.dev/e/lifecycle_outside_component`)}function Eee(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function Dee(e,t,n){throw Error(`https://svelte.dev/e/each_key_duplicate`)}function Oee(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function kee(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function Aee(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function jee(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function Mee(e){throw Error(`https://svelte.dev/e/props_invalid_value`)}function Nee(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function Pee(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function Fee(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function Iee(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}var Lee=[];function Yr(e,t=!1,n=!1){return Xr(e,new Map,``,Lee,null,n)}function Xr(e,t,n,r,i=null,a=!1){if(typeof e==`object`&&e){var o=t.get(e);if(o!==void 0)return o;if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);if(_r(e)){var s=Array(e.length);t.set(e,s),i!==null&&t.set(i,s);for(var c=0;c<e.length;c+=1){var l=e[c];c in e&&(s[c]=Xr(l,t,n,r,null,a))}return s}if(xr(e)===gee){s={},t.set(e,s),i!==null&&t.set(i,s);for(var u of Object.keys(e))s[u]=Xr(e[u],t,n,r,null,a);return s}if(e instanceof Date)return e.getTime(),structuredClone(e);if(typeof e.toJSON==`function`&&!a)return Xr(e.toJSON(),t,n,r,e)}if(e instanceof EventTarget)return e;try{return structuredClone(e)}catch{return e}}function Ree(e){let t=e.p;for(;t!==null&&t.c===null;)t=t.p;return t?.c??null}function Zr(e,t){return e===null&&Jr(t),e.c??=new Map(Ree(e)||void 0)}var Qr=null;function $r(e){Qr=e}function ei(e){return Zr(Qr,`getContext`).get(e)}function ti(e,t){return Zr(Qr,`setContext`).set(e,t),t}function zee(){return Zr(Qr,`getAllContexts`)}function O(e,t=!1,n){Qr={p:Qr,i:!1,c:null,e:null,s:e,x:null,r:Na,l:null}}function k(e){var t=Qr,n=t.e;if(n!==null){t.e=null;for(var r of n)rte(r)}return e!==void 0&&(t.x=e),t.i=!0,Qr=t.p,ni(e)}function ni(e={}){return mee(e,Or,{value:!0}),e}function ri(){return!0}var ii=[];function ai(){var e=ii;ii=[],bee(e)}function oi(e){if(ii.length===0&&!Oi){var t=ii;queueMicrotask(()=>{t===ii&&ai()})}ii.push(e)}function Bee(){for(;ii.length>0;)ai()}var Vee=-7169;function si(e,t){e.f=e.f&Vee|t}function ci(e){e.f&512||e.deps===null?si(e,1024):si(e,4096)}function li(e,t){e.f&2048?t.set(e,2048):e.f&4096&&t.get(e)!==2048&&t.set(e,4096),si(e,1024)}function Hee(e,t){if(t){let t=document.body;e.autofocus=!0,oi(()=>{document.activeElement===t&&e.focus()})}}function Uee(e){Rr&&aa(e)!==null&&Qee(e)}var ui=!1;function di(){ui||(ui=!0,document.addEventListener(`reset`,e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(let t of e.target.elements)t[Pr]?.()})},{capture:!0}))}function fi(e){var t=Aa,n=Na;Ma(null),Pa(null);try{return e()}finally{Ma(t),Pa(n)}}function Wee(e,t,n,r=n){e.addEventListener(t,()=>fi(n));let i=e[Pr];e[Pr]=i?()=>{i(),r(!0)}:()=>r(!0),di()}function pi(e,t,n,r){let i=ri()?_i:yi;var a=e.filter(e=>!e.settled),o=t.map(i);if(n.length===0&&a.length===0){r(o);return}var s=Na,c=mi(),l=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;function u(e){if(!(s.f&16384)){c();try{r([...o,...e])}catch(e){la(e,s)}hi()}}var d=gi();if(n.length===0){l.then(()=>u([])).finally(d);return}function f(){Promise.all(n.map(e=>Gee(e))).then(u).catch(e=>la(e,s)).finally(d)}l?l.then(()=>{s.f&16384?d():(c(),f(),hi())}):f()}function mi(){var e=Na,t=Aa,n=Qr,r=wi;return function(i=!0){Pa(e),Ma(t),$r(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function hi(e=!0){Pa(null),Ma(null),$r(null),e&&wi?.deactivate()}function gi(){var e=Na,t=e.b,n=wi,r=!!t?.is_rendered();return t?.update_pending_count(1,n),n.increment(r,e),()=>{t?.update_pending_count(-1,n),n.decrement(r,e)}}function _i(e){return Na!==null&&(Na.f|=524288),{ctx:Qr,deps:null,effects:null,equals:Kr,f:2050,fn:e,reactions:null,rv:0,v:gr,wv:0,parent:Na,ac:null}}var vi=Symbol(`obsolete`);function Gee(e,t,n){let r=Na;r===null&&Eee();var i=void 0,a=Ui(gr),o=!Aa,s=new Set;return ate(()=>{var t=Na,n=wr();i=n.promise;try{Promise.resolve(e()).then(n.resolve,e=>{e!==Fr&&n.reject(e)}).finally(hi)}catch(e){n.reject(e),hi()}var c=wi;if(o){if(t.f&32768)var l=gi();if(r.b?.is_rendered())c.async_deriveds.get(t)?.reject(vi);else for(let e of s.values())e.reject(vi);s.add(n),c.async_deriveds.set(t,n)}let u=(e,t=void 0)=>{l?.(),s.delete(n),t!==vi&&(c.activate(),t?(a.f|=8388608,qi(a,t)):(a.f&8388608&&(a.f^=8388608),qi(a,e)),c.deactivate())};n.promise.then(u,e=>u(null,e||`unknown`))}),fa(()=>{for(let e of s)e.reject(vi)}),new Promise(e=>{function t(n){function r(){n===i?e(a):t(i)}n.then(r,r)}t(i)})}function A(e){let t=_i(e);return Ia(t),t}function yi(e){let t=_i(e);return t.equals=qr,t}function Kee(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)ba(t[n])}}function bi(e){var t,n=Na,r=e.parent;if(!Oa&&r!==null&&e.v!==gr&&r.f&24576)return See(),e.v;Pa(r);try{Kee(e),t=qa(e)}finally{Pa(n)}return t}function xi(e){var t=bi(e);!e.equals(t)&&(e.wv=Wa(),(!wi?.is_fork||e.deps===null)&&(wi===null?e.v=t:(wi.capture(e,t,!0),Ti?.capture(e,t,!0)),e.deps===null))?si(e,1024):Oa||(Ei===null?ci(e):(da()||wi?.is_fork)&&Ei.set(e,t))}function qee(e){if(e.effects!==null)for(let t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac!==null&&fi(()=>{t.ac.abort(Fr),t.ac=null}),t.fn!==null&&(t.teardown=Cr),Ya(t,0),ya(t))}function Si(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&t.fn!==null&&Xa(t)}var Ci=null,wi=null,Ti=null,Ei=null,Di=null,Oi=!1,ki=!1,Ai=null,ji=null,Mi=0,Jee=1,Ni=class e{id=Jee++;started=!1;linked=!0;prev=null;next=null;async_deriveds=new Map;current=new Map;previous=new Map;#e=new Set;#t=new Set;#n=0;#r=new Map;#i=null;#a=[];#o=[];#s=new Map;#c=new Map;#l=new Set;is_fork=!1;#u=!1;constructor(){Ci===null?Ci=this:(Ci.next=this,this.prev=Ci),Ci=this}#d(){if(this.is_fork)return!0;for(let e of this.#r.keys())if(!this.#f(e))return!0;return!1}#f(e){for(var t=e;t!==null;t=t.parent)if(this.#c.has(t))return!0;return!1}skip_effect(e){this.#c.has(e)||this.#c.set(e,{d:[],m:[]}),this.#l.delete(e)}unskip_effect(e,t=e=>this.schedule(e)){var n=this.#c.get(e);if(n){this.#c.delete(e);for(var r of n.d)si(r,2048),t(r);for(r of n.m)si(r,4096),t(r)}this.#l.add(e)}#p(){var e=[];for(let i of this.#a)if(!(i.f&16384||!(i.f&6144))){for(var t=i,n=!1;t.parent!==null;){t=t.parent;var r=t.f;if(r&96){if(!(r&1024)){n=!0;break}t.f^=1024}}n||e.push(t)}return this.#a=[],e}#m(){this.started=!0;for(let[e,t]of this.#s)si(e,t),this.schedule(e);this.apply();for(var t=Ai=[],n=[],r=ji=[];this.#a.length>0;){Mi++>1e3&&(this.#b(),Yee());for(let e of this.#p())try{this.#h(e,t,n)}catch(t){throw zi(e),this.#d()||this.discard(),t}}if(wi=null,r.length>0){var i=e.ensure();for(let e of r)i.schedule(e)}if(Ai=null,ji=null,this.#d()){this.#y(n),this.#y(t);for(let[e,t]of this.#c)Ri(e,t);r.length>0&&wi.#m();return}let a=this.#g();if(a)this.#y(n),this.#y(t),a.#v(this);else{this.#s.clear();for(let e of this.#e)e(this);this.#e.clear(),Ti=this,Ii(n),Ii(t),Ti=null,this.#i?.resolve();var o=wi;this.#n===0&&(this.#a.length===0||o!==null)&&this.#b(),o!==null&&(Vi.clear(),o.#m())}}#h(e,t,n){e.f^=1024;for(var r=e.first;r!==null;){var i=r.f,a=!!(i&96);if(!(a&&i&1024||i&8192||this.#c.has(r))&&r.fn!==null){a?r.f^=1024:i&4?t.push(r):Ga(r)&&(i&16&&this.add_dirty_reaction(r,4096),Xa(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}#g(){for(var e=this.prev;e!==null;e=e.prev)if(!e.is_fork&&this.#_(e))return e;return null}#_(e){for(let[t,[,n]]of this.current)if(!n&&e.current.has(t))return!0;return!1}#v(e){for(let[t,n]of e.current)!this.previous.has(t)&&e.previous.has(t)&&this.previous.set(t,e.previous.get(t)),this.current.set(t,n);for(let[t,n]of e.async_deriveds){let e=this.async_deriveds.get(t);e&&n.promise.then(e.resolve).catch(e.reject)}e.async_deriveds.clear(),this.transfer_reactions(e.#s);let t=e=>{var n=e.reactions;if(n!==null&&!(e.f&2&&!(e.f&6144)))for(let e of n){var r=e.f;if(r&2)t(e);else{var i=e;r&4194320&&!this.async_deriveds.has(i)&&(this.#s.delete(i),si(i,2048),this.schedule(i))}}};for(let e of this.current.keys())t(e);this.oncommit(()=>e.discard()),e.#b(),wi=this,this.#m()}#y(e){for(var t=0;t<e.length;t+=1)li(e[t],this.#s)}capture(e,t,n=!1){e.v!==gr&&!this.previous.has(e)&&this.previous.set(e,e.v),e.f&8388608||(this.current.set(e,[t,n]),Ei?.set(e,t)),this.is_fork||(e.v=t)}activate(){wi=this}deactivate(){wi=null,Ei=null}flush(){try{ki=!0,wi=this,this.#m()}finally{Mi=0,Di=null,Ai=null,ji=null,ki=!1,wi=null,Ei=null,Vi.clear()}}discard(){for(let e of this.#t)e(this);this.#t.clear();for(let e of this.async_deriveds.values())e.reject(vi);this.#b(),this.#i?.resolve()}register_created_effect(e){this.#o.push(e)}increment(e,t){if(this.#n+=1,e){let e=this.#r.get(t)??0;this.#r.set(t,e+1)}}decrement(e,t){if(--this.#n,e){let e=this.#r.get(t)??0;e===1?this.#r.delete(t):this.#r.set(t,e-1)}this.#u||(this.#u=!0,oi(()=>{this.#u=!1,this.linked&&this.flush()}))}transfer_reactions(e){for(let[t,n]of e)this.add_dirty_reaction(t,n);e.clear()}add_dirty_reaction(e,t){(t===2048||this.#s.get(e)!==2048)&&this.#s.set(e,t)}oncommit(e){this.#e.add(e)}ondiscard(e){this.#t.add(e)}settled(){return(this.#i??=wr()).promise}static ensure(){if(wi===null){let t=wi=new e;!ki&&!Oi&&oi(()=>{t.started||t.flush()})}return wi}apply(){Ei=null}schedule(e){Di=e,e.b?.is_pending&&e.f&16777228&&!(e.f&32768)?e.b.defer_effect(e):this.#a.push(e)}#b(){if(this.linked){var e=this.prev,t=this.next;e===null||(e.next=t),t===null?Ci=e:t.prev=e,this.linked=!1}}};function Pi(e){var t=Oi,n=Ti;Ti=null,Oi=!0;try{var r;for(e&&(Pi(),r=e());;){if(Bee(),wi===null)return r;wi.flush()}}finally{Oi=t,Ti=n}}function Yee(){try{jee()}catch(e){la(e,Di)}}var Fi=null;function Ii(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if(!(r.f&24576)&&Ga(r)&&(Fi=new Set,Xa(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&Sa(r),Fi?.size>0)){Vi.clear();for(let e of Fi){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)Fi.has(n)&&(Fi.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||Xa(n)}}Fi.clear()}}Fi=null}}function Li(e){wi.schedule(e)}function Ri(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),si(e,1024);for(var n=e.first;n!==null;)Ri(n,t),n=n.next}}function zi(e){si(e,1024);for(var t=e.first;t!==null;)zi(t),t=t.next}var Bi=new Set,Vi=new Map,Hi=!1;function Ui(e,t){return{f:0,v:e,reactions:null,equals:Kr,rv:0,wv:0}}function j(e,t){let n=Ui(e,t);return Ia(n),n}function Wi(e,t=!1,n=!0){let r=Ui(e);return t||(r.equals=qr),r}function M(e,t,n=!1){return Aa!==null&&(!ja||Aa.f&131072)&&ri()&&Aa.f&4325394&&(Fa===null||!Fa.has(e))&&Fee(),qi(e,n?Xi(t):t,ji)}var Gi=null,Ki=0;function qi(e,t,n=null){if(!e.equals(t)){Oa?Vi.set(e,t):Vi.has(e)||Vi.set(e,e.v);var r=Ni.ensure();if(r.capture(e,t),e.f&2){let t=e;e.f&2048&&bi(t),Ei===null&&ci(t)}e.wv=Wa(),Gi=null,Ki=0,Yi(e,2048,n),Gi=null,ri()&&Na!==null&&Na.f&1024&&!(Na.f&96)&&(za===null?dte([e]):za.push(e)),!r.is_fork&&Bi.size>0&&!Hi&&Xee()}return t}function Xee(){Hi=!1;for(let e of Bi){e.f&1024&&si(e,4096);let t;try{t=Ga(e)}catch{t=!0}t&&Xa(e)}Bi.clear()}function Ji(e){M(e,e.v+1)}function Yi(e,t,n){var r=e.reactions;if(r!==null){var i=ri(),a=r.length;if(Ki+=a,Ki>1e5&&Gi===null&&(Gi=new Set),Gi!==null){if(Gi.has(e))return;Gi.add(e)}for(var o=0;o<a;o++){var s=r[o],c=s.f;if(i||s!==Na){var l=!(c&2048);if(l&&si(s,t),c&131072)Bi.add(s);else if(c&2){var u=s;Ei?.delete(u),Yi(u,4096,n)}else if(l){var d=s;c&16&&Fi!==null&&Fi.add(d),n===null?Li(d):n.push(d)}}}}}function Xi(e){if(typeof e!=`object`||!e||Dr in e||Or in e)return e;let t=xr(e);if(t!==gee&&t!==_ee)return e;var n=new Map,r=_r(e),i=j(0),a=null,o=Ha,s=e=>{if(Ha===o)return e();var t=Aa,n=Ha;Ma(null),Ua(o);var r=e();return Ma(t),Ua(n),r};return r&&n.set(`length`,j(e.length,a)),new Proxy(e,{defineProperty(e,t,r){`value`in r&&r.configurable!==!1&&r.enumerable!==!1&&r.writable!==!1||Nee();var i=n.get(t);return i===void 0?s(()=>{var e=j(r.value,a);return n.set(t,e),e}):M(i,r.value,!0),!0},deleteProperty(e,t){var r=n.get(t);if(r===void 0){if(t in e){let e=s(()=>j(gr,a));n.set(t,e),Ji(i)}}else M(r,gr),Ji(i);return!0},get(t,r,i){if(r===Dr)return e;var o=n.get(r),c=r in t;if(o===void 0&&(!c||br(t,r)?.writable)&&(o=s(()=>j(Xi(c?t[r]:gr),a)),n.set(r,o)),o!==void 0){var l=z(o);return l===gr?void 0:l}return Reflect.get(t,r,i)},getOwnPropertyDescriptor(e,t){this.has?.(e,t);var r=Reflect.getOwnPropertyDescriptor(e,t),i=n.get(t);if(i!==void 0){var a=z(i);if(a===gr)return;if(r&&`value`in r)r.value=a;else return{enumerable:!0,configurable:!0,value:a,writable:!0}}return r},has(e,t){if(t===Dr)return!0;var r=n.get(t),i=r!==void 0&&r.v!==gr||Reflect.has(e,t);return(r!==void 0||(Na!==null||Aa!==null)&&(!i||br(e,t)?.writable))&&(r===void 0&&(r=s(()=>j(i?Xi(e[t]):gr,a)),n.set(t,r)),z(r)===gr)?!1:i},set(e,t,o,c){var l=n.get(t),u=t in e;if(r&&t===`length`)for(var d=o;d<l.v;d+=1){var f=n.get(d+``);f===void 0?d in e&&(f=s(()=>j(gr,a)),n.set(d+``,f)):M(f,gr)}if(l===void 0)(!u||br(e,t)?.writable)&&(l=s(()=>j(void 0,a)),M(l,Xi(o)),n.set(t,l));else{u=l.v!==gr;var p=s(()=>Xi(o));M(l,p)}var m=Reflect.getOwnPropertyDescriptor(e,t);if(m?.set&&m.set.call(c,o),!u){if(r&&typeof t==`string`){var h=n.get(`length`),g=Number(t);Number.isInteger(g)&&g>=h.v&&M(h,g+1)}Ji(i)}return!0},ownKeys(e){z(i);var t=Reflect.ownKeys(e).filter(e=>{var t=n.get(e);return t===void 0||t.v!==gr});for(var[r,a]of n)a.v!==gr&&!(r in e)&&t.push(r);return t},setPrototypeOf(){Pee()}})}function Zi(e){try{if(typeof e==`object`&&e&&Dr in e)return e[Dr]}catch{}return e}function Qi(e,t){return Object.is(Zi(e),Zi(t))}var $i,ea,ta,na,ra;function Zee(){if($i===void 0){$i=window,ea=document,ta=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;na=br(t,`firstChild`).get,ra=br(t,`nextSibling`).get,vee(e)&&(e[jr]=void 0,e[Ar]=null,e[Mr]=void 0,e.__e=void 0),vee(n)&&(n[Nr]=void 0)}}function ia(e=``){return document.createTextNode(e)}function aa(e){return na.call(e)}function oa(e){return ra.call(e)}function N(e,t){if(!Rr)return aa(e);var n=aa(Br);if(n===null)n=Br.appendChild(ia());else if(t&&n.nodeType!==3){var r=ia();return n?.before(r),Vr(r),r}return t&&ca(n),Vr(n),n}function P(e,t=!1){if(!Rr){var n=aa(e);return n instanceof Comment&&n.data===``?oa(n):n}if(t){if(Br?.nodeType!==3){var r=ia();return Br?.before(r),Vr(r),r}ca(Br)}return Br}function F(e,t=!1){if(!Rr)return aa(e);var n=N(e,t);return D(e),n}function I(e,t=1,n=!1){let r=Rr?Br:e;for(var i;t--;)i=r,r=oa(r);if(!Rr)return r;if(n){if(r?.nodeType!==3){var a=ia();return r===null?i?.after(a):r.before(a),Vr(a),a}ca(r)}return Vr(r),r}function Qee(e){e.textContent=``}function $ee(){return!1}function sa(e,t,n){return t==null||t===`http://www.w3.org/1999/xhtml`?n?document.createElement(e,{is:n}):document.createElement(e):n?document.createElementNS(t,e,{is:n}):document.createElementNS(t,e)}function ca(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function ete(e){var t=Na;if(t===null)return Aa.f|=8388608,e;if(!(t.f&32768)&&!(t.f&4))throw e;la(e,t)}function la(e,t){if(e===hr)throw e;if(!(t!==null&&t.f&16384)){for(;t!==null;){if(t.f&128&&!(t.f&33570816)){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}}function tte(e){Na===null&&(Aa===null&&Aee(e),kee()),Oa&&Oee(e)}function nte(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function ua(e,t){var n=Na;n!==null&&n.f&8192&&(e|=8192);var r={ctx:Qr,deps:null,nodes:null,f:e|2560,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};wi?.register_created_effect(r);var i=r;if(e&4)Ai===null?Ni.ensure().schedule(r):Ai.push(r);else if(t!==null){try{Xa(r)}catch(e){throw ba(r),e}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=65536))}if(i!==null&&(i.parent=n,n!==null&&nte(i,n),Aa!==null&&Aa.f&2&&!(e&64))){var a=Aa;(a.effects??=[]).push(i)}return r}function da(){return Aa!==null&&!ja}function fa(e){let t=ua(8,null);return si(t,1024),t.teardown=e,t}function L(e){tte(`$effect`);var t=Na.f;if(!Aa&&t&32&&Qr!==null&&!Qr.i){var n=Qr;(n.e??=[]).push(e)}else return rte(e)}function rte(e){return ua(1048580,e)}function pa(e){return tte(`$effect.pre`),ua(1048584,e)}function ma(e){Ni.ensure();let t=ua(524352,e);return()=>{ba(t)}}function ite(e){Ni.ensure();let t=ua(524352,e);return(e={})=>new Promise(n=>{e.outro?Ca(t,()=>{ba(t),n(void 0)}):(ba(t),n(void 0))})}function ha(e){return ua(4,e)}function ate(e){return ua(4718592,e)}function ga(e,t=0){return ua(8|t,e)}function R(e,t=[],n=[],r=[]){pi(r,t,n,t=>{ua(8,()=>{e(...t.map(z))})})}function ote(e,t=[],n=[],r=[]){pi(r,t,n,t=>{ua(4,()=>e(...t.map(z)))})}function _a(e,t=0){return ua(16|t,e)}function ste(e,t=0){return ua(16777216|t,e)}function va(e){return ua(524320,e)}function cte(e){var t=e.teardown;if(t!==null){let n=Oa,r=Aa;ka(!0),Ma(null);try{t.call(null)}catch(t){la(t,e.parent)}finally{ka(n),Ma(r)}}}function ya(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&fi(()=>{e.abort(Fr)});var r=n.next;n.f&64?n.parent=null:ba(n,t),n=r}}function lte(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||ba(t),t=n}}function ba(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(xa(e.nodes.start,e.nodes.end),n=!0),e.f|=33554432,ya(e,t&&!n),Ya(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();cte(e),e.f^=33554432,e.f|=16384;var i=e.parent;i!==null&&i.first!==null&&Sa(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function xa(e,t){for(;e!==null;){var n=e===t?null:oa(e);e.remove(),e=n}}function Sa(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function Ca(e,t,n=!0){var r=[];e.f|=256,wa(e,r,!0);var i=()=>{n&&ba(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function wa(e,t,n){if(!(e.f&8192)){e.f^=8192;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next;if(!(i.f&64)){var o=!!(i.f&65536)||!!(i.f&32)&&!!(e.f&16);wa(i,t,o?n:!1)}i=a}}}function Ta(e){e.f&=-257,Ea(e,!0)}function Ea(e,t){if(!(e.f&256)&&e.f&8192){e.f^=8192,e.f&1024||(si(e,2048),Ni.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=!!(n.f&65536)||!!(n.f&32);Ea(n,i?t:!1),n=r}var a=e.nodes&&e.nodes.t;if(a!==null)for(let e of a)(e.is_global||t)&&e.in()}}function Da(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:oa(n);t.append(n),n=i}}var ute=null,Oa=!1;function ka(e){Oa=e}var Aa=null,ja=!1;function Ma(e){Aa=e}var Na=null;function Pa(e){Na=e}var Fa=null;function Ia(e){Aa!==null&&(Aa.f&2097152||Aa.f&2)&&(Fa??=new Set).add(e)}var La=null,Ra=0,za=null;function dte(e){za=e}var Ba=1,Va=0,Ha=Va;function Ua(e){Ha=e}function Wa(){return++Ba}function Ga(e){var t=e.f;if(t&2048)return!0;if(t&4096){for(var n=e.deps,r=n.length,i=0;i<r;i++){var a=n[i];if(Ga(a)&&xi(a),a.wv>e.wv)return!0}t&512&&Ei===null&&si(e,1024)}return!1}function Ka(e,t,n=!0){var r=e.reactions;if(r!==null&&!(Fa!==null&&Fa.has(e)))for(var i=0;i<r.length;i++){var a=r[i];a.f&2?Ka(a,t,!1):t===a&&(n?si(a,2048):a.f&1024&&si(a,4096),Li(a))}}function qa(e){var t=La,n=Ra,r=za,i=Aa,a=Fa,o=Qr,s=ja,c=Ha,l=e.f;La=null,Ra=0,za=null,Aa=l&96?null:e,Fa=null,$r(e.ctx),ja=!1,Ha=++Va,e.ac!==null&&(fi(()=>{e.ac.abort(Fr)}),e.ac=null);try{e.f|=2097152;var u=e.fn,d=u();e.f|=32768;var f=Ja(e);if(ri()&&za!==null&&!ja&&f!==null&&!(e.f&6146))for(var p=0;p<za.length;p++)Ka(za[p],e);if(i!==null&&i!==e){if(Va++,i.deps!==null)for(let e=0;e<n;e+=1)i.deps[e].rv=Va;if(t!==null)for(let e of t)e.rv=Va;za!==null&&(r===null?r=za:r.push(...za))}return e.f&8388608&&(e.f^=8388608),d}catch(t){return Ja(e),ete(t)}finally{e.f^=2097152,La=t,Ra=n,za=r,Aa=i,Fa=a,$r(o),ja=s,Ha=c}}function Ja(e){var t=e.deps,n=wi?.is_fork;if(La!==null){var r;if(n||Ya(e,Ra),t!==null&&Ra>0)for(t.length=Ra+La.length,r=0;r<La.length;r++)t[Ra+r]=La[r];else e.deps=t=La;if(da()&&e.f&512)for(r=Ra;r<t.length;r++)(t[r].reactions??=[]).push(e)}else!n&&t!==null&&Ra<t.length&&(Ya(e,Ra),t.length=Ra);return t}function fte(e,t){let n=t.reactions;if(n!==null){var r=pee.call(n,e);if(r!==-1){var i=n.length-1;i===0?n=t.reactions=null:(n[r]=n[i],n.pop())}}if(n===null&&t.f&2&&(La===null||!vr.call(La,t))){var a=t;a.f&512&&(a.f^=512),a.v!==gr&&ci(a),a.ac!==null&&fi(()=>{a.ac.abort(Fr),a.ac=null,si(a,2048)}),qee(a),Ya(a,0)}}function Ya(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)fte(e,n[r])}function Xa(e){var t=e.f;if(!(t&16384)){si(e,1024);var n=Na;Na=e;try{t&16777232?lte(e):ya(e),cte(e);var r=qa(e);e.teardown=typeof r==`function`?r:null,e.wv=Ba}finally{Na=n}}}async function Za(){await Promise.resolve(),Pi()}function z(e){var t=!!(e.f&2);if(ute?.add(e),Aa!==null&&!ja&&!(Na!==null&&Na.f&16384)&&(Fa===null||!Fa.has(e))){var n=Aa.deps;if(Aa.f&2097152)e.rv<Va&&(e.rv=Va,La===null&&n!==null&&n[Ra]===e?Ra++:La===null?La=[e]:La.push(e));else{Aa.deps??=[],vr.call(Aa.deps,e)||Aa.deps.push(e);var r=e.reactions;r===null?e.reactions=[Aa]:vr.call(r,Aa)||r.push(Aa)}}if(Oa&&Vi.has(e))return Vi.get(e);if(t){var i=e;if(Oa){var a=i.v;return(!(i.f&1024)&&i.reactions!==null||$a(i))&&(a=bi(i)),Vi.set(i,a),a}var o=!(i.f&512)&&!ja&&Aa!==null&&!!(Aa.f&512),s=!(i.f&32768);Ga(i)&&(o&&(i.f|=512),xi(i)),o&&!s&&(Si(i),Qa(i))}if(Ei?.has(e))return Ei.get(e);if(e.f&8388608)throw e.v;return e.v}function Qa(e){if(e.f|=512,e.deps!==null)for(let n of e.deps){var t=n.reactions;t===null?n.reactions=[e]:vr.call(t,e)||t.push(e),n.f&2&&!(n.f&512)&&(Si(n),Qa(n))}}function $a(e){if(e.v===gr)return!0;if(e.deps===null)return!1;for(let t of e.deps)if(Vi.has(t)||t.f&2&&$a(t))return!0;return!1}function eo(e){var t=ja;try{return ja=!0,e()}finally{ja=t}}var to=Symbol(`events`),no=new Set,ro=new Set;function pte(e){if(!Rr)return;e.removeAttribute(`onload`),e.removeAttribute(`onerror`);let t=e.__e;t!==void 0&&(e.__e=void 0,queueMicrotask(()=>{e.isConnected&&e.dispatchEvent(t)}))}function io(e,t,n,r={}){function i(e){if(r.capture||fo.call(t,e),!e.cancelBubble)return fi(()=>n?.call(this,e))}return e.startsWith(`pointer`)||e.startsWith(`touch`)||e===`wheel`?(i.__removed=!1,oi(()=>{i.__removed||t.addEventListener(e,i,r)})):t.addEventListener(e,i,r),i}function ao(e,t,n,r={}){var i=io(t,e,n,r);return()=>{i.__removed=!0,e.removeEventListener(t,i,r)}}function oo(e,t,n,r,i){var a={capture:r,passive:i},o=io(e,t,n,a);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&fa(()=>{o.__removed=!0,t.removeEventListener(e,o,a)})}function so(e,t,n){(t[to]??={})[e]=n}function co(e){for(var t=0;t<e.length;t++)no.add(e[t]);for(var n of ro)n(e)}var lo=null,uo=!1;function fo(e){var t=this,n=t.ownerDocument,r=e.type,i=e.composedPath?.()||[],a=i[0]||e.target;lo=e,uo||(uo=!0,setTimeout(()=>{uo=!1,lo=null}));var o=0,s=lo===e&&e[to];if(s){var c=i.indexOf(s);if(c!==-1&&(t===document||t===window)){e[to]=t;return}var l=i.indexOf(t);if(l===-1)return;c<=l&&(o=c)}if(a=i[o]||e.target,a!==t){mee(e,`currentTarget`,{configurable:!0,get(){return a||n}});var u=Aa,d=Na;Ma(null),Pa(null);try{for(var f,p=[];a!==null&&a!==t;){try{var m=a[to]?.[r];m==null||a.disabled&&e.target!==a||m.call(a,e)}catch(e){f?p.push(e):f=e}if(e.cancelBubble)break;o++,a=o<i.length?i[o]:null}if(f){for(let e of p)queueMicrotask(()=>{throw e});throw f}}finally{e[to]=t,delete e.currentTarget,Ma(u),Pa(d)}}}var mte=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function hte(e){return mte?.createHTML(e)??e}function gte(e){var t=sa(`template`);return t.innerHTML=hte(e.replaceAll(`<!>`,`<!---->`)),t.content}function po(e,t){var n=Na;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function B(e,t){var n=!!(t&1),r=!!(t&2),i,a=!e.startsWith(`<!>`);return()=>{if(Rr)return po(Br,null),Br;i===void 0&&(i=gte(a?e:`<!>`+e),n||(i=aa(i)));var t=r||ta?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=aa(t),s=t.lastChild;po(o,s)}else po(t,t);return t}}function V(e=``){if(!Rr){var t=ia(e+``);return po(t,t),t}var n=Br;return n.nodeType===3?ca(n):(n.before(n=ia()),Vr(n)),po(n,n),n}function H(){if(Rr)return po(Br,null),Br;var e=document.createDocumentFragment(),t=document.createComment(``),n=ia();return e.append(t,n),po(t,n),e}function U(e,t){if(Rr){var n=Na;n.f&32768&&n.nodes.end!==null||(n.nodes.end=Br),Hr()}else e!==null&&e.before(t)}function mo(){if(Rr&&Br&&Br.nodeType===8&&Br.textContent?.startsWith(`$`)){let e=Br.textContent.substring(1);return Hr(),e}return(window.__svelte??={}).uid??=1,`c${window.__svelte.uid++}`}function _te(e){return e.endsWith(`capture`)&&e!==`gotpointercapture`&&e!==`lostpointercapture`}var vte=[`beforeinput`,`click`,`change`,`dblclick`,`contextmenu`,`focusin`,`focusout`,`input`,`keydown`,`keyup`,`mousedown`,`mousemove`,`mouseout`,`mouseover`,`mouseup`,`pointerdown`,`pointermove`,`pointerout`,`pointerover`,`pointerup`,`touchend`,`touchmove`,`touchstart`];function yte(e){return vte.includes(e)}var bte=`allowfullscreen.async.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.webkitdirectory.defer.disablepictureinpicture.disableremoteplayback`.split(`.`),xte={formnovalidate:`formNoValidate`,ismap:`isMap`,nomodule:`noModule`,playsinline:`playsInline`,readonly:`readOnly`,defaultvalue:`defaultValue`,defaultchecked:`defaultChecked`,srcobject:`srcObject`,novalidate:`noValidate`,allowfullscreen:`allowFullscreen`,disablepictureinpicture:`disablePictureInPicture`,disableremoteplayback:`disableRemotePlayback`};function Ste(e){return e=e.toLowerCase(),xte[e]??e}[...bte];var Cte=[`touchstart`,`touchmove`];function wte(e){return Cte.includes(e)}var Tte=[`textarea`,`script`,`style`,`title`];function Ete(e){return Tte.includes(e)}function Dte(e){let t=0,n=Ui(0),r;return()=>{da()&&(z(n),ga(()=>(t===0&&(r=eo(()=>e(()=>Ji(n)))),t+=1,()=>{oi(()=>{--t,t===0&&(r?.(),r=void 0,Ji(n))})})))}}var Ote=589824;function ho(e,t,n,r){new kte(e,t,n,r)}var kte=class{parent;is_pending=!1;transform_error;#e;#t=Rr?Br:null;#n;#r;#i;#a=null;#o=null;#s=null;#c=null;#l=0;#u=0;#d=!1;#f=new Map;#p=null;#m=Dte(()=>(this.#p=Ui(this.#l),()=>{this.#p=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=Na;t.b=this,t.f|=128,n(e)},this.parent=Na.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=_a(()=>{if(Rr){let e=Gr(this.#t);Hr();let t=e===`[!`;if(e.startsWith(`[?`)){let t=JSON.parse(e.slice(2));this.#g(t)}else t?this.#y():this.#h()}else this.#b()},Ote),Rr&&(this.#e=Br)}#h(){try{this.#a=va(()=>this.#r(this.#e))}catch(e){this.error(e)}}#g(e){let t=this.#n.failed,{reset:n,invoke_onerror:r}=this.#_(e);oi(r),t&&(this.#s=va(()=>{t(this.#e,()=>e,()=>n)}))}#_(e){var t=!1,n=!1;let r=()=>{this.#v()||(t?wee():(t=!0,n&&Iee(),this.#s!==null&&Ca(this.#s,()=>{this.#s=null}),this.#S(()=>{this.#b()})))};return{reset:r,invoke_onerror:()=>{if(!this.#v())try{n=!0,this.#n.onerror?.(e,r),n=!1}catch(e){la(e,this.#i&&this.#i.parent)}}}}#v(){return!!(this.#i.f&33570816)}#y(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=va(()=>e(this.#e)),oi(()=>{if(!this.#v()){var e=this.#c=document.createDocumentFragment(),t=ia(),n=!1;e.append(t),this.#a=this.#S(()=>{try{return va(()=>this.#r(t))}catch(e){try{this.error(e),n=!0}catch(e){la(e,this.#i.parent)}return null}}),this.#a===null?(this.#c=null,n&&this.#x(wi)):this.#u===0&&(this.#e.before(e),this.#c=null,Ca(this.#o,()=>{this.#o=null}),this.#x(wi))}}))}#b(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#l=0,this.#a=va(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();Da(this.#a,e);let t=this.#n.pending;this.#o=va(()=>t(this.#e))}else this.#x(wi)}catch(e){this.error(e)}}#x(e){this.is_pending=!1,e.transfer_reactions(this.#f)}defer_effect(e){li(e,this.#f)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#S(e){var t=Na,n=Aa,r=Qr;Pa(this.#i),Ma(this.#i),$r(this.#i.ctx);try{return Ni.ensure(),e()}finally{Pa(t),Ma(n),$r(r)}}#C(e,t){this.has_pending_snippet()?(this.#u+=e,this.#u===0&&(this.#x(t),this.#o&&Ca(this.#o,()=>{this.#o=null}),this.#c&&=(this.#e.before(this.#c),null))):this.parent&&this.parent.#C(e,t)}update_pending_count(e,t){this.#C(e,t),this.#l+=e,!this.#p||this.#d||(this.#d=!0,oi(()=>{this.#d=!1,this.#p&&qi(this.#p,this.#l)}))}get_effect_pending(){return this.#m(),z(this.#p)}error(e){if(e===hr||!this.#n.onerror&&!this.#n.failed)throw e;wi?.is_fork?(this.#a&&wi.skip_effect(this.#a),this.#o&&wi.skip_effect(this.#o),this.#s&&wi.skip_effect(this.#s),wi.oncommit(()=>{this.#v()||this.#w(e)})):this.#w(e)}#w(e){this.#a&&=(ba(this.#a),null),this.#o&&=(ba(this.#o),null),this.#s&&=(ba(this.#s),null),Rr&&(Vr(this.#t),Ur(),Vr(Wr()));let t=this.#n.failed,n=e=>{if(this.#v())return;let{reset:n,invoke_onerror:r}=this.#_(e);r(),t&&!this.#v()&&(this.#s=this.#S(()=>{try{return va(()=>{var r=Na;r.b=this,r.f|=128,t(this.#e,()=>e,()=>n)})}catch(e){return la(e,this.#i.parent),null}}))};oi(()=>{if(!this.#v()){var t;try{t=this.transform_error(e)}catch(e){la(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(n,e=>la(e,this.#i&&this.#i.parent)):n(t)}})}};function W(e,t){var n=t==null?``:typeof t==`object`?`${t}`:t;n!==(e[Nr]??=e.nodeValue)&&(e[Nr]=n,e.nodeValue=`${n}`)}function go(e,t){return Ate(e,t)}var _o=new Map;function Ate(e,{target:t,anchor:n,props:r={},events:i,context:a,intro:o=!0,transformError:s}){Zee();var c=void 0,l=ite(()=>{var o=n??t.appendChild(ia());ho(o,{pending:()=>{}},t=>{O({});var n=Qr;if(a&&(n.c=a),i&&(r.$$events=i),Rr&&po(t,null),c=e(t,r)||ni(),Rr&&(Na.nodes.end=Br,Br===null||Br.nodeType!==8||Br.data!==`]`))throw Lr(),hr;k()},s);var l=new Set,u=e=>{for(var n=0;n<e.length;n++){var r=e[n];if(!l.has(r)){l.add(r);var i=wte(r);for(let e of[t,document]){var a=_o.get(e);a===void 0&&(a=new Map,_o.set(e,a));var o=a.get(r);o===void 0?(e.addEventListener(r,fo,{passive:i}),a.set(r,1)):a.set(r,o+1)}}}};return u(yr(no)),ro.add(u),()=>{for(var e of l)for(let n of[t,document]){var r=_o.get(n),i=r.get(e);--i==0?(n.removeEventListener(e,fo),r.delete(e),r.size===0&&_o.delete(n)):r.set(e,i)}ro.delete(u),o!==n&&o.parentNode?.removeChild(o)}});return vo.set(c,l),c}var vo=new WeakMap;function yo(e,t){let n=vo.get(e);return n?(vo.delete(e),n(t)):Promise.resolve()}var bo=class{anchor;#e=new Map;#t=new Map;#n=new Map;#r=new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#a=e=>{if(this.#e.has(e)){var t=this.#e.get(e),n=this.#t.get(t);if(n)Ta(n),this.#r.delete(t);else{var r=this.#n.get(t);r&&(Ta(r.effect),this.#t.set(t,r.effect),this.#n.delete(t),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),n=r.effect)}for(let[t,n]of this.#e){if(this.#e.delete(t),t===e)break;let r=this.#n.get(n);r&&(ba(r.effect),this.#n.delete(n))}for(let[e,r]of this.#t){if(e===t||this.#r.has(e))continue;let i=()=>{if(Array.from(this.#e.values()).includes(e)){var t=document.createDocumentFragment();Da(r,t),t.append(ia()),this.#n.set(e,{effect:r,fragment:t})}else ba(r);this.#r.delete(e),this.#t.delete(e)};this.#i||!n?(this.#r.add(e),Ca(r,i,!1)):i()}}};#o=e=>{this.#e.delete(e);let t=Array.from(this.#e.values());for(let[e,n]of this.#n)t.includes(e)||(ba(n.effect),this.#n.delete(e))};ensure(e,t){var n=wi,r=$ee();if(t&&!this.#t.has(e)&&!this.#n.has(e)){if(r){var i=document.createDocumentFragment(),a=ia();i.append(a),this.#n.set(e,{effect:va(()=>t(a)),fragment:i})}else this.#t.set(e,va(()=>t(this.anchor)))}if(this.#e.set(n,e),r){for(let[t,r]of this.#t)t===e?n.unskip_effect(r):n.skip_effect(r);for(let[t,r]of this.#n)t===e?n.unskip_effect(r.effect):n.skip_effect(r.effect);n.oncommit(this.#a),n.ondiscard(this.#o)}else Rr&&(this.anchor=Br),this.#a(n)}};function xo(e,t,...n){var r=new bo(e);_a(()=>{let e=t()??null;r.ensure(e,e&&(t=>e(t,...n)))},65536)}function So(e){Qr===null&&Jr(`onMount`),L(()=>{let t=eo(e);if(typeof t==`function`)return t})}function Co(e){Qr===null&&Jr(`onDestroy`),So(()=>()=>eo(e))}function wo(){return Symbol(`@attach`)}var To=0,Eo=1,jte=2;function Do(e,t,n,r,i){Rr&&Hr();var a=ri(),o=gr,s=a?Ui(o):Wi(o,!1,!1),c=a?Ui(o):Wi(o,!1,!1),l=new bo(e);_a(()=>{var a=wi,o=t(),u=!1;let d=Rr&&yee(o)===(e.data===`[!`);if(d&&(Vr(Wr()),zr(!1)),yee(o)){var f=mi(),p=!1;let e=e=>{if(!u){p=!0,f(!1),wi===a&&a.deactivate(),Ni.ensure();try{e()}finally{hi(!1),Oi||Pi()}}};o.then(t=>{e(()=>{qi(s,t),l.ensure(Eo,r&&(e=>r(e,s)))})},t=>{e(()=>{if(qi(c,t),l.ensure(jte,i&&(e=>i(e,c))),!i)throw c.v})}),Rr?l.ensure(To,n):oi(()=>{p||e(()=>{l.ensure(To,n)})})}else qi(s,o),l.ensure(Eo,r&&(e=>r(e,s)));return d&&zr(!0),()=>{u=!0}})}function G(e,t,n=!1){var r;Rr&&(r=Br,Hr());var i=new bo(e),a=n?65536:0;function o(e,t){if(Rr){var n=Gr(r);if(e!==parseInt(n.substring(1))){var a=Wr();Vr(a),i.anchor=a,zr(!1),i.ensure(e,t),zr(!0);return}}i.ensure(e,t)}_a(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},a)}var Mte=Symbol(`NaN`);function Oo(e,t,n){Rr&&Hr();var r=new bo(e),i=!ri();_a(()=>{var e=t();e!==e&&(e=Mte),i&&typeof e==`object`&&e&&(e={}),r.ensure(e,n)})}function ko(e,t){Rr&&Vr(aa(e)),ga(()=>{var n=t();for(var r in n){var i=n[r];i==null||i===``?e.style.removeProperty(r):e.style.setProperty(r,i)}})}function Ao(e,t){return t}function Nte(e,t,n){for(var r=[],i=t.length,a,o=t.length,s=0;s<i;s++){let n=t[s];Ca(n,()=>{if(a){if(a.pending.delete(n),a.done.add(n),a.pending.size===0){var t=e.outrogroups;jo(e,yr(a.done)),t.delete(a),t.size===0&&(e.outrogroups=null)}}else--o},!1)}if(o===0){var c=r.length===0&&n!==null&&e.pending.size===0;if(c){var l=n,u=l.parentNode;Qee(u),u.append(l),e.items.clear()}jo(e,t,!c)}else a={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(a)}function jo(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(let t of e.pending.values())for(let n of t)r.add(e.items.get(n).e)}for(var i=0;i<t.length;i++){var a=t[i];r?.has(a)?(a.f|=33554432,Da(a,document.createDocumentFragment())):ba(t[i],n)}}var Mo;function No(e,t,n,r,i,a=null){var o=e,s=new Map;if(t&4){var c=e;o=Rr?Vr(aa(c)):c.appendChild(ia())}Rr&&Hr();var l=null,u=yi(()=>{var e=n();return _r(e)?e:e==null?[]:yr(e)}),d=new Map,f=!0;function p(e){if(!(h.effect.f&16384)){h.pending.delete(e);var n=z(u);h.fallback=l,Pte(h,n,o,t,r),l!==null&&(n.length===0?l.f&33554432?(l.f^=33554432,Fo(l,null,o)):Ta(l):Ca(l,()=>{l=null}))}}function m(e){h.pending.delete(e)}var h={effect:_a(()=>{var e=z(u),c=e.length;let h=!1;Rr&&Gr(o)===`[!`!=(c===0)&&(o=Wr(),Vr(o),zr(!1),h=!0);for(var g=new Set,_=wi,v=$ee(),y=0;y<c;y+=1){Rr&&Br.nodeType===8&&Br.data===`]`&&(o=Br,h=!0,zr(!1));var b=e[y],x=r(b,y),S=f?null:s.get(x);S?(S.v&&qi(S.v,b),S.i&&qi(S.i,y),v&&_.unskip_effect(S.e)):(S=Fte(s,f?o:Mo??=ia(),b,x,y,i,t,n),f||(S.e.f|=33554432),s.set(x,S)),g.add(x)}if(c===0&&a&&!l&&(f?l=va(()=>a(o)):(l=va(()=>a(Mo??=ia())),l.f|=33554432)),c>g.size&&Dee(``,``,``),Rr&&c>0&&Vr(Wr()),!f){if(d.set(_,g),v){for(let[e,t]of s)g.has(e)||_.skip_effect(t.e);_.oncommit(p),_.ondiscard(m)}else p(_)}h&&zr(!0),z(u)}),flags:t,items:s,pending:d,outrogroups:null,fallback:l};f=!1,Rr&&(o=Br)}function Po(e){for(;e!==null&&!(e.f&32);)e=e.next;return e}function Pte(e,t,n,r,i){var a=!!(r&8),o=t.length,s=e.items,c=Po(e.effect.first),l,u=null,d,f=[],p=[],m,h,g,_;if(a)for(_=0;_<o;_+=1)m=t[_],h=i(m,_),g=s.get(h).e,g.f&33554432||(g.nodes?.a?.measure(),(d??=new Set).add(g));for(_=0;_<o;_+=1){if(m=t[_],h=i(m,_),g=s.get(h).e,e.outrogroups!==null)for(let t of e.outrogroups)t.pending.delete(g),t.done.delete(g);if(g.f&8192&&(Ta(g),a&&(g.nodes?.a?.unfix(),(d??=new Set).delete(g))),g.f&33554432){if(g.f^=33554432,g===c)Fo(g,null,n);else{var v=u?u.next:c;g===e.effect.last&&(e.effect.last=g.prev),g.prev&&(g.prev.next=g.next),g.next&&(g.next.prev=g.prev),Io(e,u,g),Io(e,g,v),Fo(g,v,n),u=g,f=[],p=[],c=Po(u.next);continue}}if(g!==c){if(l!==void 0&&l.has(g)){if(f.length<p.length){var y=p[0],b;u=y.prev;var x=f[0],S=f[f.length-1];for(b=0;b<f.length;b+=1)Fo(f[b],y,n);for(b=0;b<p.length;b+=1)l.delete(p[b]);Io(e,x.prev,S.next),Io(e,u,x),Io(e,S,y),c=y,u=S,--_,f=[],p=[]}else l.delete(g),Fo(g,c,n),Io(e,g.prev,g.next),Io(e,g,u===null?e.effect.first:u.next),Io(e,u,g),u=g;continue}for(f=[],p=[];c!==null&&c!==g;)(l??=new Set).add(c),p.push(c),c=Po(c.next);if(c===null)continue}g.f&33554432||f.push(g),u=g,c=Po(g.next)}if(e.outrogroups!==null){for(let t of e.outrogroups)t.pending.size===0&&(jo(e,yr(t.done)),e.outrogroups?.delete(t));e.outrogroups.size===0&&(e.outrogroups=null)}if(c!==null||l!==void 0){var C=[];if(l!==void 0)for(g of l)g.f&8192||C.push(g);for(;c!==null;)!(c.f&8192)&&c!==e.fallback&&C.push(c),c=Po(c.next);var w=C.length;if(w>0){var T=r&4&&o===0?n:null;if(a){for(_=0;_<w;_+=1)C[_].nodes?.a?.measure();for(_=0;_<w;_+=1)C[_].nodes?.a?.fix()}Nte(e,C,T)}}a&&oi(()=>{if(d!==void 0)for(g of d)g.nodes?.a?.apply()})}function Fte(e,t,n,r,i,a,o,s){var c=o&1?o&16?Ui(n):Wi(n,!1,!1):null,l=o&2?Ui(i):null;return{v:c,i:l,e:va(()=>(a(t,c??n,l??i,s),()=>{e.delete(r)}))}}function Fo(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,a=t&&!(t.f&33554432)?t.nodes.start:n;r!==null;){var o=oa(r);if(a.before(r),r===i)return;r=o}}function Io(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function Lo(e,t,n=!1,r=!1,i=!1,a=!1){var o=e,s=``;if(n){var c=e;Rr&&(o=Vr(aa(c)))}R(()=>{var e=Na;if(s===(s=t()??``))Rr&&Hr();else if(n&&!Rr)e.nodes=null,c.innerHTML=s,s!==``&&po(aa(c),c.lastChild);else if(e.nodes!==null&&(xa(e.nodes.start,e.nodes.end),e.nodes=null),s!==``){if(Rr){for(var a=Br.data,l=Hr(),u=l;l!==null&&(l.nodeType!==8||l.data!==``);)u=l,l=oa(l);if(l===null)throw Lr(),hr;po(Br,u),o=Vr(l)}else{var d=sa(r?`svg`:i?`math`:`template`,r?`http://www.w3.org/2000/svg`:i?`http://www.w3.org/1998/Math/MathML`:void 0);d.innerHTML=s;var f=r||i?d:d.content;if(po(aa(f),f.lastChild),r||i)for(;aa(f);)o.before(aa(f));else o.before(f)}}})}function Ro(e,t,n){var r;Rr&&(r=Br,Hr());var i=new bo(e);_a(()=>{var e=t()??null;if(Rr&&Gr(r)===`[`!=(e!==null)){var a=Wr();Vr(a),i.anchor=a,zr(!1),i.ensure(e,e&&(t=>n(t,e))),zr(!0)}else i.ensure(e,e&&(t=>n(t,e)))},65536)}var Ite=()=>performance.now(),zo={tick:e=>requestAnimationFrame(e),now:()=>Ite(),tasks:new Set};function Bo(){let e=zo.now();zo.tasks.forEach(t=>{t.c(e)||(zo.tasks.delete(t),t.f())}),zo.tasks.size!==0&&zo.tick(Bo)}function Lte(e){let t;return zo.tasks.size===0&&zo.tick(Bo),{promise:new Promise(n=>{zo.tasks.add(t={c:e,f:n})}),abort(){zo.tasks.delete(t)}}}function Rte(e){if(e===`float`)return`cssFloat`;if(e===`offset`)return`cssOffset`;if(e.startsWith(`--`))return e;let t=e.split(`-`);return t.length===1?t[0]:t[0]+t.slice(1).map(e=>e[0].toUpperCase()+e.slice(1)).join(``)}function Vo(e){let t={},n=e.split(`;`);for(let e of n){let[n,r]=e.split(`:`);if(!n||r===void 0)break;let i=Rte(n.trim());t[i]=r.trim()}return t}var zte=e=>e,Ho=null;function Uo(e){Ho=e}function Wo(e,t,n){var r=(Ho??Na).nodes,i,a,o,s=null;r.a??={element:e,measure(){i=this.element.getBoundingClientRect()},apply(){if(o?.abort(),a=this.element.getBoundingClientRect(),i.left!==a.left||i.right!==a.right||i.top!==a.top||i.bottom!==a.bottom){let e=t()(this.element,{from:i,to:a},n?.());o=Go(this.element,e,void 0,1,()=>{},()=>{o?.abort(),o=void 0})}},fix(){if(!e.getAnimations().length){var{position:t,width:n,height:r}=getComputedStyle(e);if(t!==`absolute`&&t!==`fixed`){var a=e.style;s={position:a.position,width:a.width,height:a.height,transform:a.transform},a.position=`absolute`,a.width=n,a.height=r;var o=e.getBoundingClientRect();if(i.left!==o.left||i.top!==o.top){var c=`translate(${i.left-o.left}px, ${i.top-o.top}px)`;a.transform=a.transform?`${a.transform} ${c}`:c}}}},unfix(){if(s){var t=e.style;t.position=s.position,t.width=s.width,t.height=s.height,t.transform=s.transform}}},r.a.element=e}function Go(e,t,n,r,i,a){var o=r===1,s=!1;if(Sr(t)){var c;return oi(()=>{s||(c=Go(e,t({direction:o?`in`:`out`}),n,r,i,a))}),{abort:()=>{s=!0,c?.abort()},deactivate:()=>c?.deactivate(),reset:()=>c?.reset(),t:()=>c?.t()??1-r}}if(n?.deactivate(),!t?.duration&&!t?.delay)return i(),a(),{abort:Cr,deactivate:Cr,reset:Cr,t:()=>r};let{delay:l=0,css:u,tick:d,easing:f=zte}=t;var p,m=()=>1-r;return oi(()=>{if(!s){var c=[];if(o&&n===void 0&&(d&&d(0,1),u)){var h=Vo(u(0,1));c.push(h,h)}p=e.animate(c,{duration:l,fill:`forwards`}),p.onfinish=()=>{p.cancel(),i();var o=n?.t()??1-r;n?.abort();var s=r-o,c=t.duration*Math.abs(s),l=[];if(c>0){var h=!1;if(u)for(var g=Math.ceil(c/(1e3/60)),_=0;_<=g;_+=1){var v=o+s*f(_/g),y=Vo(u(v,1-v));l.push(y),h||=y.overflow===`hidden`}h&&(e.style.overflow=`hidden`),m=()=>{var e=p.currentTime;return o+s*f(e/c)},d&&Lte(()=>{if(p.playState!==`running`)return!1;var e=m();return d(e,1-e),!0})}p=e.animate(l,{duration:c,fill:`forwards`}),p.onfinish=()=>{m=()=>r,d?.(r,1-r),a()}}}}),{abort:()=>{s=!0,p&&(p.cancel(),p.effect=null,p.onfinish=Cr)},deactivate:()=>{a=Cr},reset:()=>{r===0&&d?.(1,0)},t:()=>m()}}function Bte(e,t,n,r,i,a){let o=Rr;Rr&&Hr();var s=null;Rr&&Br.nodeType===1&&(s=Br,Hr());var c=Rr?Br:e,l=Na,u=new bo(c,!1);_a(()=>{let e=t()||null;var a=i?i():n||e===`svg`?`http://www.w3.org/2000/svg`:void 0;if(e===null)u.ensure(null,null);else return u.ensure(e,t=>{if(e){var n=Rr;if(s=Rr?s:sa(e,a),po(s,s),r){var i=null;Rr&&Ete(e)&&s.append(i=document.createComment(``));var o=Rr?aa(s):s.appendChild(ia());Rr&&(o===null?zr(!1):Vr(o)),Uo(l),r(s,o),i?.remove(),Uo(null)}Na.nodes.end=s,n||t.before(s)}Rr&&Vr(t)}),()=>{}},65536),fa(()=>{}),o&&(zr(!0),Vr(c))}function Ko(e,t){let n=null,r=Rr;var i;if(Rr){n=Br;for(var a=aa(document.head);a!==null&&(a.nodeType!==8||a.data!==e);)a=oa(a);if(a===null)zr(!1);else{var o=oa(a);a.remove(),Vr(o)}}Rr||(i=document.head.appendChild(ia()));try{_a(()=>{var e=va(()=>t(i));e.f|=262144,Rr||(e.nodes===null?e.nodes={start:i,end:i,a:null,t:null}:e.nodes.end=i)})}finally{r&&(zr(!0),Vr(n))}}function K(e,t){ha(()=>{e=Na?.parent?.nodes?.start??e;var n=e.getRootNode(),r=n.host?n:n.head??n.ownerDocument.head;if(!r.querySelector(`#`+t.hash)){let e=sa(`style`);e.id=t.hash,e.textContent=t.code,r.appendChild(e)}})}function qo(e,t){var n=void 0,r;ste(()=>{n!==(n=t())&&(r&&=(ba(r),null),n&&(r=va(()=>{ha(()=>n(e))})))})}function Jo(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Jo(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function Vte(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Jo(e))&&(r&&(r+=` `),r+=t);return r}function Yo(e){return typeof e==`object`?Vte(e):e??``}var Xo=[...`
\r\f\xA0\v`];function Hte(e,t,n){var r=e==null?``:``+e;if(t&&(r=r?r+` `+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+` `+i:i;else if(r.length)for(var a=i.length,o=0;(o=r.indexOf(i,o))>=0;){var s=o+a;(o===0||Xo.includes(r[o-1]))&&(s===r.length||Xo.includes(r[s]))?r=(o===0?``:r.substring(0,o))+r.substring(s+1):o=s}}return r===``?null:r}function Zo(e,t=!1){var n=t?` !important;`:`;`,r=``;for(var i of Object.keys(e)){var a=e[i];a!=null&&a!==``&&(r+=` `+i+`: `+a+n)}return r}function Qo(e){return e[0]!==`-`||e[1]!==`-`?e.toLowerCase():e}function Ute(e,t){if(t){var n=``,r,i;if(Array.isArray(t)?(r=t[0],i=t[1]):r=t,e){e=String(e).replaceAll(/\/\*.*?\*\//g,``).trim();var a=!1,o=0,s=!1,c=[];r&&c.push(...Object.keys(r).map(Qo)),i&&c.push(...Object.keys(i).map(Qo));var l=0,u=-1;let t=e.length;for(var d=0;d<t;d++){var f=e[d];if(s?f===`/`&&e[d-1]===`*`&&(s=!1):a?a===f&&(a=!1):f===`/`&&e[d+1]===`*`?s=!0:f===`"`||f===`'`?a=f:f===`(`?o++:f===`)`&&o--,!s&&a===!1&&o===0){if(f===`:`&&u===-1)u=d;else if(f===`;`||d===t-1){if(u!==-1){var p=Qo(e.substring(l,u).trim());if(!c.includes(p)){f!==`;`&&d++;var m=e.substring(l,d).trim();n+=` `+m+`;`}}l=d+1,u=-1}}}}return r&&(n+=Zo(r)),i&&(n+=Zo(i,!0)),n=n.trim(),n===``?null:n}return e==null?null:String(e)}function $o(e,t,n,r,i,a){var o=e[jr];if(Rr||o!==n||o===void 0){var s=Hte(n,r,a);Rr&&s===e.getAttribute(`class`)||(s==null?e.removeAttribute(`class`):t?e.className=s:e.setAttribute(`class`,s)),e[jr]=n}else if(a&&i!==a)for(var c in a){var l=!!a[c];(i==null||l!==!!i[c])&&e.classList.toggle(c,l)}return a}function es(e,t={},n,r){for(var i in n){var a=n[i];t[i]!==a&&(n[i]==null?e.style.removeProperty(i):e.style.setProperty(i,a,r))}}function ts(e,t,n,r){var i=e[Mr];if(Rr||i!==t){var a=Ute(t,r);Rr&&a===e.getAttribute(`style`)||(a==null?e.removeAttribute(`style`):e.style.cssText=a),e[Mr]=t}else r&&(Array.isArray(r)?(es(e,n?.[0],r[0]),es(e,n?.[1],r[1],`important`)):es(e,n,r));return r}function ns(e,t){t?e.hasAttribute(`selected`)||e.setAttribute(`selected`,``):e.removeAttribute(`selected`)}function rs(e,t){var n=!(`__defaultValue`in e);(n||e.__defaultValue!==t)&&(e.__defaultValue=t,is(e,!n||`__value`in e))}function is(e,t){var n=e.__defaultValue,r=e.multiple,i=r?n??[]:null;if(!r||_r(i)){var a=e.selectedIndex,o=t&&r?new Set(e.selectedOptions):null;for(var s of e.options){var c=os(s);ns(s,r?i.includes(c):Qi(c,n))}if(t){if(o!==null)for(s of e.options){var l=o.has(s);s.selected!==l&&(s.selected=l)}else e.selectedIndex!==a&&(e.selectedIndex=a)}}}function as(e,t,n=!1){if(e.multiple){if(t==null)return;if(!_r(t))return Cee();for(var r of e.options)r.selected=t.includes(os(r))}else{for(r of e.options)if(Qi(os(r),t)){r.selected=!0;return}n&&t===void 0||(e.selectedIndex=-1)}}function Wte(e){var t=new MutationObserver(t=>{t.every(Gte)||(`__defaultValue`in e&&is(e,!1),`__value`in e&&as(e,e.__value))});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`value`]}),fa(()=>{t.disconnect()})}function os(e){return`__value`in e?e.__value:e.value}function Gte(e){if(e.target.closest(`selectedcontent`)!==null)return!0;if(e.type===`childList`){var t=[...e.addedNodes,...e.removedNodes];return t.length>0&&t.every(e=>e.nodeName===`SELECTEDCONTENT`)}return!1}var ss=Symbol(`class`),cs=Symbol(`style`),ls=Symbol(`is custom element`),us=Symbol(`is html`),Kte=Ir?`link`:`LINK`,ds=Ir?`input`:`INPUT`,qte=Ir?`option`:`OPTION`,Jte=Ir?`select`:`SELECT`,Yte=Ir?`progress`:`PROGRESS`;function Xte(e){if(Rr){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute(`value`)){var n=e.value;q(e,`value`,null),e.value=n}if(e.hasAttribute(`checked`)){var r=e.checked;q(e,`checked`,null),e.checked=r}}};e[Pr]=n,oi(n),di()}}function q(e,t,n,r){var i=Qte(e);if(!(Rr&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===Kte))){var a=i[t];a!==(i[t]=n)&&(t===`loading`&&(e[xee]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&ene(e).has(t)?e[t]=n:(!Rr||typeof n!=`number`&&typeof n!=`boolean`||a!==String(n))&&e.setAttribute(t,n))}}function Zte(e,t,n,r,i=!1,a=!1){Rr&&i&&e.nodeName===ds&&(`defaultValue`in n||`defaultChecked`in n||Xte(e));var o=Qte(e),s=o[ls],c=!o[us];let l=Rr&&s;l&&zr(!1);var u=t||{},d=e.nodeName===qte,f=e.nodeName===Jte;try{for(var p in t)!(p in n)&&p[0]+p[1]!==`$$`&&(n[p]=null);n.class?n.class=Yo(n.class):(r||n[ss])&&(n.class=null),n[cs]&&(n.style??=null);var m=ene(e);if(e.nodeName===ds&&`type`in n&&(`value`in n||`__value`in n)){var h=n.type;(h!==u.type||h===void 0&&e.hasAttribute(`type`))&&(u.type=h,q(e,`type`,h,a))}for(let i in n){let l=n[i];if(d&&i===`value`&&l==null)e.value=e.__value=``,u[i]=l;else if(i===`class`)$o(e,e.namespaceURI===`http://www.w3.org/1999/xhtml`,l,r,t?.[ss],n[ss]),u[i]=l,u[ss]=n[ss];else if(i===`style`)ts(e,l,t?.[cs],n[cs]),u[i]=l,u[cs]=n[cs];else{var g=u[i];if(l!==g||l===void 0&&e.hasAttribute(i)){u[i]=l;var _=i[0]+i[1];if(_!==`$$`){if(_===`on`){let t={},n=`$$`+i,r=i.slice(2);var v=yte(r);if(_te(r)&&(r=r.slice(0,-7),t.capture=!0),!v&&g){if(l!=null)continue;e.removeEventListener(r,u[n],t),u[n]=null}if(v)so(r,e,l),co([r]);else if(l!=null){function a(e){u[i].call(this,e)}u[n]=io(r,e,a,t)}}else if(i===`style`)q(e,i,l);else if(i===`autofocus`)Hee(e,!!l);else if(!s&&(i===`__value`||i===`value`&&l!=null))e.__value=l,(g==null||e.value!==l||l===0&&e.nodeName===Yte)&&(e.value=l);else if(i===`selected`&&d)ns(e,l);else{var y=i;c||(y=Ste(y));var b=y===`defaultValue`||y===`defaultChecked`;if(f&&y===`defaultValue`)continue;if(l==null&&!s&&!b){if(o[i]=null,y===`value`||y===`checked`){let n=e,r=t===void 0;if(y===`value`){let e=n.defaultValue;n.removeAttribute(y),n.defaultValue=e,n.value=n.__value=r?e:null}else{let e=n.defaultChecked;n.removeAttribute(y),n.defaultChecked=e,n.checked=r?e:!1}}else e.removeAttribute(i)}else b||(s||typeof l!=`string`)&&m.has(y)?(e[y]=l,y in o&&(o[y]=gr)):typeof l!=`function`&&q(e,y,l,a)}}}}}}finally{l&&zr(!0)}return u}function fs(e,t,n=[],r=[],i=[],a,o=!1,s=!1){pi(i,n,r,n=>{var r=void 0,i={},c=e.nodeName===Jte,l=!1;if(ste(()=>{var u=t(...n.map(z)),d=Zte(e,r,u,a,o,s);if(l&&c){var f=e;`defaultValue`in u&&rs(f,u.defaultValue),`value`in u&&as(f,u.value)}for(let e of Object.getOwnPropertySymbols(i))u[e]||ba(i[e]);for(let t of Object.getOwnPropertySymbols(u)){var p=u[t];t.description!==`@attach`||r&&p===r[t]||(i[t]&&ba(i[t]),i[t]=va(()=>qo(e,()=>p))),d[t]=p}r=d}),c){var u=e;ha(()=>{var e=r;`defaultValue`in e&&rs(u,e.defaultValue),as(u,e.value,!0),Wte(u)})}l=!0})}function Qte(e){return e[Ar]??={[ls]:e.nodeName.includes(`-`),[us]:e.namespaceURI===`http://www.w3.org/1999/xhtml`}}var $te=new Map;function ene(e){var t=e.getAttribute(`is`)||e.nodeName,n=$te.get(t);if(n)return n;$te.set(t,n=new Set);for(var r,i=e,a=Element.prototype;a!==i;){for(var o in r=hee(i),r)r[o].set&&o!==`innerHTML`&&o!==`textContent`&&o!==`innerText`&&n.add(o);i=xr(i)}return n}function tne(e,t,n=t){var r=new WeakSet;Wee(e,`input`,async i=>{var a=i?e.defaultValue:e.value;if(a=ps(e)?ms(a):a,n(a),wi!==null&&r.add(wi),await Za(),a!==(a=t())){var o=e.selectionStart,s=e.selectionEnd,c=e.value.length;if(e.value=a??``,s!==null){var l=e.value.length;o===s&&s===c&&l>c?(e.selectionStart=l,e.selectionEnd=l):(e.selectionStart=o,e.selectionEnd=Math.min(s,l))}}}),(Rr&&e.defaultValue!==e.value||eo(t)==null&&e.value)&&(n(ps(e)?ms(e.value):e.value),wi!==null&&r.add(wi)),ga(()=>{var n=t();if(e===document.activeElement){var i=wi;if(r.has(i))return}ps(e)&&n===ms(e.value)||(e.type!==`date`||n||e.value)&&n!==e.value&&(e.value=n??``)})}function ps(e){var t=e.type;return t===`number`||t===`range`}function ms(e){return e===``?null:+e}var nne=new class e{#e=new WeakMap;#t;#n;static entries=new WeakMap;constructor(e){this.#n=e}observe(e,t){var n=this.#e.get(e)||new Set;return n.add(t),this.#e.set(e,n),this.#r().observe(e,this.#n),()=>{var n=this.#e.get(e);n.delete(t),n.size===0&&(this.#e.delete(e),this.#t.unobserve(e))}}#r(){return this.#t??=new ResizeObserver(t=>{for(var n of t){e.entries.set(n.target,n);for(var r of this.#e.get(n.target)||[])r(n)}})}}({box:`border-box`});function rne(e,t,n){var r=nne.observe(e,()=>n(e[t]));ha(()=>(eo(()=>n(e[t])),r))}function hs(e,t){return e===t||e?.[Dr]===t}function gs(e=ni(),t,n,r){var i=Qr.r,a=Na;return ha(()=>{var o,s;return ga(()=>{o=s,s=r?.()||[],eo(()=>{hs(n(...s),e)||(t(e,...s),o&&hs(n(...o),e)&&t(null,...o))})}),()=>{let r=a;for(;r!==i&&r.parent!==null&&r.parent.f&33554432;)r=r.parent;let o=()=>{s&&hs(n(...s),e)&&t(null,...s)},c=r.teardown;r.teardown=()=>{o(),c?.()}}}),e}var _s=!1;function ine(e){var t=_s;try{return _s=!1,[e(),_s]}finally{_s=t}}var ane={get(e,t){if(!e.exclude.has(t))return e.props[t]},set(e,t){return!1},getOwnPropertyDescriptor(e,t){if(!e.exclude.has(t)&&t in e.props)return{enumerable:!0,configurable:!0,value:e.props[t]}},has(e,t){return!e.exclude.has(t)&&t in e.props},ownKeys(e){return Reflect.ownKeys(e.props).filter(t=>!e.exclude.has(t))}};function vs(e,t,n){return new Proxy({props:e,exclude:t},ane)}var one={get(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(Sr(r)&&(r=r()),typeof r==`object`&&r&&t in r)return r[t]}},set(e,t,n){let r=e.props.length;for(;r--;){let i=e.props[r];Sr(i)&&(i=i());let a=br(i,t);if(a&&a.set)return a.set(n),!0}return!1},getOwnPropertyDescriptor(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(Sr(r)&&(r=r()),typeof r==`object`&&r&&t in r){let e=br(r,t);return e&&!e.configurable&&(e.configurable=!0),e}}},has(e,t){if(t===Dr||t===kr)return!1;for(let n of e.props)if(Sr(n)&&(n=n()),n!=null&&t in n)return!0;return!1},ownKeys(e){let t=[];for(let n of e.props)if(Sr(n)&&(n=n()),n){for(let e in n)t.includes(e)||t.push(e);for(let e of Object.getOwnPropertySymbols(n))t.includes(e)||t.push(e)}return t}};function ys(...e){return new Proxy({props:e},one)}function J(e,t,n,r){var i=!0,a=!!(n&8),o=!!(n&16),s=r,c=!0,l=void 0,u=()=>o&&i?(l??=_i(r),z(l)):(c&&(c=!1,s=o?eo(r):r),s);let d;if(a){var f=Dr in e||kr in e;d=br(e,t)?.set??(f&&t in e?n=>e[t]=n:void 0)}var p,m=!1;a?[p,m]=ine(()=>e[t]):p=e[t],p===void 0&&r!==void 0&&(p=u(),d&&(i&&Mee(t),d(p)));var h=i?()=>{var n=e[t];return n===void 0?u():(c=!0,n)}:()=>{var n=e[t];return n!==void 0&&(s=void 0),n===void 0?s:n};if(i&&!(n&4))return h;if(d){var g=e.$$legacy;return(function(e,t){return arguments.length>0?((!i||!t||g||m)&&d(t?h():e),e):h()})}var _=!1,v=(n&1?_i:yi)(()=>(_=!1,h()));a&&z(v);var y=Na;return(function(e,t){if(arguments.length>0){let n=t?z(v):i&&a?Xi(e):e;return M(v,n),_=!0,s!==void 0&&(s=n),e}return Oa&&_||y.f&16384?v.v:z(v)})}var sne=/^[\u061c\u200e\u200f\u2066-\u2069]+/,cne=/^[-.+0-9A-Z_a-z\u{a1}-\u{61b}\u{61d}-\u{167f}\u{1681}-\u{1fff}\u{200b}-\u{200d}\u{2010}-\u{2027}\u{2030}-\u{205e}\u{2060}-\u{2065}\u{206a}-\u{2fff}\u{3001}-\u{d7ff}\u{e000}-\u{fdcf}\u{fdf0}-\u{fffd}\u{10000}-\u{1fffd}\u{20000}-\u{2fffd}\u{30000}-\u{3fffd}\u{40000}-\u{4fffd}\u{50000}-\u{5fffd}\u{60000}-\u{6fffd}\u{70000}-\u{7fffd}\u{80000}-\u{8fffd}\u{90000}-\u{9fffd}\u{a0000}-\u{afffd}\u{b0000}-\u{bfffd}\u{c0000}-\u{cfffd}\u{d0000}-\u{dfffd}\u{e0000}-\u{efffd}\u{f0000}-\u{ffffd}\u{100000}-\u{10fffd}]+/u,lne=/^[-.0-9]/;function une(e,t){let n=t,r=e.slice(n).match(sne);r&&(n+=r[0].length);let i=e.slice(n).match(cne);if(!i)return null;let a=i[0];if(lne.test(a))return null;n+=a.length;let o=e.slice(n).match(sne);return o&&(n+=o[0].length),{value:a.normalize(),end:n}}var dne=(e,t)=>e.slice(t).match(cne)?.[0]??``,fne=Symbol.for(`CST`),bs=class extends Error{type;constructor(e,t){super(t),this.type=e}},xs=class extends bs{start;end;constructor(e,t,n,r){let i=r?`Missing ${r}`:e;t>=0&&(i+=` at ${t}`),super(e,i),this.start=t,this.end=n??t+1}},pne=class extends xs{constructor(e,t){let{start:n,end:r}=t[fne]??{start:-1,end:-1};super(e,n,r)}},Ss=class extends bs{source;cause;constructor(e,t,n,r){super(e,t),this.source=n,r!==void 0&&(this.cause=r)}},Cs=class extends bs{source;cause;constructor(e,t){super(e,t),this.source=`�`}},mne=new Set(`؜‎‏⁦⁧⁨⁩`),hne=new Set(`
\r  `),ws,Ts,Es=(e,t)=>new xs(`missing-syntax`,e,e+t.length,t),Ds=(...e)=>new xs(...e);function Os(e,t){if(Ts.startsWith(e,ws))t&&(ws+=e.length);else throw Es(ws,e)}function gne(e){ws=0,Ts=e;let t=bne();if(Ts.startsWith(`.match`,ws))return _ne(t);let n=t.length>0||Ts.startsWith(`{{`,ws);!n&&ws>0&&(ws=0);let r=yne(n);if(n&&(Ns(),ws<Ts.length))throw Ds(`extra-content`,ws,Ts.length);return{type:`message`,declarations:t,pattern:r}}function _ne(e){ws+=6,Ns(!0);let t=[];for(;Ts[ws]===`$`;)t.push(Dne()),Ns(!0);if(t.length===0)throw Ds(`empty-token`,ws);let n=[];for(;ws<Ts.length;)n.push(vne()),Ns();return{type:`select`,declarations:e,selectors:t,variants:n}}function vne(){let e=[];for(;ws<Ts.length;){Ns(e.length?`{`:!1);let t=Ts[ws];if(t===`{`)break;if(t===`*`)e.push({type:`*`}),ws+=1;else{let t=As(!0);t.value=t.value.normalize(),e.push(t)}}return{keys:e,value:yne(!0)}}function yne(e){if(e){if(Ts.startsWith(`{{`,ws))ws+=2;else throw Es(ws,`{{`)}let t=[];loop:for(;ws<Ts.length;)switch(Ts[ws]){case`{`:t.push(ks(!0));break;case`}`:if(!e)throw Ds(`parse-error`,ws);break loop;default:t.push(Tne())}if(e){if(Ts.startsWith(`}}`,ws))ws+=2;else throw Es(ws,`}}`)}return t}function bne(){let e=[];Ns();loop:for(;Ts[ws]===`.`;){switch(Ts.substr(ws,6)){case`.input`:e.push(xne());break;case`.local`:e.push(Sne());break;case`.match`:break loop;default:throw Ds(`parse-error`,ws)}Ns()}return e}function xne(){ws+=6,Ns(),Os(`{`,!1);let e=ws,t=ks(!1);if(t.type===`expression`&&t.arg?.type===`variable`)return{type:`input`,name:t.arg.name,value:t};throw Ds(`bad-input-expression`,e,ws)}function Sne(){ws+=6,Ns(!0),Os(`$`,!0);let e=Ms();return Ns(),Os(`=`,!0),Ns(),Os(`{`,!1),{type:`local`,name:e,value:ks(!1)}}function ks(e){let t=ws;ws+=1,Ns();let n=Ene(!1);n&&Ns(`}`);let r=Ts[ws],i,a;switch(r){case`@`:case`}`:break;case`:`:{ws+=1,i={type:`function`,name:js()};let e=Cne();e&&(i.options=e);break}case`#`:case`/`:{if(n||!e)throw Ds(`parse-error`,ws);ws+=1,a={type:`markup`,kind:r===`#`?`open`:`close`,name:js()};let t=Cne();t&&(a.options=t);break}default:throw Ds(`parse-error`,ws)}let o=wne();if(a?.kind===`open`&&Ts[ws]===`/`&&(a.kind=`standalone`,ws+=1),Os(`}`,!0),i){let e=n?{type:`expression`,arg:n,functionRef:i}:{type:`expression`,functionRef:i};return o&&(e.attributes=o),e}if(a)return o&&(a.attributes=o),a;if(!n)throw Ds(`empty-token`,t,ws);return o?{type:`expression`,arg:n,attributes:o}:{type:`expression`,arg:n}}function Cne(){Ns(`/}`);let e={},t=!0;for(;ws<Ts.length;){let n=Ts[ws];if(n===`@`||n===`/`||n===`}`)break;let r=ws,i=js();if(Object.hasOwn(e,i))throw Ds(`duplicate-option-name`,r,ws);Ns(),Os(`=`,!0),Ns(),e[i]=Ene(!0),t=!1,Ns(`/}`)}return t?null:e}function wne(){let e={},t=!0;for(;Ts[ws]===`@`;){let n=ws;ws+=1;let r=js();if(Object.hasOwn(e,r))throw Ds(`duplicate-attribute`,n,ws);Ns(`=/}`),Ts[ws]===`=`?(ws+=1,Ns(),e[r]=As(!0),Ns(`/}`)):e[r]=!0,t=!1}return t?null:e}function Tne(){let e=``,t=ws;loop:for(;t<Ts.length;++t)switch(Ts[t]){case`\\`:{let n=Ts[t+1];if(!`\\{|}`.includes(n))throw Ds(`bad-escape`,t,t+2);e+=Ts.substring(ws,t)+n,t+=1,ws=t+1;break}case`{`:case`}`:break loop}return e+=Ts.substring(ws,t),ws=t,e}function Ene(e){return Ts[ws]===`$`?Dne():As(e)}function Dne(){return ws+=1,{type:`variable`,name:Ms()}}function As(e){if(Ts[ws]===`|`)return One();let t=dne(Ts,ws);if(t)return ws+=t.length,{type:`literal`,value:t};if(e)throw Ds(`empty-token`,ws)}function One(){ws+=1;let e=``;for(let t=ws;t<Ts.length;++t)switch(Ts[t]){case`\\`:{let n=Ts[t+1];if(!`\\{|}`.includes(n))throw Ds(`bad-escape`,t,t+2);e+=Ts.substring(ws,t)+n,t+=1,ws=t+1;break}case`|`:return e+=Ts.substring(ws,t),ws=t+1,{type:`literal`,value:e}}throw Es(Ts.length,`|`)}function js(){let e=Ms();return Ts[ws]===`:`?(ws+=1,e+`:`+Ms()):e}function Ms(){let e=une(Ts,ws);if(!e)throw Ds(`empty-token`,ws);return ws=e.end,e.value}function Ns(e=!1){let t=Ts[ws],n=!1;if(e){for(;mne.has(t);)t=Ts[++ws];for(;hne.has(t);)t=Ts[++ws],n=!0}for(;mne.has(t)||hne.has(t);)t=Ts[++ws];if(e&&!n&&(e===!0||!e.includes(Ts[ws])))throw Es(ws,`' '`)}function kne(e,t){let{node:n,pattern:r}=t,{functionRef:i=n,attributes:a=null,declaration:o=n,expression:s=n,key:c=n,markup:l=n,options:u=null,value:d=n,variant:f=n}=t,p=(e,t)=>{if(e){let n=u?.(e,t);if(d)for(let n of Object.values(e))d(n,t,`option`);n?.()}},m=(e,t)=>{if(e){let n=a?.(e,t);if(d)for(let n of Object.values(e))n!==!0&&d(n,t,`attribute`);n?.()}},h=(e,t)=>{if(typeof e==`object`){let n;switch(e.type){case`expression`:if(n=s?.(e,t),e.arg&&d?.(e.arg,t,`arg`),e.functionRef){let n=i?.(e.functionRef,t,e.arg);p(e.functionRef.options,t),n?.()}m(e.attributes,t);break;case`markup`:n=l?.(e,t),p(e.options,t),m(e.attributes,t)}n?.()}},g=e=>{let t=r?.(e);for(let t of e)h(t,`placeholder`);t?.()};for(let t of e.declarations){let e=o?.(t);t.value&&h(t.value,`declaration`),e?.()}if(e.type===`message`)g(e.pattern);else{if(d)for(let t of e.selectors)d(t,`selector`,`arg`);for(let t of e.variants){let e=f?.(t);c&&t.keys.forEach(c),g(t.value),e?.()}}}function Ane(e,t=(e,t)=>{throw new pne(e,t)}){let n=0,r=null,i=new Set,a=new Set,o=new Set,s=new Set,c=new Set,l=new Set,u=!0;kne(e,{declaration(e){if(e.name)return(e.value.functionRef||e.type===`local`&&e.value.arg?.type===`variable`&&i.has(e.value.arg.name))&&i.add(e.name),e.type===`local`&&s.add(e.name),u=e.type===`local`,()=>{a.has(e.name)?t(`duplicate-declaration`,e):a.add(e.name)}},expression({functionRef:e}){e&&o.add(e.name)},value(e,o,s){if(e.type===`variable`)switch(c.add(e.name),o){case`declaration`:(s!==`arg`||u)&&a.add(e.name);break;case`selector`:n+=1,r=e,i.has(e.name)||t(`missing-selector-annotation`,e)}},variant(e){let{keys:i}=e;i.length!==n&&t(`key-mismatch`,e);let a=JSON.stringify(i.map(e=>e.type===`literal`?e.value:0));l.has(a)?t(`duplicate-variant`,e):l.add(a),r&&=i.every(e=>e.type===`*`)?null:e}}),r&&t(`missing-fallback`,r);for(let e of s)c.delete(e);return{functions:o,variables:c}}var jne=`Adlm,Arab,Hebr,Mand,Nkoo,Rohg,Syrc,Thaa`;function Ps(e){if(e)try{typeof e==`string`&&(e=new Intl.Locale(e));let t=e.getTextInfo?.()??e.textInfo;if(t?.direction)return t.direction;let n=e.maximize().script;if(n)return jne.includes(n)?`rtl`:`ltr`}catch{}return`auto`}function Mne(e){if(e&&typeof e==`object`&&(e=e.valueOf()),typeof e==`boolean`)return e;if(e&&typeof e==`object`&&(e=String(e)),e===`true`)return!0;if(e===`false`)return!1;throw RangeError(`Not a boolean`)}function Fs(e){if(e&&typeof e==`object`&&(e=e.valueOf()),e&&typeof e==`object`&&(e=String(e)),typeof e==`string`&&/^(0|[1-9][0-9]*)$/.test(e)&&(e=Number(e)),typeof e==`number`&&e>=0&&Number.isInteger(e))return e;throw RangeError(`Not a positive integer`)}function Is(e){if(e&&typeof e==`object`&&(e=e.valueOf()),typeof e==`string`)return e;if(e&&typeof e==`object`)return String(e);throw RangeError(`Not a string`)}function Ls(e){let t;if(typeof e==`object`){let n=e?.valueOf;typeof n==`function`&&(t=e.options,e=n.call(e))}if(typeof e==`string`)try{e=JSON.parse(e)}catch{}if(typeof e!=`bigint`&&typeof e!=`number`)throw new Cs(`bad-operand`,`Input is not numeric`);return{value:e,options:t}}function Rs(e,t,n,r){let{dir:i,locales:a}=e;n.useGrouping===`never`&&(n.useGrouping=!1),r&&`select`in n&&!e.literalOptionKeys.has(`select`)&&(e.onError(`bad-option`,`The option select may only be set by a literal value`),r=!1);let o,s,c,l;return{type:`number`,get dir(){return i??=(o??=Intl.NumberFormat.supportedLocalesOf(a,n)[0],Ps(o)),i},get options(){return{...n}},selectKey:r?e=>{let r=t;n.style===`percent`&&(r*=typeof r==`bigint`?100n:100);let i=String(r);if(e.has(i))return i;if(n.select===`exact`)return null;let o=n.select?{...n,select:void 0,type:n.select}:n;return c??=new Intl.PluralRules(a,o).select(Number(r)),e.has(c)?c:null}:void 0,toParts(){s??=new Intl.NumberFormat(a,n);let e=s.formatToParts(t);return o??=s.resolvedOptions().locale,i??=Ps(o),i===`ltr`||i===`rtl`?[{type:`number`,dir:i,locale:o,parts:e}]:[{type:`number`,locale:o,parts:e}]},toString(){return s??=new Intl.NumberFormat(a,n),l??=s.format(t),l},valueOf:()=>t}}function Nne(e,t,n){let r=Ls(n),i=r.value,a=Object.assign({},r.options,{localeMatcher:e.localeMatcher,style:`decimal`});for(let[n,r]of Object.entries(t))if(r!==void 0)try{switch(n){case`minimumIntegerDigits`:case`minimumFractionDigits`:case`maximumFractionDigits`:case`minimumSignificantDigits`:case`maximumSignificantDigits`:case`roundingIncrement`:a[n]=Fs(r);break;case`roundingMode`:case`roundingPriority`:case`select`:case`signDisplay`:case`trailingZeroDisplay`:case`useGrouping`:a[n]=Is(r)}}catch{e.onError(`bad-option`,`Value ${r} is not valid for :number option ${n}`)}return Rs(e,i,a,!0)}function Pne(e,t,n){let r=Ls(n),i=Number.isFinite(r.value)?Math.round(r.value):r.value,a=Object.assign({},r.options,{maximumFractionDigits:0,minimumFractionDigits:void 0,minimumSignificantDigits:void 0,style:`decimal`});for(let[n,r]of Object.entries(t))if(r!==void 0)try{switch(n){case`minimumIntegerDigits`:case`maximumSignificantDigits`:a[n]=Fs(r);break;case`select`:case`signDisplay`:case`useGrouping`:a[n]=Is(r)}}catch{e.onError(`bad-option`,`Value ${r} is not valid for :integer option ${n}`)}return Rs(e,i,a,!0)}function Fne(e,t,n){let r=Ls(n),i=Object.assign({},r.options,{localeMatcher:e.localeMatcher,style:`currency`});for(let[n,r]of Object.entries(t))if(r!==void 0)try{switch(n){case`currency`:case`currencySign`:case`roundingMode`:case`roundingPriority`:case`trailingZeroDisplay`:case`useGrouping`:i[n]=Is(r);break;case`minimumIntegerDigits`:case`minimumSignificantDigits`:case`maximumSignificantDigits`:case`roundingIncrement`:i[n]=Fs(r);break;case`currencyDisplay`:{let t=Is(r);t===`never`?e.onError(`unsupported-operation`,`Currency display "never" is not yet supported`):i[n]=t;break}case`fractionDigits`:{let e=Is(r);if(e===`auto`)i.minimumFractionDigits=void 0,i.maximumFractionDigits=void 0;else{let t=Fs(e);i.minimumFractionDigits=t,i.maximumFractionDigits=t}break}}}catch{e.onError(`bad-option`,`Value ${r} is not valid for :currency option ${n}`)}if(!i.currency)throw new Cs(`bad-operand`,`A currency code is required for :currency`);return Rs(e,r.value,i,!1)}var Ine=new Set([`weekday`,`day-weekday`,`month-day`,`month-day-weekday`,`year-month-day`,`year-month-day-weekday`]),Lne=new Set([`long`,`medium`,`short`]),Rne=new Set([`hour`,`minute`,`second`]),zne=new Set([`long`,`short`]),Bne=(e,t,n)=>zs(`datetime`,e,t,n),Vne=(e,t,n)=>zs(`date`,e,t,n),Hne=(e,t,n)=>zs(`time`,e,t,n);function zs(e,t,n,r){let i={localeMatcher:t.localeMatcher},a=r;if(typeof a==`object`&&a){let t=a.options;t&&(i.calendar=t.calendar,e!==`date`&&(i.hour12=t.hour12),i.timeZone=t.timeZone),typeof a.valueOf==`function`&&(a=a.valueOf())}switch(typeof a){case`number`:case`string`:a=new Date(a)}if(!(a instanceof Date)||isNaN(a.getTime()))throw new Cs(`bad-operand`,`Input is not a valid date`);if(n.calendar!==void 0)try{i.calendar=Is(n.calendar)}catch{t.onError(`bad-option`,`Invalid :${e} calendar option value`)}if(n.hour12!==void 0&&e!==`date`)try{i.hour12=Mne(n.hour12)}catch{t.onError(`bad-option`,`Invalid :${e} hour12 option value`)}if(n.timeZone!==void 0){let r;try{r=Is(n.timeZone)}catch{t.onError(`bad-option`,`Invalid :${e} timeZone option value`)}if(r===`input`)i.timeZone===void 0&&t.onError(`bad-operand`,`Missing input timeZone value for :${e}`);else if(r!==void 0){if(i.timeZone!==void 0&&r!==i.timeZone)throw new Cs(`bad-option`,`Time zone conversion is not supported`);i.timeZone=r}}if(e!==`time`){let r=e===`date`?`fields`:`dateFields`,a=e===`date`?`length`:`dateLength`,o=Bs(t,n,r,Ine)??`year-month-day`,s=Bs(t,n,a,Lne),c=new Set(o.split(`-`));c.has(`year`)&&(i.year=`numeric`),c.has(`month`)&&(i.month=s===`long`?`long`:s===`short`?`numeric`:`short`),c.has(`day`)&&(i.day=`numeric`),c.has(`weekday`)&&(i.weekday=s===`long`?`long`:`short`)}if(e!==`date`){switch(Bs(t,n,e===`time`?`precision`:`timePrecision`,Rne)){case`hour`:i.hour=`numeric`;break;case`second`:i.hour=`numeric`,i.minute=`numeric`,i.second=`numeric`;break;default:i.hour=`numeric`,i.minute=`numeric`}i.timeZoneName=Bs(t,n,`timeZoneStyle`,zne)}let o=new Intl.DateTimeFormat(t.locales,i),s=t.dir,c,l;return{type:`datetime`,get dir(){return s??=(c??=o.resolvedOptions().locale,Ps(c)),s},get options(){return{...i}},toParts(){let e=o.formatToParts(a);return c??=o.resolvedOptions().locale,s??=Ps(c),s===`ltr`||s===`rtl`?[{type:`datetime`,dir:s,locale:c,parts:e}]:[{type:`datetime`,locale:c,parts:e}]},toString(){return l??=o.format(a),l},valueOf:()=>a}}function Bs(e,t,n,r){let i=t[n];if(i!==void 0)try{let e=Is(i);if(r&&!r.has(e))throw Error();return e}catch{e.onError(`bad-option`,`Invalid value for ${n} option`)}}function Une(e,t,n){let{value:r,options:i}=Ls(n),a;try{a=`add`in t?Fs(t.add):-1}catch{throw new Cs(`bad-option`,`Value ${t.add} is not valid for :offset option add`)}let o;try{o=`subtract`in t?Fs(t.subtract):-1}catch{throw new Cs(`bad-option`,`Value ${t.subtract} is not valid for :offset option subtract`)}if(a<0==o<0)throw new Cs(`bad-option`,`Exactly one of "add" or "subtract" is required as an :offset option`);let s=a<0?-o:a;return r+=typeof r==`number`?s:BigInt(s),Nne(e,{},{valueOf:()=>r,options:i})}function Wne(e,t,n){let r=Ls(n),i=Object.assign({},r.options,{localeMatcher:e.localeMatcher,style:`percent`});for(let[n,r]of Object.entries(t))if(r!==void 0)try{switch(n){case`roundingMode`:case`roundingPriority`:case`signDisplay`:case`trailingZeroDisplay`:case`useGrouping`:i[n]=Is(r);break;case`minimumFractionDigits`:case`maximumFractionDigits`:case`minimumSignificantDigits`:case`maximumSignificantDigits`:i[n]=Fs(r)}}catch{e.onError(`bad-option`,`Value ${r} is not valid for :percent option ${n}`)}return Rs(e,r.value,i,!0)}function Vs(e,t,n){let r=n===void 0?``:String(n),i=r.normalize();return{type:`string`,dir:e.dir??`auto`,selectKey:e=>e.has(i)?i:null,toParts(){let{dir:t}=e,n=e.locales[0];return t===`ltr`||t===`rtl`?[{type:`string`,dir:t,locale:n,value:r}]:[{type:`string`,locale:n,value:r}]},toString:()=>r,valueOf:()=>r}}function Gne(e,t,n){let r=Ls(n),i=Object.assign({},r.options,{localeMatcher:e.localeMatcher,style:`unit`});for(let[n,r]of Object.entries(t))if(r!==void 0)try{switch(n){case`signDisplay`:case`roundingMode`:case`roundingPriority`:case`trailingZeroDisplay`:case`unit`:case`unitDisplay`:case`useGrouping`:i[n]=Is(r);break;case`minimumIntegerDigits`:case`minimumFractionDigits`:case`maximumFractionDigits`:case`minimumSignificantDigits`:case`maximumSignificantDigits`:case`roundingIncrement`:i[n]=Fs(r)}}catch(t){t instanceof bs?e.onError(t):e.onError(`bad-option`,`Value ${r} is not valid for :currency option ${n}`)}if(!i.unit)throw new Cs(`bad-operand`,`A unit identifier is required for :unit`);return Rs(e,r.value,i,!1)}var Hs={currency:Fne,integer:Pne,number:Nne,offset:Une,percent:Wne,string:Vs};Hs=Object.freeze(Object.assign(Object.create(null),Hs));var Us={date:Vne,datetime:Bne,time:Hne,unit:Gne};Us=Object.freeze(Object.assign(Object.create(null),Us));var Ws=Symbol(`bidi-isolate`),Gs=(e=`�`)=>({type:`fallback`,source:e,toParts:()=>[{type:`fallback`,source:e}],toString:()=>`{${e}}`}),Kne=(e,t)=>({type:`unknown`,source:e,dir:`auto`,toParts:()=>[{type:`unknown`,value:t}],toString:()=>String(t),valueOf:()=>t}),Ks=class{#e;#t;#n;dir;id;constructor(e,t,n){this.#e=e,this.#n=t,this.dir=void 0;let r=n&&Object.hasOwn(n,`u:dir`)?n[`u:dir`]:void 0;if(r){let t=String(Qs(e,r));if(t===`ltr`||t===`rtl`||t===`auto`)this.dir=t;else if(t!==`inherit`){let t=new Cs(`bad-option`,`Unsupported value for u:dir option`);t.source=$s(r),e.onError(t)}}let i=n&&Object.hasOwn(n,`u:id`)?n[`u:id`]:void 0;if(this.id=i?String(Qs(e,i)):void 0,n){this.#t=new Set;for(let[e,t]of Object.entries(n))t.type===`literal`&&this.#t.add(e)}}get literalOptionKeys(){return new Set(this.#t)}get localeMatcher(){return this.#e.localeMatcher}get locales(){return this.#e.locales.map(String)}onError(e,t){let n;e instanceof Cs?n=e:typeof e==`string`&&typeof t==`string`?n=new Cs(e,t):(n=new Cs(`function-error`,String(e)),n.cause=e),n.source=this.#n,this.#e.onError(n)}};function qne(e,t,{name:n,options:r}){let i=`:${n}`,a=$s(t)??i;try{let o=t?[Qs(e,t)]:[],s=e.functions[n];if(!s)throw new Ss(`unknown-function`,`Unknown function ${i}`,a);let c=new Ks(e,a,r),l=s(c,Jne(e,r),...o);if(typeof l!=`object`||!l||typeof l.type!=`string`)throw new Ss(`bad-function-result`,`Function ${i} did not return a MessageValue`,a);let u={source:a};return c.dir&&(u.dir=c.dir,u[Ws]=!0),c.id&&typeof l.toParts==`function`&&(u.toParts=()=>{let e=l.toParts();for(let t of e)t.id=c.id;return e}),{...l,...u}}catch(t){return e.onError(t instanceof bs?t:new Ss(`bad-function-result`,String(t),a,t)),Gs(a)}}function Jne(e,t){let n=Object.create(null);if(t)for(let[r,i]of Object.entries(t))r.startsWith(`u:`)||(n[r]=Qs(e,i));return n}function qs(e,{arg:t,functionRef:n}){if(n)return qne(e,t,n);switch(t?.type){case`literal`:{let n=`|${t.value}|`,r=Vs(new Ks(e,n),{},t.value);return r.source=n,r}case`variable`:return Zs(e,t);default:throw Error(`Unsupported expression: ${t?.type}`)}}var Js=class{expression;scope;constructor(e,t){this.expression=e,this.scope=t}},Yne=e=>e!==null&&(typeof e==`object`||typeof e==`function`);function Ys(e,t){if(Yne(e)){if(t in e)return e[t];let n=t.split(`.`);for(let t=n.length-1;t>0;--t){let r=n.slice(0,t).join(`.`);if(r in e){let i=n.slice(t).join(`.`);return Ys(e[r],i)}}for(let[n,r]of Object.entries(e))if(n.normalize()===t)return r}}function Xs(e,{name:t}){let n=Ys(e.scope,t);if(n===void 0){let n=`$`+t,r=`Variable not available: ${n}`;e.onError(new Ss(`unresolved-variable`,r,n))}else if(n instanceof Js){let r=qs(n.scope?{...e,scope:n.scope}:e,n.expression);return e.scope[t]=r,e.localVars.add(r),r}return n}function Zs(e,t){let n=`$`+t.name,r=Xs(e,t);if(r===void 0)return Gs(n);let i=typeof r;if(i===`object`){let t=r;if(t.type===`fallback`)return Gs(n);if(e.localVars.has(t))return t.source=n,t;r instanceof Number?i=`number`:r instanceof String&&(i=`string`)}let a;switch(i){case`bigint`:case`number`:a=e.functions.number;break;case`string`:a=e.functions.string;break;default:return Kne(n,r)}let o=new Ks(e,n),s=a(o,{},r);return s.source=n,s}function Qs(e,t){switch(t.type){case`literal`:return t.value;case`variable`:return Xs(e,t);default:throw Error(`Unsupported value: ${t.type}`)}}function $s(e){switch(e?.type){case`literal`:return`|`+e.value.replaceAll(`\\`,`\\\\`).replaceAll(`|`,`\\|`)+`|`;case`variable`:return`$`+e.name;default:return}}function ec(e,{kind:t,name:n,options:r}){let i={type:`markup`,kind:t,name:n},a=r?Object.entries(r):null;if(a?.length){i.options={};for(let[t,n]of a)if(t===`u:dir`){let r=new Cs(`bad-option`,`The option ${t} is not valid for markup`);r.source=$s(n),e.onError(r)}else{let r=Qs(e,n);typeof r==`object`&&typeof r?.valueOf==`function`&&(r=r.valueOf()),t===`u:id`?i.id=String(r):i.options[t]=r}}return i}function tc(e,t){if(t.type===`message`)return t.pattern;let n=t.selectors.map(t=>{let n=Zs(e,t),r;return typeof n.selectKey==`function`?r=n.selectKey.bind(n):(e.onError(new Ss(`bad-selector`,`Selector does not support selection`,n.source)),r=()=>null),{selectKey:r,source:n.source,best:null,keys:null}}),r=t.variants;loop:for(let i=0;i<n.length;++i){let a=n[i];if(!a.keys){a.keys=new Set;for(let{keys:e}of r){let t=e[i];if(!t)break loop;t.type!==`*`&&a.keys.add(t.value)}}try{a.best=a.keys.size?a.selectKey(a.keys):null}catch(t){e.onError(new Ss(`bad-selector`,`Selection failed`,a.source,t)),a.selectKey=()=>null,a.best=null}if(r=r.filter(e=>{let t=e.keys[i];return t.type===`*`?a.best==null:a.best===t.value}),r.length===0){if(i===0)break;let e=n[i-1];e.best==null?e.keys?.clear():e.keys?.delete(e.best);for(let e=i;e<n.length;++e)n[e].keys=null;r=t.variants,i=-1}}let i=r[0];return i?i.value:(e.onError(new Ss(`no-match`,`No variant was selected!?`,`.match`)),[])}Intl.MessageFormat??=class{#e;#t;#n;#r;#i;#a;constructor(e,t,n){this.#e=n?.bidiIsolation!==`none`,this.#n=n?.localeMatcher??`best fit`,this.#r=Array.isArray(e)?e.map(e=>new Intl.Locale(e)):e?[new Intl.Locale(e)]:[],this.#t=n?.dir??Ps(this.#r[0]),this.#i=typeof t==`string`?gne(t):t,Ane(this.#i),this.#a=n?.functions?Object.assign(Object.create(null),Hs,n.functions):Hs}format(e,t){let n=this.#o(e,t),r=``;for(let e of tc(n,this.#i))if(typeof e==`string`)r+=e;else if(e.type===`markup`)ec(n,e);else{let t;try{if(t=qs(n,e),typeof t.toString==`function`){if(this.#e&&(this.#t!==`ltr`||t.dir!==`ltr`||t[Ws])){let e=t.dir===`ltr`?`⁦`:t.dir===`rtl`?`⁧`:`⁨`;r+=e+t.toString()+`⁩`}else r+=t.toString()}else{let e=new Cs(`not-formattable`,`Message part is not formattable`);throw e.source=t.source,e}}catch(e){n.onError(e);let i=`{${t?.source??`�`}}`;r+=this.#e?`⁨`+i+`⁩`:i}}return r}formatToParts(e,t){let n=this.#o(e,t),r=[];for(let e of tc(n,this.#i))if(typeof e==`string`)r.push({type:`text`,value:e});else if(e.type===`markup`)r.push(ec(n,e));else{let t;try{if(t=qs(n,e),typeof t.toParts==`function`){let e=t.toParts();if(this.#e&&(this.#t!==`ltr`||t.dir!==`ltr`||t[Ws])){let n=t.dir===`ltr`?`⁦`:t.dir===`rtl`?`⁧`:`⁨`;r.push({type:`bidiIsolation`,value:n},...e,{type:`bidiIsolation`,value:`⁩`})}else r.push(...e)}else{let e=new Cs(`not-formattable`,`Message part is not formattable`);throw e.source=t.source,e}}catch(e){n.onError(e);let i={type:`fallback`,source:t?.source??`�`};this.#e?r.push({type:`bidiIsolation`,value:`⁨`},i,{type:`bidiIsolation`,value:`⁩`}):r.push(i)}}return r}#o(e,t=e=>{try{process.emitWarning(e)}catch{console.warn(e)}}){let n={...e};for(let t of this.#i.declarations)n[t.name]=new Js(t.value,t.type===`input`?e??{}:void 0);return{onError:t,localeMatcher:this.#n,locales:this.#r,localVars:new WeakSet,functions:this.#a,scope:n}}};var nc=j(``),rc=``,ic=Xi([]),ac=Xi({}),oc=``,sc=``,cc,lc={},Xne={},uc,dc=(e,t)=>{if(typeof t!=`string`||!t)throw TypeError(`${e} must be a non-empty string (got ${JSON.stringify(t)})`)},fc=(e,t)=>{if(typeof t!=`string`)throw TypeError(`${e} must be a string (got ${typeof t})`)},pc=(e,t)=>{if(typeof t!=`function`)throw TypeError(`${e} must be a function (got ${typeof t})`)},mc=new Map,hc=e=>{if(!mc.has(e))try{let t=new Intl.Locale(e),{language:n,script:r,region:i}=t,a=r&&i?void 0:t.maximize();mc.set(e,{language:n,script:r??a?.script,region:i,preferredRegion:i??a?.region,anyScript:!r&&!i})}catch{mc.set(e,void 0)}return mc.get(e)},gc=(e,t)=>{if(!e||!t.length||t.includes(e))return e;let n=hc(e);if(!n)return e;let{language:r,script:i,anyScript:a,preferredRegion:o}=n,s=t.filter(e=>{let t=hc(e);return!!t&&t.language===r&&(a||t.script===i)});if(s.length<2)return s[0]??e;let c=e=>e?s.find(t=>hc(t)?.region===e):void 0;return c(o)??c(hc(r)?.preferredRegion)??s[0]},_c=(e,t=``)=>Object.entries(e).reduce((e,[n,r])=>{let i=t?`${t}.${n}`:n;return typeof r==`object`&&r&&!Array.isArray(r)?Object.assign(e,_c(r,i)):e[i]=r,e},Object.create(null)),vc=e=>{ic.includes(e)||(ic.push(e),sc=gc(oc,ic))},yc=e=>{if(!e||!ic.length)return e;let t=gc(e,ic);return!ic.includes(t)&&sc&&ic.includes(sc)?sc:t},bc=()=>{rc&&yc(rc)!==z(nc)&&Ec.set(rc)},xc=(e,...t)=>{dc(`addMessages: localeCode`,e),t.forEach((e,t)=>{if(typeof e!=`object`||!e||Array.isArray(e))throw TypeError(`addMessages: maps[${t}] must be a plain object (got ${Array.isArray(e)?`array`:typeof e})`)}),vc(e),ac[e]??={};let n=ac[e],r={...cre,...Xne};t.forEach(t=>{Object.entries(_c(t)).forEach(([t,i])=>{n[t]=new Intl.MessageFormat(e,String(i),{functions:r})})}),bc()},Sc=new Map,Cc=new Map,wc=(e=z(nc))=>{if(fc(`waitLocale: localeCode`,e),!e)return Promise.resolve();let t=Cc.get(e);if(!t){let n=Sc.get(e);t=n?Promise.resolve(n()).then(t=>{xc(e,t)},()=>{if(Cc.delete(e),z(nc)===e&&!ac[e]&&sc&&sc!==e)return Ec.set(sc)}):Promise.resolve(),Cc.set(e,t)}return t},Tc=(e=z(nc))=>Ps(e)===`rtl`,Ec={get current(){return z(nc)},set(e){fc(`locale.set: value`,e),rc=e;let t=yc(e);if(M(nc,t,!0),typeof document<`u`&&t){document.documentElement.lang=t;let e=Ps(t);e!==`auto`&&(document.documentElement.dir=e)}return wc(t)}},Zne=(e,t)=>{dc(`register: localeCode`,e),pc(`register: loader`,t),Sc.set(e,t),Cc.delete(e),vc(e),bc()},Qne=()=>{if(typeof navigator>`u`)return;let e=navigator.languages?.length?navigator.languages:[navigator.language];return e.map(e=>gc(e,ic)).find(e=>ic.includes(e))??e[0]},$ne=e=>{if(!e||typeof e.fallbackLocale!=`string`)throw TypeError(`init: fallbackLocale must be a string (got ${JSON.stringify(e?.fallbackLocale)})`);e.initialLocale!==void 0&&fc(`init: initialLocale`,e.initialLocale),e.handleMissingMessage!==void 0&&pc(`init: handleMissingMessage`,e.handleMissingMessage),oc=e.fallbackLocale,sc=gc(oc,ic),cc=e.handleMissingMessage,lc=e.formats??{},e.initialLocale&&Ec.set(e.initialLocale)},ere=(e,t)=>{let n=ac[e];return n&&Object.hasOwn(n,t)?n[t]:void 0},tre=e=>{let t=e??z(nc);return t===sc?[t]:[t,sc]},Y=(e,{values:t={},locale:n,default:r,formats:i}={})=>{if(e==null)throw TypeError(`format: key must be a string or message object (got ${JSON.stringify(e)})`);if(typeof e==`object`){let{id:t,...n}=e;return Y(t,n)}let a=tre(n),[o]=a,s=a.reduce((t,n)=>t??ere(n,e),void 0);uc=i;let c;try{c=s?.format(t)}finally{uc=void 0}if(c!==void 0)return c;if(cc){let t=cc(e,o,r);if(t!==void 0)return t}return r??e},nre=`_default`,rre={date:{short:{month:`numeric`,day:`numeric`,year:`2-digit`},medium:{month:`short`,day:`numeric`,year:`numeric`},long:{month:`long`,day:`numeric`,year:`numeric`},full:{weekday:`long`,month:`long`,day:`numeric`,year:`numeric`}},time:{short:{hour:`numeric`,minute:`numeric`},medium:{hour:`numeric`,minute:`numeric`,second:`numeric`},long:{hour:`numeric`,minute:`numeric`,second:`numeric`,timeZoneName:`short`},full:{hour:`numeric`,minute:`numeric`,second:`numeric`,timeZoneName:`short`}},number:{currency:{style:`currency`},percent:{style:`percent`},scientific:{notation:`scientific`},engineering:{notation:`engineering`},compactLong:{notation:`compact`,compactDisplay:`long`},compactShort:{notation:`compact`,compactDisplay:`short`}}},ire=(e,t)=>lc[e]?.[t]??rre[e]?.[t],are=e=>lc[e]?.[nre],ore=e=>{let t=uc?.[e];return(typeof t==`string`?ire(e,t):t)??are(e)},sre=(e,t,n)=>{let r=e.valueOf();return{...e,dir:n?Ps(n):e.dir,toString:()=>t.format(r)}},Dc=(e,t,n)=>(r,i,a)=>{let o=e(r,i,a),s=ore(t);if(!s)return o;let{locale:c,...l}=s;return sre(o,new n(c??r.locales,l),c)},cre={...Us,date:Dc(Us.date,`date`,Intl.DateTimeFormat),time:Dc(Us.time,`time`,Intl.DateTimeFormat),datetime:Dc(Us.datetime,`datetime`,Intl.DateTimeFormat),number:Dc(Hs.number,`number`,Intl.NumberFormat),integer:Dc(Hs.integer,`number`,Intl.NumberFormat)},X=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Oc=e=>JSON.parse(JSON.stringify(e)),kc=e=>Array.isArray(e)&&e.every(X),Ac=e=>[...new Set(e)],lre=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/,jc=e=>{let t=globalThis.crypto.randomUUID();return e===`short`?t.split(`-`).pop():e===`shorter`?t.split(`-`).shift():typeof e==`number`?t.split(`-`).join(``).slice(0,e):t},Mc=`abcdefghijklmnopqrstuvwxyz234567`,ure=e=>{let t=``,n=0,r=0;return e.forEach(e=>{for(n=n<<8|e,r+=8;r>=5;)r-=5,t+=Mc[n>>>r&31]}),r>0&&(t+=Mc[n<<5-r&31]),t},Nc=()=>ure(Uint8Array.fromHex(jc().replaceAll(`-`,``))),Pc=async(e,{algorithm:t=`SHA-1`,format:n=`hex`}={})=>{let r;if(typeof e==`string`)r=new TextEncoder().encode(e);else if(e instanceof ArrayBuffer||ArrayBuffer.isView(e))r=e;else if(e&&typeof e.arrayBuffer==`function`)r=await e.arrayBuffer();else throw Error(`Unsupported input type for getHash`);let i=await globalThis.crypto.subtle.digest(t,r);return n===`binary`?Array.from(new Uint8Array(i),e=>String.fromCharCode(e)).join(``):new Uint8Array(i).toHex()},Fc=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),Ic=(e,t,{ellipsis:n=`…`}={})=>{let r=e.trim();if(r.length<=t)return r;let i=[...r.slice(0,t*2)];return`${i.slice(0,t).join(``).trim()}${i.length>t||r.length>t*2?n:``}`},Lc=e=>e.replace(/^\/+|\/+$/g,``),Rc,dre=e=>(Rc??=new DOMParser,Rc.parseFromString(e,`text/html`).body.textContent),zc=e=>!/\s/.test(e)&&URL.canParse(e),Bc=new Intl.Collator(void 0,{numeric:!0,sensitivity:`base`}).compare,Vc=(e=``)=>RegExp(`\\bblob:${Fc(globalThis.location.origin)}\\/${lre.source}\\b`,e),fre=/(?:(.+?)\/)?(([^/]+?)(?:\.((?:[Tt][Aa][Rr]\.)?[a-zA-Z0-9]+))?)$/,pre=[`application/atom+xml`,`application/javascript`,`application/json`,`application/ld+json`,`application/rss+xml`,`application/xhtml+xml`,`application/xml`,`application/yaml`,`image/svg+xml`],Hc=e=>e.startsWith(`text/`)||pre.includes(e),Uc=e=>{let t=e.length;for(;e[t-1]===`/`;)--t;let[,n,r=``,i=``,a]=e.slice(0,t).match(fre)??[];return{dirname:n,basename:r,filename:i,extension:a}},Wc=(e,t)=>{if(!t.length)return!0;let n=e.name.toLowerCase();return t.some(t=>{let r=t.toLowerCase();if(r.startsWith(`.`))return n.endsWith(r);let[i,a]=r.split(`/`);return a===`*`?e.type.split(`/`)[0]===i:e.type===r})},mre=async({items:e},{accept:t}={})=>{let n=t?t.split(`,`).map(e=>e.trim()).filter(Boolean):[],r=e=>new Promise(t=>{e.file(t,()=>t(null))}),i=e=>new Promise(t=>{e.readEntries(t,()=>t([]))}),a=async e=>{if(e.name.startsWith(`.`))return[];if(e.isFile){let t=await r(e);return t&&Wc(t,n)?[t]:[]}let t=e.createReader(),o=[];for(;;){let e=await i(t);if(!e.length)break;o.push(...e)}return(await Promise.all(o.map(a))).flat()},o=[...e].map(e=>e.webkitGetAsEntry()).filter(e=>e!==null);return(await Promise.all(o.map(a))).flat().sort((e,t)=>e.name.localeCompare(t.name))},hre=async e=>(await e.text()).replace(/\r\n?/g,`
`),gre=e=>typeof e==`string`?new Blob([e],{type:`text/plain`}):e,Gc=async e=>{let t=gre(e);return new Uint8Array(await t.arrayBuffer()).toBase64()},_re=async e=>{let t=Uint8Array.fromBase64(e);return new TextDecoder().decode(t)},vre=new Map([[`application/gzip`,`gz`],[`application/javascript`,`js`],[`application/ld+json`,`jsonld`],[`audio/mpeg`,`mp3`],[`text/javascript`,`js`],[`text/markdown`,`md`],[`text/plain`,`txt`],[`video/quicktime`,`mov`]]),yre=e=>{let t=e.toLowerCase().split(`;`)[0].trim(),n=vre.get(t);if(n)return n;let r=t.split(`/`)[1]?.split(`+`)[0];if(r&&!/[.-]/.test(r))return r},bre=(e,t)=>{let n=document.createElement(`a`),r=URL.createObjectURL(e),i=yre(e.type);n.download=t||e.name||[Date.now(),i].filter(Boolean).join(`.`),n.href=r,n.click(),globalThis.setTimeout(()=>{URL.revokeObjectURL(r)},0)},xre={"@cfworker/json-schema":`^4.1.6`,"@discourse/heic":`^1.0.0`,"@fastify/deepmerge":`^3.2.4`,"@jsquash/webp":`^1.5.0`,"@lexical/markdown":`^0.53.0`,"@sindresorhus/transliterate":`^3.0.0`,"@sveltia/i18n":`^1.5.0`,"@sveltia/ui":`^0.90.0`,"@sveltia/utils":`^0.13.2`,buffer:`^6.0.3`,"create-react-class":`^15.7.0`,dayjs:`^1.11.23`,exifr:`^7.1.3`,"fast-deep-equal":`^3.1.3`,flat:`^6.0.1`,htm:`^3.1.1`,immutable:`^5.2.1`,"isomorphic-dompurify":`^4.7.0`,"isomorphic-git":`^1.44.13`,leaflet:`^1.9.4`,lexical:`^0.53.0`,marked:`^18.2.0`,mime:`^4.1.2`,"parse-entities":`^4.0.2`,"pdfjs-dist":`^6.5.438`,qrcode:`^1.5.4`,react:`^19.3.1`,"react-dom":`^19.3.1`,"sanitize-filename":`^1.6.5`,"smol-toml":`^1.9.1`,svgo:`^4.1.0`,"terra-draw":`^1.39.0`,turndown:`^7.2.5`,yaml:`^2.9.1`},Sre=`modulepreload`,Cre=function(e){return`/`+e},wre={},Tre=function(e){return e.pathname.endsWith(`.css`)},Ere=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},Dre=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=Cre(t,n);let r=s(t),i=Tre(r);return Ere(wre,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:Sre,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{let i=a=>{t.removeEventListener(`load`,i),t.removeEventListener(`error`,i),a.type===`error`?n(Error(`Unable to preload CSS for ${r}`)):e(a)};t.addEventListener(`load`,i),t.addEventListener(`error`,i)})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Kc=(typeof document>`u`?void 0:document.currentScript?.src)||import.meta.url,qc=e=>{let t=`https://unpkg.com/${e}`,n=xre[e]?.replace(/^\D/,``);return n?`${t}@${n}`:t},Jc=async(e,t)=>Dre(()=>import(`${qc(e)}/${t}`),[]),Ore=async()=>`${qc(`leaflet`)}/dist/images/marker-icon-2x.png`,kre=[`unpkg.com`,`cdn.jsdelivr.net`],Yc=e=>{let t=new URL(e),n=t.pathname.match(/^(.*\/@sveltia\/cms)(?:@([^/]*))?(\/.*)$/);if(!n)return;let[,r,i,a]=n;if(!(i===`0.266.0`||i===void 0&&!kre.includes(t.host)))return{url:t,packagePath:r,versionSpec:i,filePath:a}},Are=e=>{let t=Yc(e);if(!t)return e;let{url:n,packagePath:r,filePath:i}=t;return n.pathname=`${r}@0.266.0${i}`,n.href},jre=(e=Kc)=>{let t=e?Yc(e):void 0;return t?t.versionSpec??``:void 0},Mre=(e,t=Kc)=>{let n=`chunks/${e}.js`,r=`https://unpkg.com/@sveltia/cms@0.266.0/dist/${n}`;if(!t)return[r];let i=new URL(n,Are(t)).href;return i===r?[r]:[i,r]},Xc={},Zc=async e=>{if(e in Xc)return Xc[e]();let t;for(let n of Mre(e))try{return await import(n)}catch(e){t=e}throw Error(`Failed to load the ${e} chunk.`,{cause:t})},Qc=l(o(((e,t)=>{t.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t==`object`&&typeof n==`object`){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}}))(),1),$c=(e,t=[])=>(t.forEach(t=>{Object.hasOwn(e,t)&&Object.defineProperty(e,t,{value:e[t],writable:!1,enumerable:!0,configurable:!0})}),Xi(e)),el=e=>Yr(e),tl=e=>{let t=j(e);return{get current(){return z(t)},set current(e){M(t,e)}}},nl=e=>Xi({current:e}),rl=e=>{let t=A(e);return{get current(){return z(t)}}},il=e=>{let t;return rl(()=>{let n=e();return(0,Qc.default)(n,t)||(t=n),t})},al=(e,t,n)=>(e.current?.respond(n),new Promise(n=>{let r={...t,respond:t=>{e.current===r&&(e.current=void 0),n(t)}};e.current=r})),ol=e=>ma(()=>{L(e)}),sl=(e,t)=>{L(()=>(e(),eo(t)))},cl=(e,t,n)=>{L(()=>{let r=e();if(!r)return;let i=!1;return r.then(e=>{i||t(e)},n&&(e=>{i||n(e)})),()=>{i=!0}})},ll=(e,t,n,r,i=e=>e,a=e=>e)=>{let o,s=()=>{let t=i(e());n()!==t&&r(t),o=t},c=()=>{let r=a(n());e()!==r&&t(r)};return sl(e,s),sl(n,()=>{n()!==o&&c()}),{updateInput:s,updateValue:c}},ul=tl(),dl=tl(),fl=async(e,t)=>{let n={};if(e)try{n=await t(e)}catch{}ul.current=n.canPush===!1?e:void 0,dl.current=n.canMerge===!1?e:void 0},pl=2,ml=tl(),Nre=e=>{ml.current=e>=pl?{phase:`preparing`,done:0,total:e,approximate:!1}:void 0},Pre=()=>{let e=ml.current;e?.phase===`preparing`&&(ml.current={...e,done:Math.min(e.done+1,e.total)})},hl=(e,t)=>{let n=Math.max(e,t);ml.current=n>=pl?{phase:`committing`,done:e,total:n,approximate:!0}:void 0},gl=()=>{ml.current=void 0},_l=[`gitea`,`forgejo`],vl=e=>!!e&&_l.includes(e),yl=class extends Error{},bl=(e,t,n)=>Error(e,{cause:new yl(n?Y(t,{values:n}):Y(t))}),xl=(e,t)=>e?.cause instanceof yl&&e.cause.message||Y(t),Sl=e=>bl(`Not a collaborator of the repository`,`repository_no_access`,{repo:e}),Fre=e=>bl(`Not a collaborator of the repository`,`repository_no_write_access`,{repo:e}),Cl=(e,t)=>t?Fre(e):Sl(e),wl=({owner:e,repo:t},n)=>n===401||n===403||n===404?Sl(t):bl(`Failed to check the repository permission.`,`open_authoring.permission_check_failed`,{repo:`${e}/${t}`}),{DEV:Ire,VITE_SITE_URL:Lre}={DEV:!1},Tl=Ire?Lre||`http://localhost:5174`:void 0,Rre=[`text/yaml`,`application/x-yaml`,`application/yaml`,`application/toml`,`application/json`],El=tl(),Dl=El,Ol={},kl=tl(),Al=tl([]),jl=rl(()=>!!Dl.current||!!Al.current.length),Ml={errors:new Set,warnings:new Set,mediaFields:new Set,relationFields:new Set,formatLocales:new Set},zre=o(((e,t)=>{function n(e){return e>=55296&&e<=56319}function r(e){return e>=56320&&e<=57343}t.exports=function(e,t,i){if(typeof t!=`string`)throw Error(`Input must be string`);for(var a=t.length,o=0,s,c,l=0;l<a;l+=1){if(s=t.charCodeAt(l),c=t[l],n(s)&&r(t.charCodeAt(l+1))&&(l+=1,c+=t[l]),o+=e(c),o===i)return t.slice(0,l+1);if(o>i)return t.slice(0,l-c.length+1)}return t}})),Bre=o(((e,t)=>{function n(e){return e>=55296&&e<=56319}function r(e){return e>=56320&&e<=57343}t.exports=function(e){if(typeof e!=`string`)throw Error(`Input must be string`);for(var t=e.length,i=0,a=null,o=null,s=0;s<t;s++)a=e.charCodeAt(s),r(a)?o!=null&&n(o)?i+=1:i+=3:a<=127?i+=1:a>=128&&a<=2047?i+=2:a>=2048&&a<=65535&&(i+=3),o=a;return i}})),Vre=o(((e,t)=>{var n=zre(),r=Bre();t.exports=n.bind(null,r)})),Hre=l(o(((e,t)=>{var n=Vre(),r=/[\/\?<>\\:\*\|"]/g,i=/[\x00-\x1f\x80-\x9f]/g,a=/^\.+$/,o=/^(con|prn|aux|nul|com[0-9\u00b9\u00b2\u00b3]|lpt[0-9\u00b9\u00b2\u00b3])(\..*)?$/i;function s(e,t){for(var n=e.length;n>0&&(e[n-1]===`.`||e[n-1]===` `);)n--;return n===e.length?e:typeof t==`function`?e.slice(0,n)+t(e.slice(n),n,e):e.slice(0,n)+t}function c(e,t){if(typeof e!=`string`)throw Error(`Input must be string`);var c=e.replace(r,t).replace(i,t).replace(a,t).replace(o,t);return c=s(c,t),c=n(c,255),s(c,``).replace(o,``)}t.exports=function(e,t){var n=t&&t.replacement||``,r=c(e,n);return n===``?r:c(r,``)}}))(),1),Nl=(e,t,n)=>{let r=e;return r.has(t)||r.set(t,n()),r.get(t)},Pl=(e,t)=>{let n=e.get(t);return e.delete(t),e.set(t,n),n},Fl=(e,t,n,r)=>{e.delete(t),e.set(t,n),e.size>r&&e.delete(e.keys().next().value)},Il=e=>{let t=new Map;return{has:e=>t.has(e),get:e=>t.has(e)?Pl(t,e):void 0,set:(n,r)=>{Fl(t,n,r,e)},clear:()=>{t.clear()}}},Ll=(e,t,n,r)=>{if(e.has(t))return Pl(e,t);let i=n();return Fl(e,t,i,r),i},Rl=(e,t,n)=>Nl(e,t,()=>n().finally(()=>{e.delete(t)})),zl=(e,t,n)=>Nl(e,t,()=>n().catch(n=>{throw e.delete(t),n})),Bl=(e,t)=>{let n;return()=>{let r=e();return n&&n.source===r||(n={source:r,value:t(r)}),n.value}},Vl=(e,t)=>{try{return t(e)}catch{return e.replace(/(?:%[\da-f]{2})+/gi,e=>{try{return t(e)}catch{return e}})}},Hl=e=>Vl(e,decodeURI),Ul=e=>Vl(e,decodeURIComponent),Wl=e=>{try{return new URL(e).href}catch{return encodeURI(Hl(e).toWellFormed())}},Gl=e=>encodeURIComponent(e).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),Kl=(e,t=encodeURIComponent)=>e.split(`/`).map(e=>t(e)).join(`/`),ql=e=>e.replace(/\/+$/,``),Jl=(e,t)=>RegExp(`^${e.split(`/`).map(t).join(`\\/`)}(?=\\/|$)`),Yl=e=>{let t=e.startsWith(`@`);return t&&(e=e.slice(1)),e=Kl(e,Gl),t?`@${e}`:e},Xl=(e,t,{hasExtension:n=!0}={})=>{let r=e.toLowerCase();if(!t.some(e=>e.toLowerCase()===r))return e;let{filename:i,extension:a}=n?Uc(e):{filename:e,extension:void 0},o=a?`\\.${a}`:``,s=RegExp(`^${Fc(i)}-(?<num>\\d+)${o}$`,`i`),c=0;return t.forEach(e=>{let t=e.match(s);t&&(c=Math.max(c,Number(t.groups.num)))}),`${i}-${c+1}${a?`.${a}`:``}`},Zl=e=>(0,Hre.default)(e.normalize().replace(/[\s\u00A0\u202F]+/g,` `)),Ure=[[`jpg`,`jpeg`,`jpe`,`jfif`],[`tif`,`tiff`],[`htm`,`html`],[`yml`,`yaml`],[`md`,`markdown`],[`mpg`,`mpeg`],[`mid`,`midi`],[`aif`,`aiff`]],Ql=(e,t)=>{let n=e?.toLowerCase()??``,r=t?.toLowerCase()??``;return n===r||Ure.some(e=>e.includes(n)&&e.includes(r))},$l=e=>e.filter(Boolean).join(`/`),eu=e=>Uc(e).dirname??``,tu=e=>e.slice(e.lastIndexOf(`/`)+1),nu=(e,t)=>t&&e.startsWith(`${t}/`)?e.slice(t.length+1):e,ru=e=>e.split(`/`).filter(e=>e!==`.`&&e!==`..`).join(`/`),iu=e=>{let t=[],n=!1;return e.split(`/`).forEach(e=>{if(e){if(!n||e!==`.`&&e!==`..`)n||=e!==`.`&&e!==`..`,t.push(e);else if(e===`..`){let n=t.at(-1);n!==void 0&&n!==`.`&&n!==`..`?t.pop():t.push(e)}}}),t.join(`/`)},au=e=>typeof e==`string`?new Blob([e],{type:`text/plain`}):e,ou=e=>typeof e==`string`?new TextEncoder().encode(e).length:e.size,su=async e=>{let t=await e.arrayBuffer();return Pc(new Blob([`blob ${t.byteLength}\0`,t]))},Wre=new WeakMap,cu=e=>typeof e==`string`?su(au(e)):zl(Wre,e,()=>su(e)),lu=e=>typeof e==`string`?e.split(`/`).filter(e=>e&&e!==`.`).join(`/`):``,uu=()=>lu(Dl.current?.backend?.root_dir),du=(e,t=uu())=>t?iu(`${t}/${e}`):e,fu=(e,t=uu())=>{if(!t)return e;if(e.startsWith(`${t}/`))return e.slice(t.length+1);let n=t.split(`/`),r=e.split(`/`),i=0;for(;i<n.length&&i<r.length-1&&n[i]===r[i];)i+=1;return[...n.slice(i).map(()=>`..`),...r.slice(i)].join(`/`)},pu=e=>!e.startsWith(`../`),mu=e=>{let t=uu();return t?e.map(({previousPath:e,...n})=>({...n,path:du(n.path,t),...e!==void 0&&{previousPath:du(e,t)}})):e},hu=class e{#e;#t;#n=``;#r=``;#i={};#a=[];constructor(e,t,{keyPath:n,autoIncrement:r,indexes:i=[]}={}){this.#e=void 0,this.#n=e,this.#r=t,this.#i={keyPath:n,autoIncrement:r},this.#a=i}async#o(e){return new Promise((t,n)=>{let r=globalThis.indexedDB.open(this.#n,e);r.onupgradeneeded=()=>{let e=r.result,t=this.#r,n=e.objectStoreNames.contains(t)?r.transaction.objectStore(t):e.createObjectStore(t,this.#i);this.#a.forEach(({name:e,keyPath:t,options:r})=>{n.indexNames.contains(e)||n.createIndex(e,t,r)})},r.onsuccess=()=>{t(r.result)},r.onerror=()=>{n(r.error)}})}#s(e){let t=this.#r;if(!e.objectStoreNames.contains(t))return!0;let n=e.transaction(t).objectStore(t);return this.#a.some(({name:e})=>!n.indexNames.contains(e))}async#c(){let e=await this.#o();for(;this.#s(e);){let{version:t}=e;e.close();try{e=await this.#o(t+1)}catch(t){if(t?.name!==`VersionError`)throw t;e=await this.#o()}}return e.onversionchange=()=>{e.close(),this.#e=void 0},e.onclose=()=>{this.#e=void 0},e}async#l(e,{mode:t=`readonly`}={}){if(!this.#e){this.#t??=this.#c();try{this.#e=await this.#t}finally{this.#t=void 0}}let n=this.#e,r=this.#r,i=n.transaction(r,t),a=e(i.objectStore(r));return new Promise((e,n)=>{if(i.onerror=()=>{n(i.error)},i.onabort=()=>{n(i.error)},t===`readwrite`){let t;a&&(a.onsuccess=()=>{t=a.result}),i.oncomplete=()=>{e(t)}}else a?a.onsuccess=()=>{e(a.result)}:i.oncomplete=()=>{e(void 0)}})}async set(e,t){return this.#l(n=>n.put(t,e),{mode:`readwrite`})}async put(e){return this.#l(t=>t.put(e),{mode:`readwrite`})}async saveEntries(e){return this.#l(t=>{e.forEach(([e,n])=>{t.put(n,e)})},{mode:`readwrite`})}async get(e){return this.#l(t=>t.get(e))}async keys(){return this.#l(e=>e.getAllKeys())}async values(){return this.#l(e=>e.getAll())}async entries(){let e=[],t=await this.#l(t=>{let n=t.getAllKeys();return n.onsuccess=()=>{e=n.result},t.getAll()});return e.map((e,n)=>[e,t[n]])}static#u(e,t){return t?e.index(t):e}async#d({callback:t=void 0,index:n=void 0,query:r=void 0,direction:i=`next`}){return new Promise((a,o)=>{this.#l(o=>{let s=e.#u(o,n).openCursor(r,i);s.onsuccess=()=>{let e=s.result;if(e){let{value:n}=e;typeof t!=`function`||t(n)?a(n):e.continue()}else a(void 0)}}).catch(o)})}async find(e,{index:t,query:n}={}){return this.#d({callback:e,index:t,query:n})}async findLast(e,{index:t,query:n}={}){return this.#d({callback:e,index:t,query:n,direction:`prev`})}async filter(t,{index:n,query:r}={}){let i=await this.#l(t=>e.#u(t,n).getAll(r));return typeof t==`function`?i.filter(e=>t(e)):i}async delete(e){await this.#l(t=>t.delete(e),{mode:`readwrite`})}async deleteEntries(e){await this.#l(t=>{e.forEach(e=>{t.delete(e)})},{mode:`readwrite`})}async clear(){await this.#l(e=>e.clear(),{mode:`readwrite`})}},gu=e=>{try{return JSON.parse(e)}catch{return null}},_u=class{static async set(e,t){t===void 0?globalThis.localStorage.removeItem(e):globalThis.localStorage.setItem(e,JSON.stringify(t))}static async get(e){let t=globalThis.localStorage.getItem(e);return t?gu(t):null}static async delete(e){globalThis.localStorage.removeItem(e)}static async clear(){globalThis.localStorage.clear()}static async keys(){return Object.keys(globalThis.localStorage)}static async values(){return Object.values(globalThis.localStorage).map(gu)}static async entries(){return Object.entries(globalThis.localStorage).map(([e,t])=>[e,gu(t)])}},vu=Xi({current:void 0}),yu=Xi({}),bu=!1,xu=0,Su,Cu=Xi({current:void 0});ma(()=>{(async()=>{vu.current=void 0;try{let e=await _u.get(`sveltia-cms.prefs`),t=X(e)?e:{};t.apiKeys??={},t.useDraftBackup??=!0,t.closeOnSave??=!0,t.closeWithEscape??=!0,t.underlineLinks??=!0,t.devModeEnabled??=!1,t.localGitCommits??=!1,t.defaultTranslationService??=`google`,t.locale??=`auto`,t.locale===`en`&&(t.locale=`auto`),delete t.beta,Object.assign(yu,t)}catch{vu.current={type:`permission_denied`}}})(),L(()=>{if(!Object.keys(yu).length)return;let e=Yr(yu);(async()=>{try{(0,Qc.default)(e,await _u.get(`sveltia-cms.prefs`))||await _u.set(`sveltia-cms.prefs`,e)}catch{}})();let{theme:t,underlineLinks:n=!0,devModeEnabled:r=!1}=yu,i=!t||t===`auto`,a=window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`;Object.assign(document.documentElement.dataset,{theme:i?a:t,autoTheming:i,underlineLinks:n,devMode:r})}),L(()=>{let{locale:e}=yu,t=e===`auto`?Cu.current:e;if(!t||!ic.includes(t))return;let n=eo(()=>Ec.current),r=bu&&e!==`auto`;bu=!0,xu+=1;let i=xu;wc(t).then(()=>{i===xu&&(t in ac?(Ec.set(t),Su=e):r&&n&&(yu.locale=Su??n))})})});var wu={service:``,label:``,owner:``,repo:``,branch:``,repoURL:``,treeBaseURL:``,blobBaseURL:``,isSelfHosted:!1,databaseName:``},Gre=/^(?<origin>(?:[a-z][a-z\d+.-]*:)?\/\/[^/]*)?(?<path>.*?)\/api(?:\/.*)?$/i,Tu=e=>e===`https://api.github.com`?`https://github.com`:e.replace(Gre,`$<origin>$<path>`),Kre=(e,t)=>`${Tu(e)}/${t}`,Eu=({owner:e,repo:t})=>`/repos/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,Du=e=>{let[t,n]=e.split(`/`);return{owner:t,repo:n}},Ou=(e,{owner:t,repo:n})=>typeof e==`string`&&e.toLowerCase()===`${t}/${n}`.toLowerCase(),ku=(e,t)=>`${Eu(e)}/pulls/${t}`,qre=(e,t)=>`${Eu(e)}/branches/${Kl(t)}`,Au=({tree:e,blob:t,commit:n})=>(r,i)=>({treeBaseURL:i?`${r}${e}/${Kl(i)}`:r,blobBaseURL:i?`${r}${t}/${Kl(i)}`:``,commitBaseURL:`${r}${n}`}),ju=(e,t,n)=>{let r=e(t,n),i=uu();return!i||!n?r:{...r,treeBaseURL:`${r.treeBaseURL}/${Kl(i)}`,blobBaseURL:`${r.blobBaseURL}/${Kl(i)}`}},Jre=(e,{service:t,label:n,owner:r,repo:i,branch:a,restApiRoot:o,defaultApiRoot:s,getTokenPageURL:c,getBaseURLs:l})=>{o=Lc(o);let u=`${r}/${i}`,d=Kre(o,u),f=uu();return Object.assign(e,{service:t,label:n,owner:r,repo:i,branch:a,repoURL:d,tokenPageURL:c(Tu(o)),databaseName:f?`${t}:${u}:${f}`:`${t}:${u}`,isSelfHosted:o!==s},ju(l,d,a)),yu.devModeEnabled&&console.info(`repositoryInfo`,e),e},Mu=(e,{found:t,branch:n,getBaseURLs:r})=>{let{repo:i,repoURL:a=``}=e;if(!t)throw bl(`Failed to retrieve the default branch name.`,`repository_not_found`,{repo:i});if(!n)throw bl(`Failed to retrieve the default branch name.`,`repository_empty`,{repo:i});return Object.assign(e,{branch:n},ju(r,a,n)),n},Nu=({name:e,base_url:t,api_root:n})=>t??(e===`forgejo`&&n?Tu(n):`https://gitea.com`),Pu=[`decap-cms-user`,`netlify-cms-user`],Fu=Xi({account:void 0});ma(()=>{L(()=>{let e=Fu.account;(async()=>{try{e?await _u.set(`sveltia-cms.user`,e):e===null&&await _u.delete(`sveltia-cms.user`)}catch{}})()})});var Iu=(e=0)=>new Promise(t=>{globalThis.setTimeout(()=>{t(void 0)},e)}),Yre=/^(.+\.)?localhost$/,Lu=e=>[`127.0.0.1`,`[::1]`].includes(e)||Yre.test(e),Ru=(e,t=globalThis.window?.location?.origin??globalThis.location?.origin??`https://localhost`)=>{try{let{hostname:n,protocol:r}=new URL(e,t);return r===`https:`||Lu(n)}catch{return!1}},zu=({method:e=`GET`,body:t})=>{if([`GET`,`HEAD`].includes(e.toUpperCase()))return!0;let n=t;if(typeof t==`string`)try{n=JSON.parse(t)}catch{return!1}return X(n)&&typeof n.query==`string`&&!/^\s*(?:#[^\n]*\n\s*)*mutation\b/.test(n.query)},Xre=[429,503,504],Zre=1e3,Qre=(e,t)=>{let n=t?.get(`Retry-After`)?.trim();if(n){let e=/^\d+$/.test(n)?Number(n)*1e3:Date.parse(n)-Date.now();if(!Number.isNaN(e))return e>1e4?void 0:Math.max(e,0)}return e===429?void 0:Zre},Bu=async(...e)=>{let t=await fetch(...e);if(!t.ok)throw Error(`HTTP ${t.status}`);return t},Vu=async(e,t={},{responseType:n=`json`,refreshAccessToken:r=void 0,retries:i=1,retryable:a=zu(t)}={})=>{let o,s=new Headers(t.headers);if(t.cache=`no-cache`,t.headers=s,s.has(`Authorization`)&&!Ru(e))throw Error(`Refusing to send credentials over an insecure connection`);n===`json`&&s.set(`Accept`,`application/json`),X(t.body)&&(s.set(`Content-Type`,`application/json`),t.body=JSON.stringify(t.body));try{o=await fetch(e,t)}catch(e){throw Error(`Failed to send the request`,{cause:e})}let{ok:c,status:l}=o,u=async()=>{let[i]=s.get(`Authorization`)?.split(` `)??[`token`],{token:o}=await r();return s.set(`Authorization`,`${i} ${o}`),Vu(e,t,{responseType:n,retryable:a})},d=i>0&&a&&(l===502||Xre.includes(l)&&zu(t))?Qre(l,o.headers):void 0,f=d!==void 0,p=async()=>(await Iu(d),Vu(e,t,{responseType:n,refreshAccessToken:r,retries:i-1,retryable:a}));if(n===`raw`)return f?p():l===401&&r?u():o;let m;if(c)try{if(n===`blob`)return await o.blob();if(n===`text`)return await o.text();m=await o.json()}catch(e){throw Error(`Failed to parse the response`,{cause:e})}else try{m=await o.json()}catch{m=void 0}if(c&&!(e.endsWith(`/graphql`)&&X(m)&&m.errors))return m;if(f)return p();if(l===401&&r)return u();if(!X(m))throw Error(`Server responded with an error`,{cause:{status:l}});let h=``;throw typeof m.error==`string`&&(h=m.error),typeof m.message==`string`&&(h=m.message),Array.isArray(m.errors)&&(typeof m.errors[0]==`string`&&(h=m.errors.join(`, `)),X(m.errors[0])&&typeof m.errors[0].message==`string`&&(h=m.errors.map(e=>e.message).join(`, `))),Error(`Server responded with an error`,{cause:{status:l,message:h}})},Hu=async(e,t,{allowNotFound:n=!1}={})=>{if(!e.ok&&!(n&&e.status===404)){let n=await e.text();throw Error(`${t}: ${n}`)}},Uu=e=>typeof e==`string`&&!!e.trim(),Wu=e=>typeof e==`string`&&/^https?:\/\//i.test(e.trim())&&zc(e.trim()),Gu=e=>e.replace(/&(?![a-zA-Z0-9#]+;)/g,`&amp;`).replaceAll(`"`,`&quot;`),$re={"&":`&amp;`,"<":`&lt;`,">":`&gt;`},Ku=e=>e.replace(/[&<>]/g,e=>$re[e]),qu={ALLOWED_TAGS:[`a`],ALLOWED_ATTR:[`href`,`target`,`rel`]},Ju=(e,t)=>dt(e.replace(`<a>`,`<a href="${Gu(t)}" target="_blank" rel="noopener noreferrer">`),qu),Yu=(e,{allowedTags:t=[`strong`,`em`,`del`,`code`,`a`],allowedAttr:n=[`href`]}={})=>dt(fr(e),{ALLOWED_TAGS:t,ALLOWED_ATTR:n}),Xu=e=>Yu(e.replaceAll(`\\n`,`<br>`),{allowedTags:[`strong`,`em`,`del`,`code`,`a`,`br`]}),Zu={clientId:``,authScope:``,authURL:``,tokenURL:``,authScheme:`token`,restBaseURL:``,graphqlBaseURL:``,includeCredentials:!1},Qu={},$u=async(e,t,{includeCredentials:n=!1}={})=>{if(Ru(e))try{return await fetch(e,{method:`POST`,headers:{Accept:`application/json`,"Content-Type":`application/json`},body:JSON.stringify(t),...n&&{credentials:`include`}})}catch{return}},ed=new Map,eie=async({clientId:e,tokenURL:t,refreshToken:n})=>{let r=await $u(t,{grant_type:`refresh_token`,client_id:e,refresh_token:n},{includeCredentials:Zu.includeCredentials});if(!r?.ok)throw Error(Y(`sign_in_error.TOKEN_REFRESH_FAILED`));let i;try{i=await r.json()}catch{}if(!Uu(i?.access_token))throw Error(Y(`sign_in_error.TOKEN_REFRESH_FAILED`));let a=i?.access_token;if(Uu(i?.refresh_token)&&(n=i?.refresh_token),Fu.account){Fu.account={...Fu.account,token:a,refreshToken:n};try{await _u.set(`sveltia-cms.user`,Fu.account)}catch{}}return{token:a,refreshToken:n}},tie=({clientId:e,tokenURL:t,refreshToken:n})=>{let r=ed.get(n);return r||(r=eie({clientId:e,tokenURL:t,refreshToken:n}).finally(()=>{ed.delete(n)}),ed.set(n,r)),r},nie=`sveltia-cms.token-refresh`,rie=e=>{let t=globalThis.navigator?.locks;return t?t.request(nie,e):e()},td=e=>{let{account:t}=Fu,n=Uu(e?.refreshToken)?e.refreshToken:void 0;if(t&&Uu(e?.token)&&e.backendName===t.backendName&&e.id===t.id&&(!t.refreshToken||n))return{token:e.token,refreshToken:n}},iie=async()=>{try{return td(await _u.get(`sveltia-cms.user`))}catch{return}},nd=(e,{token:t,refreshToken:n})=>!!e?.token&&e.token!==t&&e.refreshToken!==n;globalThis.addEventListener?.(`storage`,({key:e,newValue:t})=>{if(e!==`sveltia-cms.user`||!t)return;let n;try{n=JSON.parse(t)}catch{return}let r=td(n),{account:i}=Fu;r&&(r.token!==i.token||r.refreshToken!==i.refreshToken)&&(Fu.account={...i,...r})});var rd=async(e,{method:t=`GET`,headers:n={},body:r=null,isGraphQL:i=!1,responseType:a=`json`,token:o=void 0,refreshToken:s=void 0,retryable:c=void 0}={})=>{let{clientId:l,tokenURL:u,restBaseURL:d,graphqlBaseURL:f,authScheme:p=`token`,includeCredentials:m}=Zu,h=Fu.account,g=i?f:d;o??=h?.token,s??=h?.refreshToken,n.Authorization=`${p} ${o}`;let _=!!h&&o===h.token&&s===h.refreshToken;return Vu(`${g}${e}`,{method:t,headers:n,body:r,...m&&{credentials:`include`}},{responseType:a,retryable:c,refreshAccessToken:s?()=>rie(async()=>{if(_){let{account:e}=Fu;if(e&&nd(e,{token:o,refreshToken:s}))return{token:e.token,refreshToken:e.refreshToken};let t=await iie();if(t&&nd(t,{token:o,refreshToken:s}))return Fu.account={...Fu.account,...t},t}return tie({clientId:l,tokenURL:u,refreshToken:s})}):void 0})},id=async(e,t={},{retryable:n}={})=>{e=e.replace(/\n\s*/g,` `),Object.entries(Qu).forEach(([n,r])=>{e.includes(`$${n}`)&&(t[n]??=r)});let{data:r}=await rd(``,{method:`POST`,body:{query:e,variables:t},isGraphQL:!0,retryable:n});return r},ad=async(...e)=>{try{return await rd(...e)}catch(e){if(e?.cause?.status===404)return;throw e}},od=tl(!1),sd=tl(),cd=`sveltia-cms.auth`,ld=`sveltia-cms.auth-popup`,ud=e=>`sveltia-cms.auth.${e}`,dd=e=>`authorizing:${e}`,fd=(e,t,n)=>`authorization:${e}:${t}:${JSON.stringify(n)}`,aie=(e,t)=>t.match(`^authorization:${e}:(success|error):(?<result>.+)`)?.groups?.result,oie=()=>{try{return window.sessionStorage.getItem(ld)}catch{return null}},pd=e=>{try{e?window.sessionStorage.setItem(ld,e):window.sessionStorage.removeItem(ld)}catch{}},md=async()=>{pd(),await _u.delete(cd)},hd=()=>Object.assign(Error(`Authentication aborted`),{name:`AbortError`}),gd=({authURL:e})=>{let{availHeight:t,availWidth:n}=window.screen,r=t/2-400,i=n/2-300;return window.open(e,`auth`,`width=600,height=800,top=${r},left=${i}`)},_d=async({backendName:e,authURL:t,popup:n,state:r})=>{let i=n??gd({authURL:t});if(!i)throw hd();return new Promise((n,a)=>{let o=new AbortController,s=e,c=r?new BroadcastChannel(ud(r)):void 0,l,u=()=>{o.abort(),clearInterval(l),c?.close(),sd.current=void 0},d=()=>{u(),i.close(),a(hd())};(e===`github`||vl(e))&&(l=setInterval(()=>{i.closed&&d()},1e3));let f=e=>{let t=aie(s,e),r;try{r=t?JSON.parse(t):{error:`No data`},X(r)||(r={error:`Malformed data`})}catch{r={error:`Malformed data`}}`token`in r?n(r):a(Error(`Authentication failed`,{cause:Error(r.errorCode?Y(`sign_in_error.${r.errorCode}`,{default:r.error}):r.error)})),u(),i.close()};window.addEventListener(`message`,({origin:e,data:n,source:r})=>{r===i&&e===new URL(t).origin&&typeof n==`string`&&(n===dd(s)?i.postMessage(n,e):f(n))},{signal:o.signal}),c&&(c.onmessage=({data:e})=>{typeof e==`string`&&f(e)}),sd.current=d})},sie=async({backendName:e,siteDomain:t,authURL:n,scope:r})=>{let{hostname:i}=window.location;t??=i===`localhost`?`cms.netlify.com`:i;try{new URL(n).origin===`https://api.netlify.com`&&(t=new URL(`https://${t}`).hostname)}catch{}return _d({backendName:e,authURL:`${n}?${new URLSearchParams({provider:e,site_id:t,scope:r})}`})},cie=async()=>{let e=`${Nc()}${Nc()}`,t=btoa(await Pc(e,{algorithm:`SHA-256`,format:`binary`})).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``);return{csrfToken:jc().replaceAll(`-`,``),codeVerifier:e,codeChallenge:t}},lie=async({backendName:e,clientId:t,authURL:n,scope:r})=>{let{origin:i,pathname:a}=window.location,o=`${i}${a}`,s=gd({authURL:o});if(!s)throw hd();let{csrfToken:c,codeVerifier:l,codeChallenge:u}=await cie(),d=new URLSearchParams({client_id:t,redirect_uri:o,response_type:`code`,state:c,scope:r,code_challenge:u,code_challenge_method:`S256`});if(await _u.set(cd,{csrfToken:c,codeVerifier:l,realAuthURL:`${n}?${d}`}),await _u.set(`sveltia-cms.user`,{backendName:e}),s.closed)throw hd();try{return await _d({backendName:e,authURL:o,popup:s,state:c})}catch(e){throw await _u.delete(cd),e}},vd=({provider:e=`unknown`,state:t,token:n,refreshToken:r,error:i,errorCode:a})=>{let o=i?`error`:`success`,s=i?{provider:e,error:i,errorCode:a}:{provider:e,token:n,refreshToken:r};if(!window.opener){if(t){let n=new BroadcastChannel(ud(t));n.postMessage(fd(e,o,s)),n.close(),window.close()}return}let c=({data:t,origin:n,source:r})=>{r===window.opener&&n===window.location.origin&&t===dd(e)&&(window.opener?.postMessage(fd(e,o,s),n),window.removeEventListener(`message`,c))};window.addEventListener(`message`,c),window.opener?.postMessage(dd(e),window.location.origin)},uie=async({backendName:e,apiConfig:t,code:n,state:r})=>{let{clientId:i,tokenURL:a,includeCredentials:o=!1}=t,{origin:s,pathname:c}=new URL(window.location.href),{csrfToken:l,codeVerifier:u}=await _u.get(cd)??{},d=e,f=`${s}${c}`;if(await md(),!l||!u||r!==l)return vd({provider:d,state:r,error:Y(`sign_in_error.CSRF_DETECTED`),errorCode:`CSRF_DETECTED`});let p=``,m=``,h=``,g=await $u(a,{grant_type:`authorization_code`,client_id:i,code:n,redirect_uri:f,code_verifier:u},{includeCredentials:o});if(!g)return vd({provider:d,state:r,error:Y(`sign_in_error.TOKEN_REQUEST_FAILED`),errorCode:`TOKEN_REQUEST_FAILED`});try{({access_token:p,refresh_token:m,error:h}=await g.json())}catch{return vd({provider:d,state:r,error:Y(`sign_in_error.MALFORMED_RESPONSE`),errorCode:`MALFORMED_RESPONSE`})}return vd({provider:d,state:r,token:p,refreshToken:m,error:h})},die=async({backendName:e,apiConfig:t})=>{od.current=!0;let{search:n}=window.location,{code:r,state:i,error:a,error_description:o}=Object.fromEntries(new URLSearchParams(n));if(r&&i)await uie({backendName:e,apiConfig:t,code:r,state:i});else if(a)await md(),vd({provider:e,state:i,error:o||a,errorCode:`AUTH_CODE_REQUEST_FAILED`});else{let{csrfToken:e,realAuthURL:t}=await _u.get(cd)??{};t&&(pd(e),window.location.href=t)}},fie=()=>{try{if(window.opener)return window.opener.origin===window.location.origin&&window.name===`auth`}catch{return!1}let e=new URLSearchParams(window.location.search).get(`state`);return!!e&&e===oie()},pie=async({auto:e,apiConfig:t})=>{let{backend:n}=Dl.current,{name:r,site_domain:i,auth_type:a}=n,{clientId:o,authScope:s,authURL:c}=t,l={backendName:r,authURL:c,scope:s};if(vl(r)||a===`pkce`){let n=fie();return n&&await die({backendName:r,apiConfig:t}),n||e?void 0:lie({...l,clientId:o})}if(!e)return sie({...l,siteDomain:i})},mie=async({options:{token:e,refreshToken:t,auto:n=!1},apiConfig:r})=>{if(!e){let i=await pie({auto:n,apiConfig:r});if(!i)return;({token:e,refreshToken:t}=i)}return{token:e,refreshToken:t}},yd=async({options:e,getUserProfile:t})=>{let{token:n,refreshToken:r}=await mie({options:e,apiConfig:Zu})??{};if(n)return t({token:n,refreshToken:r})},bd=async()=>void 0,hie=[408,413,499,502,504],xd=(e,t=new Set)=>({queue:e.filter(({path:e})=>!t.has(e)).toSorted((e,t)=>Number(typeof e.data==`string`)-Number(typeof t.data==`string`)),addedAgain:e.filter(({path:e})=>t.has(e))}),Sd=(e,t)=>{let n=[],r=0;for(;e.length&&(!n.length||r+e[0].contents.length<=t);){let t=e.shift();n.push(t),r+=t.contents.length}return n},Cd=e=>e.reduce((e,{contents:t})=>e+t.length,0),wd=(e,t)=>Math.max(1,Math.ceil(Cd(e)/t)),Td=e=>e?.message===`Failed to send the request`||hie.includes(e?.cause?.status),Ed=async(e,t,{concurrency:n=10}={})=>{let r=0,i=async()=>{for(;r<e.length;){let n=e[r];r+=1,await t(n)}};await Promise.all(Array(Math.min(n,e.length)).fill(void 0).map(()=>i()))},Dd=async(e,t,n)=>{let r=Array(e.length);return await Ed([...e.keys()],async n=>{r[n]=await t(e[n])},n),r},Od=e=>Array.isArray(e.fields)&&!Array.isArray(e.files),kd=e=>Array.isArray(e.files),Ad=e=>kd(e)&&e.name===`_singletons`,jd=e=>e?._type===`entry`&&!!e._file.arrayFile,gie=(e,{visible:t=void 0,type:n=void 0}={})=>`divider`in e||t&&e.hide?!1:n===`entry`?Od(e):n===`file`?kd(e):n===`singleton`?Ad(e):Od(e)||kd(e),Md=e=>!(`divider`in e)&&typeof e.file==`string`&&Array.isArray(e.fields),Nd=e=>e.filter(e=>Md(e)),Pd=[`boolean`,`code`,`color`,`compute`,`datetime`,`file`,`hidden`,`image`,`keyvalue`,`list`,`map`,`markdown`,`number`,`object`,`relation`,`richtext`,`select`,`string`,`text`,`uuid`],Fd=[`boolean`,`color`,`compute`,`datetime`,`map`,`markdown`,`number`,`richtext`,`string`,`text`,`uuid`],Id=Fd.filter(e=>![`boolean`,`number`].includes(e)),Ld=[`file`,`image`],Rd=[`richtext`,`markdown`],_ie=[`text`,`string`,...Rd],zd=[...Ld,`relation`,`select`],vie=[...zd,`datetime`,`keyvalue`,`list`,`number`],yie=[`forEach`,`isDisjointFrom`,`isSubsetOf`,`isSupersetOf`],bie=[`difference`,`intersection`,`symmetricDifference`,`union`],xie=!1,Sie=class e extends Set{#e=new Map;#t=j(0);#n=j(0);#r=Ha||-1;constructor(e){if(super(),e){for(var t of e)super.add(t);this.#n.v=super.size}xie||this.#a()}#i(e){return Ha===this.#r?j(e):Ui(e)}#a(){xie=!0;var t=e.prototype,n=Set.prototype;for(let e of yie)t[e]=function(...t){return z(this.#t),n[e].apply(this,t)};for(let r of bie)t[r]=function(...t){z(this.#t);var i=n[r].apply(this,t);return new e(i)}}has(e){var t=super.has(e),n=this.#e,r=n.get(e);if(r===void 0){if(!t)return z(this.#t),!1;r=this.#i(!0),n.set(e,r)}return z(r),t}add(e){return super.has(e)||(super.add(e),M(this.#n,super.size),Ji(this.#t)),this}delete(e){var t=super.delete(e),n=this.#e,r=n.get(e);return r!==void 0&&(n.delete(e),M(r,!1)),t&&(M(this.#n,super.size),Ji(this.#t)),t}clear(){if(super.size!==0){super.clear();var e=this.#e;for(var t of e.values())M(t,!1);e.clear(),M(this.#n,0),Ji(this.#t)}}keys(){return this.values()}values(){return z(this.#t),super.values()}entries(){return z(this.#t),super.entries()}[Symbol.iterator](){return this.keys()}get size(){return z(this.#n)}},Cie=class extends Map{#e=new Map;#t=j(0);#n=j(0);#r=Ha||-1;constructor(e){if(super(),e){for(var[t,n]of e)super.set(t,n);this.#n.v=super.size}}#i(e){return Ha===this.#r?j(e):Ui(e)}has(e){var t=this.#e,n=t.get(e);if(n===void 0){if(super.has(e))n=this.#i(0),t.set(e,n);else return z(this.#t),!1}return z(n),!0}forEach(e,t){this.#a(),super.forEach(e,t)}get(e){var t=this.#e,n=t.get(e);if(n===void 0){if(super.has(e))n=this.#i(0),t.set(e,n);else{z(this.#t);return}}return z(n),super.get(e)}getOrInsert(e,t){return super.has(e)||this.set(e,t),this.get(e)}getOrInsertComputed(e,t){return super.has(e)||this.set(e,t(e)),this.get(e)}set(e,t){var n=this.#e,r=n.get(e),i=super.get(e),a=super.set(e,t),o=this.#t;if(r===void 0)r=this.#i(0),n.set(e,r),M(this.#n,super.size),Ji(o);else if(i!==t){Ji(r);var s=o.reactions===null?null:new Set(o.reactions);s!==null&&r.reactions?.every(e=>s.has(e))||Ji(o)}return a}delete(e){var t=this.#e,n=t.get(e),r=super.delete(e);return n!==void 0&&(t.delete(e),M(n,-1)),r&&(M(this.#n,super.size),Ji(this.#t)),r}clear(){if(super.size!==0){super.clear();var e=this.#e;M(this.#n,0);for(var t of e.values())M(t,-1);Ji(this.#t),e.clear()}}#a(){z(this.#t);var e=this.#e;if(this.#n.v!==e.size){for(var t of super.keys())if(!e.has(t)){var n=this.#i(0);e.set(t,n)}}for([,n]of this.#e)z(n)}keys(){return z(this.#t),super.keys()}values(){return this.#a(),super.values()}entries(){return this.#a(),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return z(this.#n),super.size}},Bd=new Map,Vd=new Cie,Hd=new Map,Ud=new Map,Wd=new Set,wie=new Map,Gd=new Map,Tie=new Set,Kd=/(?<!\\){{(.+?)}}/,qd=new RegExp(Kd.source,`g`),Jd=[`year`,`month`,`day`,`hour`,`minute`,`second`],Eie=/{{(?:year|month|day|hour|minute|second)}}/,Yd=/^fields\./,Die=/\|\s*default\s*\(/,Xd={uuid:{length:void 0,pattern:`[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}`},uuid_short:{length:`short`,pattern:`[0-9a-f]{12}`},uuid_shorter:{length:`shorter`,pattern:`[0-9a-f]{8}`}},Zd=(e,t,n)=>{let r=t+n;for(;/\s/.test(e[r]??``);)r+=n;return e[r]??``},Qd=(e,t,{unescape:n=!0}={})=>{let r=``,i=0;for(;i<e.length;){let a=e.indexOf(`{{`,i);if(a===-1){r+=e.slice(i);break}r+=e.slice(i,a);let o=a+2,s=!1;for(;o<e.length;){let c=e[o],l=e[o+1];if(c===`'`&&(!s&&[`(`,`,`].includes(Zd(e,o,-1))?s=!0:s&&[`,`,`)`].includes(Zd(e,o,1))&&(s=!1)),!s&&c===`}`&&l===`}`){let s=o,c=e.slice(a+2,s);if(e[a-1]===`\\`){r=n?r.slice(0,-1):r,r+=e.slice(a,s+2),i=s+2;break}r+=c?t(e.slice(a,s+2),c):e.slice(a,s+2),i=s+2;break}o+=1}if(o>=e.length){r+=e.slice(a);break}}return r},$d=e=>{let t=[];return{tags:t,literals:Qd(e,(e,n)=>(t.push(n),`\0`)).split(`\0`)}},ef=e=>{let t=[];return Qd(e,(e,n)=>(t.push({tag:e,content:n,name:n.split(`|`)[0].trim()}),e)),t},tf=e=>Kd.test(e),nf=e=>e.replace(Yd,``),Oie=(e,t=[])=>{let n=e.split(`/`).pop(),r=n.lastIndexOf(`.`),i=r===-1?``:n.slice(r+1),a=r===-1?n:n.slice(0,r),o=t.find(e=>a.endsWith(`.${e}`));return o&&(a=a.slice(0,-(o.length+1))),{filename:a,extension:i}},kie=({_i18n:e})=>e?.structureMap?.i18nMultiFile?e.allLocales:[],rf=(e,t)=>$d(e).literals.map(Fc).join(t),Aie=`_index`,jie=new WeakMap,af=e=>{if(!Od(e))return;let{index_file:t}=e;if(t)return(t===!0?void 0:t.name)??Aie},of=e=>{let t=jie.get(e);if(t&&t.locale===Ec.current)return t.indexFile;let n=af(e),r;if(n!==void 0){let{index_file:t}=e,i=t===!0?{}:t;r={...i,name:n,label:i.label||Y(`index_file`),icon:i.icon??`home`}}return jie.set(e,{locale:Ec.current,indexFile:r}),r},sf=(e,t)=>{let n=af(e);if(n===void 0)return!1;let r=e._file?.fullPathRegEx;return!!r&&t.match(r)?.groups?.subPath===n},cf=(e,t)=>{let n=af(e);if(n===void 0)return!1;let r=Object.values(t.locales??{})[0]?.path;return r===void 0?t.slug===n:sf(e,r)},lf=[`markdown`,`md`,`mdown`,`mdwn`,`mdx`,`mkd`,`mkdn`,`html.md`],Mie={raw:`txt`,yaml:`yml`,yml:`yml`,toml:`toml`,json:`json`},uf={yaml:`yaml`,yml:`yaml`,toml:`toml`,json:`json`,astro:`raw`},df={"json-frontmatter":[`{`,`}`],"toml-frontmatter":[`+++`,`+++`],"yaml-frontmatter":[`---`,`---`]},ff=[`yaml-frontmatter`,`toml-frontmatter`,`json-frontmatter`],Nie=[`yml`,`yaml`,`toml`,`json`,`frontmatter`,...ff,`raw`],Pie=[`toml`,`toml-frontmatter`],Fie={yml:`yaml`,yaml:`yaml`,toml:`toml`,json:`json`,frontmatter:`yaml`,"yaml-frontmatter":`yaml`,"toml-frontmatter":`toml`,"json-frontmatter":`json`},pf=e=>Object.hasOwn(Fie,e)?Fie[e]:void 0,Iie=[`index`,`_index`],Lie=[...lf,...Object.keys(uf)],Rie=e=>{if(typeof e!=`string`||!e.trim())return;let t=Lc(e.trim()),{filename:n,extension:r}=Uc(t);return r!==void 0&&Lie.includes(r)?n:t},mf=tl(``),hf=e=>{let t=e;if(!Od(t))return;let{nested:n}=t;if(!n||typeof n!=`object`)return;let{depth:r,summary:i,subfolders:a}=n;return{depth:typeof r==`number`&&r>=1?Math.floor(r):1/0,summary:Uu(i)?i:void 0,subfolders:a!==!1}},gf=e=>!!hf(e),_f=e=>{if(!gf(e))return;let t=e.meta?.path;if(t&&typeof t==`object`)return{indexFileName:Rie(t.index_file)}},zie=e=>gf(e)?_f(e)?.indexFileName:void 0,vf=e=>hf(e)?.subfolders===!1?void 0:_f(e)?.indexFileName,yf=(e,t)=>{let n=vf(e);return n&&t.endsWith(`/${n}`)?t.slice(0,-n.length-1):t},bf=({collection:e,isNew:t,originalPath:n,currentPath:r})=>r===void 0?!1:t&&vf(e)?!0:!!Lc(r)||!!Lc(n??``),xf=e=>{let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)},Bie=(e,t)=>{let n=t?`${t}/`:``,r=e.startsWith(n)?e.slice(n.length):void 0;return r?.includes(`/`)?void 0:r},Sf=(e,t)=>!e||t.startsWith(`${e}/`),Vie=({collection:e,entries:t,dirPath:n})=>{if(!gf(e))return!1;let r=Lc(n);return!r||t.some(({subPath:e})=>Sf(r,e))},Hie=({collection:e,entries:t,dirPath:n})=>{let r=hf(e);if(!r)return t;let{subfolders:i}=r,a=Lc(n);return t.filter(({subPath:e})=>{if(!Sf(a,e))return!1;let t=(a?e.slice(a.length+1):e).split(`/`).length;return i?a?t===2:t<=2:t===1})},Uie=/(?:^|\/){{locale}}(?:\/|$)/,Cf=e=>e.includes(`{{locale}}`),Wie=e=>e.split(`{{locale}}`).length===2&&Uie.test(e),wf=e=>{let t=e.indexOf(`{{locale}}`);if(t===-1)return;let n=e.slice(0,t),r=e.slice(t+10);if(n===``||n.endsWith(`/`))return r.startsWith(`/`)?`${n}${r.slice(1)}`:r===``?n.endsWith(`//`)?void 0:n.length>1?n.slice(0,-1):n:/^\.(?:[^./][^/]*\.|{{)/.test(r)?`${n}${r.slice(1)}`:void 0;if(/[^/]\.$/.test(n)&&/^(?:[./]|$)/.test(r))return`${n.slice(0,-1)}${r}`},Gie=e=>wf(e)!==void 0,Kie=({path:e,locale:t,omitLocale:n=!1})=>(n&&(e=wf(e)??e),e.replaceAll(`{{locale}}`,t)),Tf=(e,t)=>`${e}/`.split(`{{locale}}/`).map(Fc).join(t),qie=new Map,Jie=(e,t)=>e.replace(Nl(qie,t,()=>RegExp(`^${Tf(t,`(?:[^/]+\\/)?`)}`)),``),Yie={type:`language`,languageDisplay:`standard`,style:`short`,fallback:`none`},Ef=e=>{let t;if(e!==`_default`)try{[t]=Intl.getCanonicalLocales(e)}catch{}return t},Df=e=>e===`_default`?`auto`:Tc(e)?`rtl`:`ltr`,Xie=new Map,Of=(e,{displayLocale:t=Ef(Ec.current??`en`),formatterOptions:n=Yie}={})=>{let r=Ef(e);if(!r)return;let i=t?Nl(Xie,t,()=>new Intl.DisplayNames(t,n)):new Intl.DisplayNames(void 0,n);try{let e=i.of(r);if(!e)return;let[n,...a]=e;return[n.toLocaleUpperCase(t),...a].join(``)}catch(e){console.error(e);return}},Zie=new Map,kf=(e,t={})=>{let n={style:`narrow`,type:`conjunction`,...t};return Nl(Zie,`${e}|${n.style}|${n.type}`,()=>{let t=new Intl.ListFormat(Ef(e),n);return{format:e=>t.format([...e].filter(e=>e!=null).map(e=>`${e}`))}})},Af=({_i18n:e,locale:t,path:n})=>{let{defaultLocale:r,omitDefaultLocaleFromFilePath:i}=e;return Kie({path:n,locale:t,omitLocale:i&&t===r})},jf=({extension:e,format:t})=>(t?Ud.get(t)?.extension:void 0)||e||(t?Mie[t]??`md`:`md`),Mf=({extension:e,format:t})=>t||(lf.includes(e)?`frontmatter`:uf[e]??`yaml-frontmatter`),Qie=({subPath:e,indexFileName:t,nestedDepth:n,entrySuffix:r=``,indexSuffix:i=``})=>{let a=t?Fc(t):``,o=!!a&&!!i,s=a&&!o?`|${a}`:``,c;if(!e)c=n===void 0?`[^/]+?`:`[^/]+?(?:\\/[^/]+?)${Number.isFinite(n)?`{0,${Math.max(0,n-1)}}`:`*`}`;else{let t=`${rf(e,`[^/]+?`)}${s}`;if(n===void 0)c=t;else{let r=Number.isFinite(n)?Math.max(0,n-e.split(`/`).length):void 0;c=`${r===void 0?`(?:[^/]+\\/)*`:`(?:[^/]+\\/){0,${r}}`}(?:${t})`}}return o?`(?<subPath>${`(?!${a}${r})`}(?:${c})${r}|${a}${i})`:`(?<subPath>${c})`},$ie=({extension:e,format:t,basePath:n,subPath:r,indexFileName:i,indexFileExtension:a,nestedDepth:o,_i18n:s})=>{let{allLocales:c,defaultLocale:l,omitDefaultLocaleFromFilePath:u,structureMap:{i18nMultiFile:d,i18nMultiFolder:f,i18nMultiRootFolder:p}}=s,m=c.map(Fc).join(`|`),h=c.filter(e=>e!==l).map(Fc).join(`|`),g=`(?<locale>${m})`,_=u?`(?:(?<locale>${h})\\/)?`:`${g}\\/`,v=u?`(?:\\.(?<locale>${h}))?`:`\\.${g}`,y=!!n&&Cf(n),b=y?Tf(n,_):n?`${Fc(n)}\\/`:``,x=jf({format:t,extension:e}),S=i&&a!==void 0&&a!==x?a:void 0,C=e=>{let t=u?`(?:\\.(?:${h}))?`:`\\.(?:${m})`;return`(?=${d?t:``}\\.${Fc(e)}$)`},w=[`^`,p&&!y?_:``,b,f&&!y?_:``,Qie({subPath:r,indexFileName:i,nestedDepth:o,entrySuffix:S?C(x):``,indexSuffix:S?C(S):``}),d?v:``,`\\.`,S?`(?:${Fc(x)}|${Fc(S)})`:Fc(x),`$`].join(``);return new RegExp(w)},Nf=({format:e,delimiter:t})=>Uu(t)?[t,t]:Array.isArray(t)&&t.length===2?t:df[e]??void 0,eae=({indexFile:e,extension:t,format:n})=>{if(!e)return;let{extension:r,format:i}=e;if(r===void 0&&i===void 0)return;let a=jf({extension:r,format:i}),o=Mf({extension:a,format:i}),s=jf({extension:t,format:n}),c=Mf({extension:s,format:n});if(a!==s||o!==c)return{extension:a,format:o}},tae=({rawCollection:e,file:t,_i18n:n})=>{let{folder:r,file:i,path:a,extension:o,format:s,frontmatter_delimiter:c,body_field:l,yaml_quote:u}=e,d=Od(e),f=d&&typeof i==`string`,p=t?.file?Lc(t.file):f?Lc(i):void 0,m=p?Uc(p).extension:o,h=t?.format??s,g=jf({format:h,extension:m}),_=Mf({format:h,extension:g}),v=t?.frontmatter_delimiter??c,y=d&&!f,b=y?Lc(r):void 0,x=y?of(e):void 0,S=x?.name,C=y?hf(e)?.depth:void 0,w=eae({indexFile:x,extension:o,format:s}),T={extension:g,format:_,basePath:b,subPath:y?a:void 0,fullPathRegEx:b===void 0?void 0:$ie({extension:g,format:_,basePath:b,subPath:a,indexFileName:S,indexFileExtension:w?.extension,nestedDepth:C,_i18n:n}),fullPath:p?Af({_i18n:n,locale:n.defaultLocale,path:p}):void 0,fmDelimiters:Nf({format:_,delimiter:v}),bodyField:t?.body_field??l,yamlQuote:!!u};return f&&(T.arrayFile=!0),w&&(T.indexFile={...T,...w,fmDelimiters:Nf({format:w.format,delimiter:v})}),T},Pf=({collection:e,collectionFile:t,isIndexFile:n=!1})=>{let{_file:r}=t??e;return(n?r.indexFile:void 0)??r},Ff={SINGLE_FILE:`single_file`,SINGLE_FILE_DEFAULT_ROOT:`single_file_default_root`,MULTIPLE_FILES:`multiple_files`,MULTIPLE_FOLDERS:`multiple_folders`,MULTIPLE_FOLDERS_I18N_ROOT:`multiple_folders_i18n_root`,MULTIPLE_ROOT_FOLDERS:`multiple_root_folders`},nae=[Ff.MULTIPLE_FOLDERS_I18N_ROOT,Ff.MULTIPLE_ROOT_FOLDERS],If={key:`translationKey`,value:`{{slug}}`},Lf=({cmsConfig:e,collection:t,file:n})=>{let r=e?.i18n;if(!X(r))return;let i=structuredClone(r),{name:a,i18n:o}=t;if(o||a===`_singletons`){if(X(o)&&Object.assign(i,o),n){if(!n.i18n)return;X(n.i18n)&&Object.assign(i,n.i18n)}return i}},rae=e=>e?.omit_default_locale_from_file_path??e?.omit_default_locale_from_filename??!1,iae={i18nEnabled:!1,saveAllLocales:!0,allLocales:[`_default`],initialLocales:[`_default`],defaultLocale:`_default`,structure:Ff.SINGLE_FILE,structureMap:{i18nSingleFile:!1,i18nSingleFileDefaultRoot:!1,i18nMultiFile:!1,i18nMultiFolder:!1,i18nMultiRootFolder:!1},canonicalSlug:{...If},omitDefaultLocaleFromFilePath:!1,omitDefaultLocaleFromPreviewPath:!1},Rf=e=>(e?.collectionFile??e?.collection)?._i18n??iae,aae=(e,t,n,r)=>!t&&typeof r!=`string`?typeof n==`string`&&Cf(n)?Ff.MULTIPLE_FOLDERS:e:t?.file.includes(`{{locale}}`)?Ff.MULTIPLE_FILES:e===Ff.SINGLE_FILE_DEFAULT_ROOT?Ff.SINGLE_FILE_DEFAULT_ROOT:Ff.SINGLE_FILE,oae=(e,t)=>({i18nSingleFile:e&&t===Ff.SINGLE_FILE,i18nSingleFileDefaultRoot:e&&t===Ff.SINGLE_FILE_DEFAULT_ROOT,i18nMultiFile:e&&t===Ff.MULTIPLE_FILES,i18nMultiFolder:e&&t===Ff.MULTIPLE_FOLDERS,i18nMultiRootFolder:e&&(t===Ff.MULTIPLE_FOLDERS_I18N_ROOT||t===Ff.MULTIPLE_ROOT_FOLDERS)}),zf=({i18nSingleFile:e,i18nSingleFileDefaultRoot:t})=>!!e||!!t,Bf=({i18nMultiFile:e,i18nMultiFolder:t,i18nMultiRootFolder:n})=>!!e||!!t||!!n,sae=(e,t,n)=>e?n&&t.includes(n)?n:t[0]:`_default`,cae=(e,t,n)=>e===`all`?t:e==="default"?[n]:t.filter(t=>t===n||!Array.isArray(e)||e.includes(t)),lae=(e,t,n)=>e?n?Gie(n.file):Bf(t):!1,Vf=(e,t)=>{let{structure:n=Ff.SINGLE_FILE,locales:r=[],default_locale:i,initial_locales:a,save_all_locales:o=!0,canonical_slug:s={key:void 0,value:void 0},omit_default_locale_from_filename:c,omit_default_locale_from_file_path:l=c??!1,omit_default_locale_from_preview_path:u=!1}=Lf({cmsConfig:Dl.current,collection:e,file:t})??{},{key:d=If.key,value:f=If.value}=s,p=r.length>0,m=p?r:[`_default`],h=sae(p,m,i),{folder:g,file:_}=e,v=aae(n,t,g,_),y=oae(p,v),b=!p||o===!0&&a===void 0,x=cae(a,m,h),S=lae(l,y,t);return{i18nEnabled:p,saveAllLocales:b,allLocales:m,defaultLocale:h,initialLocales:x,structure:v,structureMap:y,canonicalSlug:{key:d,value:f},omitDefaultLocaleFromFilePath:S,omitDefaultLocaleFromPreviewPath:u}},uae=e=>{if(!e)return;let t=Object.values(e);if(t.some(e=>e.config?.multiple===!0))return!0;if(t.some(e=>e.config?.multiple===!1))return!1},dae=e=>{if(!e?.config)return;let{multiple:t}=e.config;if(typeof t==`boolean`)return t},Hf=e=>{let t=Dl.current;return e.multiple??uae(e.media_libraries)??dae(e.media_library)??uae(t?.media_libraries)??dae(t?.media_library)??!1},Uf=tl(),Wf=new Map,Gf=({collections:e=Dl.current?.collections??[],visible:t,type:n}={})=>e.filter(e=>gie(e,{visible:t,type:n})),fae=()=>Gf({visible:!0})[0],pae=e=>{if(!Od(e))return[];let{fields:t,thumbnail:n=!0}=e;return n===!1?[]:typeof n==`string`?[n]:Array.isArray(n)?n:t?.length?t.filter(({widget:e=`string`})=>Ld.includes(e)).map(e=>Hf(e)?`${e.name}.*`:e.name):[]},mae=(e,t)=>({...e,_i18n:t,_type:`entry`,_file:tae({rawCollection:e,_i18n:t}),_thumbnailFieldNames:pae(e)}),hae=(e,t,n)=>({...e,_i18n:t,_type:Ad(e)?`singleton`:`file`,_fileMap:Object.fromEntries(n.filter(Md).map(t=>{let n=Vf(e,t),r=tae({rawCollection:e,file:t,_i18n:n});return[t.name,{...t,_file:r,_i18n:n}]}))}),gae=()=>{let e=Dl.current?.singletons;if(!Array.isArray(e))return;let t=Nd(e).map(e=>({...e,file:Lc(e.file)}));if(!t.length)return;let n={name:`_singletons`,files:t};return hae(n,Vf(n),t)},Kf=e=>{let t=Wf.get(e);if(t)return t;if(e===`_singletons`){let t=gae();return Wf.set(e,t),t}let n=Gf().find(t=>t.name===e);if(!n){Wf.set(e,void 0);return}let r=Od(n)?n:void 0,i=kd(n)?n:void 0;if(!r&&!i){Wf.set(e,void 0);return}r?(typeof r.folder==`string`&&(r.folder=Lc(r.folder)),typeof r.file==`string`&&(r.file=Lc(r.file))):i?.files.forEach(e=>{e.file&&=Lc(e.file)});let a=Vf(n),o=r?mae(r,a):hae(i,a,i.files);return Wf.set(e,o),o},qf=(e,{useSingular:t=!1}={})=>{let{_type:n,name:r,label:i,label_singular:a}=e;return n===`singleton`?Y(`files`):t&&a?a:i||r},_ae=e=>e?e===`_singletons`?9999999:Dl.current?.collections?.findIndex(({name:t})=>t===e)??-1:-1,Jf=tl(),Yf=rl(()=>!!Jf.current),Xf=tl(!1),vae=e=>e?.message===`entry_already_published`,Zf=e=>e?`${e.owner}/${e.repo}`:``,yae=(e,t)=>{let{repoURL:n,owner:r,repo:i}=e??{};return!t||!n?``:n.slice(0,-`${r}/${i}`.length)+Zf(t)},Qf=tl(),bae=async e=>al(Qf,{repo:e},!1),xae={create:`Create {{collection}} “{{slug}}”`,update:`Update {{collection}} “{{slug}}”`,delete:`Delete {{collection}} “{{slug}}”`,uploadMedia:`Upload “{{path}}”`,deleteMedia:`Delete “{{path}}”`,openAuthoring:`{{message}}`},Sae=/\[(?:skip[ -](?:ci|actions)|(?:ci|actions)[ -]skip|no[ -]ci|cf-pages-skip)\]/i,Cae=e=>Sae.test(e),$f=(e,t)=>e.replace(/\{\{([\w-]+)\}\}/g,(e,n)=>Object.hasOwn(t,n)?t[n]:e),ep=()=>Dl.current?.backend??{},wae=()=>{let{email:e=``,login:t=``,name:n=``}=Fu.account;return{"author-email":e,"author-login":t,"author-name":n}},Tae=(e,{commitType:t=`update`,collection:n},r=ep())=>{let{commit_messages:i={}}=r,[a=``]=e.map(e=>e.slug).filter(Boolean),[o,...s]=e.map(({path:e})=>e),c=n?qf(n,{useSingular:!0}):``,l=i[t]||xae[t]||``,u=wae();return[`create`,`update`,`delete`].includes(t)&&(l=$f(l,{slug:a,collection:c,path:o,...u})),[`uploadMedia`,`deleteMedia`].includes(t)&&(l=$f(l,{path:o,...u})),s.length&&(l+=` +${s.length}`),l},Eae=(e,t,n)=>{let r=t?.trim();return r?n===!0?r:n===`prefix`?`${r} ${e}`:n===`suffix`?`${e} ${r}`:e:e},tp=({commitType:e,skipCI:t})=>{let{skip_ci:n,automatic_deployments:r}=ep();return e===`delete`||e===`deleteMedia`||!(t??(n===!0||r===!1))},np=(e,t)=>{let{userMessage:n}=t,r=ep(),{commit_messages:i={},prompt_commit_messages:a}=r,o=Eae(Tae(e,t,r),n,a);return Yf.current&&(o=$f(i.openAuthoring||xae.openAuthoring,{message:o,...wae()})),tp(t)||(o=`[skip ci] ${o}`),o},Dae=/^[A-Za-z0-9-]+:\s*\S/,rp=e=>(e??``).replace(/[\s<>]+/g,` `).trim(),Oae=new WeakSet,kae=e=>{if(!ep().signoff_commits)return e;let{account:t}=Fu,{email:n,login:r,name:i}=t,a=rp(n);if(!a)return Oae.has(t)||(Oae.add(t),console.warn("The `signoff_commits` option is enabled, but the Git host doesn’t share your email address, so commits are made without a `Signed-off-by` trailer.")),e;let o=rp(i)||rp(r)||a,s=e.trimEnd(),c=`<${a}>`.toLowerCase();if(s.split(/\r?\n/).some(e=>{let t=e.trim().toLowerCase();return t.startsWith(`signed-off-by:`)&&t.endsWith(c)}))return e;let l=s.split(/\r?\n\s*\r?\n/),u=l.at(-1);return`${s}${l.length>1&&u.split(/\r?\n/).every(e=>Dae.test(e))?`
`:`
`}Signed-off-by: ${o} <${a}>`},Aae=e=>{let t=new Map;return e.forEach(e=>{t.has(e.sha)||t.set(e.sha,e)}),[...t.values()].sort((e,t)=>t.date.getTime()-e.date.getTime())},ip=(e,t)=>bl(`Failed to retrieve the last commit hash.`,e,t),jae=async(e,t)=>{let n=await t().catch(()=>void 0);if(n&&n.hash!==e)throw bl(`The branch has moved since the site data was loaded.`,`save_conflict.branch_moved`)},Mae=async(e,t,n)=>Aae((await Dd(e,t)).flat().map(n)),Nae=/netlify|vercel|cloudflare|workers|deploy|preview|pages|render|surge|amplify|firebase/i,Pae=/prod/i,Fae=/canceled|cancelled|skipped|no (?:changes|build)/i,Iae={deployment:2,status:1,check:0},Lae=()=>{let{backend:e}=Dl.current??{};return(e??{}).preview_context??``},Rae=e=>{if(!e)return;let t;try{t=new URL(e)}catch{return}if(t.protocol===`https:`)return t.href.replace(/\/$/,``)},zae=(e,t)=>{if(!e)return;let n=``;try{n=new URL(t??``).host}catch{}return(e.match(/https:\/\/[^\s"'<>)\]]+/g)??[]).map(e=>Rae(e)).find(e=>!!e&&new URL(e).host!==n)},Bae=(e,t)=>{try{return new URL(e).host===new URL(t).host}catch{return!1}},Vae=({name:e,source:t},n)=>!!n||t===`deployment`||Nae.test(e),Hae=(e,t)=>e.source!==`check`||Vae(e,t),Uae=(e,{kind:t,previewContext:n})=>{let{name:r,url:i,state:a,source:o}=e,s=Pae.test(r);return(Vae(e,n)?0:-64)+(i?32:0)+(a===`ready`?16:0)+Iae[o]*4+(t===`production`===s?2:0)+ +!!Nae.test(r)},Wae=(e,{kind:t,selfURL:n})=>{let r=Lae(),i=e;if(r){let e=r.toLowerCase(),t=i.filter(({name:t})=>t.toLowerCase()===e);i=t.length?t:i.filter(({name:t})=>t.toLowerCase().includes(e))}if(i=i.filter(({description:e})=>!e||!Fae.test(e)),i=i.map(e=>({...e,url:e.state===`ready`&&Hae(e,r)&&!Bae(e.url,n)?Rae(e.url):void 0})),!i.length)return{state:`unknown`,checkedTime:Date.now()};let[a]=i.map((e,n)=>({candidate:e,index:n,score:Uae(e,{kind:t,previewContext:r})})).sort((e,t)=>t.score-e.score||t.index-e.index).map(({candidate:e})=>e);return{state:a.state,url:a.url,context:a.name,checkedTime:Date.now()}},ap=(e,t,n,r)=>{t?.forEach(t=>{let i=n(t);i&&e.push({...r(t),state:i})})},Gae=async e=>{try{await e()}catch(e){console.warn(`Failed to fetch the deployment info.`,e)}},Kae=async(e,{collect:t,selfURL:n})=>{let r=e.filter(({sha:e})=>!!e),i=[...new Set(r.map(({sha:e})=>e))];if(!i.length)return{};let a=Object.fromEntries(i.map(e=>[e,[]]));return await t(i,a),Object.fromEntries(r.map(({sha:e,kind:t})=>[e,Wae(a[e],{kind:t,selfURL:n})]))},qae=async(e,t)=>{if(e)return(await rd(t(e)))?.commit?.id??void 0},Jae=4,Yae=/^[\da-f]{40,64}$/,Xae=(e,t)=>{let n=Il(Jae);return{fetchDirSHA:async(r,i)=>{let a=`${e.owner}/${e.repo}:${r}:${i}`;if(n.has(a))return n.get(a);let o=await t(r,i);return Yae.test(r)&&n.set(a,o),o},resetDirLookups:()=>{n.clear()}}},op=e=>(e.catch(()=>{}),e),sp=tl(``),cp={current:0},lp=()=>{let e=cp.current;return()=>e!==cp.current},up={"application/andrew-inset":[`ez`],"application/appinstaller":[`appinstaller`],"application/applixware":[`aw`],"application/appx":[`appx`],"application/appxbundle":[`appxbundle`],"application/atom+xml":[`atom`],"application/atomcat+xml":[`atomcat`],"application/atomdeleted+xml":[`atomdeleted`],"application/atomsvc+xml":[`atomsvc`],"application/atsc-dwd+xml":[`dwd`],"application/atsc-held+xml":[`held`],"application/atsc-rsat+xml":[`rsat`],"application/automationml-aml+xml":[`aml`],"application/automationml-amlx+zip":[`amlx`],"application/bdoc":[`bdoc`],"application/calendar+xml":[`xcs`],"application/ccxml+xml":[`ccxml`],"application/cdfx+xml":[`cdfx`],"application/cdmi-capability":[`cdmia`],"application/cdmi-container":[`cdmic`],"application/cdmi-domain":[`cdmid`],"application/cdmi-object":[`cdmio`],"application/cdmi-queue":[`cdmiq`],"application/cpl+xml":[`cpl`],"application/cu-seeme":[`cu`],"application/cwl":[`cwl`],"application/dash+xml":[`mpd`],"application/dash-patch+xml":[`mpp`],"application/davmount+xml":[`davmount`],"application/dicom":[`dcm`],"application/docbook+xml":[`dbk`],"application/dssc+der":[`dssc`],"application/dssc+xml":[`xdssc`],"application/ecmascript":[`ecma`],"application/emma+xml":[`emma`],"application/emotionml+xml":[`emotionml`],"application/epub+zip":[`epub`],"application/exi":[`exi`],"application/express":[`exp`],"application/fdf":[`fdf`],"application/fdt+xml":[`fdt`],"application/font-tdpfr":[`pfr`],"application/geo+json":[`geojson`],"application/gml+xml":[`gml`],"application/gpx+xml":[`gpx`],"application/gxf":[`gxf`],"application/gzip":[`gz`],"application/hjson":[`hjson`],"application/hyperstudio":[`stk`],"application/inkml+xml":[`ink`,`inkml`],"application/ipfix":[`ipfix`],"application/its+xml":[`its`],"application/java-archive":[`jar`,`war`,`ear`],"application/java-serialized-object":[`ser`],"application/java-vm":[`class`],"application/javascript":[`*js`],"application/json":[`json`,`map`],"application/json5":[`json5`],"application/jsonml+json":[`jsonml`],"application/ld+json":[`jsonld`],"application/lgr+xml":[`lgr`],"application/lost+xml":[`lostxml`],"application/mac-binhex40":[`hqx`],"application/mac-compactpro":[`cpt`],"application/mads+xml":[`mads`],"application/manifest+json":[`webmanifest`],"application/marc":[`mrc`],"application/marcxml+xml":[`mrcx`],"application/mathematica":[`ma`,`nb`,`mb`],"application/mathml+xml":[`mathml`],"application/mbox":[`mbox`],"application/media-policy-dataset+xml":[`mpf`],"application/mediaservercontrol+xml":[`mscml`],"application/metalink+xml":[`metalink`],"application/metalink4+xml":[`meta4`],"application/mets+xml":[`mets`],"application/mmt-aei+xml":[`maei`],"application/mmt-usd+xml":[`musd`],"application/mods+xml":[`mods`],"application/mp21":[`m21`,`mp21`],"application/mp4":[`*mp4`,`*mpg4`,`mp4s`,`m4p`],"application/msix":[`msix`],"application/msixbundle":[`msixbundle`],"application/msword":[`doc`,`dot`],"application/mxf":[`mxf`],"application/n-quads":[`nq`],"application/n-triples":[`nt`],"application/node":[`cjs`],"application/octet-stream":[`bin`,`dms`,`lrf`,`mar`,`so`,`dist`,`distz`,`pkg`,`bpk`,`dump`,`elc`,`deploy`,`exe`,`dll`,`deb`,`dmg`,`iso`,`img`,`msi`,`msp`,`msm`,`buffer`],"application/oda":[`oda`],"application/oebps-package+xml":[`opf`],"application/ogg":[`ogx`],"application/omdoc+xml":[`omdoc`],"application/onenote":[`onetoc`,`onetoc2`,`onetmp`,`onepkg`,`one`,`onea`],"application/oxps":[`oxps`],"application/p2p-overlay+xml":[`relo`],"application/patch-ops-error+xml":[`xer`],"application/pdf":[`pdf`],"application/pgp-encrypted":[`pgp`],"application/pgp-keys":[`asc`],"application/pgp-signature":[`sig`,`*asc`],"application/pics-rules":[`prf`],"application/pkcs10":[`p10`],"application/pkcs7-mime":[`p7m`,`p7c`],"application/pkcs7-signature":[`p7s`],"application/pkcs8":[`p8`],"application/pkix-attr-cert":[`ac`],"application/pkix-cert":[`cer`],"application/pkix-crl":[`crl`],"application/pkix-pkipath":[`pkipath`],"application/pkixcmp":[`pki`],"application/pls+xml":[`pls`],"application/postscript":[`ai`,`eps`,`ps`],"application/provenance+xml":[`provx`],"application/pskc+xml":[`pskcxml`],"application/raml+yaml":[`raml`],"application/rdf+xml":[`rdf`,`owl`],"application/reginfo+xml":[`rif`],"application/relax-ng-compact-syntax":[`rnc`],"application/resource-lists+xml":[`rl`],"application/resource-lists-diff+xml":[`rld`],"application/rls-services+xml":[`rs`],"application/route-apd+xml":[`rapd`],"application/route-s-tsid+xml":[`sls`],"application/route-usd+xml":[`rusd`],"application/rpki-ghostbusters":[`gbr`],"application/rpki-manifest":[`mft`],"application/rpki-roa":[`roa`],"application/rsd+xml":[`rsd`],"application/rss+xml":[`rss`],"application/rtf":[`rtf`],"application/sbml+xml":[`sbml`],"application/scvp-cv-request":[`scq`],"application/scvp-cv-response":[`scs`],"application/scvp-vp-request":[`spq`],"application/scvp-vp-response":[`spp`],"application/sdp":[`sdp`],"application/senml+xml":[`senmlx`],"application/sensml+xml":[`sensmlx`],"application/set-payment-initiation":[`setpay`],"application/set-registration-initiation":[`setreg`],"application/shf+xml":[`shf`],"application/sieve":[`siv`,`sieve`],"application/smil+xml":[`smi`,`smil`],"application/sparql-query":[`rq`],"application/sparql-results+xml":[`srx`],"application/sql":[`sql`],"application/srgs":[`gram`],"application/srgs+xml":[`grxml`],"application/sru+xml":[`sru`],"application/ssdl+xml":[`ssdl`],"application/ssml+xml":[`ssml`],"application/swid+xml":[`swidtag`],"application/tei+xml":[`tei`,`teicorpus`],"application/thraud+xml":[`tfi`],"application/timestamped-data":[`tsd`],"application/toml":[`toml`],"application/trig":[`trig`],"application/ttml+xml":[`ttml`],"application/ubjson":[`ubj`],"application/urc-ressheet+xml":[`rsheet`],"application/urc-targetdesc+xml":[`td`],"application/voicexml+xml":[`vxml`],"application/wasm":[`wasm`],"application/watcherinfo+xml":[`wif`],"application/widget":[`wgt`],"application/winhlp":[`hlp`],"application/wsdl+xml":[`wsdl`],"application/wspolicy+xml":[`wspolicy`],"application/xaml+xml":[`xaml`],"application/xcap-att+xml":[`xav`],"application/xcap-caps+xml":[`xca`],"application/xcap-diff+xml":[`xdf`],"application/xcap-el+xml":[`xel`],"application/xcap-ns+xml":[`xns`],"application/xenc+xml":[`xenc`],"application/xfdf":[`xfdf`],"application/xhtml+xml":[`xhtml`,`xht`],"application/xliff+xml":[`xlf`],"application/xml":[`xml`,`xsl`,`xsd`,`rng`],"application/xml-dtd":[`dtd`],"application/xop+xml":[`xop`],"application/xproc+xml":[`xpl`],"application/xslt+xml":[`*xsl`,`xslt`],"application/xspf+xml":[`xspf`],"application/xv+xml":[`mxml`,`xhvml`,`xvml`,`xvm`],"application/yang":[`yang`],"application/yin+xml":[`yin`],"application/zip":[`zip`],"application/zip+dotlottie":[`lottie`],"audio/3gpp":[`*3gpp`],"audio/aac":[`adts`,`aac`],"audio/adpcm":[`adp`],"audio/amr":[`amr`],"audio/basic":[`au`,`snd`],"audio/midi":[`mid`,`midi`,`kar`,`rmi`],"audio/mobile-xmf":[`mxmf`],"audio/mp3":[`*mp3`],"audio/mp4":[`m4a`,`mp4a`,`m4b`],"audio/mpeg":[`mpga`,`mp2`,`mp2a`,`mp3`,`m2a`,`m3a`],"audio/ogg":[`oga`,`ogg`,`spx`,`opus`],"audio/s3m":[`s3m`],"audio/silk":[`sil`],"audio/wav":[`wav`],"audio/wave":[`*wav`],"audio/webm":[`weba`],"audio/xm":[`xm`],"font/collection":[`ttc`],"font/otf":[`otf`],"font/ttf":[`ttf`],"font/woff":[`woff`],"font/woff2":[`woff2`],"image/aces":[`exr`],"image/apng":[`apng`],"image/avci":[`avci`],"image/avcs":[`avcs`],"image/avif":[`avif`],"image/bmp":[`bmp`,`dib`],"image/cgm":[`cgm`],"image/dicom-rle":[`drle`],"image/dpx":[`dpx`],"image/emf":[`emf`],"image/fits":[`fits`],"image/g3fax":[`g3`],"image/gif":[`gif`],"image/heic":[`heic`],"image/heic-sequence":[`heics`],"image/heif":[`heif`],"image/heif-sequence":[`heifs`],"image/hej2k":[`hej2`],"image/ief":[`ief`],"image/jaii":[`jaii`],"image/jais":[`jais`],"image/jls":[`jls`],"image/jp2":[`jp2`,`jpg2`],"image/jpeg":[`jpg`,`jpeg`,`jpe`],"image/jph":[`jph`],"image/jphc":[`jhc`],"image/jpm":[`jpm`,`jpgm`],"image/jpx":[`jpx`,`jpf`],"image/jxl":[`jxl`],"image/jxr":[`jxr`],"image/jxra":[`jxra`],"image/jxrs":[`jxrs`],"image/jxs":[`jxs`],"image/jxsc":[`jxsc`],"image/jxsi":[`jxsi`],"image/jxss":[`jxss`],"image/ktx":[`ktx`],"image/ktx2":[`ktx2`],"image/pjpeg":[`jfif`],"image/png":[`png`],"image/sgi":[`sgi`],"image/svg+xml":[`svg`,`svgz`],"image/t38":[`t38`],"image/tiff":[`tif`,`tiff`],"image/tiff-fx":[`tfx`],"image/webp":[`webp`],"image/wmf":[`wmf`],"message/disposition-notification":[`disposition-notification`],"message/global":[`u8msg`],"message/global-delivery-status":[`u8dsn`],"message/global-disposition-notification":[`u8mdn`],"message/global-headers":[`u8hdr`],"message/rfc822":[`eml`,`mime`,`mht`,`mhtml`],"model/3mf":[`3mf`],"model/gltf+json":[`gltf`],"model/gltf-binary":[`glb`],"model/iges":[`igs`,`iges`],"model/jt":[`jt`],"model/mesh":[`msh`,`mesh`,`silo`],"model/mtl":[`mtl`],"model/obj":[`obj`],"model/prc":[`prc`],"model/step":[`step`,`stp`,`stpnc`,`p21`,`210`],"model/step+xml":[`stpx`],"model/step+zip":[`stpz`],"model/step-xml+zip":[`stpxz`],"model/stl":[`stl`],"model/u3d":[`u3d`],"model/vrml":[`wrl`,`vrml`],"model/x3d+binary":[`*x3db`,`x3dbz`],"model/x3d+fastinfoset":[`x3db`],"model/x3d+vrml":[`*x3dv`,`x3dvz`],"model/x3d+xml":[`x3d`,`x3dz`],"model/x3d-vrml":[`x3dv`],"text/cache-manifest":[`appcache`,`manifest`],"text/calendar":[`ics`,`ifb`],"text/coffeescript":[`coffee`,`litcoffee`],"text/css":[`css`],"text/csv":[`csv`],"text/html":[`html`,`htm`,`shtml`],"text/jade":[`jade`],"text/javascript":[`js`,`mjs`],"text/jsx":[`jsx`],"text/less":[`less`],"text/markdown":[`md`,`markdown`],"text/mathml":[`mml`],"text/mdx":[`mdx`],"text/n3":[`n3`],"text/plain":[`txt`,`text`,`conf`,`def`,`list`,`log`,`in`,`ini`],"text/richtext":[`rtx`],"text/rtf":[`*rtf`],"text/sgml":[`sgml`,`sgm`],"text/shex":[`shex`],"text/slim":[`slim`,`slm`],"text/spdx":[`spdx`],"text/stylus":[`stylus`,`styl`],"text/tab-separated-values":[`tsv`],"text/troff":[`t`,`tr`,`roff`,`man`,`me`,`ms`],"text/turtle":[`ttl`],"text/uri-list":[`uri`,`uris`,`urls`],"text/vcard":[`vcard`],"text/vtt":[`vtt`],"text/wgsl":[`wgsl`],"text/xml":[`*xml`],"text/yaml":[`yaml`,`yml`],"video/3gpp":[`3gp`,`3gpp`],"video/3gpp2":[`3g2`],"video/h261":[`h261`],"video/h263":[`h263`],"video/h264":[`h264`],"video/iso.segment":[`m4s`],"video/jpeg":[`jpgv`],"video/jpm":[`*jpm`,`*jpgm`],"video/mj2":[`mj2`,`mjp2`],"video/mp2t":[`ts`,`m2t`,`m2ts`,`mts`],"video/mp4":[`mp4`,`mp4v`,`mpg4`],"video/mpeg":[`mpeg`,`mpg`,`mpe`,`m1v`,`m2v`],"video/ogg":[`ogv`],"video/quicktime":[`qt`,`mov`],"video/webm":[`webm`]};Object.freeze(up);var dp=function(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)},fp,pp,mp,hp=class{constructor(...e){fp.set(this,new Map),pp.set(this,new Map),mp.set(this,new Map);for(let t of e)this.define(t)}define(e,t=!1){for(let[n,r]of Object.entries(e)){n=n.toLowerCase(),r=r.map(e=>e.toLowerCase());let e=dp(this,mp,`f`).get(n);e||(e=new Set,dp(this,mp,`f`).set(n,e));let i=!0;for(let a of r){let r=a.startsWith(`*`);if(a=r?a.slice(1):a,e.add(a),i&&dp(this,pp,`f`).set(n,a),i=!1,r)continue;let o=dp(this,fp,`f`).get(a);if(o&&o!=n&&!t)throw Error(`"${n} -> ${a}" conflicts with "${o} -> ${a}". Pass \`force=true\` to override this definition.`);dp(this,fp,`f`).set(a,n)}}return this}getType(e){if(typeof e!=`string`)return null;let t=e.replace(/^.*[/\\]/s,``).toLowerCase(),n=t.replace(/^.*\./s,``).toLowerCase(),r=t.length<e.length;return!(n.length<t.length-1)&&r?null:dp(this,fp,`f`).get(n)??null}getExtension(e){return typeof e==`string`?(e=e?.split?.(`;`)[0],(e&&dp(this,pp,`f`).get(e.trim().toLowerCase()))??null):null}getAllExtensions(e){if(typeof e!=`string`)return null;e=e.split(`;`)[0].trim().toLowerCase();let t=dp(this,mp,`f`).get(e);return t?new Set(t):null}_freeze(){return this.define=()=>{throw Error(`define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances`)},Object.freeze(this),this}_getTestState(){return{types:dp(this,fp,`f`),extensions:dp(this,pp,`f`)}}};fp=new WeakMap,pp=new WeakMap,mp=new WeakMap,new hp(up)._freeze();var gp=new hp(up,{"application/vnd.ms-excel":[`xls`,`xlm`,`xla`,`xlc`,`xlt`,`xlw`],"application/vnd.ms-powerpoint":[`ppt`,`pps`,`pot`],"application/vnd.oasis.opendocument.presentation":[`odp`],"application/vnd.oasis.opendocument.spreadsheet":[`ods`],"application/vnd.oasis.opendocument.text":[`odt`],"application/vnd.openxmlformats-officedocument.presentationml.presentation":[`pptx`],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":[`xlsx`],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":[`docx`],"audio/vnd.dece.audio":[`uva`,`uvva`],"audio/vnd.digital-winds":[`eol`],"audio/vnd.dra":[`dra`],"audio/vnd.dts":[`dts`],"audio/vnd.dts.hd":[`dtshd`],"audio/vnd.lucent.voice":[`lvp`],"audio/vnd.ms-playready.media.pya":[`pya`],"audio/vnd.nuera.ecelp4800":[`ecelp4800`],"audio/vnd.nuera.ecelp7470":[`ecelp7470`],"audio/vnd.nuera.ecelp9600":[`ecelp9600`],"audio/vnd.rip":[`rip`],"audio/x-aac":[`*aac`],"audio/x-aiff":[`aif`,`aiff`,`aifc`],"audio/x-caf":[`caf`],"audio/x-flac":[`flac`],"audio/x-m4a":[`*m4a`],"audio/x-matroska":[`mka`],"audio/x-mpegurl":[`m3u`],"audio/x-ms-wax":[`wax`],"audio/x-ms-wma":[`wma`],"audio/x-pn-realaudio":[`ram`,`ra`],"audio/x-pn-realaudio-plugin":[`rmp`],"audio/x-realaudio":[`*ra`],"audio/x-wav":[`*wav`],"image/prs.btif":[`btif`,`btf`],"image/prs.pti":[`pti`],"image/vnd.adobe.photoshop":[`psd`],"image/vnd.airzip.accelerator.azv":[`azv`],"image/vnd.blockfact.facti":[`facti`],"image/vnd.dece.graphic":[`uvi`,`uvvi`,`uvg`,`uvvg`],"image/vnd.djvu":[`djvu`,`djv`],"image/vnd.dvb.subtitle":[`*sub`],"image/vnd.dwg":[`dwg`],"image/vnd.dxf":[`dxf`],"image/vnd.fastbidsheet":[`fbs`],"image/vnd.fpx":[`fpx`],"image/vnd.fst":[`fst`],"image/vnd.fujixerox.edmics-mmr":[`mmr`],"image/vnd.fujixerox.edmics-rlc":[`rlc`],"image/vnd.microsoft.icon":[`ico`],"image/vnd.ms-dds":[`dds`],"image/vnd.ms-modi":[`mdi`],"image/vnd.ms-photo":[`wdp`],"image/vnd.net-fpx":[`npx`],"image/vnd.pco.b16":[`b16`],"image/vnd.tencent.tap":[`tap`],"image/vnd.valve.source.texture":[`vtf`],"image/vnd.wap.wbmp":[`wbmp`],"image/vnd.xiff":[`xif`],"image/vnd.zbrush.pcx":[`pcx`],"image/x-3ds":[`3ds`],"image/x-adobe-dng":[`dng`],"image/x-cmu-raster":[`ras`],"image/x-cmx":[`cmx`],"image/x-freehand":[`fh`,`fhc`,`fh4`,`fh5`,`fh7`],"image/x-icon":[`*ico`],"image/x-jng":[`jng`],"image/x-mrsid-image":[`sid`],"image/x-ms-bmp":[`*bmp`],"image/x-pcx":[`*pcx`],"image/x-pict":[`pic`,`pct`],"image/x-portable-anymap":[`pnm`],"image/x-portable-bitmap":[`pbm`],"image/x-portable-graymap":[`pgm`],"image/x-portable-pixmap":[`ppm`],"image/x-rgb":[`rgb`],"image/x-tga":[`tga`],"image/x-xbitmap":[`xbm`],"image/x-xpixmap":[`xpm`],"image/x-xwindowdump":[`xwd`],"text/prs.lines.tag":[`dsc`],"text/vnd.curl":[`curl`],"text/vnd.curl.dcurl":[`dcurl`],"text/vnd.curl.mcurl":[`mcurl`],"text/vnd.curl.scurl":[`scurl`],"text/vnd.dvb.subtitle":[`sub`],"text/vnd.familysearch.gedcom":[`ged`],"text/vnd.fly":[`fly`],"text/vnd.fmi.flexstor":[`flx`],"text/vnd.graphviz":[`gv`],"text/vnd.in3d.3dml":[`3dml`],"text/vnd.in3d.spot":[`spot`],"text/vnd.sun.j2me.app-descriptor":[`jad`],"text/vnd.wap.wml":[`wml`],"text/vnd.wap.wmlscript":[`wmls`],"text/x-asm":[`s`,`asm`],"text/x-c":[`c`,`cc`,`cxx`,`cpp`,`h`,`hh`,`dic`],"text/x-component":[`htc`],"text/x-fortran":[`f`,`for`,`f77`,`f90`],"text/x-handlebars-template":[`hbs`],"text/x-java-source":[`java`],"text/x-lua":[`lua`],"text/x-markdown":[`mkd`],"text/x-nfo":[`nfo`],"text/x-opml":[`opml`],"text/x-org":[`*org`],"text/x-pascal":[`p`,`pas`],"text/x-processing":[`pde`],"text/x-sass":[`sass`],"text/x-scss":[`scss`],"text/x-setext":[`etx`],"text/x-sfv":[`sfv`],"text/x-suse-ymp":[`ymp`],"text/x-uuencode":[`uu`],"text/x-vcalendar":[`vcs`],"text/x-vcard":[`vcf`],"video/vnd.dece.hd":[`uvh`,`uvvh`],"video/vnd.dece.mobile":[`uvm`,`uvvm`],"video/vnd.dece.pd":[`uvp`,`uvvp`],"video/vnd.dece.sd":[`uvs`,`uvvs`],"video/vnd.dece.video":[`uvv`,`uvvv`],"video/vnd.dvb.file":[`dvb`],"video/vnd.fvt":[`fvt`],"video/vnd.mpegurl":[`mxu`,`m4u`],"video/vnd.ms-playready.media.pyv":[`pyv`],"video/vnd.uvvu.mp4":[`uvu`,`uvvu`],"video/vnd.vivo":[`viv`],"video/x-f4v":[`f4v`],"video/x-fli":[`fli`],"video/x-flv":[`flv`],"video/x-m4v":[`m4v`],"video/x-matroska":[`mkv`,`mk3d`,`mks`],"video/x-mng":[`mng`],"video/x-ms-asf":[`asf`,`asx`],"video/x-ms-vob":[`vob`],"video/x-ms-wm":[`wm`],"video/x-ms-wmv":[`wmv`],"video/x-ms-wmx":[`wmx`],"video/x-ms-wvx":[`wvx`],"video/x-msvideo":[`avi`],"video/x-sgi-movie":[`movie`],"video/x-smv":[`smv`]})._freeze(),_p=[`image`,`video`,`audio`],vp=[`image`,`video`],yp=e=>/\.pdf$/i.test(e),bp=e=>vp.includes(e.kind)||yp(e.name),Zae=[..._p,`document`,`other`],Qae=/\.(?:csv|docx?|odp|ods|odt|pdf|pptx?|rtf|xlsx?)$/i,$ae=/^(?<type>image|video|audio)\//,xp=e=>_p.includes(e),Sp=(e,t)=>{let n=gp.getType(t);return xp(e)||n===`application/pdf`||!!n&&Hc(n)},Cp=e=>Sp(e.kind,e.path),wp=e=>{if(!e)return;let[t,n]=e.split(`/`);if(xp(t)&&n&&!n.startsWith(`x-`))return t},Tp=e=>{if(e.startsWith(`data:`))return wp(e.slice(5).split(/[;,]/)[0]);if(zc(e)){let{hostname:t,pathname:n}=new URL(e);if(t.startsWith(`images.`))return`image`;e=n}return wp(gp.getType(e)??``)},eoe=async e=>{if(typeof e==`string`){if(!e.startsWith(`blob:`))return Tp(e);try{return wp((await(await fetch(e)).blob()).type)}catch{return}}if(e instanceof Blob)return wp(e.type)},toe=e=>{let t=gp.getType(e.path);return!!t&&Hc(t)},Ep=e=>gp.getType(e)?.match($ae)?.groups?.type??(Qae.test(e)?`document`:`other`),Dp=tl([]),Op=rl(()=>Dp.current.some(({workflow:e})=>e)?Dp.current.filter(({workflow:e})=>!e):Dp.current),kp=tl([]),noe=rl(()=>new Set(kp.current.map(e=>e.path))),Ap=tl(),roe=rl(()=>kp.current.length?[...kp.current]:Ap.current?[Ap.current]:[]),jp=tl(),Mp=tl({folder:void 0,files:[]}),Np=tl(),Pp=tl(),Fp=/^(?:.+\/)?(\.git(?:attributes|ignore|keep))$/,Ip=tl([]),Lp=({arrayIndex:e},t)=>e===void 0?t:`${t}#${e}`,ioe=({entries:e,previous:t,changedPaths:n})=>{if(!t.length)return e;let r=new Map(t.flatMap(e=>Object.values(e.locales).map(({path:t})=>[Lp(e,t),e]))),i=new Set;return e.map(e=>{let t=Object.values(e.locales).map(({path:e})=>e),a=t.map(t=>r.get(Lp(e,t))).find(e=>!!e&&!i.has(e));if(!a)return e;i.add(a);let o=Object.values(a.locales).map(({path:e})=>e);return t.length===o.length&&t.every(e=>o.includes(e)&&!n.has(e))?a:{...e,id:a.id}})},aoe=({assets:e,previous:t,changedPaths:n})=>{if(!t.length)return e;let r=new Map(t.map(e=>[e.path,e])),i=new Set(e.map(({path:e})=>e)),a=(e,t)=>{let{workflow:n}=e;return n.replacedAsset===t?e:{...e,workflow:{...n,replacedAsset:t}}};return[...e.map(e=>{let t=r.get(e.path),i=t?.workflow?t.workflow.replacedAsset:t,o=i&&!n.has(e.path)?i:e;return t?.workflow?a(t,o):o}),...t.filter(({path:e,workflow:t})=>!!t&&!i.has(e)).map(e=>a(e,void 0))]},Rp=tl(!1),zp=tl(),Bp=tl([]),Vp=tl([]),ooe=Bl(()=>Vp.current,e=>{let t=new Map;return e.forEach((e,n)=>{Object.values(e.locales).forEach(({path:r})=>{t.has(r)||t.set(r,{entry:e,index:n})})}),t}),Hp=e=>{let t=ooe(),n;return[...e].forEach(e=>{let r=t.get(e);r&&(!n||r.index<n.index)&&(n=r)}),n?.entry},Up=tl([]),Wp=(e,t)=>{let n=typeof e==`string`?Kf(e):e;if(n&&`_fileMap`in n&&Object.hasOwn(n._fileMap,t))return n._fileMap[t]},Gp=(e,t)=>{let n=Kf(e);if(!n)return;let r=t?Wp(n,t):void 0;if(!t||r)return{collection:n,collectionFile:r}},Kp=e=>e.label||e.name,qp=(e,t)=>`_fileMap`in e?Object.values(e._fileMap).filter(({file:e,_file:n,_i18n:r})=>Object.entries(t.locales).some(([t,{path:i}])=>i===(t===r.defaultLocale?n.fullPath:Af({_i18n:r,locale:t,path:Lc(e)})))):[],Jp=(e,t)=>{let n=Bp.current.find(({collectionName:n,fileName:r})=>n===e&&r===t);if(n?.filePathMap)return Hp(Object.values(n.filePathMap))},Yp=(e,t)=>{if(e&&t){let{collections:n,singletons:r}=Dl.current;if(e===`_singletons`)return Array.isArray(r)?Nd(r).findIndex(e=>e.name===t):-1;let i=Gf({collections:n}).find(({name:t})=>t===e);if(i&&`files`in i)return i.files.findIndex(({name:e})=>e===t)}return-1},Xp=(e,t)=>t&&e[t]?t:Object.keys(e)[0],Zp=(e,{locale:t,defaultLocale:n}={})=>(t?e.locales[t]:void 0)??e.locales[Xp(e.locales,n)],Qp=(e,{includePrevious:t=!1}={})=>[...new Set([...Object.values(e.locales).map(({path:e})=>e),...t&&e.workflow?.previousPaths||[]])],$p=(e,{basePath:t,fullPathRegEx:n}={})=>{let r=n?e.match(n)?.groups?.subPath:void 0;if(r!==void 0)return eu(r);let i=Lc(t??``);return eu(Cf(i)?Jie(e,i):nu(e,i))},soe=({collectionName:e,fileName:t})=>{let n=Kf(e),{structureMap:r}=((n&&t?Wp(n,t):void 0)??n)?._i18n??{};return!!(r?.i18nMultiFile||r?.i18nMultiFolder||r?.i18nMultiRootFolder)},coe=({entryFiles:e,previous:t,changedPaths:n})=>{let r=new Set(e.map(({path:e})=>e)),i=new Map,a=new Set;t.forEach(e=>{Qp(e).forEach(t=>{i.has(t)&&a.add(t),i.set(t,e)})});let o=({path:e},t)=>{let o=i.get(e);if(!o||n.has(e)||a.has(e))return;let s=Qp(o);if(t||s.length===1&&s[0]===e)return s.every(e=>r.has(e)&&!n.has(e)&&!a.has(e))?o:void 0},s=new Map,c=[],l=new Map,u=new Map;return e.forEach(e=>{let{collectionName:t,fileName:n}=e.folder,r=`${t}\n${n??``}`,i=l.get(r);i===void 0&&(i=soe(e.folder),l.set(r,i));let a=o(e,i);if(i){let n=u.get(t)??[];n.push({file:e,entry:a}),u.set(t,n)}else a?s.set(e.path,a):c.push(e)}),u.forEach(e=>{e.every(({entry:e})=>!!e)?e.forEach(({file:e,entry:t})=>{s.set(e.path,t)}):c.push(...e.map(({file:e})=>e))}),{reusedEntries:s,dirtyFiles:c}},loe=({entryFiles:e,reusedEntries:t,parsedEntries:n})=>{let r=new Map;n.forEach(e=>{Qp(e).forEach(t=>{Nl(r,t,()=>[]).push(e)})});let i=new Set;return e.forEach(({path:e})=>{let n=t.get(e);(n?[n]:r.get(e)??[]).forEach(e=>{i.add(e)})}),[...i]},em=e=>Fc(e).replaceAll(`\\*`,`\\d+`),tm=(e,t)=>e===t||e.startsWith(`${t}.`),nm=new WeakMap,uoe=e=>{let t=nm.get(e);return t||(t=Object.keys(e).map((e,t)=>[e,t]).sort(([e],[t])=>e<t?-1:1),nm.set(e,t)),t},rm=(e,t,{live:n=!1}={})=>{if(n)return Object.keys(e).filter(e=>e.startsWith(t));let r=uoe(e),i=0,a=r.length;for(;i<a;){let e=Math.floor((i+a)/2);r[e][0]<t?i=e+1:a=e}let o=[];for(let e=i;e<r.length&&r[e][0].startsWith(t);e+=1)o.push(r[e]);return o.sort(([,e],[,t])=>e-t).map(([e])=>e)},im=/\.\d+$/,am=/^(?<parent>.+)\.\d+$/,om=new WeakMap,sm=(e,t,{live:n=!1}={})=>{if(n)return Object.keys(e).filter(e=>e.match(am)?.groups?.parent===t);let r=om.get(e);return r||(r=new Map,Object.keys(e).forEach(e=>{let{parent:t}=e.match(am)?.groups??{};if(t===void 0)return;let n=r.get(t);n?n.push(e):r.set(t,[e])}),om.set(e,r)),r.get(t)??[]};function cm(e){return e&&e.constructor&&typeof e.constructor.isBuffer==`function`&&e.constructor.isBuffer(e)}function lm(e){return e}function doe(e,t){t||={};let n=t.delimiter||`.`,r=t.maxDepth,i=t.transformKey||lm,a={};function o(e,s,c){c||=1,Object.keys(e).forEach(function(l){let u=e[l],d=t.safe&&Array.isArray(u),f=Object.prototype.toString.call(u),p=cm(u),m=f===`[object Object]`||f===`[object Array]`,h=s?s+n+i(l):i(l);if(!d&&!p&&m&&Object.keys(u).length&&(!t.maxDepth||c<r))return o(u,h,c+1);a[h]=u})}return o(e),a}function um(e,t){t||={};let n=t.delimiter||`.`,r=t.overwrite||!1,i=t.transformKey||lm,a={};if(cm(e)||Object.prototype.toString.call(e)!==`[object Object]`)return e;function o(e){let n=Number(e);return isNaN(n)||e.indexOf(`.`)!==-1||t.object?e:n}function s(e,t,r){return Object.keys(r).reduce(function(t,i){return t[e+n+i]=r[i],t},t)}function c(e){let t=Object.prototype.toString.call(e),n=t===`[object Array]`,r=t===`[object Object]`;if(!e)return!0;if(n)return!e.length;if(r)return!Object.keys(e).length}return e=Object.keys(e).reduce(function(n,r){let i=Object.prototype.toString.call(e[r]);return i!==`[object Object]`&&i!==`[object Array]`||c(e[r])?(n[r]=e[r],n):s(r,n,doe(e[r],t))},{}),Object.keys(e).forEach(function(s){let c=s.split(n).map(i),l=o(c.shift()),u=o(c[0]),d=a;for(;u!==void 0;){if(l===`__proto__`)return;let e=Object.prototype.toString.call(d[l]),n=e===`[object Object]`||e===`[object Array]`;if(!r&&!n&&d[l]!==void 0)return;(r&&!n||!r&&d[l]==null)&&(d[l]=typeof u==`number`&&!t.object?[]:{}),d=d[l],c.length>0&&(l=o(c.shift()),u=o(c[0]))}d[l]=um(e[s],t)}),a}var foe=``,poe=``,moe=/[.\uE000\uE001]/g,hoe=/\uE001([\uE000\uE001])|\uE000/g,dm=/[\uE000\uE001]/,fm=`\0`,pm=/^(?:0|[1-9]\d*)$/,mm=e=>!Number.isNaN(Number(e))&&!pm.test(e),goe=e=>mm(e)?`${fm}${e}`:e,hm=e=>X(e)&&[Object.prototype,null].includes(Object.getPrototypeOf(e)),gm=e=>Array.isArray(e)?(e.forEach((t,n)=>{e[n]=gm(t)}),e):hm(e)?Object.fromEntries(Object.entries(e).map(([e,t])=>[e.startsWith(fm)?e.slice(1):e,gm(t)])):e,_m=e=>e.includes(`.`)||dm.test(e)?e.replace(moe,e=>e===`.`?foe:`${poe}${e}`):e,vm=e=>dm.test(e)?e.replace(hoe,(e,t)=>t??`.`):e,ym=e=>[`[object Object]`,`[object Array]`].includes(Object.prototype.toString.call(e))&&!!Object.keys(e).length,_oe=e=>Object.prototype.toString.call(e)===`[object Object]`&&Object.keys(e).some(e=>pm.test(e)),voe=(e,t)=>{let n=`${t}.`;return Object.keys(e).some(e=>e.startsWith(n)&&pm.test(e.slice(n.length).split(`.`)[0]))},bm=(e,t)=>{let n={},r=(e,t)=>{t!==void 0&&_oe(e)&&(n[t]={}),Object.entries(e).forEach(([e,i])=>{let a=_m(e),o=t===void 0?a:`${t}.${a}`;ym(i)?r(i,o):n[o]=i})};return ym(e)?r(e,t):t!==void 0&&(n[t]=e),n},yoe=e=>goe(vm(e)),xm=e=>{let t=Object.entries(e);return t.some(([,e])=>ym(e))?xm(Object.fromEntries(t.flatMap(([e,t])=>ym(t)?Object.entries(bm(t,e)):[[e,t]]))):t.some(([e])=>dm.test(e)||e.split(`.`).some(mm))?gm(um(e,{transformKey:yoe})):um(e)},Sm=e=>e?xm(Object.fromEntries(Object.entries(e).sort(([e],[t])=>Bc(e,t)))):um(e),Cm=e=>e==null||e===``||Array.isArray(e)&&!e.length||hm(e)&&!Object.keys(e).length,wm=e=>Array.isArray(e)&&!e.length||X(e)&&!Object.keys(e).length,Tm=(e,t)=>({[e]:Array.isArray(t)?[]:{},...bm(t,e)}),Em=(e,t,{live:n=!1}={})=>{let r=rm(e,`${t}.`,{live:n});if(!r.length)return;let i=r.map(n=>[`_${n.slice(t.length)}`,e[n]]),a=e[t];return wm(a)&&i.push([`_`,a]),Sm(Object.fromEntries(i))._},boe=e=>typeof e==`object`&&e?Array.isArray(e)?`\0[]`:`\0{}`:e,Dm=(e,t,n)=>{let r=rm(t,`${n}.`),i=[...r,n].map(e=>boe(t[e])),a=e.keys,o=e.values;return e.keyPath===n&&a.length===r.length&&r.every((e,t)=>e===a[t])&&i.every((e,t)=>e===o[t])||Object.assign(e,{keyPath:n,keys:r,values:i,subtree:Em(t,n)}),e.subtree},Om=(e,t)=>{Object.keys(e).forEach(n=>{tm(n,t)&&delete e[n]})},xoe=(e,t,n)=>{Om(e,t),Object.assign(e,Tm(t,n))},km=e=>!!e&&`type`in e&&e.type===`inline`,Soe=({source:e,flags:t})=>new RegExp(e.startsWith(`^`)?e.slice(1):e,t.replace(/[gy]/g,``)),Coe=e=>{let{id:t,label:n,icon:r,pattern:i,trigger:a,toPreview:o,onInsert:s,onEdit:c}=e,{fromBlock:l,toBlock:u}=e,d=e.fromInline??l,f=e.toInline??u;return{id:t,label:n,icon:r,fields:[],pattern:Soe(i),fromBlock:d,toBlock:f,toPreview:o,inlinePattern:{trigger:a||void 0,onInsert:s,onEdit:c}}},woe=new WeakMap,Toe=(e,t)=>{let n=t?`sticky`:`global`,r=Nl(woe,e,()=>({}));return r[n]??=new RegExp(e.source,`${e.flags}${t?`y`:`g`}`),r[n]},Am=(e,t,{trigger:n}={},r=1/0)=>{let i=Toe(t,!!n),a=[],o=n?e.indexOf(n):0;for(;o!==-1&&a.length<r;){i.lastIndex=o;let t=i.exec(e);if(!t&&!n)break;let r;t?.[0]?(a.push(t),r=t.index+t[0].length):r=(t?.index??o)+1,o=n?e.indexOf(n,r):r<=e.length?r:-1}return a},Eoe=(e,t)=>Object.assign(new RegExp(e),{[Symbol.match]:n=>Am(n,e,t,1)[0]??null}),jm=e=>e.startsWith(`__sc_`),Mm=({multiline:e,dotAll:t,source:n})=>e||t||n.includes(`[\\s\\S]`)||n.includes(`[\\S\\s]`),Nm=({pattern:e,inlinePattern:t})=>!!t||!Mm(e),Doe=e=>{let t=[],n=0,r=``,i=0,a=!1;return[...e,`,`].forEach((o,s)=>{r?o===r&&(r=``):n===0&&o===`,`?(t.push(e.slice(i,s).trim()),i=s+1,a=!1):n===0&&/[\s>+~]/.test(o)?a=!0:(a&&=(i=s,!1),o===`"`||o===`'`?r=o:o===`(`||o===`[`?n+=1:(o===`)`||o===`]`)&&--n)}),t},Pm=e=>{let t=Doe(e).map(e=>/^[a-z][a-z\d-]*(?![\w-])/i.exec(e)?.[0].toLowerCase()??``);return t.every(Boolean)?[...new Set(t)]:void 0},Ooe=e=>{try{return document.createDocumentFragment().querySelector(e),!0}catch{return!1}},Fm=({htmlSelector:e,fromBlockHTML:t,toBlockHTML:n})=>typeof e==`string`&&typeof t==`function`&&typeof n==`function`,Im=e=>xm(Object.fromEntries(Object.entries(bm(e)).filter(([e])=>!jm(e.split(`.`).pop())))),koe=e=>{let t=e?.parentElement?.closest(`[data-component-path]`);return t?JSON.parse(t.dataset.componentPath):[]},Aoe=(e,t)=>{let n=e?.closest(`[role="textbox"]`);if(!n)return;let r=()=>{t(n.getAttribute(`aria-readonly`)===`true`)},i=new MutationObserver(r);return r(),i.observe(n,{attributes:!0,attributeFilter:[`aria-readonly`]}),i},Lm=(e,t)=>{let n,r=window.requestAnimationFrame(()=>{n=Aoe(e,t)});return()=>{window.cancelAnimationFrame(r),n?.disconnect()}},Rm=e=>e.replace(/\\([!-/:-@[-`{-~])/g,`$1`),joe=e=>e.replace(/\\(?=[!-/:-@[-`{-~]|$)/g,`\\\\`).replace(/"/g,`\\"`),Moe=e=>e.replace(/\\(?=[!-/:-@[-`{-~]|$)/g,`\\\\`).replace(/[[\]]/g,`\\$&`),Noe=[String.raw`(?:[^\][\\!]|\\(?!!\[).|!(?!\[)`,String.raw`|\[(?:[^\][\\!]|\\(?!!\[).|!(?!\[))*\])*`].join(``),Poe=[String.raw`(?:[^"()\\!]|\\(?!!\[).|!(?!\[)`,String.raw`|\((?:[^)!]|!(?!\[))*\)|"(?:[^"!]|!(?!\[))*")*?`].join(``),zm=e=>String.raw`(?:[^${e}\\!]|\\(?!!\[).|!(?!\[))*`,Bm=(e=``)=>[String.raw`!\[(?<alt${e}>${Noe})\]\((?<src${e}>${Poe})`,String.raw`(?:(?<![^\\]\s)\s+(?:"(?<title${e}>${zm(`"`)})"`,String.raw`|'(?<singleQuotedTitle${e}>${zm(`'`)})'))?\)`].join(``),Vm=new RegExp(Bm()),Hm=new RegExp(String.raw`\[${Bm(`2`)}\](?:\((?<link>[^()]*(?:\([^)]*\)[^)]*|\([^)]*)?)\))`),Um=RegExp(`${Vm.source}|${Hm.source}`),Wm=String.raw`(?:\s+[^\s"'<>=/]+(?:="[^"]*")?)*\s*`,Gm=String.raw`<img${Wm}\/?>`,Foe=({linked:e=!1}={})=>{let t=e?String.raw`(?:<a${Wm}>${Gm}<\/a>|${Gm})`:Gm;return[String.raw`<figure>(?<figureContent>${t})`,String.raw`<figcaption>(?<caption>(?:[^<\n]|<(?!\/fig(?:caption|ure)>))*)<\/figcaption>`,String.raw`<\/figure>`].join(``)},Ioe={ALLOWED_URI_REGEXP:/^(?:(?:(?:f|ht)tps?|mailto|tel|blob):|[^a-z]|[a-z+.-]+(?:[^a-z+.\-:]|$))/i,ADD_TAGS:[`iframe`],ADD_ATTR:[`allow`,`allowfullscreen`,`referrerpolicy`,`sandbox`],FORBID_TAGS:[`style`,`form`,`input`,`button`,`textarea`,`select`,`option`]},Loe=[`color`,`background-color`,`font-style`,`font-weight`,`text-decoration`,`text-decoration-line`,`text-decoration-style`,`text-decoration-color`,`text-decoration-thickness`,`text-align`,`text-align-all`,`text-align-last`,`width`,`height`,`max-width`,`max-height`],Roe=e=>{let{style:t}=e;Array.from(t).filter(e=>!Loe.includes(e)).forEach(e=>{t.removeProperty(e)}),t.length||e.removeAttribute(`style`)},zoe=[`allow-forms`,`allow-orientation-lock`,`allow-pointer-lock`,`allow-popups`,`allow-presentation`,`allow-same-origin`,`allow-scripts`,`allow-storage-access-by-user-activation`],Boe=[`accelerometer`,`autoplay`,`clipboard-write`,`encrypted-media`,`fullscreen`,`gyroscope`,`picture-in-picture`,`web-share`],Voe=e=>{let t=e.getAttribute(`allow`);if(t===null)return;let n=t.split(`;`).map(e=>e.trim()).filter(e=>Boe.includes(e.split(/\s+/)[0].toLowerCase()));n.length?e.setAttribute(`allow`,n.join(`; `)):e.removeAttribute(`allow`)},Hoe=e=>{let t=e.getAttribute(`src`)?.trim()||``;if(!t.startsWith(`https://`))return!1;try{let e=new URL(t),n=typeof window<`u`&&window.location?window.location.origin:``;if(n&&e.origin===n)return!1}catch{return!1}let n=e.getAttribute(`sandbox`)||``,r=new Set(n.toLowerCase().split(/\s+/).filter(e=>zoe.includes(e)));return r.add(`allow-scripts`),r.add(`allow-same-origin`),e.setAttribute(`sandbox`,Array.from(r).join(` `)),Voe(e),!0},Km=(e,t={})=>{let n=dt(e,{...Ioe,...t,RETURN_DOM:!0});return Array.from(n.querySelectorAll(`iframe`)).forEach(e=>{Hoe(e)||e.remove()}),n.querySelectorAll(`[style]`).forEach(e=>{Roe(e)}),n.innerHTML},qm=e=>({src:e.getAttribute(`src`)??``,alt:e.getAttribute(`alt`)??``,title:e.getAttribute(`title`)??``}),Uoe=({src:e=``,alt:t=``,title:n=``})=>{if(!e)return``;let r=document.createElement(`img`);return r.setAttribute(`src`,e),r.setAttribute(`alt`,t),n&&r.setAttribute(`title`,n),r},Woe=({src:e=``,alt:t=``,title:n=``})=>e?`![${Moe(t)}](${e}${n?` "${joe(n)}"`:``})`:``,Goe=({src:e=``,alt:t=``,title:n=``})=>`<img src="${Gu(e)}" alt="${Gu(t)}" title="${Gu(n)}">`,Jm=(e,{linked:t=!1}={})=>{let[n,r,...i]=e.children,a=[...e.childNodes].some(e=>e.nodeType===Node.TEXT_NODE&&!!e.textContent?.trim());if(!n||r?.localName!==`figcaption`||i.length||a)return;let o=t&&n.localName===`a`&&n.children.length===1&&!n.textContent?.trim()?n:void 0,s=o?o.children[0]:n;if(s.localName!==`img`)return;let c={...qm(s),caption:r.innerHTML.trim()};return t?{...c,link:o?.getAttribute(`href`)??``}:c},Koe=(e,t,{linked:n=!1}={})=>{if(e.groups?.figureContent===void 0)return t(e);let{body:r}=new DOMParser().parseFromString(e[0],`text/html`);return{...Jm(r.firstElementChild,{linked:n}),caption:e.groups.caption}},Ym=({src:e=``,alt:t=``,title:n=``,link:r=``,caption:i=``})=>{let a=`<img src="${Gu(e)}" alt="${Gu(t)}"${n?` title="${Gu(n)}"`:``}>`;return[`<figure>`,r?`<a href="${Gu(r)}">${a}</a>`:a,`<figcaption>${String(i).replace(/\s*\n\s*/g,` `)}</figcaption>`,`</figure>`].join(``)},qoe=(e,t)=>{let n=document.createElement(`figure`),r=document.createElement(`figcaption`),i=document.createElement(`template`);return i.innerHTML=Km(t),r.append(i.content),n.append(e,r),n},Joe={image:`Image`,src:`Source`,alt:`Alt Text`,title:`Title`,link:`Link`,caption:`Caption`},Yoe=({groups:e})=>{let{src:t,alt:n,title:r=e?.singleQuotedTitle}=e??{};return{src:t,alt:n&&Rm(n),title:r&&Rm(r)}},Xoe=({groups:e})=>{let{src:t,alt:n,title:r,singleQuotedTitle:i,src2:a,alt2:o,title2:s,singleQuotedTitle2:c,link:l}=e??{};return{src:(t||a||``).trim(),alt:Rm(n||o||``).trim(),title:Rm(r||i||s||c||``).trim(),link:(l||``).trim()}},Xm=({linked:e,getLabel:t})=>({id:e?`linked-image`:`image`,label:t(`image`),fields:[{name:`src`,label:t(`src`),widget:`image`},{name:`alt`,label:t(`alt`),required:!1},{name:`title`,label:t(`title`),required:!1},...e?[{name:`link`,label:t(`link`),required:!1}]:[],{name:`caption`,label:t(`caption`),required:!1}],pattern:new RegExp([Foe({linked:e}),(e?Um:Vm).source].join(`|`)),fromBlock:t=>Koe(t,e?Xoe:Yoe,{linked:e}),toBlock:t=>{let n=e?t.link??``:``,r=Woe(t);return r&&t.caption?Ym({...t,link:n}):r&&n?`[${r}](${n})`:r},toPreview:t=>{let n=e?t.link??``:``;if(t.src&&t.caption)return Ym({...t,link:n});let r=Goe(t);return n?`<a href="${Gu(n)}">${r}</a>`:r},htmlSelector:e?`figure, a:has(> img:only-child), img`:`figure, img`,fromBlockHTML:t=>{if(t.localName===`figure`)return Jm(t,{linked:e});if(t.localName===`img`)return e?{...qm(t),link:``}:qm(t);if(!t.textContent?.trim())return{...qm(t.querySelector(`img`)),link:t.getAttribute(`href`)??``}},toBlockHTML:t=>{let n=e?t.link??``:``,r=Uoe(t);if(!r)return r;let i=r;return n&&(i=document.createElement(`a`),i.setAttribute(`href`,n),i.append(r)),t.caption?qoe(i,t.caption):i}}),Zm=e=>Joe[e];Xm({linked:!1,getLabel:Zm}),Xm({linked:!0,getLabel:Zm});var Zoe=e=>Y(`editor_components.${e}`),Qoe=()=>[!1,!0].map(e=>({...Xm({linked:e,getLabel:Zoe}),icon:`image`,trigger:`button`,createMarkdown:()=>`![]()`})),Qm=e=>{if(!e)return;if(Bd.has(e))return e;let t=e.replace(/^x-/,``);return t!==e&&Bd.has(t)?t:void 0},$m=e=>{let t=Qm(e);if(t){let e=Bd.get(t),n=km(e)?Coe(e):e;return{...n,id:`x-${t}`,label:n.label??t}}return Qoe().find(({id:t})=>t===e)},$oe=/^\d+$/,eh=e=>$oe.test(e),th=e=>Number.isInteger(e)?e:Number(e.toPrecision(15)),nh=(e,t)=>{let[n,r=`0`]=String(e).split(`e`);return Number(`${n}e${Number(r)+t}`)},rh=(e,t)=>{if(typeof e!=`number`)return NaN;if(!Number.isFinite(e))return e;let n=Math.abs(th(e)),r=nh(Math.round(nh(n,t)),-t);return Math.sign(e)*r+0},ese=/^(.*?)<([^>]+)>(.*)$/,ih=new Map,ah=(e,t)=>{if(e.length!==1)return!1;let[n]=e;return n.widget===t&&`root`in n&&n.root===!0},oh=e=>{let t=e.widget??`string`;return Ld.includes(t)?Hf(e):zd.includes(t)?!!e.multiple:!1},sh=e=>{let t=e.match(ese);if(!t)return{cleanKey:e};let[,n,r,i]=t;return i?{cleanKey:e}:{cleanKey:n||``,typeName:r}},tse=({field:e,key:t,keyPathArray:n,segmentIndex:r,pendingExplicitType:i,valueMap:a})=>{let{cleanKey:o,typeName:s}=sh(t),{widget:c=`text`}=e,l=s??i,u=eh(o),d=o===`*`;if((u||d)&&zd.includes(c))return{field:oh(e)?e:void 0,explicitType:l};let{field:f}=e,{fields:p}=e,{types:m,typeKey:h=`type`}=e;if(f){let e=u||d?n[r+1]:void 0;return{field:!e||f.name===e||f.widget===`object`&&`fields`in f&&f.fields?.some(t=>t.name===e)?f:void 0,explicitType:l}}if(p&&(u||d))return{field:e,explicitType:l};if(p&&!u&&o!==``)return{field:p.find(({name:e})=>e===o),explicitType:l};if(m&&(u||d)){let e=l??a[[n.slice(0,r).join(`.`),o,h].join(`.`)];return{field:m.find(({name:t})=>t===e),explicitType:d?void 0:l}}if(m&&t!==h&&o!==h&&o!==``){let e=l??a[[n.slice(0,r).join(`.`),h].join(`.`)];return{field:m.find(({name:t})=>t===e)?.fields?.find(({name:e})=>e===o),explicitType:void 0}}return{field:void 0,explicitType:l}},ch=({collectionName:e,fileName:t,isIndexFile:n},r={})=>({collectionName:e,fileName:t,isIndexFile:n,...r}),lh=e=>{let{collectionName:t,fileName:n=void 0,componentName:r=void 0,valueMap:i={},keyPath:a,isIndexFile:o=!1}=e,s=[t,n??``,r??``,a,o?`1`:`0`].join(`|`);if(ih.has(s))return ih.get(s);let c=Kf(t),l=c&&n?Wp(c,n):void 0;if(!c||n&&c?._type!==`entry`&&!l){ih.set(s,void 0);return}let{fields:u=[]}=l??c,d=o?of(c):void 0,f=r?$m(r)?.fields??[]:d?.fields??u,p=a.split(`.`),m,h,g=!1;if(p.forEach((e,t)=>{if(t===0){let{cleanKey:t,typeName:n}=sh(e);m=f.find(({name:e})=>e===t),!m&&d?.fields&&(m=u.find(({name:e})=>e===t)),n&&(h=n)}else if(m){let n=tse({field:m,key:e,keyPathArray:p,segmentIndex:t,pendingExplicitType:h,valueMap:i});m=n.field,h=n.explicitType}m&&`types`in m&&(g=!0)}),h&&m&&`types`in m){let{types:e}=m;m=e.find(({name:e})=>e===h)}return g||ih.set(s,m),m},uh=({keyPath:e,valueMap:t={},...n})=>{let r=e.split(`.`);return r.map((e,i)=>{let a=r.slice(0,i).join(`.`),o=i?`${a}.${e}`:e;if(eh(e)){let e=lh({...n,valueMap:t,keyPath:a}),{widget:r=`text`}=e??{};if(zd.includes(r))return;let{field:i}=e??{},{types:s,typeKey:c=`type`}=e??{};if(i)return`*.${i.name}`;let l=s?t[`${o}.${c}`]:void 0;return l?`*<${l}>`:`*`}let s=lh({...n,valueMap:t,keyPath:o}),{types:c,typeKey:l=`type`}=s??{},u=s?.widget===`object`&&c?t[`${o}.${l}`]:void 0;return u?`${e}<${u}>`:e}).filter(e=>e!==void 0).join(`.`)},dh=e=>{let t=e.widget??`string`;return Pd.includes(t)?`builtin`:Hd.has(t)?`custom`:`unknown`},fh=({fieldConfig:{required:e=!0},locale:t})=>Array.isArray(e)?e.includes(t):!!e,ph=({valueMap:e,keyPath:t,isList:n,isCustomFieldType:r=!1})=>{let i=e[t];if(!n&&!r)return X(i)?Em(e,t)??i:i;let a=sm(e,t);return a.length?a.map(t=>e[t]).filter(e=>e!==void 0):r?i===void 0||X(i)?Em(e,t)??i:i:[]},mh=(e,t,n)=>{let{fields:r,types:i,typeKey:a=`type`}=e;return r??i?.find(({name:e})=>e===t[`${n}.${a}`])?.fields},hh=(e,t)=>{let n=e.find(({name:e})=>e===t);return n?n.fields??[]:void 0},gh=({value:e,fields:t,types:n,typeKey:r=`type`})=>t??(n?hh(n,e?.[r]):void 0)??[],_h=(e,t,n,r)=>{let{widget:i}=t,{field:a}=t,{fields:o,types:s,typeKey:c}=t;return i===`object`?n(e,gh({value:e,fields:o,types:s,typeKey:c})):i!==`list`||!Array.isArray(e)?e:e.map((e,t)=>a?r(e,a,t):n(e,gh({value:e,fields:o,types:s,typeKey:c}),t))},vh=e=>{let{field:t,fields:n=[],types:r=[]}=e;return[...t?[t]:[],...n,...r.flatMap(e=>e.fields??[])]},yh=(e,t,n,r=!1)=>{let{widget:i,field:a,fields:o,types:s}=e;if(i!==`object`&&i!==`list`)return;let c=i===`list`?`${t}.*`:t,l=(e,t)=>{Array.isArray(e)&&e.forEach(e=>n(e,`${t}.${e?.name}`))};i===`list`&&a&&n(a,c),l(o,c),Array.isArray(s)&&s.forEach(e=>l(e?.fields,r?`${c}<${e?.name}>`:c))},bh=(e,t,n)=>{let r=n?.get(e);if(r!==void 0)return r;let i=t(e)||vh(e).some(e=>bh(e,t,n));return n?.set(e,i),i},nse=/^(?:0|[1-9]\d*)$/,rse=/^(.+)\.\d+\.([^.]+)$/,xh=e=>{if(e.widget!==`list`||!(`fields`in e||`types`in e))return;let{map_key_field:t}=e;return typeof t==`string`&&t?t:void 0},ise=e=>nse.test(e)&&Number(e)<2**32-1,ase=(e,t)=>!X(e)||!Object.values(e).every(e=>e===null||X(e))?e:Object.entries(e).map(([e,n])=>({...n,[t]:e})),ose=(e,t)=>Array.isArray(e)?Object.fromEntries(e.map(e=>{let{[t]:n=``,...r}=X(e)?e:{};return[String(n),r]})):e,sse=new WeakMap,cse=e=>bh(e,e=>!!xh(e),sse),Sh=(e,t,n)=>{if(!cse(t))return e;let r=xh(t),i=r&&n?ase(e,r):e,a=_h(i,t,(e,t)=>Ch(e,t,n),(e,t)=>Sh(e,t,n)),o=Array.isArray(a)&&a.every((e,t)=>e===i[t])?i:a;return r&&!n?ose(o,r):o},Ch=(e,t,n)=>{if(!X(e))return e;let r=e;return t.forEach(t=>{let{name:i}=t;if(!Object.hasOwn(e,i))return;let a=Sh(e[i],t,n);a!==e[i]&&(r===e&&(r={...e}),r[i]=a)}),r},wh=e=>{if(e.componentName)return;let[,t,n]=e.keyPath.match(rse)??[];if(!t)return;let r=lh({...e,keyPath:t});if(r&&xh(r)===n)return{listKeyPath:t,keyField:n}},Th=({valueMap:e,listKeyPath:t,keyField:n})=>{let r=`${t}.`,i=`.${n}`;return Object.keys(e).filter(e=>e.startsWith(r)&&e.endsWith(i)&&eh(e.slice(r.length,-i.length)))},lse=({valueMap:e,keyPath:t,listKeyPath:n,keyField:r,value:i})=>Th({valueMap:e,listKeyPath:n,keyField:r}).some(n=>n!==t&&e[n]!==void 0&&e[n]!==null&&String(e[n])===String(i)),Eh=Symbol.for(`yaml.alias`),Dh=Symbol.for(`yaml.document`),Oh=Symbol.for(`yaml.map`),kh=Symbol.for(`yaml.pair`),Ah=Symbol.for(`yaml.scalar`),jh=Symbol.for(`yaml.seq`),Mh=Symbol.for(`yaml.node.type`),Nh=e=>!!e&&typeof e==`object`&&e[Mh]===Eh,Ph=e=>!!e&&typeof e==`object`&&e[Mh]===Dh,Fh=e=>!!e&&typeof e==`object`&&e[Mh]===Oh,Ih=e=>!!e&&typeof e==`object`&&e[Mh]===kh,Lh=e=>!!e&&typeof e==`object`&&e[Mh]===Ah,Rh=e=>!!e&&typeof e==`object`&&e[Mh]===jh;function zh(e){if(e&&typeof e==`object`)switch(e[Mh]){case Oh:case jh:return!0}return!1}function Bh(e){if(e&&typeof e==`object`)switch(e[Mh]){case Eh:case Oh:case Ah:case jh:return!0}return!1}var Vh=e=>(Lh(e)||zh(e))&&!!e.anchor,Hh=Symbol(`break visit`),use=Symbol(`skip children`),Uh=Symbol(`remove node`);function Wh(e,t){let n=dse(t);Ph(e)?Gh(null,e.contents,n,Object.freeze([e]))===Uh&&(e.contents=null):Gh(null,e,n,Object.freeze([]))}Wh.BREAK=Hh,Wh.SKIP=use,Wh.REMOVE=Uh;function Gh(e,t,n,r){let i=fse(e,t,n,r);if(Bh(i)||Ih(i))return pse(e,r,i),Gh(e,i,n,r);if(typeof i!=`symbol`){if(zh(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=Gh(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===Hh)return Hh;else i===Uh&&(t.items.splice(e,1),--e)}}else if(Ih(t)){r=Object.freeze(r.concat(t));let e=Gh(`key`,t.key,n,r);if(e===Hh)return Hh;e===Uh&&(t.key=null);let i=Gh(`value`,t.value,n,r);if(i===Hh)return Hh;i===Uh&&(t.value=null)}}return i}function dse(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function fse(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(Fh(t))return n.Map?.(e,t,r);if(Rh(t))return n.Seq?.(e,t,r);if(Ih(t))return n.Pair?.(e,t,r);if(Lh(t))return n.Scalar?.(e,t,r);if(Nh(t))return n.Alias?.(e,t,r)}function pse(e,t,n){let r=t[t.length-1];if(zh(r))r.items[e]=n;else if(Ih(r))e===`key`?r.key=n:r.value=n;else if(Ph(r))r.contents=n;else{let e=Nh(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}var mse={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},hse=e=>e.replace(/[!,[\]{}]/g,e=>mse[e]),Kh=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags)}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+hse(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],n=Object.entries(this.tags),r;if(e&&n.length>0&&Bh(e.contents)){let t={};Wh(e.contents,(e,n)=>{Bh(n)&&n.tag&&(t[n.tag]=!0)}),r=Object.keys(t)}else r=[];for(let[i,a]of n)i===`!!`&&a===`tag:yaml.org,2002:`||e&&!r.some(e=>e.startsWith(a))||t.push(`%TAG ${i} ${a}`);return t.join(`
`)}};Kh.defaultYaml={explicit:!1,version:`1.2`},Kh.defaultTags={"!!":`tag:yaml.org,2002:`};function qh(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function Jh(e){let t=new Set;return Wh(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function Yh(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function gse(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=Jh(e);let a=Yh(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(Lh(t.node)||zh(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function Xh(e,t,n,r){if(r&&typeof r==`object`){if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=Xh(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=Xh(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=Xh(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=Xh(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function Zh(e,t,n){if(Array.isArray(e))return e.map((e,t)=>Zh(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!Vh(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var Qh=class{constructor(e){Object.defineProperty(this,Mh,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!Ph(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=Zh(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?Xh(i,{"":o},``,o):o}},$h=class extends Qh{constructor(e){super(Eh),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],Wh(e,{Node:(e,t)=>{(Nh(t)||Vh(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}if(r&&t){let{anchors:e,doc:n,maxAliasCount:i}=t,a=e.get(r);if(a||=(Zh(r,null,t),e.get(r)),a?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=eg(n,r,e)),a.count*a.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`)}return r}toJSON(e,t){if(!t)return{source:this.source};let n=this.resolve(t.doc,t);if(!n){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}return t.anchors.get(n).res}toString(e,t,n){let r=`*${this.source}`;if(e){if(qh(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function eg(e,t,n){if(Nh(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(zh(t)){let r=0;for(let i of t.items){let t=eg(e,i,n);t>r&&(r=t)}return r}if(Ih(t)){let r=eg(e,t.key,n),i=eg(e,t.value,n);return Math.max(r,i)}return 1}var tg=e=>!e||typeof e!=`function`&&typeof e!=`object`,ng=class extends Qh{constructor(e){super(Ah),this.value=e}toJSON(e,t){return t?.keep?this.value:Zh(this.value,e,t)}toString(){return String(this.value)}};ng.BLOCK_FOLDED=`BLOCK_FOLDED`,ng.BLOCK_LITERAL=`BLOCK_LITERAL`,ng.PLAIN=`PLAIN`,ng.QUOTE_DOUBLE=`QUOTE_DOUBLE`,ng.QUOTE_SINGLE=`QUOTE_SINGLE`;var _se=`tag:yaml.org,2002:`;function vse(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function rg(e,t,n){if(Ph(e)&&(e=e.contents),Bh(e))return e;if(Ih(e)){let t=n.schema[Oh].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??(c.anchor=i(e)),new $h(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=_se+t.slice(2));let l=vse(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new ng(e);return c&&(c.node=t),t}l=e instanceof Map?o[Oh]:Symbol.iterator in Object(e)?o[jh]:o[Oh]}a&&(a(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from==`function`?l.nodeClass.from(n.schema,e,n):new ng(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function ig(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){let n=t[e];if(typeof n==`number`&&Number.isInteger(n)&&n>=0){let e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return rg(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}var ag=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done,og=class extends Qh{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>Bh(t)||Ih(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(ag(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(zh(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,ig(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(zh(r))return r.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return r.length===0?!t&&Lh(i)?i.value:i:zh(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!Ih(t))return!1;let n=t.value;return n==null||e&&Lh(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let r=this.get(t,!0);return zh(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let e=this.get(n,!0);if(zh(e))e.setIn(r,t);else if(e===void 0&&this.schema)this.set(n,ig(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}},yse=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function sg(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var cg=(e,t,n)=>e.endsWith(`
`)?sg(n,t):n.includes(`
`)?`
`+sg(n,t):(e.endsWith(` `)?``:` `)+n;function lg(e,t,n=`flow`,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;i<a&&(a=0);let c=Math.max(1+a,1+i-t.length);if(e.length<=c)return e;let l=[],u={},d=i-t.length;typeof r==`number`&&(r>i-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,_=-1;n===`block`&&(h=ug(e,h,t.length),h!==-1&&(d=h+c));for(let r;r=e[h+=1];){if(n===`quoted`&&r===`\\`){switch(g=h,e[h+1]){case`x`:h+=3;break;case`u`:h+=5;break;case`U`:h+=9;break;default:h+=1}_=h}if(r===`
`)n===`block`&&(h=ug(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
`&&p!==` `){let t=e[h+1];t&&t!==` `&&t!==`
`&&t!==` `&&(f=h)}if(h>=d){if(f)l.push(f),d=f+c,f=void 0;else if(n===`quoted`){for(;p===` `||p===` `;)p=r,r=e[h+=1],m=!0;let t=h>_+1?h-2:g-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,f=void 0}else m=!0}}p=r}if(m&&s&&s(),l.length===0)return e;o&&o();let v=e.slice(0,l[0]);for(let r=0;r<l.length;++r){let i=l[r],a=l[r+1]||e.length;i===0?v=`\n${t}${e.slice(0,a)}`:(n===`quoted`&&u[i]&&(v+=`${e[i]}\\`),v+=`\n${t}${e.slice(i+1,a)}`)}return v}function ug(e,t,n){let r=t,i=t+1,a=e[i];for(;a===` `||a===` `;)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
`);r=t,i=t+1,a=e[i]}return r}var dg=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),fg=e=>/^(%|---|\.\.\.)/m.test(e);function bse(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t<i;++t)if(e[t]===`
`){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function pg(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(fg(e)?` `:``),o=``,s=0;for(let e=0,t=n[e];t;t=n[++e])if(t===` `&&n[e+1]===`\\`&&n[e+2]===`n`&&(o+=n.slice(s,e)+`\\ `,e+=1,s=e,t=`\\`),t===`\\`)switch(n[e+1]){case`u`:{o+=n.slice(s,e);let t=n.substr(e+2,4);switch(t){case`0000`:o+=`\\0`;break;case`0007`:o+=`\\a`;break;case`000b`:o+=`\\v`;break;case`001b`:o+=`\\e`;break;case`0085`:o+=`\\N`;break;case`00a0`:o+=`\\_`;break;case`2028`:o+=`\\L`;break;case`2029`:o+=`\\P`;break;default:t.substr(0,2)===`00`?o+=`\\x`+t.substr(2):o+=n.substr(e,6)}e+=5,s=e+1}break;case`n`:if(r||n[e+2]===`"`||n.length<i)e+=1;else{for(o+=n.slice(s,e)+`
`;n[e+2]===`\\`&&n[e+3]===`n`&&n[e+4]!==`"`;)o+=`
`,e+=2;o+=a,n[e+2]===` `&&(o+=`\\`),e+=1,s=e+1}break;default:e+=1}return o=s?o+n.slice(s):n,r?o:lg(o,a,`quoted`,dg(t,!1))}function mg(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
`)||/[ \t]\n|\n[ \t]/.test(e))return pg(e,t);let n=t.indent||(fg(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:lg(r,n,`flow`,dg(t,!1))}function hg(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=pg;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?mg:i&&!t?pg:n?mg:pg}return r(e,t)}var gg;try{gg=RegExp(`(^|(?<!
))
+(?!
|$)`,`g`)}catch{gg=/\n+(?!\n|$)/g}function _g({comment:e,type:t,value:n},r,i,a){let{blockQuote:o,commentString:s,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return hg(n,r);let l=r.indent||(r.forceBlockIndent||fg(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===ng.BLOCK_FOLDED?!1:t===ng.BLOCK_LITERAL||!bse(n,c,l.length);if(!n)return u?`|
`:`>
`;let d,f;for(f=n.length;f>0;--f){let e=n[f-1];if(e!==`
`&&e!==` `&&e!==` `)break}let p=n.substring(f),m=p.indexOf(`
`);m===-1?d=`-`:n===p||m!==p.length-1?(d=`+`,a&&a()):d=``,p&&=(n=n.slice(0,-p.length),p[p.length-1]===`
`&&(p=p.slice(0,-1)),p.replace(gg,`$&${l}`));let h=!1,g,_=-1;for(g=0;g<n.length;++g){let e=n[g];if(e===` `)h=!0;else if(e===`
`)_=g;else break}let v=n.substring(0,_<g?_+1:g);v&&=(n=n.substring(v.length),v.replace(/\n+/g,`$&${l}`));let y=(h?l?`2`:`1`:``)+d;if(e&&(y+=` `+s(e.replace(/ ?[\r\n]+/g,` `)),i&&i()),!u){let e=n.replace(/\n+/g,`
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${l}`),i=!1,a=dg(r,!0);o!==`folded`&&t!==ng.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=lg(`${v}${e}${p}`,l,`block`,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function xse(e,t,n,r){let{type:i,value:a}=e,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:u}=t;if(s&&a.includes(`
`)||u&&/[[\]{},]/.test(a))return hg(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
`)?hg(a,t):_g(e,t,n,r);if(!s&&!u&&i!==ng.PLAIN&&a.includes(`
`))return _g(e,t,n,r);if(fg(a)){if(c===``)return t.forceBlockIndent=!0,_g(e,t,n,r);if(s&&c===l)return hg(a,t)}let d=a.replace(/\n+/g,`$&\n${c}`);if(o){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(d),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return hg(a,t)}return s?d:lg(d,c,`flow`,dg(t,!1))}function vg(e,t,n,r){let{implicitKey:i,inFlow:a}=t,o=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==ng.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=ng.QUOTE_DOUBLE);let c=e=>{switch(e){case ng.BLOCK_FOLDED:case ng.BLOCK_LITERAL:return i||a?hg(o.value,t):_g(o,t,n,r);case ng.QUOTE_DOUBLE:return pg(o.value,t);case ng.QUOTE_SINGLE:return mg(o.value,t);case ng.PLAIN:return xse(o,t,n,r);default:return null}},l=c(s);if(l===null){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(l=c(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}function yg(e,t){let n=Object.assign({blockQuote:!0,commentString:yse,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case`block`:r=!1;break;case`flow`:r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:r,options:n}}function Sse(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(Lh(t)){r=t.value;let i=e.filter(e=>e.identify?.(r));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n){let e=r?.constructor?.name??(r===null?`null`:typeof r);throw Error(`Tag not resolved for ${e} value`)}return n}function Cse(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(Lh(e)||zh(e))&&e.anchor;a&&qh(a)&&(n.add(a),i.push(`&${a}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(` `)}function bg(e,t,n,r){if(Ih(e))return e.toString(t,n,r);if(Nh(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,a=Bh(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=Sse(t.doc.schema.tags,a);let o=Cse(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let s=typeof i.stringify==`function`?i.stringify(a,t,n,r):Lh(a)?vg(a,t,n,r):a.toString(t,n,r);return o?Lh(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function wse({key:e,value:t},n,r,i){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,f=Bh(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(zh(e)||!Bh(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let p=!d&&(!e||f&&t==null&&!n.inFlow||zh(e)||(Lh(e)?e.type===ng.BLOCK_FOLDED||e.type===ng.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=bg(e,n,()=>m=!0,()=>h=!0);if(!p&&!n.inFlow&&g.length>1024){if(d)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);p=!0}if(n.inFlow){if(a||t==null)return m&&r&&r(),g===``?`?`:p?`? ${g}`:g}else if(a&&!d||t==null&&p)return g=`? ${g}`,f&&!m?g+=cg(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=cg(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=cg(g,n.indent,l(f))));let _,v,y;Bh(t)?(_=!!t.spaceBefore,v=t.commentBefore,y=t.comment):(_=!1,v=null,y=null,t&&typeof t==`object`&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!f&&Lh(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&Rh(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=bg(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
`:``,v){let e=l(v);S+=`\n${sg(e,n.indent)}`}x===``&&!n.inFlow?S===`
`&&y&&(S=`
`):S+=`\n${n.indent}`}else if(!p&&zh(t)){let e=x[0],r=x.indexOf(`
`),i=r!==-1,a=n.inFlow??t.flow??t.items.length===0;if(i||!a){let t=!1;if(i&&(e===`&`||e===`!`)){let n=x.indexOf(` `);e===`&`&&n!==-1&&n<r&&x[n+1]===`!`&&(n=x.indexOf(` `,n+1)),(n===-1||r<n)&&(t=!0)}t||(S=`\n${n.indent}`)}}else(x===``||x[0]===`
`)&&(S=``);return g+=S+x,n.inFlow?b&&r&&r():y&&!b?g+=cg(g,n.indent,l(y)):h&&i&&i(),g}function xg(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var Sg=`<<`,Cg={identify:e=>e===Sg||typeof e==`symbol`&&e.description===Sg,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new ng(Symbol(Sg)),{addToJSMap:wg}),stringify:()=>Sg},Tse=(e,t)=>(Cg.identify(t)||Lh(t)&&(!t.type||t.type===ng.PLAIN)&&Cg.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===Cg.tag&&e.default);function wg(e,t,n){let r=Eg(e,n);if(Rh(r))for(let n of r.items)Tg(e,t,n);else if(Array.isArray(r))for(let n of r)Tg(e,t,n);else Tg(e,t,r)}function Tg(e,t,n){let r=Eg(e,n);if(!Fh(r))throw Error(`Merge sources must be maps or map aliases`);let i=r.toJSON(null,e,Map);for(let[e,n]of i)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function Eg(e,t){return e&&Nh(t)?t.resolve(e.doc,e):t}function Dg(e,t,{key:n,value:r}){if(Bh(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(Tse(e,n))wg(e,t,r);else{let i=Zh(n,``,e);if(t instanceof Map)t.set(i,Zh(r,i,e));else if(t instanceof Set)t.add(i);else{let a=Ese(n,i,e),o=Zh(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function Ese(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(Bh(e)&&n?.doc){let t=yg(n.doc,{});t.anchors=new Set;for(let e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+`..."`),xg(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function Og(e,t,n){return new kg(rg(e,void 0,n),rg(t,void 0,n))}var kg=class e{constructor(e,t=null){Object.defineProperty(this,Mh,{value:kh}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return Bh(n)&&(n=n.clone(t)),Bh(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return Dg(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?wse(this,e,t,n):JSON.stringify(this)}};function Ag(e,t,n){return(t.inFlow??e.flow?Ose:Dse)(e,t,n)}function Dse({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:a,type:null}),d=!1,f=[];for(let e=0;e<t.length;++e){let i=t[e],o=null;if(Bh(i))!d&&i.spaceBefore&&f.push(``),jg(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(Ih(i)){let e=Bh(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),jg(n,f,e.commentBefore,d))}d=!1;let s=bg(i,u,()=>o=null,()=>d=!0);o&&(s+=cg(s,a,l(o))),d&&o&&(d=!1),f.push(r+s)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let e=1;e<f.length;++e){let t=f[e];p+=t?`\n${c}${t}`:`
`}}return e?(p+=`
`+sg(l(e),c),s&&s()):d&&o&&o(),p}function Ose({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=t;r+=a;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let n=0;n<e.length;++n){let i=e[n],a=null;if(Bh(i))i.spaceBefore&&d.push(``),jg(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(Ih(i)){let e=Bh(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),jg(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=Bh(i.value)?i.value:null;n?(n.comment&&(a=n.comment),n.commentBefore&&(l=!0)):i.value==null&&e?.comment&&(a=e.comment)}a&&(l=!0);let o=bg(i,c,()=>a=null);l||=d.length>u||o.includes(`
`),n<e.length-1?o+=`,`:t.options.trailingComma&&(t.options.lineWidth>0&&(l||=d.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth),l&&(o+=`,`)),a&&(o+=cg(o,r,s(a))),d.push(o),u=d.length}let{start:f,end:p}=n;if(d.length===0)return f+p;if(!l){let e=d.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=f;for(let t of d)e+=t?`\n${a}${i}${t}`:`
`;return`${e}\n${i}${p}`}return`${f}${o}${d.join(` `)}${o}${p}`}function jg({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=sg(t(r),e);n.push(i.trimStart())}}function Mg(e,t){let n=Lh(t)?t.value:t;for(let r of e)if(Ih(r)&&(r.key===t||r.key===n||Lh(r.key)&&r.key.value===n))return r}var Ng=class extends og{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(Oh,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,a=new this(e),o=(e,o)=>{if(typeof i==`function`)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(o!==void 0||r)&&a.items.push(Og(e,o,n))};if(t instanceof Map)for(let[e,n]of t)o(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))o(e,t[e]);return typeof e.sortMapEntries==`function`&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;n=Ih(e)?e:!e||typeof e!=`object`||!(`key`in e)?new kg(e,e?.value):new kg(e.key,e.value);let r=Mg(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);Lh(r.value)&&tg(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let e=this.items.findIndex(e=>i(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=Mg(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=Mg(this.items,e)?.value;return(!t&&Lh(n)?n.value:n)??void 0}has(e){return!!Mg(this.items,e)}set(e,t){this.add(new kg(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let e of this.items)Dg(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!Ih(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Ag(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},Pg={collection:`map`,default:!0,nodeClass:Ng,tag:`tag:yaml.org,2002:map`,resolve(e,t){return Fh(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>Ng.from(e,t,n)},Fg=class extends og{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(jh,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=Ig(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=Ig(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&Lh(r)?r.value:r}has(e){let t=Ig(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=Ig(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];Lh(r)&&tg(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(Zh(e,String(r++),t));return n}toString(e,t,n){return e?Ag(this,e,{blockItemPrefix:`- `,flowChars:{start:`[`,end:`]`},itemIndent:(e.indent||``)+` `,onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let a of t){if(typeof r==`function`){let n=t instanceof Set?a:String(e++);a=r.call(t,n,a)}i.items.push(rg(a,void 0,n))}}return i}};function Ig(e){let t=Lh(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var Lg={collection:`seq`,default:!0,nodeClass:Fg,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return Rh(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>Fg.from(e,t,n)},Rg={identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),vg(e,t,n,r)}},zg={identify:e=>e==null,createNode:()=>new ng(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new ng(null),stringify:({source:e},t)=>typeof e==`string`&&zg.test.test(e)?e:t.options.nullStr},Bg={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new ng(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&Bg.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function Vg({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r==`bigint`)return String(r);let i=typeof r==`number`?r:Number(r);if(!isFinite(i))return isNaN(i)?`.nan`:i<0?`-.inf`:`.inf`;let a=Object.is(r,-0)?`-0`:JSON.stringify(r);if(!e&&t&&(!n||n===`tag:yaml.org,2002:float`)&&/^-?\d/.test(a)&&!a.includes(`e`)){let e=a.indexOf(`.`);e<0&&(e=a.length,a+=`.`);let n=t-(a.length-e-1);for(;n-->0;)a+=`0`}return a}var Hg={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:Vg},Ug={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():Vg(e)}},Wg={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new ng(parseFloat(e)),n=e.indexOf(`.`);return n!==-1&&e[e.length-1]===`0`&&(t.minFractionDigits=e.length-n-1),t},stringify:Vg},Gg=e=>typeof e==`bigint`||Number.isInteger(e),Kg=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function qg(e,t,n){let{value:r}=e;return Gg(r)&&r>=0?n+r.toString(t):Vg(e)}var Jg={identify:e=>Gg(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^0o[0-7]+$/,resolve:(e,t,n)=>Kg(e,2,8,n),stringify:e=>qg(e,8,`0o`)},Yg={identify:Gg,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Kg(e,0,10,n),stringify:Vg},Xg={identify:e=>Gg(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Kg(e,2,16,n),stringify:e=>qg(e,16,`0x`)},kse=[Pg,Lg,Rg,zg,Bg,Jg,Yg,Xg,Hg,Ug,Wg];function Zg(e){return typeof e==`bigint`||Number.isInteger(e)}var Qg=({value:e})=>JSON.stringify(e),Ase=[{identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify:Qg},{identify:e=>e==null,createNode:()=>new ng(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^null$/,resolve:()=>null,stringify:Qg},{identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^true$|^false$/,resolve:e=>e===`true`,stringify:Qg},{identify:Zg,default:!0,tag:`tag:yaml.org,2002:int`,test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>Zg(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Qg}],jse=[Pg,Lg].concat(Ase,{default:!0,tag:``,test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}}),$g={identify:e=>e instanceof Uint8Array,default:!1,tag:`tag:yaml.org,2002:binary`,resolve(e,t){if(typeof atob==`function`){let t=atob(e.replace(/[\n\r]/g,``)),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}return t(`This environment does not support reading binary tags; either Buffer or atob is required`),e},stringify({comment:e,type:t,value:n},r,i,a){if(!n)return``;let o=n,s;if(typeof btoa==`function`){let e=``;for(let t=0;t<o.length;++t)e+=String.fromCharCode(o[t]);s=btoa(e)}else throw Error(`This environment does not support writing binary tags; either Buffer or btoa is required`);if(t??=ng.BLOCK_LITERAL,t!==ng.QUOTE_DOUBLE){let e=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),n=Math.ceil(s.length/e),i=Array(n);for(let t=0,r=0;t<n;++t,r+=e)i[t]=s.substr(r,e);s=i.join(t===ng.BLOCK_LITERAL?`
`:` `)}return vg({comment:e,type:t,value:s},r,i,a)}};function e_(e,t){if(Rh(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!Ih(r)){if(Fh(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new kg(new ng(null));if(r.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${r.commentBefore}\n${e.key.commentBefore}`:r.commentBefore),r.comment){let t=e.value??e.key;t.comment=t.comment?`${r.comment}\n${t.comment}`:r.comment}r=e}e.items[n]=Ih(r)?r:new kg(r)}}else t(`Expected a sequence for this tag`);return e}function t_(e,t,n){let{replacer:r}=n,i=new Fg(e);i.tag=`tag:yaml.org,2002:pairs`;let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof r==`function`&&(e=r.call(t,String(a++),e));let o,s;if(Array.isArray(e)){if(e.length===2)o=e[0],s=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`)}else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)o=t[0],s=e[o];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(Og(o,s,n))}return i}var n_={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:e_,createNode:t_},r_=class e extends Fg{constructor(){super(),this.add=Ng.prototype.add.bind(this),this.delete=Ng.prototype.delete.bind(this),this.get=Ng.prototype.get.bind(this),this.has=Ng.prototype.has.bind(this),this.set=Ng.prototype.set.bind(this),this.tag=e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let e of this.items){let r,i;if(Ih(e)?(r=Zh(e.key,``,t),i=Zh(e.value,r,t)):r=Zh(e,``,t),n.has(r))throw Error(`Ordered maps must not include duplicate keys`);n.set(r,i)}return n}static from(e,t,n){let r=t_(e,t,n),i=new this;return i.items=r.items,i}};r_.tag=`tag:yaml.org,2002:omap`;var i_={collection:`seq`,identify:e=>e instanceof Map,nodeClass:r_,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=e_(e,t),r=[];for(let{key:e}of n.items)Lh(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new r_,n)},createNode:(e,t,n)=>r_.from(e,t,n)};function a_({value:e,source:t},n){return t&&(e?o_:s_).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var o_={identify:e=>e===!0,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new ng(!0),stringify:a_},s_={identify:e=>e===!1,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new ng(!1),stringify:a_},Mse={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:Vg},Nse={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():Vg(e)}},Pse={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new ng(parseFloat(e.replace(/_/g,``))),n=e.indexOf(`.`);if(n!==-1){let r=e.substring(n+1).replace(/_/g,``);r[r.length-1]===`0`&&(t.minFractionDigits=r.length)}return t},stringify:Vg},c_=e=>typeof e==`bigint`||Number.isInteger(e);function l_(e,t,n,{intAsBigInt:r}){let i=e[0];if((i===`-`||i===`+`)&&(t+=1),e=e.substring(t).replace(/_/g,``),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function u_(e,t,n){let{value:r}=e;if(c_(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return Vg(e)}var Fse={identify:c_,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>l_(e,2,2,n),stringify:e=>u_(e,2,`0b`)},Ise={identify:c_,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>l_(e,1,8,n),stringify:e=>u_(e,8,`0`)},Lse={identify:c_,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>l_(e,0,10,n),stringify:Vg},Rse={identify:c_,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>l_(e,2,16,n),stringify:e=>u_(e,16,`0x`)},d_=class e extends Ng{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=Ih(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new kg(e.key,null):new kg(e,null),Mg(this.items,t.key)||this.items.push(t)}get(e,t){let n=Mg(this.items,e);return!t&&Ih(n)?Lh(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=Mg(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new kg(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw Error(`Set items must all have null values`)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)typeof r==`function`&&(e=r.call(t,e,e)),i.items.push(Og(e,null,n));return i}};d_.tag=`tag:yaml.org,2002:set`;var f_={collection:`map`,identify:e=>e instanceof Set,nodeClass:d_,default:!1,tag:`tag:yaml.org,2002:set`,createNode:(e,t,n)=>d_.from(e,t,n),resolve(e,t){if(Fh(e)){if(e.hasAllNullValues(!0))return Object.assign(new d_,e);t(`Set items must all have null values`)}else t(`Expected a mapping for this tag`);return e}};function p_(e,t){let n=e[0],r=n===`-`||n===`+`?e.substring(1):e,i=e=>t?BigInt(e):Number(e),a=r.replace(/_/g,``).split(`:`).reduce((e,t)=>e*i(60)+i(t),i(0));return n===`-`?i(-1)*a:a}function m_(e){let{value:t}=e,n=e=>e;if(typeof t==`bigint`)n=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return Vg(e);let r=``;t<0&&(r=`-`,t*=n(-1));let i=n(60),a=[t%i];return t<60?a.unshift(0):(t=(t-a[0])/i,a.unshift(t%i),t>=60&&(t=(t-a[0])/i,a.unshift(t))),r+a.map(e=>String(e).padStart(2,`0`)).join(`:`).replace(/000000\d*$/,``)}var h_={identify:e=>typeof e==`bigint`||Number.isInteger(e),default:!0,tag:`tag:yaml.org,2002:int`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>p_(e,n),stringify:m_},g_={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>p_(e,!1),stringify:m_},__={identify:e=>e instanceof Date,default:!0,tag:`tag:yaml.org,2002:timestamp`,test:RegExp(`^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$`),resolve(e){let t=e.match(__.test);if(!t)throw Error(`!!timestamp expects a date, starting with yyyy-mm-dd`);let[,n,r,i,a,o,s]=t.map(Number),c=t[7]?Number((t[7]+`00`).substr(1,3)):0,l=Date.UTC(n,r-1,i,a||0,o||0,s||0,c),u=t[8];if(u&&u!==`Z`){let e=p_(u,!1);Math.abs(e)<30&&(e*=60),l-=6e4*e}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,``)??``},v_=[Pg,Lg,Rg,zg,o_,s_,Fse,Ise,Lse,Rse,Mse,Nse,Pse,$g,Cg,i_,n_,f_,h_,g_,__],y_=new Map([[`core`,kse],[`failsafe`,[Pg,Lg,Rg]],[`json`,jse],[`yaml11`,v_],[`yaml-1.1`,v_]]),b_={binary:$g,bool:Bg,float:Wg,floatExp:Ug,floatNaN:Hg,floatTime:g_,int:Yg,intHex:Xg,intOct:Jg,intTime:h_,map:Pg,merge:Cg,null:zg,omap:i_,pairs:n_,seq:Lg,set:f_,timestamp:__},zse={"tag:yaml.org,2002:binary":$g,"tag:yaml.org,2002:merge":Cg,"tag:yaml.org,2002:omap":i_,"tag:yaml.org,2002:pairs":n_,"tag:yaml.org,2002:set":f_,"tag:yaml.org,2002:timestamp":__};function x_(e,t,n){let r=y_.get(t);if(r&&!e)return n&&!r.includes(Cg)?r.concat(Cg):r.slice();let i=r;if(!i){if(Array.isArray(e))i=[];else{let e=Array.from(y_.keys()).filter(e=>e!==`yaml11`).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}}if(Array.isArray(e))for(let t of e)i=i.concat(t);else typeof e==`function`&&(i=e(i.slice()));return n&&(i=i.concat(Cg)),i.reduce((e,t)=>{let n=typeof t==`string`?b_[t]:t;if(!n){let e=JSON.stringify(t),n=Object.keys(b_).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown custom tag ${e}; use one of ${n}`)}return e.includes(n)||e.push(n),e},[])}var Bse=(e,t)=>e.key<t.key?-1:+(e.key>t.key),Vse=class e{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:r,schema:i,sortMapEntries:a,toStringDefaults:o}){this.compat=Array.isArray(e)?x_(e,`compat`):e?x_(null,e):null,this.name=typeof i==`string`&&i||`core`,this.knownTags=r?zse:{},this.tags=x_(t,this.name,n),this.toStringOptions=o??null,Object.defineProperty(this,Oh,{value:Pg}),Object.defineProperty(this,Ah,{value:Rg}),Object.defineProperty(this,jh,{value:Lg}),this.sortMapEntries=typeof a==`function`?a:a===!0?Bse:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};function Hse(e,t){let n=[],r=t.directives===!0;if(t.directives!==!1&&e.directives){let t=e.directives.toString(e);t?(n.push(t),r=!0):e.directives.docStart&&(r=!0)}r&&n.push(`---`);let i=yg(e,t),{commentString:a}=i.options;if(e.commentBefore){n.length!==1&&n.unshift(``);let t=a(e.commentBefore);n.unshift(sg(t,``))}let o=!1,s=null;if(e.contents){if(Bh(e.contents)){if(e.contents.spaceBefore&&r&&n.push(``),e.contents.commentBefore){let t=a(e.contents.commentBefore);n.push(sg(t,``))}i.forceBlockIndent=!!e.comment,s=e.contents.comment}let t=s?void 0:()=>o=!0,c=bg(e.contents,i,()=>s=null,t);s&&(c+=cg(c,``,a(s))),(c[0]===`|`||c[0]===`>`)&&n[n.length-1]===`---`?n[n.length-1]=`--- ${c}`:n.push(c)}else n.push(bg(e.contents,i));if(e.directives?.docEnd){if(e.comment){let t=a(e.comment);t.includes(`
`)?(n.push(`...`),n.push(sg(t,``))):n.push(`... ${t}`)}else n.push(`...`)}else{let t=e.comment;t&&o&&(t=t.replace(/^\n+/,``)),t&&((!o||s)&&n[n.length-1]!==``&&n.push(``),n.push(sg(a(t),``)))}return n.join(`
`)+`
`}var S_=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Mh,{value:Dh});let r=null;typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:`warn`,prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:`1.2`},n);this.options=i;let{version:a}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new Kh({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[Mh]:{value:Dh}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=Bh(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){C_(this.contents)&&this.contents.add(e)}addIn(e,t){C_(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=Jh(this);e.anchor=!t||n.has(t)?Yh(t||`a`,n):t}return new $h(e.anchor)}createNode(e,t,n){let r;if(typeof t==`function`)e=t.call({"":e},``,e),r=t;else if(Array.isArray(t)){let e=t.filter(e=>typeof e==`number`||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),r=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:a,flow:o,keepUndefined:s,onTagObj:c,tag:l}=n??{},{onAnchor:u,setAnchors:d,sourceObjects:f}=gse(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=rg(e,l,p);return o&&zh(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new kg(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return C_(this.contents)?this.contents.delete(e):!1}deleteIn(e){return ag(e)?this.contents!=null&&(this.contents=null,!0):C_(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return zh(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return ag(e)?!t&&Lh(this.contents)?this.contents.value:this.contents:zh(this.contents)?this.contents.getIn(e,t):void 0}has(e){return zh(this.contents)?this.contents.has(e):!1}hasIn(e){return ag(e)?this.contents!==void 0:zh(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=ig(this.schema,[e],t):C_(this.contents)&&this.contents.set(e,t)}setIn(e,t){ag(e)?this.contents=t:this.contents==null?this.contents=ig(this.schema,Array.from(e),t):C_(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e==`number`&&(e=String(e));let n;switch(e){case`1.1`:this.directives?this.directives.yaml.version=`1.1`:this.directives=new Kh({version:`1.1`}),n={resolveKnownTags:!1,schema:`yaml-1.1`};break;case`1.2`:case`next`:this.directives?this.directives.yaml.version=e:this.directives=new Kh({version:e}),n={resolveKnownTags:!0,schema:`core`};break;case null:this.directives&&delete this.directives,n=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new Vse(Object.assign(n,t));else throw Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:a}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r==`number`?r:100},s=Zh(this.contents,t??``,o);if(typeof i==`function`)for(let{count:e,res:t}of o.anchors.values())i(t,e);return typeof a==`function`?Xh(a,{"":s},``,s):s}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error(`Document with errors cannot be stringified`);if(`indent`in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return Hse(this,e)}};function C_(e){if(zh(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var w_=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},T_=class extends w_{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},Use=class extends w_{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},E_=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(e=>t.linePos(e));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,``);if(a>=60&&o.length>80){let e=Math.min(a-39,o.length-79);o=`…`+o.substring(e),a-=e-1}if(o.length>80&&(o=o.substring(0,79)+`…`),r>1&&/^ *$/.test(o.substring(0,a))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+`…
`),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t?.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let s=` `.repeat(a)+`^`.repeat(e);n.message+=`:\n\n${o}\n${s}\n`}};function D_(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,u=s,d=``,f=``,p=!1,m=!1,h=null,g=null,_=null,v=null,y=null,b=null,x=null;for(let i of e)switch(m&&=(i.type!==`space`&&i.type!==`newline`&&i.type!==`comma`&&a(i.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),!1),h&&=(l&&i.type!==`comment`&&i.type!==`newline`&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),null),i.type){case`space`:!t&&(n!==`doc-start`||r?.type!==`flow-collection`)&&i.source.includes(` `)&&(h=i),u=!0;break;case`comment`:{u||a(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let e=i.source.substring(1)||` `;d?d+=f+e:d=e,f=``,l=!1;break}case`newline`:l?d?d+=i.source:b&&n===`seq-item-ind`||(c=!0):f+=i.source,l=!0,p=!0,(g||_)&&(v=i),u=!0;break;case`anchor`:g&&a(i,`MULTIPLE_ANCHORS`,`A node can have at most one anchor`),i.source.endsWith(`:`)&&a(i.offset+i.source.length-1,`BAD_ALIAS`,`Anchor ending in : is ambiguous`,!0),g=i,x??=i.offset,l=!1,u=!1,m=!0;break;case`tag`:_&&a(i,`MULTIPLE_TAGS`,`A node can have at most one tag`),_=i,x??=i.offset,l=!1,u=!1,m=!0;break;case n:(g||_)&&a(i,`BAD_PROP_ORDER`,`Anchors and tags must be after the ${i.source} indicator`),b&&a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.source} in ${t??`collection`}`),b=i,l=n===`seq-item-ind`||n===`explicit-key-ind`,u=!1;break;case`comma`:if(t){y&&a(i,`UNEXPECTED_TOKEN`,`Unexpected , in ${t}`),y=i,l=!1,u=!1;break}default:a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.type} token`),l=!1,u=!1}let S=e[e.length-1],C=S?S.offset+S.source.length:i;return m&&r&&r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&(r.type!==`scalar`||r.source!==``)&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),h&&(l&&h.indent<=o||r?.type===`block-map`||r?.type===`block-seq`)&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),{comma:y,found:b,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:_,newlineAfterProp:v,end:C,start:x??C}}function O_(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(`
`))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let t of e.items){for(let e of t.start)if(e.type===`newline`)return!0;if(t.sep){for(let e of t.sep)if(e.type===`newline`)return!0}if(O_(t.key)||O_(t.value))return!0}return!1;default:return!0}}function k_(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&O_(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function A_(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||Lh(e)&&Lh(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var j_=`All mapping items must start at the same column`;function Wse({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??Ng)(n.schema);n.atRoot&&=!1;let s=r.offset,c=null;for(let a of r.items){let{start:l,key:u,sep:d,value:f}=a,p=D_(l,{indicator:`explicit-key-ind`,next:u??d?.[0],offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0}),m=!p.found;if(m){if(u&&(u.type===`block-seq`?i(s,`BLOCK_AS_IMPLICIT_KEY`,`A block sequence may not be used as an implicit map key`):`indent`in u&&u.indent!==r.indent&&i(s,`BAD_INDENT`,j_)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
`+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||O_(u))&&i(u??l[l.length-1],`MULTILINE_IMPLICIT_KEY`,`Implicit keys need to be on a single line`)}else p.found?.indent!==r.indent&&i(s,`BAD_INDENT`,j_);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&k_(r.indent,u,i),n.atKey=!1,A_(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=D_(d??[],{indicator:`map-value-ind`,next:f,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!u||u.type===`block-scalar`});if(s=_.end,_.found){m&&(f?.type===`block-map`&&!_.hasNewline&&i(s,`BLOCK_AS_IMPLICIT_KEY`,`Nested mappings are not allowed in compact mappings`),n.options.strict&&p.start<_.found.offset-1024&&i(g.range,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit block mapping key`));let c=f?e(n,f,_,i):t(n,s,d,null,_,i);n.schema.compat&&k_(r.indent,f,i),s=c.range[2];let l=new kg(g,c);n.options.keepSourceTokens&&(l.srcToken=a),o.items.push(l)}else{m&&i(g.range,`MISSING_CHAR`,`Implicit map keys need to be followed by map values`),_.comment&&(g.comment?g.comment+=`
`+_.comment:g.comment=_.comment);let e=new kg(g);n.options.keepSourceTokens&&(e.srcToken=a),o.items.push(e)}}return c&&c<s&&i(c,`IMPOSSIBLE`,`Map comment with trailing content`),o.range=[r.offset,s,c??s],o}function Gse({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??Fg)(n.schema);n.atRoot&&=!1,n.atKey&&=!1;let s=r.offset,c=null;for(let{start:a,value:l}of r.items){let u=D_(a,{indicator:`seq-item-ind`,next:l,offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!u.found){if(u.anchor||u.tag||l)l?.type===`block-seq`?i(u.end,`BAD_INDENT`,`All sequence items must start at the same column`):i(s,`MISSING_CHAR`,`Sequence item without - indicator`);else{c=u.end,u.comment&&(o.comment=u.comment);continue}}let d=l?e(n,l,u,i):t(n,u.end,a,null,u,i);n.schema.compat&&k_(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function M_(e,t,n,r){let i=``;if(e){let a=!1,o=``;for(let s of e){let{source:e,type:c}=s;switch(c){case`space`:a=!0;break;case`comment`:{n&&!a&&r(s,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let t=e.substring(1)||` `;i?i+=o+t:i=t,o=``;break}case`newline`:i&&(o+=e),a=!0;break;default:r(s,`UNEXPECTED_TOKEN`,`Unexpected ${c} at node end`)}t+=e.length}}return{comment:i,offset:t}}var N_=`Block collections are not allowed within flow collections`,P_=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function Kse({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new((a?.nodeClass)??(o?Ng:Fg))(n.schema);c.flow=!0;let l=n.atRoot;l&&(n.atRoot=!1),n.atKey&&=!1;let u=r.offset+r.start.source.length;for(let a=0;a<r.items.length;++a){let l=r.items[a],{start:d,key:f,sep:p,value:m}=l,h=D_(d,{flow:s,indicator:`explicit-key-ind`,next:f??p?.[0],offset:u,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!h.found){if(!h.anchor&&!h.tag&&!p&&!m){a===0&&h.comma?i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`):a<r.items.length-1&&i(h.start,`UNEXPECTED_TOKEN`,`Unexpected empty item in ${s}`),h.comment&&(c.comment?c.comment+=`
`+h.comment:c.comment=h.comment),u=h.end;continue}!o&&n.options.strict&&O_(f)&&i(f,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`)}if(a===0)h.comma&&i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`);else if(h.comma||i(h.start,`MISSING_CHAR`,`Missing , between ${s} items`),h.comment){let e=``;loop:for(let t of d)switch(t.type){case`comma`:case`space`:break;case`comment`:e=t.source.substring(1);break loop;default:break loop}if(e){let t=c.items[c.items.length-1];Ih(t)&&(t=t.value??t.key),t.comment?t.comment+=`
`+e:t.comment=e,h.comment=h.comment.substring(e.length+1)}}if(!o&&!p&&!h.found){let r=m?e(n,m,h,i):t(n,h.end,p,null,h,i);c.items.push(r),u=r.range[2],P_(m)&&i(r.range,`BLOCK_IN_FLOW`,N_)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);P_(f)&&i(g.range,`BLOCK_IN_FLOW`,N_),n.atKey=!1;let _=D_(p??[],{flow:s,indicator:`map-value-ind`,next:m,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(_.found){if(!o&&!h.found&&n.options.strict){if(p)for(let e of p){if(e===_.found)break;if(e.type===`newline`){i(e,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`);break}}h.start<_.found.offset-1024&&i(_.found,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit flow sequence key`)}}else m&&(`source`in m&&m.source?.[0]===`:`?i(m,`MISSING_CHAR`,`Missing space after : in ${s}`):i(_.start,`MISSING_CHAR`,`Missing , or : between ${s} items`));let v=m?e(n,m,_,i):_.found?t(n,_.end,p,null,_,i):null;v?P_(m)&&i(v.range,`BLOCK_IN_FLOW`,N_):_.comment&&(g.comment?g.comment+=`
`+_.comment:g.comment=_.comment);let y=new kg(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;A_(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new Ng(n.schema);e.flow=!0,e.items.push(y);let t=(v??g).range;e.range=[g.range[0],t[1],t[2]],c.items.push(e)}u=v?v.range[2]:_.end}}let d=o?`}`:`]`,[f,...p]=r.end,m=u;if(f?.source===d)m=f.offset+f.source.length;else{let e=s[0].toUpperCase()+s.substring(1),t=l?`${e} must end with a ${d}`:`${e} in block collection must be sufficiently indented and end with a ${d}`;i(u,l?`MISSING_CHAR`:`BAD_INDENT`,t),f&&f.source.length!==1&&p.unshift(f)}if(p.length>0){let e=M_(p,m,n.options.strict,i);e.comment&&(c.comment?c.comment+=`
`+e.comment:c.comment=e.comment),c.range=[r.offset,m,e.offset]}else c.range=[r.offset,m,m];return c}function F_(e,t,n,r,i,a){let o=n.type===`block-map`?Wse(e,t,n,r,a):n.type===`block-seq`?Gse(e,t,n,r,a):Kse(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function qse(e,t,n,r,i){let a=r.tag,o=a?t.directives.tagName(a.source,e=>i(a,`TAG_RESOLVE_FAILED`,e)):null;if(n.type===`block-seq`){let{anchor:e,newlineAfterProp:t}=r,n=e&&a?e.offset>a.offset?e:a:e??a;n&&(!t||t.offset<n.offset)&&i(n,`MISSING_CHAR`,`Missing newline after block sequence props`)}let s=n.type===`block-map`?`map`:n.type===`block-seq`?`seq`:n.start.source===`{`?`map`:`seq`;if(!a||!o||o===`!`||o===Ng.tagName&&s===`map`||o===Fg.tagName&&s===`seq`)return F_(e,t,n,i,o);let c=t.schema.tags.find(e=>e.tag===o&&e.collection===s);if(!c){let r=t.schema.knownTags[o];if(r?.collection===s)t.schema.tags.push(Object.assign({},r,{default:!1})),c=r;else return r?i(a,`BAD_COLLECTION_TYPE`,`${r.tag} used for ${s} collection, but expects ${r.collection??`scalar`}`,!0):i(a,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${o}`,!0),F_(e,t,n,i,o)}let l=F_(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=Bh(u)?u:new ng(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function Jse(e,t,n){let r=t.offset,i=Yse(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?ng.BLOCK_FOLDED:ng.BLOCK_LITERAL,o=t.source?Xse(t.source):[],s=o.length;for(let e=o.length-1;e>=0;--e){let t=o[e][1];if(t===``||t===`\r`)s=e;else break}if(s===0){let e=i.chomp===`+`&&o.length>0?`
`.repeat(Math.max(1,o.length-1)):``,n=r+i.length;return t.source&&(n+=t.source.length),{value:e,type:a,comment:i.comment,range:[r,n,n]}}let c=t.indent+i.indent,l=t.offset+i.length,u=0;for(let t=0;t<s;++t){let[r,a]=o[t];if(a===``||a===`\r`)i.indent===0&&r.length>c&&(c=r.length);else{r.length<c&&n(l+r.length,`MISSING_CHAR`,`Block scalars with more-indented leading empty lines must use an explicit indentation indicator`),i.indent===0&&(c=r.length),u=t,c===0&&!e.atRoot&&n(l,`BAD_INDENT`,`Block scalar values in collections must be indented`);break}l+=r.length+a.length+1}for(let e=o.length-1;e>=s;--e)o[e][0].length>c&&(s=e+1);let d=``,f=``,p=!1;for(let e=0;e<u;++e)d+=o[e][0].slice(c)+`
`;for(let e=u;e<s;++e){let[t,r]=o[e];l+=t.length+r.length+1;let s=r[r.length-1]===`\r`;if(s&&(r=r.slice(0,-1)),r&&t.length<c){let e=`Block scalar lines must not be less indented than their ${i.indent?`explicit indentation indicator`:`first line`}`;n(l-r.length-(s?2:1),`BAD_INDENT`,e),t=``}a===ng.BLOCK_LITERAL?(d+=f+t.slice(c)+r,f=`
`):t.length>c||r[0]===` `?(f===` `?f=`
`:!p&&f===`
`&&(f=`
`),d+=f+t.slice(c)+r,f=`
`,p=!0):r===``?f===`
`?d+=`
`:f=`
`:(d+=f+r,f=` `,p=!1)}switch(i.chomp){case`-`:break;case`+`:for(let e=s;e<o.length;++e)d+=`
`+o[e][0].slice(c);d[d.length-1]!==`
`&&(d+=`
`);break;default:d+=`
`}let m=r+i.length+t.source.length;return{value:d,type:a,comment:i.comment,range:[r,m,m]}}function Yse({offset:e,props:t},n,r){if(t[0].type!==`block-scalar-header`)return r(t[0],`IMPOSSIBLE`,`Block scalar header not found`),null;let{source:i}=t[0],a=i[0],o=0,s=``,c=-1;for(let t=1;t<i.length;++t){let n=i[t];if(!s&&(n===`-`||n===`+`))s=n;else{let r=Number(n);!o&&r?o=r:c===-1&&(c=e+t)}}c!==-1&&r(c,`UNEXPECTED_TOKEN`,`Block scalar header includes extra characters: ${i}`);let l=!1,u=``,d=i.length;for(let e=1;e<t.length;++e){let i=t[e];switch(i.type){case`space`:l=!0;case`newline`:d+=i.source.length;break;case`comment`:n&&!l&&r(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`),d+=i.source.length,u=i.source.substring(1);break;case`error`:r(i,`UNEXPECTED_TOKEN`,i.message),d+=i.source.length;break;default:{r(i,`UNEXPECTED_TOKEN`,`Unexpected token in block scalar header: ${i.type}`);let e=i.source;e&&typeof e==`string`&&(d+=e.length)}}}return{mode:a,indent:o,chomp:s,comment:u,length:d}}function Xse(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:[``,n]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}function Zse(e,t,n){let{offset:r,type:i,source:a,end:o}=e,s,c,l=(e,t,i)=>n(r+e,t,i);switch(i){case`scalar`:s=ng.PLAIN,c=Qse(a,l);break;case`single-quoted-scalar`:s=ng.QUOTE_SINGLE,c=$se(a,l);break;case`double-quoted-scalar`:s=ng.QUOTE_DOUBLE,c=ece(a,l);break;default:return n(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found: ${i}`),{value:``,type:null,comment:``,range:[r,r+a.length,r+a.length]}}let u=r+a.length,d=M_(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function Qse(e,t){let n=``;switch(e[0]){case` `:n=`a tab character`;break;case`,`:n=`flow indicator character ,`;break;case`%`:n=`directive indicator character %`;break;case`|`:case`>`:n=`block scalar indicator ${e[0]}`;break;case`@`:case"`":n=`reserved character ${e[0]}`}return n&&t(0,`BAD_SCALAR_START`,`Plain value cannot start with ${n}`),I_(e)}function $se(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),I_(e.slice(1,-1)).replace(/''/g,`'`)}function I_(e){let t=/(.*?)\r?\n/sy,n=t.exec(e);if(!n)return e;let r,i;try{r=RegExp(`(?<![ ])[ ]+$`),i=RegExp(`^[ ]+|(?<![ ])[ ]+$`,`g`)}catch{r=/[ \t]+$/,i=/^[ \t]+|[ \t]+$/g}let a=n[1].replace(r,``),o=` `,s=t.lastIndex;for(;n=t.exec(e);){let e=n[1].replace(i,``);e===``?o===`
`?a+=o:o=`
`:(a+=o+e,o=` `),s=t.lastIndex}let c=/[ \t]*(.*)/sy;return c.lastIndex=s,n=c.exec(e),a+o+(n?.[1]??``)}function ece(e,t){let n=``;for(let r=1;r<e.length-1;++r){let i=e[r];if(i!==`\r`||e[r+1]!==`
`){if(i===`
`){let{fold:t,offset:i}=tce(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=nce[i];if(a)n+=a;else if(i===`
`)for(i=e[r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`\r`&&e[r+1]===`
`)for(i=e[++r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`x`||i===`u`||i===`U`){let a=i===`x`?2:i===`u`?4:8;n+=rce(e,r+1,a,t),r+=a}else{let i=e.substr(r-1,2);t(r-1,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),n+=i}}else if(i===` `||i===` `){let t=r,a=e[r+1];for(;a===` `||a===` `;)a=e[++r+1];a!==`
`&&(a!==`\r`||e[r+2]!==`
`)&&(n+=r>t?e.slice(t,r+1):i)}else n+=i}}return(e[e.length-1]!==`"`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing "quote`),n}function tce(e,t){let n=``,r=e[t+1];for(;(r===` `||r===` `||r===`
`||r===`\r`)&&(r!==`\r`||e[t+2]===`
`);)r===`
`&&(n+=`
`),t+=1,r=e[t+1];return n||=` `,{fold:n,offset:t}}var nce={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
`,r:`\r`,t:` `,v:`\v`,N:`…`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function rce(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{let i=e.substr(t-2,n+2);return r(t-2,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),i}}function L_(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?Jse(e,t,r):Zse(t,e.options.strict,r),c=n?e.directives.tagName(n.source,e=>r(n,`TAG_RESOLVE_FAILED`,e)):null,l;l=e.options.stringKeys&&e.atKey?e.schema[Ah]:c?ice(e.schema,i,c,n,r):t.type===`scalar`?ace(e,i,t,r):e.schema[Ah];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=Lh(a)?a:new ng(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new ng(i)}return u.range=s,u.source=i,a&&(u.type=a),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function ice(e,t,n,r,i){if(n===`!`)return e[Ah];let a=[];for(let t of e.tags)if(!t.collection&&t.tag===n){if(t.default&&t.test)a.push(t);else return t}for(let e of a)if(e.test?.test(t))return e;let o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${n}`,n!==`tag:yaml.org,2002:str`),e[Ah])}function ace({atKey:e,directives:t,schema:n},r,i,a){let o=n.tags.find(t=>(t.default===!0||e&&t.default===`key`)&&t.test?.test(r))||n[Ah];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[Ah];o.tag!==e.tag&&a(i,`TAG_RESOLVE_FAILED`,`Value may be parsed as either ${t.tagString(o.tag)} or ${t.tagString(e.tag)}`,!0)}return o}function oce(e,t,n){if(t){n??=t.length;for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case`space`:case`comment`:case`newline`:e-=n.source.length;continue}for(n=t[++r];n?.type===`space`;)e+=n.source.length,n=t[++r];break}}return e}var sce={composeNode:R_,composeEmptyNode:z_};function R_(e,t,n,r){let i=e.atKey,{spaceBefore:a,comment:o,anchor:s,tag:c}=n,l,u=!0;switch(t.type){case`alias`:l=cce(e,t,r),(s||c)&&r(t,`ALIAS_PROPS`,`An alias node must not specify any properties`);break;case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`block-scalar`:l=L_(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=qse(sce,e,t,n,r),s&&(l.anchor=s.source.substring(1))}catch(e){r(t,`RESOURCE_EXHAUSTION`,e instanceof Error?e.message:String(e))}break;default:r(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),u=!1}return l??=z_(e,t.offset,void 0,null,n,r),s&&l.anchor===``&&r(s,`BAD_ALIAS`,`Anchor cannot be an empty string`),i&&e.options.stringKeys&&(!Lh(l)||typeof l.value!=`string`||l.tag&&l.tag!==`tag:yaml.org,2002:str`)&&r(c??t,`NON_STRING_KEY`,`With stringKeys, all keys must be strings`),a&&(l.spaceBefore=!0),o&&(t.type===`scalar`&&t.source===``?l.comment=o:l.commentBefore=o),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function z_(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=L_(e,{type:`scalar`,offset:oce(t,n,r),indent:-1,source:``},s,l);return o&&(u.anchor=o.source.substring(1),u.anchor===``&&l(o,`BAD_ALIAS`,`Anchor cannot be an empty string`)),i&&(u.spaceBefore=!0),a&&(u.comment=a,u.range[2]=c),u}function cce({options:e},{offset:t,source:n,end:r},i){let a=new $h(n.substring(1));a.source===``&&i(t,`BAD_ALIAS`,`Alias cannot be an empty string`),a.source.endsWith(`:`)&&i(t+n.length-1,`BAD_ALIAS`,`Alias ending in : is ambiguous`,!0);let o=t+n.length,s=M_(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function lce(e,t,{offset:n,start:r,value:i,end:a},o){let s=new S_(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=D_(r,{indicator:`doc-start`,next:i??a?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});l.found&&(s.directives.docStart=!0,i&&(i.type===`block-map`||i.type===`block-seq`)&&!l.hasNewline&&o(l.end,`MISSING_CHAR`,`Block collection cannot start on same line with directives-end marker`)),s.contents=i?R_(c,i,l,o):z_(c,l.end,r,null,l,o);let u=s.contents.range[2],d=M_(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function B_(e){if(typeof e==`number`)return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n==`string`?n.length:1)]}function V_(e){let t=``,n=!1,r=!1;for(let i=0;i<e.length;++i){let a=e[i];switch(a[0]){case`#`:t+=(t===``?``:r?`
`:`
`)+(a.substring(1)||` `),n=!0,r=!1;break;case`%`:e[i+1]?.[0]!==`#`&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}var uce=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=B_(e);r?this.warnings.push(new Use(i,t,n)):this.errors.push(new T_(i,t,n))},this.directives=new Kh({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=V_(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(zh(i)&&!i.flow&&i.items.length>0){let e=i.items[0];Ih(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{let e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}if(t){for(let t=0;t<this.errors.length;++t)e.errors.push(this.errors[t]);for(let t=0;t<this.warnings.length;++t)e.warnings.push(this.warnings[t])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:V_(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let t of e)yield*this.next(t);yield*this.end(t,n)}*next(e){switch(e.type){case`directive`:this.directives.add(e.source,(t,n,r)=>{let i=B_(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=lce(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,`MISSING_CHAR`,`Missing directives-end/doc-start indicator line`),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case`byte-order-mark`:case`space`:break;case`comment`:case`newline`:this.prelude.push(e.source);break;case`error`:{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new T_(B_(e),`UNEXPECTED_TOKEN`,t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case`doc-end`:{if(!this.doc){this.errors.push(new T_(B_(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=M_(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new T_(B_(e),`UNEXPECTED_TOKEN`,`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=new S_(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),e.range=[0,t,t],this.decorate(e,!1),yield e}}},H_=Symbol(`break visit`),dce=Symbol(`skip children`),U_=Symbol(`remove item`);function W_(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),G_(Object.freeze([]),e,t)}W_.BREAK=H_,W_.SKIP=dce,W_.REMOVE=U_,W_.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},W_.parentCollection=(e,t)=>{let n=W_.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function G_(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;t<a.items.length;++t){let r=G_(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===H_)return H_;else r===U_&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function fce(e){switch(e){case``:return`byte-order-mark`;case``:return`doc-mode`;case``:return`flow-error-end`;case``:return`scalar`;case`---`:return`doc-start`;case`...`:return`doc-end`;case``:case`
`:case`\r
`:return`newline`;case`-`:return`seq-item-ind`;case`?`:return`explicit-key-ind`;case`:`:return`map-value-ind`;case`{`:return`flow-map-start`;case`}`:return`flow-map-end`;case`[`:return`flow-seq-start`;case`]`:return`flow-seq-end`;case`,`:return`comma`}switch(e[0]){case` `:case` `:return`space`;case`#`:return`comment`;case`%`:return`directive-line`;case`*`:return`alias`;case`&`:return`anchor`;case`!`:return`tag`;case`'`:return`single-quoted-scalar`;case`"`:return`double-quoted-scalar`;case`|`:case`>`:return`block-scalar-header`}return null}function K_(e){switch(e){case void 0:case` `:case`
`:case`\r`:case` `:return!0;default:return!1}}var q_=new Set(`0123456789ABCDEFabcdef`),pce=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),J_=new Set(`,[]{}`),mce=new Set(` ,[]{}
\r `),Y_=e=>!e||mce.has(e),hce=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer=``,this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!=`string`)throw TypeError(`source is not a string`);this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??`stream`;for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===` `||t===` `;)t=this.buffer[++e];return!t||t===`#`||t===`
`||t===`\r`&&this.buffer[e+1]===`
`}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===` `;)t=this.buffer[++n+e];if(t===`\r`){let t=this.buffer[n+e+1];if(t===`
`||!t&&!this.atEnd)return e+n+1}return t===`
`||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t===`-`||t===`.`){let t=this.buffer.substr(e,3);if((t===`---`||t===`...`)&&K_(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!=`number`||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]===`\r`&&--e,this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case`stream`:return yield*this.parseStream();case`line-start`:return yield*this.parseLineStart();case`block-start`:return yield*this.parseBlockStart();case`doc`:return yield*this.parseDocument();case`flow`:return yield*this.parseFlowCollection();case`quoted-scalar`:return yield*this.parseQuotedScalar();case`block-scalar`:return yield*this.parseBlockScalar();case`plain-scalar`:return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext(`stream`);if(e[0]===``&&(yield*this.pushCount(1),e=e.substring(1)),e[0]===`%`){let t=e.length,n=e.indexOf(`#`);for(;n!==-1;){let r=e[n-1];if(r===` `||r===` `){t=n-1;break}n=e.indexOf(`#`,n+1)}for(;;){let n=e[t-1];if(n===` `||n===` `)--t;else break}let r=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),`stream`}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),`stream`}return yield``,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext(`line-start`);if(e===`-`||e===`.`){if(!this.atEnd&&!this.hasChars(4))return this.setNext(`line-start`);let e=this.peek(3);if((e===`---`||e===`...`)&&K_(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,e===`---`?`doc`:`stream`}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!K_(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext(`block-start`);if((e===`-`||e===`?`||e===`:`)&&K_(t)){let e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,`block-start`}return`doc`}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext(`doc`);let t=yield*this.pushIndicators();switch(e[t]){case`#`:yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),`doc`;case`*`:return yield*this.pushUntil(Y_),`doc`;case`"`:case`'`:return yield*this.parseQuotedScalar();case`|`:case`>`:return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let r=this.getLine();if(r===null)return this.setNext(`flow`);if((n!==-1&&n<this.indentNext&&r[0]!==`#`||n===0&&(r.startsWith(`---`)||r.startsWith(`...`))&&K_(r[3]))&&(n!==this.indentNext-1||this.flowLevel!==1||r[0]!==`]`&&r[0]!==`}`))return this.flowLevel=0,yield``,yield*this.parseLineStart();let i=0;for(;r[i]===`,`;)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),r[i]){case void 0:return`flow`;case`#`:return yield*this.pushCount(r.length-i),`flow`;case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),this.flowKey=!0,--this.flowLevel,this.flowLevel?`flow`:`doc`;case`*`:return yield*this.pushUntil(Y_),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||K_(e)||e===`,`)return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),`flow`}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e===`'`)for(;t!==-1&&this.buffer[t+1]===`'`;)t=this.buffer.indexOf(`'`,t+2);else for(;t!==-1;){let e=0;for(;this.buffer[t-1-e]===`\\`;)e+=1;if(e%2==0)break;t=this.buffer.indexOf(`"`,t+1)}let n=this.buffer.substring(0,t),r=n.indexOf(`
`,this.pos);if(r!==-1){for(;r!==-1;){let e=this.continueScalar(r+1);if(e===-1)break;r=n.indexOf(`
`,e)}r!==-1&&(t=r-(n[r-1]===`\r`?2:1))}if(t===-1){if(!this.atEnd)return this.setNext(`quoted-scalar`);t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?`flow`:`doc`}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t===`+`)this.blockScalarKeep=!0;else if(t>`0`&&t<=`9`)this.blockScalarIndent=Number(t)-1;else if(t!==`-`)break}return yield*this.pushUntil(e=>K_(e)||e===`#`)}*parseBlockScalar(){let e=this.pos-1,t=0,n;loop:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case` `:t+=1;break;case`
`:e=r,t=0;break;case`\r`:{let e=this.buffer[r+1];if(!e&&!this.atEnd)return this.setNext(`block-scalar`);if(e===`
`)break}default:break loop}if(!n&&!this.atEnd)return this.setNext(`block-scalar`);if(t>=this.indentNext){this.indentNext=this.blockScalarIndent===-1?t:this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let t=this.continueScalar(e+1);if(t===-1)break;e=this.buffer.indexOf(`
`,t)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext(`block-scalar`);e=this.buffer.length}}let r=e+1;for(n=this.buffer[r];n===` `;)n=this.buffer[++r];if(n===` `){for(;n===` `||n===` `||n===`\r`||n===`
`;)n=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let n=e-1,r=this.buffer[n];r===`\r`&&(r=this.buffer[--n]);let i=n;for(;r===` `;)r=this.buffer[--n];if(r===`
`&&n>=this.pos&&n+1+t>i)e=n;else break}while(1);return yield``,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,r;for(;r=this.buffer[++n];)if(r===`:`){let r=this.buffer[n+1];if(K_(r)||e&&J_.has(r))break;t=n}else if(K_(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===`
`?(n+=1,r=`
`,i=this.buffer[n+1]):t=n),i===`#`||e&&J_.has(i))break;if(r===`
`){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&J_.has(r))break;t=n}return!r&&!this.atEnd?this.setNext(`plain-scalar`):(yield``,yield*this.pushToIndex(t+1,!0),e?`flow`:`doc`)}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield``),0)}*pushIndicators(){let e=0;loop:for(;;){switch(this.charAt(0)){case`!`:e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue loop;case`&`:e+=yield*this.pushUntil(Y_),e+=yield*this.pushSpaces(!0);continue loop;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,n=this.charAt(1);if(K_(n)||t&&J_.has(n)){t?this.flowKey&&=!1:this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue loop}}}break loop}return e}*pushTag(){if(this.charAt(1)===`<`){let e=this.pos+2,t=this.buffer[e];for(;!K_(t)&&t!==`>`;)t=this.buffer[++e];return yield*this.pushToIndex(t===`>`?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(pce.has(t))t=this.buffer[++e];else if(t===`%`&&q_.has(this.buffer[e+1])&&q_.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
`?yield*this.pushCount(1):e===`\r`&&this.charAt(1)===`
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===` `||e&&n===` `);let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}},gce=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}};function X_(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function Z_(e){for(let t=0;t<e.length;++t)switch(e[t].type){case`space`:case`comment`:case`newline`:break;default:return t}return-1}function Q_(e){switch(e?.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`flow-collection`:return!0;default:return!1}}function $_(e){switch(e.type){case`document`:return e.start;case`block-map`:{let t=e.items[e.items.length-1];return t.sep??t.start}case`block-seq`:return e.items[e.items.length-1].start;default:return[]}}function ev(e){if(e.length===0)return[];let t=e.length;loop:for(;--t>=0;)switch(e[t].type){case`doc-start`:case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:case`newline`:break loop}for(;e[++t]?.type===`space`;);return e.splice(t,e.length)}function tv(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function nv(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!X_(t.start,`explicit-key-ind`)&&!X_(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,Q_(t.value)?t.value.end?tv(t.value.end,t.sep):t.value.end=t.sep:tv(t.start,t.sep),delete t.sep)}var _ce=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source=``,this.type=``,this.lexer=new hce,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=fce(e);if(!t){let t=`Not a YAML token: ${e}`;yield*this.pop({type:`error`,offset:this.offset,message:t,source:e}),this.offset+=e.length}else if(t===`scalar`)this.atNewLine=!1,this.atScalar=!0,this.type=`scalar`;else{switch(this.type=t,yield*this.step(),t){case`newline`:this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case`space`:this.atNewLine&&e[0]===` `&&(this.indent+=e.length);break;case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:this.atNewLine&&(this.indent+=e.length);break;case`doc-mode`:case`flow-error-end`:return;default:this.atNewLine=!1}this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type===`doc-end`&&e?.type!==`doc-end`){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:`doc-end`,offset:this.offset,source:this.source})}else{if(!e)return yield*this.stream();switch(e.type){case`document`:return yield*this.document(e);case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return yield*this.scalar(e);case`block-scalar`:return yield*this.blockScalar(e);case`block-map`:return yield*this.blockMap(e);case`block-seq`:return yield*this.blockSequence(e);case`flow-collection`:return yield*this.flowCollection(e);case`doc-end`:return yield*this.documentEnd(e)}yield*this.pop()}}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:`error`,offset:this.offset,source:``,message:`Tried to pop an empty stack`};else if(this.stack.length===0)yield t;else{let e=this.peek(1);switch(t.type===`block-scalar`?t.indent=`indent`in e?e.indent:0:t.type===`flow-collection`&&e.type===`document`&&(t.indent=0),t.type===`flow-collection`&&nv(t),e.type){case`document`:e.value=t;break;case`block-scalar`:e.props.push(t);break;case`block-map`:{let n=e.items[e.items.length-1];if(n.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case`block-seq`:{let n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case`flow-collection`:{let n=e.items[e.items.length-1];!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((e.type===`document`||e.type===`block-map`||e.type===`block-seq`)&&(t.type===`block-map`||t.type===`block-seq`)){let n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&Z_(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!==`comment`||e.indent<t.indent))&&(e.type===`document`?e.end=n.start:e.items.push({start:n.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case`directive-line`:yield{type:`directive`,offset:this.offset,source:this.source};return;case`byte-order-mark`:case`space`:case`comment`:case`newline`:yield this.sourceToken;return;case`doc-mode`:case`doc-start`:{let e={type:`document`,offset:this.offset,start:[]};this.type===`doc-start`&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:`error`,offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case`doc-start`:Z_(e.start)===-1?e.start.push(this.sourceToken):(yield*this.pop(),yield*this.step());return;case`anchor`:case`tag`:case`space`:case`comment`:case`newline`:e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:`error`,offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type===`map-value-ind`){let t=ev($_(this.peek(2))),n;e.end?(n=e.end,n.push(this.sourceToken),delete e.end):n=[this.sourceToken];let r={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:t,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case`space`:case`comment`:case`newline`:e.props.push(this.sourceToken);return;case`scalar`:if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let e=this.source.indexOf(`
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
`,e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(this.onKeyLine=!1,t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){tv(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!==`seq-item-ind`,i=[];if(r&&t.sep&&!t.value){let n=[];for(let r=0;r<t.sep.length;++r){let i=t.sep[r];switch(i.type){case`newline`:n.push(r);break;case`space`:break;case`comment`:i.indent>e.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case`anchor`:case`tag`:r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`explicit-key-ind`:!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case`map-value-ind`:if(t.explicitKey){if(!t.sep){if(X_(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=ev(t.start);this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(X_(t.sep,`map-value-ind`))this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(Q_(t.key)&&!X_(t.sep,`newline`)){let e=ev(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken)}else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):X_(t.sep,`map-value-ind`)?this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0);return}default:{let r=this.startBlockValue(e);if(r){if(r.type===`block-seq`){if(!t.explicitKey&&t.sep&&!X_(t.sep,`newline`)){yield*this.pop({type:`error`,offset:this.offset,message:`Unexpected block-seq-ind on same line with key`,source:this.source});return}}else n&&e.items.push({start:i});this.stack.push(r);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){tv(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case`anchor`:case`tag`:if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case`seq-item-ind`:if(this.indent!==e.indent)break;t.value||X_(t.start,`seq-item-ind`)?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type===`flow-error-end`){let e;do yield*this.pop(),e=this.peek(1);while(e?.type===`flow-collection`)}else if(e.end.length===0){switch(this.type){case`comma`:case`explicit-key-ind`:!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case`map-value-ind`:!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case`space`:case`comment`:case`newline`:case`anchor`:case`tag`:!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]});return}case`flow-map-end`:case`flow-seq-end`:e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let t=this.peek(2);if(t.type===`block-map`&&(this.type===`map-value-ind`&&t.indent===e.indent||this.type===`newline`&&!t.items[t.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type===`map-value-ind`&&t.type!==`flow-collection`){let n=ev($_(t));nv(e);let r=e.end.splice(1,e.end.length);r.push(this.sourceToken);let i={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf(`
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
`,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=ev($_(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=ev($_(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}};function vce(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new gce||null,prettyErrors:t}}function rv(e,t={}){let{lineCounter:n,prettyErrors:r}=vce(t),i=new _ce(n?.addNewLine),a=new uce(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new T_(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(E_(e,n)),o.warnings.forEach(E_(e,n))),o}function yce(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=rv(e,n);if(!i)return null;if(i.warnings.forEach(e=>xg(i.options.logLevel,e)),i.errors.length>0){if(i.options.logLevel!==`silent`)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}function bce(e,t,n){let r=null;if(typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n==`string`&&(n=n.length),typeof n==`number`){let e=Math.round(n);n=e<1?void 0:e>8?{indent:8}:{indent:e}}if(e===void 0){let{keepUndefined:e}=n??t??{};if(!e)return}return Ph(e)&&!r?e.toString(n):new S_(e,r,n).toString(n)}var iv=new Map,av=(e,t)=>{let n=Object.entries(t).filter(([,e])=>e!==void 0);n.length?iv.set(e,Object.fromEntries(n)):iv.delete(e)},ov=(e,t)=>{av(e,{...iv.get(e),...t})},xce=({previousPath:e,path:t})=>{let n=e?iv.get(e):void 0;return n?iv.set(t,n):iv.delete(t),n??{}},Sce=/(?:^|[^\d])\.0|\d\.0*(?!\d)|\d[eE][-+]?\d/,Cce=/^[-+]?(?:\d+|0o[0-7]+|0x[\da-fA-F]+)$/,wce=/^[-+]?(?:\.\d+|\d+(?:\.\d*)?)(?:[eE][-+]?\d+)?$/,Tce=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][-+]?\d+)?$/,sv=/^-?\d+$/,cv=e=>Sce.test(e),lv=e=>typeof e==`number`&&Number.isInteger(e),uv=e=>{let t=Object.is(e,-0)?`-0`:String(e);return/[.e]/.test(t)?t:`${t}.0`},dv=(e,t,n)=>{let r=e.get(t);e.set(t,r===void 0||r===n?n:null)},fv=(e,t)=>{let n=String(t).replace(/[\\.]/g,`\\$&`);return e?`${e}.${n}`:n},Ece=e=>{let t={},n=(e,r)=>{if(Lh(e)){let{value:n,source:i,tag:a}=e;r&&lv(n)&&(!a||a===`tag:yaml.org,2002:float`)&&typeof i==`string`&&!Cce.test(i)&&(t[r]={value:n,source:i})}else Fh(e)?e.items.forEach(({key:e,value:t})=>{Lh(e)&&n(t,fv(r,String(e.value)))}):Rh(e)&&e.items.forEach((e,t)=>{n(e,fv(r,t))})};return n(e.contents,``),t},pv=class{constructor(e,t){this.value=e,this.source=t}toJSON(){return this.value}},Dce=(e,t,n)=>{let r=n?.source;return lv(t)&&typeof r==`string`&&!sv.test(r)?new pv(t,r):t},Oce=e=>{let t={},n=(e,r)=>e instanceof pv?(r&&(t[r]={value:e.value,source:e.source}),e.value):((Array.isArray(e)||X(e))&&Object.entries(e).forEach(([t,i])=>{e[t]=n(i,fv(r,t))}),e);return{value:n(e,``),sourceMap:t}},mv=(e,t)=>{Object.keys(t).length&&ov(e,{valueSources:t})},kce=(e,t)=>{let n=new Map;return Object.entries(e).forEach(([e,t])=>{let[r,...i]=e.split(`.`);n.has(r)||n.set(r,[]),n.get(r).push([i.join(`.`),t])}),Object.fromEntries(t.flatMap((e,t)=>e===void 0?[]:(n.get(String(e))??[]).map(([e,n])=>[e?`${t}.${e}`:String(t),n])))},Ace=(e,{value:t,source:n})=>typeof e==`number`&&e===t?new pv(e,n):void 0,hv=(e,t,n=Ace,r=``)=>{let i=r&&Object.hasOwn(t,r)?t[r]:void 0,a=i?n(e,i):void 0;return a===void 0?Array.isArray(e)?e.map((e,i)=>hv(e,t,n,fv(r,i))):hm(e)?Object.fromEntries(Object.entries(e).map(([e,i])=>[e,hv(i,t,n,fv(r,e))])):e:a},gv=(e,t,n)=>n.test(e)&&/[.eE]/.test(e)&&Number(e.replaceAll(`_`,``))===t,jce=({value:e,source:t})=>gv(t,e,Tce)?t:void 0,Mce={identify:e=>e instanceof pv,default:!0,tag:`tag:yaml.org,2002:float`,resolve:e=>Number(e),stringify:({value:e})=>{let{value:t,source:n}=e;return gv(n,t,wce)?n:uv(t)}},_v=new Map,Nce=/\d{16}/,vv=e=>Nce.test(e),yv=(e,t)=>{dv(_v,e,t)},bv=e=>{let t=Number(e);return Number.isSafeInteger(t)||yv(t,String(e)),t},xv=e=>typeof e==`bigint`?bv(e):Number.isInteger(e)&&!Number.isSafeInteger(e)?(yv(e,String(BigInt(e))),e):((Array.isArray(e)||X(e))&&Object.entries(e).forEach(([t,n])=>{e[t]=xv(n)}),e),Sv=(e,t,n)=>{let r=n?.source;return typeof t==`number`&&!Number.isSafeInteger(t)&&typeof r==`string`&&sv.test(r)?bv(BigInt(r)):t},Cv=e=>typeof e==`number`&&!Number.isSafeInteger(e)?_v.get(e)??void 0:void 0,Pce=()=>_v.size>0,wv=e=>{let t=Cv(e);return t===void 0?Array.isArray(e)?e.map(wv):hm(e)?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,wv(t)])):e:BigInt(t)};
/*!
* Copyright (c) Squirrel Chat et al., All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
function Fce(e,t){let n=e.slice(0,t).split(/\r?\n/);return[n.length,n.pop().length+1]}function Ice(e,t,n){let r=e.split(/\r?\n/),i=``,a=(Math.log10(t+1)|0)+1;for(let e=t-1;e<=t+1;e++){let o=r[e-1];o&&(i+=e.toString().padEnd(a,` `),i+=`: `,i+=o,i+=`
`,e===t&&(i+=` `.repeat(a+n+2),i+=`^
`))}return i}var Tv=class e extends Error{line;column;codeblock;constructor(e,t){let[n,r]=Fce(t.toml,t.ptr),i=Ice(t.toml,n,r);super(`Invalid TOML document: ${e}\n\n${i}`,t),this.line=n,this.column=r,this.codeblock=i}static x(t,n,r){throw new e(t,{toml:n.s,ptr:r??n.p})}};
/*!
* Copyright (c) Squirrel Chat et al., All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
function Ev(e){let t=e.p,n=e.s.charCodeAt(e.p++),r=n,i=n===39,a=n===e.s.charCodeAt(e.p)&&n===e.s.charCodeAt(e.p+1);a&&((n=e.s.charCodeAt(e.p+=2))===10?e.p++:n===13&&e.s.charCodeAt(e.p+1)===10&&(e.p+=2));let o=``,s=e.p,c=0;for(;e.p<e.s.length;e.p++)if(n=e.s.charCodeAt(e.p),a&&(n===10||n===13&&e.s.charCodeAt(e.p+1)===10))c&&=3;else if(n<32&&n!==9||n===127)Tv.x(`control characters are not allowed in strings`,e);else if((!c||c===3)&&n===r&&(!a||e.s.charCodeAt(e.p+1)===r&&e.s.charCodeAt(e.p+2)===r)){if(a&&(e.s.charCodeAt(e.p+3)===r&&e.p++,e.s.charCodeAt(e.p+3)===r&&e.p++),!c){let t=e.s.slice(s,e.p);o=o?o+t:t}return e.p+=a?3:1,o}else if(!c)!i&&n===92&&(o+=e.s.slice(s,s=e.p),c=1);else if(c===1){if(n===120||n===117||n===85){let t=e.p++-1,r=0,i=n===120?2:n===117?4:8;for(let t=0;t<i;t++,e.p++){let t=e.s.charCodeAt(e.p),n=t>=48&&t<=57?t-48:t>=65&&t<=70?t-65+10:t>=97&&t<=102?t-97+10:-1;n<0&&Tv.x(`invalid non-hex character in unicode escape`,e),r=r<<4|n}(r<0||r>1114111||r>=55296&&r<=57343)&&Tv.x(`invalid unicode escape`,e,t),o+=String.fromCodePoint(r),s=e.p--,c=0}else a&&(n===32||n===9)?c=2:(n===98?o+=`\b`:n===116?o+=` `:n===110?o+=`
`:n===102?o+=`\f`:n===114?o+=`\r`:n===101?o+=`\x1B`:n===34?o+=`"`:n===92?o+=`\\`:Tv.x(`unrecognised escape sequence`,e),s=e.p+1,c=0)}else n!==32&&n!==9&&(c===2&&Tv.x(`invalid escape: only line-ending whitespace may be escaped`,e,s),c=+(!i&&n===92),s=e.p);Tv.x(`unfinished string`,e,t)}
/*!
* Copyright (c) Squirrel Chat et al., All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
var Lce=/^(\d{4}-\d{2}-\d{2})?[Tt ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|z|[-+]\d{2}:\d{2})?$/i,Dv=class e extends Date{#e=!1;#t=!1;#n=null;constructor(e,t,n){let r=!0,i=!0,a=`Z`,o;if(typeof e==`string`){if(t)prep:{if(t<3){if(+e.slice(11,13)>23){e=``;break prep}t===2?(a=null,e+=`Z`):(o=e.charCodeAt(e.length-1))!==90&&o!==122&&(a=e.slice(e.length-6)),n&&(e=e.slice(0,10)+`T`+e.slice(11))}else t===4&&(e=+e.slice(0,2)>23?``:`0000-01-01T${e}Z`);r=t!==4,i=t!==3}else{let t=e.match(Lce);t?(t[1]||(r=!1,e=`0000-01-01T${e}`),i=!!t[2],i&&e[10]===` `&&(e=e.replace(` `,`T`)),t[2]&&+t[2]>23?e=``:(a=t[3]||null,!a&&i&&(e+=`Z`))):e=``}}super(e),isNaN(this.getTime())||(this.#e=r,this.#t=i,this.#n=a)}isDateTime(){return this.#e&&this.#t}isLocal(){return!this.#e||!this.#t||!this.#n}isDate(){return this.#e&&!this.#t}isTime(){return this.#t&&!this.#e}isValid(){return this.#e||this.#t}toISOString(){let e=super.toISOString();if(this.isDate())return e.slice(0,10);if(this.isTime())return e.slice(11,23);if(this.#n===null)return e.slice(0,-1);if(this.#n===`Z`||this.#n===`z`)return e;let t=this.#n.slice(1,3)*60+ +this.#n.slice(4,6);return t=this.#n[0]===`-`?t:-t,new Date(this.getTime()-t*6e4).toISOString().slice(0,-1)+this.#n}static wrapAsOffsetDateTime(t,n=`Z`){let r=new e(t);return r.#n=n,r}static wrapAsLocalDateTime(t){let n=new e(t);return n.#n=null,n}static wrapAsLocalDate(t){let n=new e(t);return n.#t=!1,n.#n=null,n}static wrapAsLocalTime(t){let n=new e(t);return n.#e=!1,n.#n=null,n}};
/*!
* Copyright (c) Squirrel Chat et al., All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
function Ov(e,t=10){return t===16?e>47&&e<58||e>64&&e<71||e>96&&e<103:e>47&&e<48+t}function kv(e,t){return e===32||e===9||e===10||e===13||t&&(e===t||e===44)||e===35}function Av(e,t){let n=e.p,r=e.s.charCodeAt(e.p);if(r===91||r===123){e.d--||Tv.x(`document contains excessively nested structures. aborting.`,e);let t=r===91?Hce(e):Vce(e);return e.d++,t}return r===34||r===39?Ev(e):r===116?((e.s.charCodeAt(++e.p)!==114||e.s.charCodeAt(++e.p)!==117||e.s.charCodeAt(++e.p)!==101)&&Tv.x(`invalid value`,e,n),e.p++,!0):r===102?((e.s.charCodeAt(++e.p)!==97||e.s.charCodeAt(++e.p)!==108||e.s.charCodeAt(++e.p)!==115||e.s.charCodeAt(++e.p)!==101)&&Tv.x(`invalid value`,e,n),e.p++,!1):r===43||r===45?jv(e,e.p,e.s.charCodeAt(++e.p),44-r,t):e.s.charCodeAt(e.p+4)===45&&e.s.charCodeAt(e.p+7)===45?Rce(e,r,t):e.s.charCodeAt(e.p+2)===58?zce(e,r,t):jv(e,e.p,r,0,t)}function jv(e,t,n,r,i){let a=n,o=0,s=!1;if(a===105)return(e.s.charCodeAt(++e.p)!==110||e.s.charCodeAt(++e.p)!==102)&&Tv.x(`invalid value`,e,t),e.p++,(r||1)/0;if(a===110)return(e.s.charCodeAt(++e.p)!==97||e.s.charCodeAt(++e.p)!==110)&&Tv.x(`invalid value`,e,t),e.p++,NaN;if(a===48){if(++e.p>=e.s.length||kv(a=e.s.charCodeAt(e.p),i))return e.bi===!0?0n:0;if(!r){if(a===120)return Mv(e,t,16,i);if(a===98)return Mv(e,t,2,i);if(a===111)return Mv(e,t,8,i)}a===46?o=2:a===101||a===69?o=4:Tv.x(`illegal leading zero`,e,t)}else Ov(a)||Tv.x(`invalid value`,e,t);for(;++e.p<e.s.length&&(a=e.s.charCodeAt(e.p),!kv(a,i));)o||=1,a===95?(o&1||Tv.x(`illegal underscore`,e),o+=11,s=!0):o===1&&a===46?o=2:(o===1||o===3)&&(a===101||a===69)?o=4:o===4&&(a===43||a===45)?o=6:Ov(a)?o>9?o-=11:o&1||o++:Tv.x(`illegal character in numeric literal`,e);if(!o){let t=(n-48)*(r||1);return e.bi===!0?BigInt(t):t}o&1||Tv.x(`unfinished numeric value`,e,t);let c=e.s.slice(t,e.p);return s&&(c=c.replaceAll(`_`,``)),o>1?parseFloat(c):Nv(e,c,10,t)}function Mv(e,t,n,r){let i,a=1;for(;++e.p<e.s.length&&(i=e.s.charCodeAt(e.p),!kv(i,r));)i===95?(a&1&&Tv.x(`illegal underscore`,e),a=3):Ov(i,n)?a&1&&a--:Tv.x(`illegal character in numeric literal`,e);a&1&&Tv.x(`unfinished numeric value`,e);let o=e.s.slice(t+2,e.p);return a&&(o=o.replaceAll(`_`,``)),Nv(e,o,n,t)}function Nv(e,t,n,r){if(e.bi!==!0)int:{let i=parseInt(t,n);if(!Number.isSafeInteger(i)){if(e.bi)break int;Tv.x(`integer value cannot be represented losslessly`,e,r)}return i}return BigInt(n===10?t:(n===2?`0b`:n===8?`0o`:`0x`)+t)}function Rce(e,t,n){let r=e.p++,i;if(!Ov(t)||!Ov(e.s.charCodeAt(e.p++))||!Ov(e.s.charCodeAt(e.p++))||!Ov(e.s.charCodeAt(e.p++)))return jv(e,e.p=r,t,0,n);if(e.p+=5,Ov(e.s.charCodeAt(e.p++))||Tv.x(`invalid date-time: date part is malformed`,e,r),e.p>=e.s.length||((t=e.s.charCodeAt(e.p))!==32||(i=!0,!Ov(e.s.charCodeAt(e.p+1))))&&t!==84&&t!==116)return Pv(e,e.s.slice(r,e.p),3,!1,r);if(e.s.charCodeAt(e.p+=3)!==58&&Tv.x(`invalid date-time: time part is malformed`,e,r),e.s.charCodeAt(e.p+=3)===58&&(e.p+=3),e.s.charCodeAt(e.p)===46)for(;Ov(e.s.charCodeAt(++e.p)););if(t=e.s.charCodeAt(e.p)){if(t===90||t===122)return Pv(e,e.s.slice(r,++e.p),1,i,r,`[+00:00]`);if(t===43||t===45)return Pv(e,e.s.slice(r,e.p+=6),1,i,r,!e.ld&&`[`+e.s.slice(e.p-6,e.p)+`]`)}return Pv(e,e.s.slice(r,e.p),2,i,r)}function zce(e,t,n){let r=e.p;if(!Ov(t)||!Ov(e.s.charCodeAt(++e.p)))return jv(e,--e.p,t,0,n);if(e.s.charCodeAt(e.p+=4)===58&&(e.p+=3),e.s.charCodeAt(e.p)===46)for(;Ov(e.s.charCodeAt(++e.p)););return Pv(e,e.s.slice(r,e.p),4,!1,r)}function Pv(e,t,n,r,i,a){if(e.ld){let a=new Dv(t,n,r);return a.isValid()||Tv.x(`invalid date`,e,i),a}try{switch(a&&(t+=a),n){case 1:return Temporal.ZonedDateTime.from(t);case 2:return Temporal.PlainDateTime.from(t);case 3:return Temporal.PlainDate.from(t);case 4:return Temporal.PlainTime.from(t)}}catch(t){Tv.x(t instanceof Error?t.message:``+t,e,i)}}
/*!
* Copyright (c) Squirrel Chat et al., All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
function Bce(e){for(;e.p<e.s.length;e.p++){let t=e.s.charCodeAt(e.p);if(t===10)break;if(t===13&&e.s.charCodeAt(e.p+1)===10){e.p++;break}(t<32&&t!==9||t===127)&&Tv.x(`control characters are not allowed in comments`,e)}}function Fv(e,t,n){let r;for(;e.p<e.s.length;){for(;e.p<e.s.length&&((r=e.s.charCodeAt(e.p))===32||r===9||!t&&(r===10||r===13&&e.s.charCodeAt(e.p+1)===10));)e.p++;if(n||r!==35)break;Bce(e)}}
/*!
* Copyright (c) Squirrel Chat et al., All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
function Iv(e,t=61){let n,r=0,i=[],a,o=e.s.charCodeAt(n=e.p);do if(o===t)return r||Tv.x(`unexpected end of key`,e),r===1&&i.push(e.s.slice(a,e.p)),e.p++,i;else o===46?(r||Tv.x(`illegal empty bare key`,e),r===1&&i.push(e.s.slice(a,e.p)),r=0):!r&&(o===34||o===39)?(o===e.s.charCodeAt(e.p+1)&&o===e.s.charCodeAt(e.p+2)&&Tv.x(`illegal quoted key: multiline strings are not allowed`,e),i.push(Ev(e)),r=2,e.p--):o===32||o===9?r===1&&(i.push(e.s.slice(a,e.p)),r=2):r===2||o<48&&o!==45||o>57&&o<65||o>90&&o<97&&o!==95||o>122?Tv.x(`illegal character in key`,e):r||(r=1,a=e.p);while(o=e.s.charCodeAt(++e.p));Tv.x(`incomplete key-value: cannot find end of key`,e,n)}function Vce(e){let t=e.p++,n=Object.create(null),r=new Set,i;for(;e.p<e.s.length;){if(Fv(e),(i=e.s.charCodeAt(e.p))===125)return e.p++,n;let t,a=n,o=!1,s=e.p,c=Iv(e);for(let n=0;n<c.length;n++){n&&(a=o?a[t]:a[t]=Object.create(null)),t=c[n],(o=Object.hasOwn(a,t))&&(typeof a[t]!=`object`||r.has(a[t]))&&Tv.x(`trying to redefine an already defined value`,e,s);let i=t===`__proto__`;if(e.uk&&(i||t===`constructor`)){a=e.uk!==1&&Tv.x(`document contains an unsafe property`,e,s);break}!o&&i&&Object.defineProperty(a,t,{enumerable:!0,configurable:!0,writable:!0})}o&&Tv.x(`trying to redefine an already defined value`,e,s),Fv(e,!0,!0);let l=Av(e,125);if(a&&typeof(a[t]=l)==`object`&&r.add(l),Fv(e),(i=e.s.charCodeAt(e.p++))===125)return n;i!==44&&Tv.x(`expected comma or end of structure`,e,e.p-1)}Tv.x(`unfinished table`,e,t)}function Hce(e){let t=e.p++,n=[],r;for(;e.p<e.s.length;){if(Fv(e),(r=e.s.charCodeAt(e.p))===93)return e.p++,n;if(n.push(Av(e,93)),Fv(e),(r=e.s.charCodeAt(e.p++))===93)return n;r!==44&&Tv.x(`expected comma or end of structure`,e,e.p-1)}Tv.x(`unfinished array`,e,t)}
/*!
* Copyright (c) Squirrel Chat et al., All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
function Lv(e,t,n,r,i){let a=n,o=r,s,c=!1,l;for(let n=0;n<t.length;n++){if(n){if(a=c?a[s]:a[s]=Object.create(null),o=(l=o[s]).c,i===0&&(l.t===1||l.t===2))return null;if(l.t===2){let e=a.length-1;a=a[e],o=o[e].c}}if(s=t[n],(c=Object.hasOwn(a,s))&&o[s]?.t===0&&o[s]?.d)return null;if(!c){let r=s===`__proto__`;if(e.uk&&(r||s===`constructor`))return!1;r&&(Object.defineProperty(a,s,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(o,s,{enumerable:!0,configurable:!0,writable:!0})),o[s]={t:n<t.length-1&&i===2?3:i,d:!1,i:0,c:Object.create(null)}}}if(l=o[s],l.t!==i&&(i!==1||l.t!==3)||(i===2&&(l.d||(l.d=!0,a[s]=[]),a[s].push(a=Object.create(null)),l.c[l.i++]=l={t:1,d:!1,i:0,c:Object.create(null)}),l.d))return null;if(l.d=!0,i===1)a=c?a[s]:a[s]=Object.create(null);else if(i===0&&c)return null;return[s,a,l.c]}function Rv(e,t,n){(t===null||e.uk===2)&&Tv.x(t===null?`trying to redefine an already defined table or value`:`document contains an unsafe property`,e,n)}function Uce(e,t={}){let n={s:e,p:0,d:t.maxDepth??1e3,bi:t.integersAsBigInt??!1,ld:t.useLegacyDate??!0,uk:t.unsafeKeyBehaviour===`throw`?2:+(t.unsafeKeyBehaviour===`drop`)},r=Object.create(null),i=Object.create(null),a,o=!1,s=r,c=i;for(e.charCodeAt(0)===65279&&n.p++,Fv(n);n.p<e.length;){if(e.charCodeAt(n.p)===91){let t=e.charCodeAt(++n.p)===91;a=n.p+=+t,o=!1;let l=Iv(n,93);t&&(e.charCodeAt(n.p)!==93&&Tv.x(`expected end of table array declaration`,n),n.p++);let u=Lv(n,l,r,i,t?2:1);u?(c=u[2],s=u[1]):(Rv(n,u,a),o=!0)}else{a=n.p;let e=Lv(n,Iv(n),s,c,0);!e&&!o&&Rv(n,e,a),Fv(n,!0,!0);let t=Av(n,void 0);e&&!o&&(e[1][e[0]]=t)}Fv(n,!0),n.p<e.length&&(a=e.charCodeAt(n.p))!==10&&(a!==13||e.charCodeAt(n.p+1)!==10)&&Tv.x(`each key-value declaration must be followed by an end-of-line`,n),Fv(n)}return r}
/*!
* Copyright (c) Squirrel Chat et al., All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
var Wce=/^[a-z0-9-_]+$/i,zv=!!``.isWellFormed;function Bv(e){let t=typeof e;if(t===`object`){if(Array.isArray(e))return`array`;if(typeof e.getUTCDate==`function`&&e instanceof Date)return`date`;if(globalThis.Temporal){if(e.until){if(e instanceof Temporal.ZonedDateTime)return`temporal/tz+uc`;if(e instanceof Temporal.PlainDateTime||e instanceof Temporal.PlainDate)return`temporal/uc`;if(e instanceof Temporal.PlainTime||e instanceof Temporal.Instant)return`temporal`;if(e instanceof Temporal.PlainYearMonth)return`temporal/x`}else if(e.toPlainDate&&e instanceof Temporal.PlainMonthDay||e.negated&&e instanceof Temporal.Duration)return`temporal/x`}}return t}function Gce(e){for(let t=0;t<e.length;t++)if(Bv(e[t])!==`object`)return!1;return e.length!=0}function Vv(e){return JSON.stringify(e).replaceAll(``,`\\u007f`)}function Kce(e){return Vv(zv?e.toWellFormed():e)}function Hv(e){if(Wce.test(e))return e;if(zv&&!e.isWellFormed())throw RangeError(`key contains illegal lone surrogates`);return Vv(e)}function Uv(e,t,n,r,i){if(n===0)throw Error(`Could not stringify the object: maximum object depth exceeded`);switch(t){case`number`:if(isNaN(e))return`nan`;if(e===1/0)return`inf`;if(e===-1/0)return`-inf`;if(Number.isInteger(e)&&(r||!Number.isSafeInteger(e)))return e.toFixed(1);case`bigint`:case`boolean`:case`temporal`:return e.toString();case`string`:return Kce(e);case`date`:if(isNaN(e.getTime()))throw TypeError(`cannot serialize invalid date`);return e.toISOString();case`object`:return qce(e,n,r,i);case`array`:return Jce(e,n,r,i);case`temporal/tz+uc`:if(i){let t=e.timeZoneId,n=t.charCodeAt(0);if(n!==43&&n!==45&&(n!==85&&n!==71&&n!==90&&n!==69||t!==`UTC`&&t!==`UCT`&&t!==`Universal`&&t!==`Zulu`&&!t.startsWith(`GMT`)&&t!==`Greenwich`&&!t.startsWith(`Etc/`)))throw TypeError(`Temporal objects with an IANA timezone are not allowed in Temporal strict mode`)}case`temporal/uc`:if(i&&e.calendarId!==`iso8601`)throw TypeError(`Temporal objects with a non-default calendar are not allowed in Temporal strict mode`);return e.toString({calendarName:`never`,timeZoneName:`never`});case`temporal/x`:throw TypeError(`Unsupported `+e[Symbol.toStringTag])}}function qce(e,t,n,r){let i=Object.keys(e);if(i.length===0)return`{}`;let a=`{ `;for(let o=0;o<i.length;o++){let s=i[o];o&&(a+=`, `),a+=Hv(s)+` = `+Uv(e[s],Bv(e[s]),t-1,n,r)}return a+` }`}function Jce(e,t,n,r){if(e.length===0)return`[]`;let i=`[ `;for(let a=0;a<e.length;a++){if(a&&(i+=`, `),e[a]===null||e[a]===void 0)throw TypeError(`arrays cannot contain null or undefined values`);i+=Uv(e[a],Bv(e[a]),t-1,n,r)}return i+` ]`}function Yce(e,t,n,r,i){if(n===0)throw Error(`Could not stringify the object: maximum object depth exceeded`);let a=``;for(let o=0;o<e.length;o++)a+=`${a&&`
`}[[${t}]]\n`,a+=Wv(0,e[o],t,n,r,i);return a}function Wv(e,t,n,r,i,a){if(r===0)throw Error(`Could not stringify the object: maximum object depth exceeded`);let o=``,s=``,c=Object.keys(t);for(let e=0;e<c.length;e++){let l=c[e];if(t[l]!==null&&t[l]!==void 0){let e=Bv(t[l]);if(e===`symbol`||e===`function`)throw TypeError(`cannot serialize values of type '${e}'`);let c=Hv(l);if(e===`array`&&Gce(t[l]))s+=(s&&`
`)+Yce(t[l],n?`${n}.${c}`:c,r-1,i,a);else if(e===`object`){let e=n?`${n}.${c}`:c;s+=(s&&`
`)+Wv(e,t[l],e,r-1,i,a)}else o+=c,o+=` = `,o+=Uv(t[l],e,r,i,a),o+=`
`}}return e&&(o||!s)&&(o=o?`[${e}]\n${o}`:`[${e}]`),o&&s?`${o}\n${s}`:o||s}function Xce(e,{maxDepth:t=1e3,numbersAsFloat:n=!1,strictTemporal:r=!1}={}){if(Bv(e)!==`object`)throw TypeError(`stringify can only be called with an object`);let i=Wv(0,e,``,t,n,r);return i[i.length-1]===`
`?i:i+`
`}
/*!
* Copyright (c) Squirrel Chat et al., All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
var Zce=/^(?:[ \t]*(?:#.*)?(?:\n|$))*/,Qce=e=>{if(!e.trimStart().startsWith(`#`))return;let[t]=e.match(Zce);return(t.length===e.length?e:t.match(/^[\s\S]*\n[ \t]*\n/)?.[0]??``).trim()||void 0},$ce=(e,t)=>{let n=Qce(t);(n||iv.get(e)?.leadingComment)&&ov(e,{leadingComment:n})},ele=(e,t)=>t?e?`${t}\n\n${e}`:t:e,tle=/(?<![\w.:+-])(?:\d{4}-\d{2}-\d{2}(?:[Tt ]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:[Zz]|[+-]\d{2}:\d{2})?)?|\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?)(?![\w.:+-])/g,nle=/(?<![\w.:+-])[-+]?(?:0x[\da-fA-F_]+|0o[0-7_]+|0b[01_]+|\d[\d_]*(?:\.\d[\d_]*)?(?:[eE][-+]?\d[\d_]*)?)(?![\w.:+-])/g,rle=/"""[\s\S]*?"""(?!")|'''[\s\S]*?'''(?!')|"(?:[^"\\\n]|\\.)*"|'[^'\n]*'|#[^\n]*/g,ile=/^[-+]?\d[\d_]*(?:\.\d[\d_]*)?(?:[eE][-+]?\d[\d_]*)?$/,ale=class extends Dv{#e;constructor(e,t){super(e),this.#e=t}toISOString(){return this.#e}},ole=(e,t)=>{let n=gv(t,e,ile)?t:uv(e);return Object.assign(new Date(0),{toISOString:()=>n})},sle=e=>{let t=new Map,n=new Set;return e.replace(rle,` `).match(nle)?.forEach(e=>{let r=!/^[-+]?0[xob]/.test(e)&&/[.eE]/.test(e),i=Number(e.replaceAll(`_`,``));r?Number.isInteger(i)&&dv(t,i,e):n.add(i)}),n.forEach(e=>{t.delete(e)}),t},cle=e=>{let t=new Map;return e.match(tle)?.forEach(e=>{let n=new Dv(e);n.isValid()&&dv(t,n.toISOString(),e)}),t},lle=(e,t)=>{let n={},r,i,a=(t,o)=>{if(t instanceof Dv){let i=t.toISOString();r??=cle(e),n[o]={value:i,source:r.get(i)??i}}else Number.isInteger(t)?(i??=cv(e)?sle(e):new Map,i.has(t)&&(n[o]={value:t,source:i.get(t)??uv(t)})):(Array.isArray(t)||X(t))&&Object.entries(t).forEach(([e,t])=>{a(t,fv(o,e))})};return a(t,``),n},ule=({path:e,str:t,parsed:n})=>{mv(e,lle(t,n))},dle=(e,t)=>e===t||e instanceof Dv&&e.toISOString()===t,fle=(e,{value:t,source:n})=>typeof t==`number`?e===t?ole(t,n):void 0:dle(e,t)?new ale(t,n):void 0,ple=(e,t)=>hv(e,t,fle),mle=(e,t,n)=>Dce(e,Sv(e,t,n),n),Gv=(e,t)=>{if(t===void 0||!cv(e))return vv(e)?JSON.parse(e,Sv):JSON.parse(e);let{value:n,sourceMap:r}=Oce(JSON.parse(e,mle));return mv(t,r),n},Kv=(e,t)=>{let n=xv(Uce(e,{integersAsBigInt:`asNeeded`}));return t!==void 0&&ule({path:t,str:e,parsed:n}),Oc(n)},hle=(e,t,n)=>{let r=rv(e,t);if(r.warnings.forEach(e=>console.warn(e)),r.errors.length)throw r.errors[0];return mv(n,Ece(r)),r.toJS(t)},qv=(e,t,n)=>{let r=vv(e),i=r?{...t,intAsBigInt:!0}:t,a=n!==void 0&&cv(e)?hle(e,i,n):yce(e,i);return r?xv(a):a},gle=e=>{let t=e.split(`
`,1)[0].trim();return ff.find(e=>t===df[e][0])??`yaml-frontmatter`},_le=/^\{\n(?<head>\{[\s\S]*?\})\n\}(?:\n\n(?<body>[\s\S]*))?$/,vle=(e,t)=>{let n=e.trim();return Gv(n.startsWith(`{`)?n:`{${n}}`,t)},Jv=e=>(t,n)=>{let r=e(t,n);return n!==void 0&&$ce(n,t),r},Yv={yaml:Jv((e,t)=>qv(e,void 0,t)),toml:Jv(Kv),json:Gv},yle={...Yv,json:vle},ble=new Map,xle=({collection:e,collectionFile:t,isIndexFile:n,format:r,text:i,path:a})=>{let{format:o,fmDelimiters:s,bodyField:{key:c=`body`,inline:l=!1}={}}=Pf({collection:e,collectionFile:t,isIndexFile:n}),[u,d]=(o===`frontmatter`?Nf({format:r,delimiter:s}):s)??df[`yaml-frontmatter`],f=Fc(u),p=Fc(d),m=Nl(ble,`${f}|${p}`,()=>RegExp(`^${f}[ \t]*\n(?:(?<head>[\\s\\S]*?)\n)?${p}[ \t]*(?:\n(?<body>[\\s\\S]*))?$`,`s`)),h=i.trimStart(),g=(r===`json-frontmatter`&&u===`{`&&d===`}`?h.match(_le)?.groups:void 0)??h.match(m)?.groups;if(!g)return{content:{[c]:i},hasFrontMatter:!1};let{head:_=``,body:v}=g,y=ff.includes(r)?pf(r):void 0,b=y?yle[y](_,a):{};return i!==h&&_.trim()&&b!=null&&(typeof b!=`object`||Array.isArray(b))?{content:{[c]:i},hasFrontMatter:!1}:((!b||typeof b!=`object`||Array.isArray(b))&&(b={}),{content:{...b,...!Object.hasOwn(b,c)&&(!l||v?.trim())?{[c]:v?.replace(/^\n/,``)}:{}},hasFrontMatter:!0})},Xv=({path:e,folder:{collectionName:t,fileName:n}})=>{let r=Kf(t),i=r&&n?Wp(r,n):void 0;if(!r)throw Error(`Collection not found`);if(n&&!i)throw Error(`Collection file not found`);let a=!i&&sf(r,e),{format:o}=Pf({collection:r,collectionFile:i,isIndexFile:a});return{collection:r,collectionFile:i,isIndexFile:a,format:o}},Sle=e=>{try{return!!Ud.get(Xv(e).format)?.parser}catch{return!1}},Cle=async({text:e=``,path:t,folder:n})=>{let r=Xv({path:t,folder:n}),{collection:i,collectionFile:a,isIndexFile:o}=r,{format:s}=r;iv.delete(t),e=e.trimEnd().replace(/\r\n?/g,`
`);let c=e.trimStart(),l=Ud.get(s)?.parser;if(l)return l(c);if(s===`raw`)return{body:e};try{let n=s===`frontmatter`;if(n&&(s=gle(c)),ff.includes(s)){let{content:r,hasFrontMatter:c}=xle({collection:i,collectionFile:a,isIndexFile:o,format:s,text:e,path:t});return n&&c&&ov(t,{format:s}),r}let r=pf(s);if(r)return Yv[r](c,t)}catch(e){throw Error(`${t} could not be parsed due to ${e.name}: ${e.message}`)}throw Ud.has(s)?Error(`${t} could not be parsed, as no \`fromFile\` method was registered for the custom “${s}” format with \`CMS.registerCustomFormat()\``):Error(`${t} could not be parsed due to an unknown format: ${s}`)},wle=async()=>{let{scheduler:e}=globalThis;typeof e?.yield==`function`?await e.yield():await Iu()},Tle=async(e,t,{budget:n=50}={})=>{let r=performance.now();for(let i=0;i<e.length;i+=1)performance.now()-r>=n&&(await wle(),r=performance.now()),await t(e[i])},Zv=()=>{let e=0;return{next:()=>{e+=1;let t=e;return()=>t===e}}},Qv=(e,{lastInFirstOut:t=!1}={})=>{let n=0,r=[];return Object.assign(async(i,{key:a=void 0}={})=>{n>=e?await new Promise(e=>{r.push({start:e,key:a})}):n+=1;try{return await i()}finally{let e=t?r.pop():r.shift();e?e.start():--n}},{prioritize:e=>{let n=e===void 0?-1:r.findIndex(t=>t.key===e);if(n>-1){let[e]=r.splice(n,1);t?r.push(e):r.unshift(e)}}})},$v=e=>/\/_index(?:\.[\w-]+)?\.md$/.test(e),Ele=/{{([^]*?)}}/,Dle=new Map,ey=({subPath:e,subPathTemplate:t})=>{if(t?.includes(`{{slug}}`)){let n=Nl(Dle,t,()=>{let e=t.split(Ele).map((e,t)=>t%2==0?Fc(e):e===`slug`?`([^/]+)`:`[^/]+?`).join(``);return RegExp(`^${e}$`)}),[,r]=e.match(n)??[];if(r)return r}return e},ty=(e,t=new Set)=>{if(typeof e!=`object`||!e)return!1;if(t.has(e))return!0;t.add(e);let n=Object.values(e).some(e=>ty(e,t));return t.delete(e),n},Ole=()=>`0.266.0\n${kl.current}`,kle=({parsedFileMap:e,path:t,key:n,content:r})=>{try{e.set(t,{key:n,content:structuredClone(r),...iv.get(t)})}catch{}},Ale=async(e,t,n)=>{let{path:r,parsed:i}=e,a=Ole(),o=Sle(e);if(i?.key===a&&!o){let{key:e,content:t,...n}=i;return av(r,n),t}try{if(e.text===void 0)throw Error(`${r} could not be read.`);let t=await Cle(e);if(ty(t))throw Error(`${r} could not be parsed, as it contains a circular reference.`);return n&&!o&&!vv(e.text)&&kle({parsedFileMap:n,path:r,key:a,content:t}),t}catch(e){console.error(e),t.push(e);return}},ny=({rawContent:e,fields:t,i18nSingleFile:n,validate:r})=>{let i=t[0].name;if(n)return!X(e)||!Object.values(e).every(r)?void 0:Object.fromEntries(Object.entries(e).map(([e,t])=>[e,{[i]:t}]));if(r(e))return{[i]:e}},ry=(e,t,n)=>{if(!X(e))return;let r=t.filter(e=>e!==n),i=Object.fromEntries(Object.entries(e).filter(([e])=>!r.includes(e))),a={[n]:i};return r.forEach(t=>{X(e[t])&&(a[t]=e[t])}),a},jle=(e,t,n)=>{let r={rawContent:e,fields:t,i18nSingleFile:n};return ah(t,`list`)?ny({...r,validate:xh(t[0])?e=>X(e)||Array.isArray(e):Array.isArray}):ah(t,`keyvalue`)?ny({...r,validate:e=>X(e)&&Object.values(e).every(e=>typeof e==`string`)}):X(e)?e:void 0},iy=(e,t,n)=>{let r=jle(e,t,n);if(r)return n?Object.fromEntries(Object.entries(r).map(([e,n])=>[e,Ch(n,t,!0)])):Ch(r,t,!0)},Mle=(e,t,n,r,i)=>r?.split(`/`).pop()===`_index`&&/\/_index(?:\.[\w-]+)?\.[\w]+$/.test(e)&&i!==`md`?!0:$v(e)?!(t||of(n)?.name===`_index`||r?.split(`/`).pop()===`_index`&&i===`md`||zie(n)===`_index`):!1,Nle=({file:e,fileName:t,fullPathRegEx:n,defaultLocale:r,isMultiFileStructure:i})=>{let{path:a,folder:{filePathMap:o}}=e;if(t){if(i){let[e,t]=Object.entries(o??{}).find(([,e])=>e===a)??[];return{subPath:t,locale:e}}return{subPath:a,locale:void 0}}if(!n)return{subPath:void 0,locale:void 0};let s=a.match(n);if(!s?.groups)return{subPath:void 0,locale:void 0};let{subPath:c,locale:l=r}=s.groups;return{subPath:c,locale:l}},ay=({entry:e,rawContent:t,path:n,fileName:r,subPath:i,subPathTemplate:a})=>{let o=r||ey({subPath:i,subPathTemplate:a});e.slug=o,e.locales._default={slug:o,path:n,content:bm(t)}},oy=({entry:e,rawContent:t,path:n,fileName:r,subPath:i,subPathTemplate:a,allLocales:o})=>{let s=r||ey({subPath:i,subPathTemplate:a});e.slug=s,e.locales=Object.fromEntries(o.filter(e=>X(t[e])).map(e=>[e,{slug:s,path:n,content:bm(t[e])}]))},Ple=({entry:e,rawContent:t,path:n,fileName:r,subPath:i,subPathTemplate:a,locale:o,defaultLocale:s,collectionName:c,canonicalSlugKey:l,entryMap:u})=>{let d=l&&typeof t[l]==`string`?t[l]:void 0,f=r||ey({subPath:i,subPathTemplate:a}),p={slug:f,path:n,content:bm(t)},m=`${c}/${r||(d??i)}`,h=u.get(m);return h?(h.locales[o]=p,o!==s&&h.slug||(h.slug=f,h.subPath=i),!0):(e.id=m,e.locales[o]=p,e.slug=f,u.set(m,e),!1)},sy=new Map,cy=({collection:e,item:t,index:n,path:r,meta:i={}})=>{let{fields:a,_i18n:{i18nEnabled:o,allLocales:s,defaultLocale:c,structureMap:{i18nSingleFileDefaultRoot:l}}}=e,u=l?ry(t,s,c):t,d=u?iy(u,a,o):void 0;if(!d)return;let f=String(n),p={id:``,slug:``,subPath:f,locales:{},arrayIndex:n,...i};return o?oy({entry:p,rawContent:d,path:r,subPath:f,allLocales:s}):ay({entry:p,rawContent:d,path:r,subPath:f}),Object.keys(p.locales).length?p:void 0},Fle=({collection:e,file:t,rawContent:n,entries:r,errors:i})=>{let{path:a,meta:o={}}=t;Array.isArray(n)?(sy.set(a,n),n.forEach((t,n)=>{let i=cy({collection:e,item:t,index:n,path:a,meta:o});i&&r.push(i)})):(sy.set(a,null),i.push(Error(`${a} could not be parsed, as it doesn’t contain an array.`)))},Ile=async({file:e,entries:t,entryMap:n,errors:r,parsedFileMap:i})=>{let a=await Ale(e,r,i),{path:o,meta:s={},folder:{collectionName:c,fileName:l}}=e,{collection:u,collectionFile:d}=Gp(c,l)??{},f=!d&&u?._type===`entry`&&u._file.arrayFile;if(!a){f&&sy.set(o,null);return}if(!u)return;if(f){Fle({collection:u,file:e,rawContent:a,entries:t,errors:r});return}let{fields:p=[],_file:{fullPathRegEx:m,subPath:h,extension:g},_i18n:{i18nEnabled:_,allLocales:v,defaultLocale:y,structureMap:b,canonicalSlug:{key:x}}}=d??u,S=!d&&sf(u,o)&&of(u)?.fields||p,C=b.i18nSingleFileDefaultRoot?ry(a,v,y):a;if(!C)return;let w=zf(b),T=iy(C,S,w);if(!T||Mle(o,l,u,h,g))return;let ee=Bf(b),{subPath:E,locale:te}=Nle({file:e,fileName:l,fullPathRegEx:m,defaultLocale:y,isMultiFileStructure:ee});if(!E||ee&&!te)return;let ne={id:``,slug:``,subPath:E,locales:{},...s},re={entry:ne,rawContent:T,path:o,fileName:l,subPath:E,subPathTemplate:h};if(!_)ay(re);else if(w)oy({...re,allLocales:v});else if(Ple({...re,locale:te,defaultLocale:y,collectionName:c,canonicalSlugKey:x,entryMap:n}))return;t.push(ne)},ly=async(e,{parsedFileMap:t}={})=>{let n=[],r=new Map,i=[];return await Tle(e,async e=>{try{await Ile({file:e,entries:n,entryMap:r,errors:i,parsedFileMap:t})}catch(e){console.error(e),i.push(e)}}),{entries:n.filter(e=>(e.id=jc(),!!e.slug&&!!Object.keys(e.locales).length)),errors:i}},uy=({fileInfo:e,fetchedFileMap:t})=>{let{meta:n,size:r,text:i}=t[e.path]??{};return{...e,size:e.size??r,text:e.text??i,meta:e.meta??n}},dy=e=>{let{name:t,meta:n={},...r}=e,i=Ep(t);return{...r,...n,name:t,kind:i}},Lle=e=>`locales`in e?Object.values(e.locales).map(({path:e})=>e):[e.path],Rle=({entries:e,assets:t,configFiles:n,errors:r=[],changedPaths:i})=>{let a=i??new Set([...e,...t].flatMap(Lle));Vp.current=ioe({entries:e,previous:Vp.current,changedPaths:a}),Dp.current=aoe({assets:t,previous:Dp.current,changedPaths:a}),Ip.current=n,Up.current=r,Rp.current=!0},zle=({fetchedFileMap:e,metadataMap:t})=>{Object.entries(t).forEach(([t,n])=>{e[t]&&(e[t].meta=n)});let n=!1,r=!1,i=Vp.current.map(e=>{if(e.commitDate)return e;let r=Object.values(e.locales).map(({path:e})=>t[e]).find(Boolean);return r?(n=!0,{...e,...r}):e}),a=Dp.current.map(e=>{let n=e.commitDate?void 0:t[e.path];return n?(r=!0,{...e,...n}):e});n&&(Vp.current=i),r&&(Dp.current=a)},Ble=async({entryFiles:e,changedPaths:t,parsedFileMap:n})=>{let r=Vp.current;if(!t||!r.length)return ly(e,{parsedFileMap:n});let{reusedEntries:i,dirtyFiles:a}=coe({entryFiles:e,previous:r,changedPaths:t}),{entries:o,errors:s}=await ly(a,{parsedFileMap:n});return{entries:loe({entryFiles:e,reusedEntries:i,parsedEntries:o}),errors:s}},Vle=async({fileList:{entryFiles:e,assetFiles:t,configFiles:n},fetchedFileMap:r,changedPaths:i,parsedFileMap:a})=>{let{entries:o,errors:s}=await Ble({entryFiles:e.map(e=>uy({fileInfo:e,fetchedFileMap:r})),changedPaths:i,parsedFileMap:a});return{entries:o,errors:s,assets:t.map(e=>dy(uy({fileInfo:e,fetchedFileMap:r}))),configFiles:n.map(e=>uy({fileInfo:e,fetchedFileMap:r}))}},fy=(e,{sha:t=``,size:n=0,...r}={})=>({path:e,name:Uc(e).basename,sha:t,size:n,...r}),py=e=>e.filter(({type:e})=>e===`blob`).map(({path:e,sha:t,size:n})=>fy(e,{sha:t,size:n})),my=[`admin`,`cms`],hy=[``,`static`,`public`],gy=e=>Lc(e).normalize().toLowerCase(),Hle=e=>my.includes(gy(e)),Ule=(e,t)=>{if(typeof e!=`string`||typeof t!=`string`)return;let n=Lc(e).replace(/^\.(?:\/|$)/,``),r=Lc(t);if(!(tf(n)||tf(r)||/^[.@]/.test(r)))return!r||n===r?r?``:n:n.endsWith(`/${r}`)?n.slice(0,-r.length-1):void 0},_y=e=>{let t=e.split(`/`).filter(Boolean);t.at(-1)?.includes(`.`)&&t.pop();try{let e=t.map(decodeURIComponent);return e.map((t,n)=>e.slice(n).join(`/`))}catch{return[]}},vy,Wle=()=>{let{media_folder:e,public_folder:t}=El.current??{},n=globalThis.location?.pathname??``,r=JSON.stringify([e,t,n]);if(vy?.key!==r){let i=Ule(e,t),a=i===void 0?hy:[...hy,i],o=[...my,..._y(n)];vy={key:r,paths:a.flatMap(e=>o.map(t=>gy(`${e}/${t}`)))}}return vy.paths},yy=e=>{let t=gy(e);return Wle().some(e=>t===e||t.startsWith(`${e}/`))},Gle=/^(?:index\.html|config\.(?:ya?ml|toml|json))$/,Kle=(e,t)=>{if(!Gle.test(gy(t)))return!1;let n=[...my,..._y(globalThis.location?.pathname??``).slice(-1).map(gy)];return gy(e).split(`/`).some(e=>n.includes(e))},by=e=>{let t=e.lastIndexOf(`/`),n=e.slice(0,Math.max(t,0));return yy(n)||Kle(n,e.slice(t+1))},xy=e=>{if(e.some(by))throw Error(`Cannot change a file in a folder the CMS is served from`)},Sy=tl([]),Cy=rl(()=>Sy.current.find(({collectionName:e,componentName:t,typedKeyPath:n,internalPath:r})=>e===void 0&&t===void 0&&n===void 0&&r!==void 0)),wy=tl(),Ty=rl(()=>{let{current:e}=wy;return e?.internalPath===void 0?Cy.current:e}),Ey=e=>{let t=`typedKeyPath`in e?e.typedKeyPath?.match(/[^:]+$/)?.[0]:e.typedKeyPath;return Sy.current.find(n=>(`typedKeyPath`in e?n.typedKeyPath===t:!n.typedKeyPath)?e.componentName?n.componentName===(Qm(e.componentName)??e.componentName):n.collectionName===e.collectionName&&n.fileName===e.fileName&&!!n.isIndexFile==!!e.isIndexFile:!1)},qle=({internalPath:e,internalSubPath:t,localeFolderNames:n})=>{let r=n?.length?`(?:(?:${n.map(Fc).join(`|`)})\\/)?`:``,i=e;if(Cf(i))return RegExp(`^${Tf(i,r)}`);if(i)return RegExp(`^${r}${Fc(i)}\\/`);let a=t,[o]=a.split(`/`);if(!o||o===`..`||tf(o))return/(?!)/;let s=rf(a,`[^/]+`);return RegExp(`^${r}${s}\\/`)},Jle=Bl(()=>Sy.current,e=>{let t=[],n=[];return e.forEach(e=>{let{internalPath:r,entryRelative:i}=e;if(r!==void 0){if(i)n.push({folder:e,regex:qle(e)});else{let n=rf(r,`.+?`);t.push({folder:e,regexSub:RegExp(`^${n}${r?`(?=\\/|$)`:`$`}`),regexExact:RegExp(`^${n}$`)})}}}),{items:t,entryRelative:n}}),Dy=(e,{matchSubFolders:t=!0}={})=>{let{filename:n,dirname:r}=Uc(e);if(n.startsWith(`+`))return[];let{items:i,entryRelative:a}=Jle(),o=r??``;return[...a.filter(({regex:t})=>t.test(e)).map(({folder:e})=>e),...i.filter(({regexSub:e,regexExact:n})=>(t?e:n).test(o)).map(({folder:e})=>e)].sort((e,t)=>t.internalPath.localeCompare(e.internalPath))},Yle=({collectionName:e,fileName:t,componentName:n,typedKeyPath:r,isIndexFile:i,internalPath:a,internalSubPath:o,publicPath:s})=>JSON.stringify([e,t,n,r,i,a,o,s]),Oy=e=>!!e&&!e.entryRelative&&!e.hasTemplateTags&&!e.readonly,ky=rl(()=>Yf.current||!!ul.current),Xle=Bl(()=>Sy.current,e=>new Set(e.filter(({readonly:e,entryRelative:t})=>e&&!t).map(({internalPath:e})=>e))),Ay=e=>e.some(({folder:e,path:t})=>!!e?.readonly||!e?.entryRelative&&Xle().has(e?.internalPath)||by(t)),Zle=Bl(()=>Bp.current,e=>{let t=new Map,n=[];return e.forEach(e=>{e.filePathMap?[...new Set(Object.values(e.filePathMap))].forEach(n=>{Nl(t,n,()=>[]).push(e)}):n.push([e,Kf(e.collectionName)?._file?.fullPathRegEx])}),{fileMap:t,regexFolders:n}}),jy=e=>{let{fileMap:t,regexFolders:n}=Zle();return t.get(e)||n.filter(([,t])=>t?.test(e)).map(([e])=>e).sort((e,t)=>(t.folderPath??``).localeCompare(e.folderPath??``))},My=e=>{let t=[],n=[],r=[],i=new Set;e.forEach(e=>{let{path:a,name:o}=e;if(o.startsWith(`.`))Fp.test(o)&&r.push({...e,type:`config`});else{let[r]=jy(a);if(r){t.push({...e,type:`entry`,folder:r}),i.add(a);return}if(i.has(a)||$v(a))return;let[o]=Dy(a);o&&n.push({...e,type:`asset`,folder:o})}});let a=[...t,...n,...r];return{entryFiles:t,assetFiles:n,configFiles:r,allFiles:a,count:a.length}},Ny=({entryFiles:e,assetFiles:t,configFiles:n})=>`${e.length} entry files, ${t.length} asset files, ${n.length} config files`,Qle=async({metaEntries:e,lastCommitHash:t,cachedFileEntries:n,fetchFileList:r,log:i})=>{let a=kl.current,{last_config_hash:o,last_commit_hash:s,git_config_fetched:c}=Object.fromEntries(e);if(o&&o===a&&s&&s===t&&c&&n.length){let e=My(n.map(([e,t])=>fy(e,t)));return i(`Restored the file list from the cache: ${Ny(e)}`),e}let l=My(await r(t));return i(`Fetched the file list: ${Ny(l)}`),l},$le=async({metaDB:e,lastConfigHash:t,lastCommitHash:n})=>{await e.saveEntries(Object.entries({last_config_hash:t,last_commit_hash:n,git_config_fetched:!0}))},eue=async({databaseName:e},t,n)=>{sp.current=n;try{let r=new hu(e,`meta`);await r.get(`last_commit_hash`)===t&&await r.set(`last_commit_hash`,n)}catch(e){console.error(`Failed to update the file cache.`,e)}},tue=({allFiles:e,cachedFiles:t})=>{e.forEach(({sha:n,path:r},i)=>{t[r]?.sha===n&&Object.assign(e[i],t[r])})},nue=({parsedFileMap:e,fetchedFileMap:t,cachedFiles:n})=>{let r={};return e.forEach((e,i)=>{t[i]?t[i].parsed=e:n[i]&&(r[i]={...n[i],parsed:e})}),r},Py=async({cacheDB:e,allFiles:t,cachedFiles:n,fetchingFiles:r,fetchedFileMap:i,reparsedFileMap:a={}})=>{let o=new Set(t.map(({path:e})=>e)),s=Object.keys(n).filter(e=>!o.has(e)),c=[...r.length?Object.entries(i):[],...Object.entries(a)];await Promise.all([c.length?e.saveEntries(c):void 0,s.length?e.deleteEntries(s):void 0])},rue=({metaDB:e,cacheDB:t})=>op((async()=>{try{let n=await t.entries();return{metaEntries:await e.entries(),cachedFileEntries:n}}catch(e){return console.error(`Failed to read the file cache.`,e),{metaEntries:[],cachedFileEntries:[]}}})()),iue=async({cacheDB:e,allFiles:t,cachedFiles:n,fetchingFiles:r,fetchedFileMap:i,reparsedFileMap:a,fetchFileMetadata:o,log:s})=>{let c={cacheDB:e,allFiles:t,cachedFiles:n,fetchingFiles:r,fetchedFileMap:i,reparsedFileMap:a},l=!0;if(o&&r.length){try{await Py(c),s(`Cached the contents of ${r.length} files`)}catch(e){console.error(`Failed to cache the contents.`,e)}try{zle({fetchedFileMap:i,metadataMap:await o(r)}),s(`Fetched the commit metadata of ${r.length} files`)}catch(e){console.error(`Failed to fetch the commit metadata.`,e),l=!1}}await Py(c),s(l?`Cached ${r.length} files with their metadata`:`Cached ${r.length} files without their metadata; they are fetched again next time`)},aue=async({metaDB:e,lastConfigHash:t,lastCommitHash:n,cacheUpdate:r})=>{try{await r,await $le({metaDB:e,lastConfigHash:t,lastCommitHash:n})}catch(e){console.error(`Failed to update the file cache.`,e)}},Fy=(e,t)=>((...n)=>{let r=uu();return r?t(r,...n):e(...n)}),Iy=(e,t)=>Object.fromEntries(Object.entries(e).map(([e,n])=>[t(e),n])),Ly=(e,t)=>({...e,path:t(e.path),...e.previousPath!==void 0&&{previousPath:t(e.previousPath)}}),Ry=(e,t)=>({...e,files:e.files.map(e=>Ly(e,t))}),zy=(e,t)=>({...e,files:Iy(e.files,e=>fu(e,t))}),oue=({repository:e,fetchFileList:t,fetchFileContents:n,fetchFileMetadata:r})=>{let i=(e,t)=>e.map(e=>({...e,path:du(e.path,t)}));return{fetchFileList:Fy(t,async(n,r)=>{let i=(await t(r)).flatMap(e=>{let t=fu(e.path,n);return pu(t)?[{...e,path:t}]:[]});if(!i.length)throw bl(`Failed to list the files.`,`root_dir_not_found`,{repo:`${e.owner}/${e.repo}`,dir:n});return i}),fetchFileContents:Fy(n,async(e,t,r)=>Iy(await n(i(t,e),r),t=>fu(t,e))),fetchFileMetadata:r&&Fy(r,async(e,t)=>Iy(await r(i(t,e)),t=>fu(t,e)))}},sue=e=>{let t=(e,t)=>Ry(e,e=>du(e,t)),n=(e,t)=>Ry(e,e=>fu(e,t));return{...e,fetchPullRequests:Fy(e.fetchPullRequests,async t=>(await e.fetchPullRequests()).map(e=>n(e,t))),savePullRequest:Fy(e.savePullRequest,async(r,i)=>{let{commit:a,pullRequest:o}=await e.savePullRequest({...i,changes:mu(i.changes),pullRequest:i.pullRequest&&t(i.pullRequest,r)});return{commit:zy(a,r),pullRequest:n(o,r)}}),updateStatus:Fy(e.updateStatus,async(r,i,a)=>n(await e.updateStatus(t(i,r),a),r)),fetchMergeState:Fy(e.fetchMergeState,async(n,r)=>{let i=await e.fetchMergeState(t(r,n)),a=i.files.some(({path:e,previousPath:t})=>[e,t].some(e=>e!==void 0&&e.split(`/`).some(e=>e===`.`||e===`..`)));return{...i,files:i.files.map(e=>Ly(e,e=>fu(e,n))),...a&&{complete:!1}}}),fetchUnchangedPaths:Fy(e.fetchUnchangedPaths,async(t,{headSHA:n,paths:r})=>(await e.fetchUnchangedPaths({headSHA:n,paths:r.map(e=>du(e,t))})).map(e=>fu(e,t))),publish:Fy(e.publish,(n,r)=>e.publish(t(r,n))),discard:Fy(e.discard,(n,r)=>e.discard(t(r,n)))}},By=e=>{let{fetchBlob:t,commitChanges:n,fetchFileCommits:r,workflow:i}=e;return{...e,fetchBlob:t&&Fy(t,(e,n)=>t({...n,path:du(n.path,e)})),commitChanges:Fy(n,async(e,t,r)=>zy(await n(mu(t),r),e)),fetchFileCommits:r&&Fy(r,(e,t)=>r(t.map(t=>du(t,e)))),workflow:i&&sue(i)}},Vy=tl({}),Hy=tl(``),Uy=tl({published:!0,time:0}),Wy=tl(!1),cue=e=>{let t=e.filter(e=>!!e);t.length&&(Vy.current=Object.fromEntries(Object.entries(Vy.current).filter(([e])=>!t.includes(e))))},lue=()=>{Vy.current={},Hy.current=``,Wy.current=!1,Uy.current={published:!0,time:0}},Gy=e=>{Uy.current={published:e,time:Date.now()}},Ky=e=>{let t=performance.now(),n=t;return(r,...i)=>{let a=performance.now(),o=Math.round(a-n),s=Math.round(a-t);n=a,console.debug(`[${e}] ${r} (+${o} ms, ${s} ms total)`,...i)}},qy,uue=e=>`${e}\n${kl.current}`,due=async({repository:e,accessPromise:t,fetchDefaultBranchName:n,fetchLastCommit:r,lastCommit:i,log:a})=>{let{branch:o}=e;if(o&&i)return await t,i;if(!o){let r=op(n());await t,o=await r,e.branch=o,a(`Fetched the default branch name: ${o}`)}let s=op(r());await t;let c=await s;return a(`Fetched the last commit on ${o}: ${c.hash}`),c},fue=async({fileList:{allFiles:e},lastCommitHash:t,cachedFileEntries:n,fetchFileContents:r,fetchFileMetadata:i,log:a})=>{let o=Object.fromEntries(n);tue({allFiles:e,cachedFiles:o});let s=new Set(e.filter(({path:e,sha:t})=>o[e]?.sha!==t).map(({path:e})=>e)),c=e.filter(({meta:e})=>!e),l=i?c.filter(({type:e,text:t})=>e!==`asset`&&t===void 0):c,u=Object.fromEntries(c.map(({path:e,sha:t,size:n,text:r})=>[e,{sha:t,size:n,text:r,meta:void 0}]));return a(`Restored ${e.length-c.length} files from the cache; fetching ${c.length} files`),l.length&&(Object.assign(u,await r(l,t)),a(`Fetched the contents of ${l.filter(({type:e})=>e!==`asset`).length} files`)),{cachedFiles:o,changedPaths:s,fetchingFiles:c,fetchedFileMap:u}},Jy=async({data:e,isStale:t,parseKey:n,metaDB:r,lastConfigHash:i,lastCommitHash:a,startCacheUpdate:o,log:s,readyMessage:c})=>{t()?s(`Discarded: the site data was reset while loading`):(Rle(e),qy=n,sp.current=a,s(c),await aue({metaDB:r,lastConfigHash:i,lastCommitHash:a,cacheUpdate:o()}))},pue=async({repository:e,checkAccess:t,checkBranchAccess:n,fetchDefaultBranchName:r,fetchLastCommit:i,lastCommit:a,...o})=>{let{service:s,owner:c,repo:l,databaseName:u}=e,{fetchFileList:d,fetchFileContents:f,fetchFileMetadata:p}=oue({repository:e,...o}),m=Ky(`Loading site data`);m(`Started: ${s} ${c}/${l}`);let h=uue(u),g=lp(),_=!!sp.current&&qy===h,v=new hu(u,`meta`),y=new hu(u,`file-cache`),b=!sp.current,x=t&&b?op(t()):void 0,S=rue({metaDB:v,cacheDB:y}),{hash:C,message:w}=await due({repository:e,accessPromise:x,fetchDefaultBranchName:r,fetchLastCommit:i,lastCommit:a,log:m}),T=n&&b?n():void 0,{metaEntries:ee,cachedFileEntries:E}=await S;m(`Read the file cache: ${E.length} files`);let te=kl.current,ne=await Qle({metaEntries:ee,lastCommitHash:C,cachedFileEntries:E,fetchFileList:d,log:m});Gy(!Cae(w)),await T;let re={isStale:g,parseKey:h,metaDB:v,lastConfigHash:te,lastCommitHash:C,log:m};if(!ne.count){await Jy({...re,data:{entries:[],assets:[],configFiles:[]},readyMessage:`The site data is ready: no files to load`,startCacheUpdate:()=>Py({cacheDB:y,allFiles:[],cachedFiles:Object.fromEntries(E),fetchingFiles:[],fetchedFileMap:{}})});return}let{cachedFiles:ie,changedPaths:ae,fetchingFiles:oe,fetchedFileMap:se}=await fue({fileList:ne,lastCommitHash:C,cachedFileEntries:E,fetchFileContents:f,fetchFileMetadata:p,log:m}),ce=new Map,{entries:le,errors:ue,assets:de,configFiles:fe}=await Vle({fileList:ne,fetchedFileMap:se,changedPaths:_?ae:void 0,parsedFileMap:ce}),pe=nue({parsedFileMap:ce,fetchedFileMap:se,cachedFiles:ie});m(`Parsed ${le.length} entries (${ue.length} errors)`),await Jy({...re,data:{entries:le,assets:de,configFiles:fe,errors:ue,changedPaths:ae},readyMessage:`The site data is ready`,startCacheUpdate:()=>iue({cacheDB:y,allFiles:ne.allFiles,cachedFiles:ie,fetchingFiles:oe,fetchedFileMap:se,reparsedFileMap:pe,fetchFileMetadata:p,log:m})})},Yy=async({isOpenAuthoringConfigured:e,initOpenAuthoring:t,checkAccess:n,checkBranchAccess:r,...i})=>{let a=e();a&&!Xf.current&&await t(),await pue({...i,checkAccess:a?void 0:n,checkBranchAccess:Jf.current?void 0:r})},Xy={attempts:10,interval:1e3},Zy=async(e,t,{attempts:n,interval:r})=>{let i=await e();return t(i)||n<=1?i:(await Iu(r),Zy(e,t,{attempts:n-1,interval:r}))},mue=/\s*<!-- sveltia-cms:deletion-group=([\w-]+) -->/g,hue=/<!-- sveltia-cms:deletion-group=([\w-]+) -->/,Qy=e=>`<!-- sveltia-cms:deletion-group=${e} -->`,gue=e=>e?`Automatically generated by Sveltia CMS\n\n${Qy(e)}`:`Automatically generated by Sveltia CMS`,$y=({description:e})=>e?.match(hue)?.[1],_ue=(e,t)=>{let n=e.replace(mue,``);return t?[n,Qy(t)].filter(Boolean).join(`
`):n},vue=({regex:e,prefix:t})=>({strip:t=>{let n=t;for(;e.test(n);)n=n.replace(e,``);return n},format:(e,n)=>n?`${t}${e}`:e}),eb=(e,{removedStatus:t})=>e.map(({filename:e,status:n,previous_filename:r})=>({path:e,sha:``,size:0,deleted:n===t,previousPath:r||void 0})),tb=({login:e,name:t,email:n,id:r})=>e?{name:t||e,email:n??``,id:r,login:e}:void 0,nb=(e,t)=>({number:e.number,nodeId:String(e.id),url:e.html_url,headSHA:e.head?.sha,createdDate:new Date(e.created_at),updatedDate:new Date(e.updated_at),files:[],...t}),rb={interval:1e3,attempts:30},ib=e=>{let{backend:t}=Dl.current??{};return!!t&&(Array.isArray(e)?e:[e]).includes(t.name)&&`open_authoring`in t&&t.open_authoring===!0},ab=({owner:e,repo:t})=>Jf.current??{owner:e,repo:t},yue=async({repoPath:e,allowForking:t})=>{if(!t)throw bl(`The repository does not allow forking`,`open_authoring.forking_disabled`,{repo:e});if(!await bae(e))throw bl(`Permission to fork the repository was declined`,`open_authoring.fork_declined`)},ob=(e,t)=>(console.error(`Failed to fork the repository.`,t),bl(`Failed to fork the repository.`,`open_authoring.fork_failed`,{repo:e})),bue=async({repoPath:e,requestFork:t,requestRenamedFork:n,conflictStatuses:r,isNameTaken:i})=>{try{return await t()}catch(t){if(!r.includes(t.cause?.status)||!await i())throw ob(e,t)}try{return await n()}catch(t){throw ob(e,t)}},sb=async({repoPath:e,checkFork:t,attemptsLeft:n=rb.attempts})=>{let r=await Zy(t,e=>e!==`pending`,{...rb,attempts:n});if(r!==`ready`)throw bl(r===`failed`?`The fork could not be created.`:`Timed out waiting for the fork to be created.`,`open_authoring.fork_failed`,{repo:e})},cb=async e=>{Jf.current=void 0,Xf.current=!1,await e(),Xf.current=!0},lb=async e=>{let{repository:t,fetchAccess:n,fetchFork:r,prepareFork:i,fetchForkingAllowed:a}=e,o=await n();if(o.canWrite)return;t.branch||await e.fetchDefaultBranchName?.();let s=await r();s?(await i?.(s),Jf.current=s):(await yue({repoPath:`${t.owner}/${t.repo}`,allowForking:await a(o)}),Jf.current=await e.createFork())},ub=()=>{if(Yf.current)throw bl(`Cannot publish as an Open Authoring contributor`,`open_authoring.publish_unsupported`)},db=({branch:e})=>{if(Yf.current&&!e)throw bl(`Cannot commit directly to the configured repository`,`open_authoring.direct_commit_unsupported`)},xue=e=>{if(e===`pending_publish`)throw bl(`Cannot mark an entry ready to publish as an Open Authoring contributor`,`open_authoring.publish_unsupported`)},Sue=async({branch:e,mergedSHA:t,fetchBranchHead:n,deleteBranch:r})=>{let i=await n(e);if(!(i&&i!==t))throw i&&await r(e),bl(`entry_already_published`,`open_authoring.entry_already_published`)},Cue=(e,t)=>{console.warn(`Failed to sync the ${Zf(e)} fork with the upstream repository.`,t)},fb=e=>{console.warn(`The ${Zf(e)} fork could not be fast-forwarded to the upstream repository.`)},pb=async(e,t,n)=>{let r;try{r=await(n?n():rd(`${Eu(e)}/merge-upstream`,{method:`POST`,body:{branch:t},responseType:`raw`}))}catch(t){Cue(e,t);return}r&&!r.ok&&fb(e)},mb=async(e,t)=>{let n=Fu.account?.login,r=await ad(Eu({owner:n,repo:e.repo}),t);return r?.fork&&Ou(r.parent?.full_name,e)&&r.owner?.login?.toLowerCase()===n.toLowerCase()?Du(r.full_name):void 0},hb=async(e,t,n)=>{let r=[],i=[];return e.forEach((e,n)=>{let a=t(e,n);`leftover`in a?r.push(a.leftover):i.push(a.pending)}),await Ed(r,n),i},gb=async e=>{let{pullRequest:t,status:n,requestKey:r,createRequest:i,fetchRequest:a,applyStatus:o}=e,{fetchBranchHead:s,deleteBranch:c}=e;xue(n);let{branch:l,title:u}=t;if(t[r]===void 0)return n===`draft`?{...t,status:n,updatedDate:new Date}:i({branch:l,title:u,status:n,description:`Automatically generated by Sveltia CMS`});let d=await a(t);if(d){let{merged:n,isEntryRequest:r,getMergedSHA:i}=d;if(n&&r&&await Sue({branch:l,mergedSHA:await i(),fetchBranchHead:s,deleteBranch:c}),n||!r)return gb({...e,pullRequest:{...t,number:void 0,nodeId:void 0,url:void 0}})}return await o({pullRequest:t,status:n,state:d?.state,draft:d?.draft}),{...t,status:n,updatedDate:new Date}},wue=({commit:e,branch:t,title:n})=>({title:n,branch:t,status:`draft`,createdDate:e.date,updatedDate:e.date,files:[],canMerge:!1}),_b=(e,{authRoot:t,authPath:n,tokenPath:r,api:i,...a})=>{let o=`${Lc(t)}/${Lc(n)}`;return Jre(e,a),Object.assign(Zu,{...i,authURL:o,tokenURL:o.replace(`/authorize`,r)}),e},Tue=e=>{let t=e.split(`/`),n=t.findIndex(e=>e.includes(`{{`));return(n===-1?t:t.slice(0,n)).join(`/`)},vb=(e,t)=>e===t||e.startsWith(`${t}/`),yb=()=>{let e=[],t=[];return Bp.current.forEach(({filePathMap:n,folderPathMap:r})=>{n?e.push(...Object.values(n)):t.push(...Object.values(r??{}))}),Sy.current.forEach(({internalPath:e})=>{e!==void 0&&t.push(e)}),{filePaths:e,folderPaths:t}},Eue=()=>{let{filePaths:e,folderPaths:t}=yb(),n=e.filter(e=>!e.includes(`{{`)),r=[...e.filter(e=>e.includes(`{{`)),...t].map(e=>Tue(Lc(e)));if(r.some(e=>!e))return;let i=[...new Set(r)].filter(e=>!e.startsWith(`../`)).sort().filter((e,t,n)=>!n.slice(0,t).some(t=>vb(e,t)));return{dirs:i,files:[...new Set(n.map(e=>Lc(e)))].filter(e=>!e.startsWith(`../`)&&!i.some(t=>vb(e,t)))}},Due=10,bb=e=>{let t=Math.max(100/(Math.max(e,1)*Due)*100,.1),n=0;zp.current=n;let r=window.setInterval(()=>{n=Math.min(n+t,99),zp.current=n},100);return()=>{window.clearInterval(r),zp.current=void 0}},xb=(e,t)=>async()=>{try{return t(await Vu(e))??`unknown`}catch{return`unknown`}},Sb=(e,t)=>{let{databaseName:n}=e??{};return n?new hu(n,t):void 0},Cb=async e=>{try{return new Map(await e?.entries()??[])}catch(e){return console.error(e),new Map}},wb=async(e,t,n)=>{if(e)try{t.size&&await e.saveEntries([...t]),n.length&&await e.deleteEntries(n)}catch(e){console.error(e)}},Oue=async({repository:e,roots:t,fetchTreeListing:n,cacheable:r,concurrency:i})=>{let a=Sb(e,`tree-cache`),o=await Cb(a),s=new Map,c=new Map,l=new Set,u=[],d=!1,f=async({path:e,sha:t})=>t?(l.add(t),o.get(t)||(c.has(t)||c.set(t,n(e).then(e=>(r&&(e.trees.length||e.blobs.length)&&s.set(t,e),e))),c.get(t))):n(e);try{let e=t;for(;e.length;){let t=await Dd(e,f,{concurrency:i}),n=e;e=t.flatMap(({trees:e,blobs:t},r)=>{let{path:i}=n[r],a=i?`${i}/`:``;return t.forEach(([e,t])=>{u.push({type:`blob`,path:`${a}${e}`,sha:t})}),e.map(([e,t])=>({path:`${a}${e}`,sha:t}))})}d=!0}finally{await wb(a,s,d?[...o.keys()].filter(e=>!l.has(e)):[])}return u},Tb=async({token:e,refreshToken:t},n,r)=>{let i=Fu.account?.token,a=await rd(`/user`,{token:e,refreshToken:t}),o=Fu.account;return o?.token&&o.token!==e&&o.token!==i&&(e=o.token,t=o.refreshToken),{backendName:n,id:a.id,name:a[r.name],login:a[r.login],email:a.email,avatarURL:a.avatar_url,profileURL:a[r.profileURL],bot:a.bot??!1,token:e,refreshToken:t}},Eb=()=>{let{backend:e}=Dl.current??{};return e&&`squash_merges`in e?!!e.squash_merges:!1},Db=async({branch:e,path:t,goneStatuses:n})=>{try{await rd(t,{method:`DELETE`,responseType:`text`})}catch(t){if(n.includes(t.cause?.status))return;console.warn(`Failed to delete the ${e} branch.`,t)}},kue=async({commit:e,branch:t,title:n,status:r,deletionGroup:i,createPullRequest:a})=>Yf.current&&r===`draft`?wue({commit:e,branch:t,title:n}):a({branch:t,title:n,status:r,description:gue(i)}),Ob=async({changes:e,options:t,branch:n,title:r,status:i,pullRequest:a,deletionGroup:o},{commitToNewBranch:s,commitToExistingBranch:c,createPullRequest:l,updateDescription:u})=>{if(a){let r=$y(a)===o?a:{...a,description:await u(a,e=>_ue(e,o))};return{commit:await c(e,{...t,branch:n},a),pullRequest:r}}let d=await s(e,{...t,branch:n});return{commit:d,pullRequest:await kue({commit:d,branch:n,title:r,status:i,deletionGroup:o,createPullRequest:l})}},Aue=async({branch:e,branchExistsStatus:t,commitFromStart:n,commitOnBranch:r,findOpenPullRequest:i,inUseMessage:a,deleteBranch:o})=>{try{return await n()}catch(e){if(e.cause?.status!==t)throw e}if(Yf.current)return r();let s=await i();if(s)throw bl(a,`workflow.branch_in_use`,{number:s});return await o(e),n()},kb=(e,t)=>bl(`Failed to save the changes.`,`branch_not_found`,{repo:t.repo,branch:e}),jue=async({branch:e,headSHA:t,fetchBranchHead:n,getWorkflowRepository:r})=>{let i=await n(e);if(i===void 0)throw kb(e,r());if(!t||i!==t)throw bl(`The workflow branch has moved since the entry was loaded.`,`save_conflict.branch_moved`);return t},Ab=async(e,t,{updateForkStatus:n,updateLabels:r,updateDraftState:i})=>{if(Yf.current)return n(e,t);let a=t===`draft`;return await r(e,t),a!==(e.status===`draft`)&&await i(e,a),{...e,status:t,updatedDate:new Date}},jb=e=>[...new Set(e.map(e=>e.slice(0,Math.max(e.lastIndexOf(`/`),0))))],Mb=async(e,{statusMap:t,headSHA:n,fetchFileModes:r})=>{let i=e.map(({filename:e,status:n,previous_filename:r})=>({path:e,status:t[n]??`modified`,previousPath:r||void 0})),a=await r({headSHA:n,paths:i.filter(({status:e})=>e!==`removed`).map(({path:e})=>e)});return i.map(e=>({...e,mode:a.get(e.path)}))},Nb=(e,t)=>t===e.headSHA?void 0:{headSHA:t,onConfiguredBranches:!0,files:[],complete:!0},Pb=async({pullRequest:e,headSHA:t,onConfiguredBranches:n,listChangedFiles:r})=>!t||!n?{headSHA:t,onConfiguredBranches:!1,files:[],complete:!1}:Nb(e,t)||{headSHA:t,onConfiguredBranches:n,...await r(t)},Mue=async(e,t)=>(await rd(`${ku(e,t)}/merge`,{responseType:`raw`})).ok,Nue=async(e,t)=>{await rd(ku(e,t),{method:`PATCH`,body:{state:`open`}})},Fb=async(e,t,n)=>{let r=ku(e,t.number),{body:i}=await rd(r),a=n(i??``);return await rd(r,{method:`PATCH`,body:{body:a}}),a},Ib=async(e,t,n)=>{await rd(`${ku(e,t.number)}/reviews`,{method:`POST`,body:{event:n,commit_id:t.headSHA}})},Lb=e=>e.filter(({state:e,dismissed:t,user:n})=>e===`APPROVED`&&!t&&n?.login===Fu.account?.login),Rb=async(e,t,{deleteBranch:n,closedStatuses:r=[]})=>{if(t.number!==void 0)try{await rd(ku(e,t.number),{method:`PATCH`,body:{state:`closed`}})}catch(e){if(!r.includes(e.cause?.status))throw e}await n(t.branch)},zb=async({pullRequest:e,status:t,state:n,draft:r},{repository:i,updateDraftState:a})=>{let o=n?.toLowerCase();t===`draft`?o===`open`&&!r&&await a(e,!0):(o===`closed`&&await Nue(i,e.number),r&&await a(e,!1))},Bb={interval:1e4,maxDuration:36e5},Pue=e=>{let t=e?.cause?.status;return typeof t==`number`&&t>=400&&t<500&&t!==429},Vb=async e=>{let{read:t,check:n,cancel:r,label:i,deadline:a=Date.now()+Bb.maxDuration}=e,o=async()=>{try{await r()}catch(e){console.warn(`Failed to cancel the auto-merge on ${i}.`,e)}};if(Date.now()>=a)throw await o(),Error(`Timed out waiting for ${i} to be merged`);await Iu(Bb.interval);let s;try{s={item:await t()}}catch(e){if(Pue(e))throw e;console.warn(`Failed to read ${i}, still waiting.`,e)}if(s){let{merged:e,failure:t,armed:r}=n(s.item);if(e)return;if(t)throw r&&await o(),Error(`${i[0].toUpperCase()}${i.slice(1)} was not merged: ${t}`)}await Vb({...e,deadline:a})},Hb=(e,t,n,r=(e,t)=>e===t)=>{let i=e.some(e=>r(e,t));return n&&!i?[...e,t]:!n&&i?e.filter(e=>!r(e,t)):e},Ub=(e,t)=>Array.from({length:Math.ceil(e.length/t)},(n,r)=>e.slice(r*t,(r+1)*t)),Wb=(e,{maxItems:t,maxSize:n,getSize:r})=>{let i=[],a=[],o=0;return e.forEach(e=>{let s=r(e);a.length&&(a.length===t||o+s>n)&&(i.push(a),a=[],o=0),a.push(e),o+=s}),a.length&&i.push(a),i},Fue=`cms`,Iue=200,Lue=244,Rue=32,Gb=new TextEncoder,zue=new Intl.Segmenter,Kb=e=>{let t=Jf.current;return[Fue,t?.owner,t?.repo,e].filter(Boolean).map(e=>`${e}/`).join(``)},qb=()=>Kb(uu()),Jb=()=>Kb(``),Yb=e=>e.replaceAll(`%`,`%25`).replaceAll(`/`,`%2F`),Bue=e=>e.replaceAll(`%2F`,`/`).replaceAll(`%25`,`%`),Xb=e=>Gb.encode(Yb(e)).length,Vue=({collectionName:e,dirPath:t})=>{let n=`${qb()}${e}/`,r=t?Xb(`${t}/`):0,i=Lue-Gb.encode(n).length-r;return Math.max(Math.min(Iue,i),Rue)},Zb=(e,t)=>{let n=Array.from(zue.segment(e),({segment:e})=>e),r=0,i=n.findIndex(e=>(r+=Xb(e),r>t));return i===-1?e:n.slice(0,i).join(``)},Hue=({collectionName:e,slug:t})=>`${qb()}${e}/${Yb(t)}`,Qb=e=>{let t=qb(),n=Jb(),r=!e.startsWith(t);if(r&&(t===n||!e.startsWith(n)))return;let i=e.slice(r?n.length:t.length),a=i.indexOf(`/`);if(!(a<1||a===i.length-1))return{collectionName:i.slice(0,a),slug:Bue(i.slice(a+1)),...r&&{legacy:r}}},Uue=({branch:e,collectionName:t,slug:n})=>{let r=Qb(e);return r?.collectionName===t&&r.slug===n},Wue=[`netlify-cms/`,`decap-cms/`],$b=[`draft`,`pending_review`,`pending_publish`],ex=[`draft`,`pending_review`],tx=[...$b,`pending_deletion`],nx={draft:`status.draft`,pending_review:`status.in_review`,pending_publish:`status.ready`,pending_deletion:`status.pending_deletion`},rx=[`preview`,`editorial_workflow`],ix=e=>typeof e==`string`?e?{type:e}:{}:X(e)?e:{},Gue=e=>Array.isArray(e)?$b.filter(t=>t===`draft`||e.includes(t)):$b,ax=({cmsConfig:e,collection:t})=>{let{type:n,stages:r,direct_publish:i=!1,allow_incomplete_drafts:a=!0}={...ix(e?.publish_mode),...ix(t?.publish_mode)},o=n&&rx.includes(n)?n:`simple`;return{type:o,stages:o===`preview`?[`draft`]:Gue(r),directPublish:o!==`simple`&&i===!0,allowIncompleteDrafts:a!==!1}},ox=({cmsConfig:e,collection:t})=>ax({cmsConfig:e,collection:t}).type,sx=e=>rx.includes(e),cx=e=>[void 0,...Array.isArray(e?.collections)?e.collections.filter(e=>X(e)&&!(`divider`in e)):[]],lx=e=>cx(e).some(t=>sx(ox({cmsConfig:e,collection:t}))),ux=()=>{let{backend:e}=Dl.current??{};return(e&&`cms_label_prefix`in e?e.cms_label_prefix:void 0)||`sveltia-cms/`},dx=()=>[...new Set([ux(),`sveltia-cms/`,...Wue])],fx=e=>`${ux()}${e}`,px=()=>dx().flatMap(e=>tx.map(t=>`${e}${t}`)),mx=(e,t)=>{let n=px();return[...e.filter(e=>!n.includes(e)),fx(t)]},hx=e=>{let t;return dx().some(n=>(t=tx.find(t=>e.includes(`${n}${t}`)),!!t)),t},Kue=[[Y],[Ac],[_re,Gc,Uc,Hc],[X],[Lc],[Jc],[fl],[gl,hl],[Nu],[`Gitea / Forgejo`,`gitea`,_l,`https://gitea.com/api/v1`,`login/oauth/authorize`,`Forgejo`,`forgejo`,12,1.24,vl],[ad],[Zu,rd,id,Qu],[yd,bd],[wd,Cd,Td,xd,Sd],[100,jae,np,ip,Mae,kae],[Dd,Ed],[ap,Gae,qae,Kae],[Xae],[bl,Sl,Cl,wl],[Yy],[db,ub,mb,ib,sb,hb,bue,ab,cb,lb,pb,gb,fb],[sp],[_b],[Eue],[Xy,Zy],[bb],[vue,eb,nb,tb],[wu,Mu,Au,ku,Eu,qre,Ou,Du],[xb],[Oue],[py],[Tb],[zb,Ib,jue,Aue,Db,Rb,Lb,Nb,jb,Mue,Eb,Pb,Ob,Mb,Ab,Fb,Vb],[uu,du],[Dl],[jy],[zp],[Fu],[Ub,Wb],[zl],[cu],[gp],[Hu,Vu],[rh],[Kl],[Jb],[lx],[px,hx,fx,mx],[Jf,Yf]],que=[`getBackend`,`getCustomFormats`,`getCustomFormatsExtensions`,`getCustomFormatsFormatters`,`getEditorComponents`,`getEventListeners`,`getLocale`,`getMediaLibrary`,`getPreviewStyles`,`getPreviewTemplate`,`getRemarkPlugins`,`getWidgetValueSerializer`,`getWidgets`,`invokeEvent`,`moment`,`registerBackend`,`registerMediaLibrary`,`registerWidgetValueSerializer`,`removeEventListener`,`resolveWidget`,`registerLocale`,`registerRemarkPlugin`];typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`);var Jue=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`name`]),Yue=B(`<span> </span>`),Xue={hash:`svelte-1wxeykp`,code:`.icon.small-arrow.svelte-1wxeykp {overflow:hidden;width:12px;text-indent:-6px;}`};function gx(e,t){K(e,Xue);let n=vs(t,Jue);var r=Yue();fs(r,()=>({...n,class:`sui icon material-symbols-outlined ${t.class??``}`,"aria-hidden":!(`aria-label`in n)}),void 0,void 0,void 0,`svelte-1wxeykp`);var i=F(r,!0);R(()=>W(i,t.name)),U(e,r)}var Zue=B(`<!> <span class="status-label svelte-8cur61"> </span> <!>`,1),Que={hash:`svelte-8cur61`,code:`.status-label.svelte-8cur61 {position:absolute;overflow:hidden;clip-path:inset(50%);width:1px;height:1px;white-space:nowrap;}`};function _x(e,t){O(t,!0),K(e,Que);let n=J(t,`children`,3,void 0),r=J(t,`icon`,3,void 0);var i=Zue(),a=P(i),o=e=>{var t=H();xo(P(t),r),U(e,t)},s=e=>{{let n=A(()=>t.status===`success`?`check_circle`:t.status);gx(e,{get name(){return z(n)}})}};G(a,e=>{r()?e(o):e(s,-1)});var c=I(a,2),l=F(c,!0);xo(I(c,2),()=>n()??Cr),R(e=>W(l,e),[()=>Y(`_sui.alert.${t.status}`)]),U(e,i),k()}var vx=e=>e===`error`||e===`warning`?`alert`:`status`,yx=(e,t)=>t??(e===`alert`?`assertive`:`polite`),$ue=new Set([`$$slots`,`$$events`,`$$legacy`,`status`,`ariaLive`,`children`,`icon`]),ede=B(`<div><!></div>`),tde={hash:`svelte-t1jvd5`,code:`.alert.svelte-t1jvd5 {display:flex;align-items:center;gap:var(--gap, 8px);padding:var(--padding, 8px);border-width:var(--border-width, var(--sui-control-medium-border-width));border-style:var(--border-style, solid);border-radius:var(--border-radius, var(--sui-control-medium-border-radius));font-size:var(--font-size, var(--sui-font-size-default));}.alert.error.svelte-t1jvd5 {border-color:var(--sui-error-border-color);color:var(--sui-error-foreground-color);background-color:var(--sui-error-background-color);}.alert.warning.svelte-t1jvd5 {border-color:var(--sui-warning-border-color);color:var(--sui-warning-foreground-color);background-color:var(--sui-warning-background-color);}.alert.info.svelte-t1jvd5 {border-color:var(--sui-info-border-color);color:var(--sui-info-foreground-color);background-color:var(--sui-info-background-color);}.alert.success.svelte-t1jvd5 {border-color:var(--sui-success-border-color);color:var(--sui-success-foreground-color);background-color:var(--sui-success-background-color);}`};function bx(e,t){O(t,!0),K(e,tde);let n=J(t,`ariaLive`,3,void 0),r=vs(t,$ue),i=A(()=>vx(t.status));var a=ede();fs(a,e=>({...r,role:z(i),class:`sui alert ${t.status??``}`,"aria-live":e}),[()=>yx(z(i),n())],void 0,void 0,`svelte-t1jvd5`),_x(N(a),{get status(){return t.status},get children(){return t.children},get icon(){return t.icon}}),D(a),U(e,a),k()}var xx,Sx=()=>(xx??=navigator.userAgentData?.platform===`macOS`||navigator.platform.startsWith(`Mac`),xx),nde=new Set([`Ctrl`,`Meta`,`Alt`,`Shift`]),rde=new Set([`Control`,`Meta`,`Alt`,`Shift`]),ide=new Set([`Space`,`Enter`,`Escape`,`Tab`,`Backspace`,`Delete`,`Insert`,`Home`,`End`,`PageUp`,`PageDown`,`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,...Array.from({length:24},(e,t)=>`F${t+1}`)]),ade=e=>{if(/^\d$/.test(e)){let t=`Digit${e}`;return({code:e})=>e===t}if(ide.has(e)){let t=e===`Space`?` `:e;return({key:n,code:r})=>r===e||n===t}let t=e.toLowerCase();if(/^[a-z]$/i.test(e)){let n=`Key${e.toUpperCase()}`;return e=>{let{key:r,code:i}=e;return(r===`Dead`||r.length===1&&r.charCodeAt(0)>127)&&(Sx()||!e.getModifierState?.(`AltGraph`))?i===n:t===r.toLowerCase()}}return({key:e})=>t===e.toLowerCase()},Cx=e=>e.replace(/\bAccel\b/g,Sx()?`Meta`:`Ctrl`),wx=new Map,Tx=e=>{let t=wx.get(e);return t||(t=Cx(e).trim().split(/\s+/).filter(Boolean).map(e=>{let t=e.split(`+`).map(e=>e===`Control`?`Ctrl`:e);return{ctrl:t.includes(`Ctrl`),meta:t.includes(`Meta`),alt:t.includes(`Alt`),shift:t.includes(`Shift`),matchers:t.filter(e=>!nde.has(e)).map(ade)}}),wx.set(e,t)),t},Ex=(e,t)=>{let{ctrlKey:n,metaKey:r,altKey:i,shiftKey:a,key:o,code:s}=e;return!o&&!s||e.isComposing||e.keyCode===229?!1:t.some(({ctrl:t,meta:s,alt:c,shift:l,matchers:u})=>t===n&&s===r&&c===i&&l===a&&(u.length?u.every(t=>t(e)):rde.has(o)))},Dx=(e,t)=>Ex(e,Tx(t)),Ox=new Map,ode=(e,t)=>{let{disabled:n}=e;if(!e.getClientRects().length)return;let{top:r,left:i}=e.getBoundingClientRect();n&&e.style.setProperty(`pointer-events`,`auto`);let a=document.elementsFromPoint(i+4,r+4).includes(e);n&&e.style.removeProperty(`pointer-events`),a&&(t.preventDefault(),n||(e.focus(),e.click()))},sde=new Set([`button`,`checkbox`,`color`,`file`,`hidden`,`image`,`radio`,`range`,`reset`,`submit`]),cde=e=>e instanceof HTMLElement&&(e.isContentEditable||e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&!sde.has(e.type)),lde=e=>Sx()&&e.altKey&&!e.ctrlKey&&!e.metaKey&&cde(e.composedPath()[0]),kx=e=>{lde(e)||[...Ox.keys()].forEach(t=>{Ox.get(t)?.some(({parsedShortcuts:t})=>Ex(e,t))&&ode(t,e)})},Ax=(e,t)=>{t.length?e.setAttribute(`aria-keyshortcuts`,[...new Set(t.flatMap(({label:e})=>e.split(` `)))].join(` `)):e.removeAttribute(`aria-keyshortcuts`)},jx=(e=``)=>{let t=Cx(e).trim().replace(/\s+/g,` `).replace(/\bCtrl\b/g,`Control`);if(!t)return()=>()=>{};let n=Tx(e);return e=>{Ox.size||globalThis.addEventListener(`keydown`,kx,{capture:!0});let r={parsedShortcuts:n,label:t},i=Ox.get(e)??[];return i.push(r),Ox.set(e,i),Ax(e,i),()=>{let t=i.indexOf(r);t!==-1&&(i.splice(t,1),Ax(e,i),i.length||Ox.delete(e),Ox.size||globalThis.removeEventListener(`keydown`,kx,{capture:!0}))}}},Mx=e=>e===null?`null`:typeof e,ude=(e,t)=>{if(t===`number`){let t=Number(e);return Number.isNaN(t)?null:t}return t===`boolean`?e===`true`:t===`null`?null:t===`string`?e?String(e):``:e},dde=B(`<span role="none" class="sui truncated-text svelte-zoz5la"><!></span>`),fde={hash:`svelte-zoz5la`,code:`.truncated-text.svelte-zoz5la {display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden;white-space:normal;overflow-wrap:anywhere;}`};function Nx(e,t){K(e,fde);let n=J(t,`lines`,3,1),r=J(t,`children`,3,void 0);var i=dde();let a;xo(N(i),()=>r()??Cr),D(i),R(()=>a=ts(i,``,a,{"-webkit-line-clamp":n(),"line-clamp":n()})),U(e,i)}var Px=new WeakMap,Fx,Ix=(e=`e`,t=7)=>[e,jc(t)].join(`-`),Lx=e=>{Px.delete(e),Fx?.unobserve(e)},pde=()=>{if(`IntersectionObserver`in globalThis)return Fx||(Fx=new IntersectionObserver(e=>{e.forEach(({isIntersecting:e,target:t})=>{if(!e||!(t instanceof HTMLElement))return;let n=Px.get(t);n&&(n(),Lx(t))})}),Fx)},Rx=new Map,mde=e=>{if(!(`IntersectionObserver`in globalThis))return;let t=Rx.get(e);if(!t){let n=new Map,r=new Map;t={observer:new IntersectionObserver(e=>{e.forEach(({isIntersecting:e,target:t})=>{let i=n.get(t);i&&(r.set(t,e),[...i].forEach(t=>{i.has(t)&&t(e)}))})},{rootMargin:e}),listeners:n,states:r},Rx.set(e,t)}return t},zx=(e,t,{rootMargin:n=`0px`}={})=>{let r=mde(n);if(!r)return()=>{};let{observer:i,listeners:a,states:o}=r,s=a.get(e)??new Set;return s.size?o.has(e)&&!s.has(t)&&queueMicrotask(()=>{s.has(t)&&a.get(e)===s&&t(o.get(e))}):(a.set(e,s),i.observe(e)),s.add(t),()=>{s.delete(t),!s.size&&a.get(e)===s&&(a.delete(e),o.delete(e),i.unobserve(e))}},Bx=(e,t,{delay:n=100,...r}={})=>{if(!(`IntersectionObserver`in globalThis)){let e=!1;return queueMicrotask(()=>{e||t()}),()=>{e=!0}}let i,a=zx(e,e=>{clearTimeout(i),e&&(i=setTimeout(()=>{a(),t()},n))},r);return()=>{clearTimeout(i),a()}},hde=e=>{let{top:t,left:n,bottom:r,right:i}=e.getBoundingClientRect(),{innerHeight:a,innerWidth:o}=globalThis;return r>0&&i>0&&t<a&&n<o},gde=e=>{`requestAnimationFrame`in globalThis?globalThis.requestAnimationFrame(e):globalThis.setTimeout(e,16)},Vx=e=>{let t=pde();if(t)return hde(e)?Promise.resolve(void 0):new Promise(n=>{let r=Px.get(e);Px.set(e,r?()=>{r(),n()}:n),gde(()=>{Px.has(e)&&t.observe(e)})})},_de=e=>{let t=e;return t.endsWith(`-left`)?t=t.replace(`-left`,`-right`):t.endsWith(`-right`)&&(t=t.replace(`-right`,`-left`)),t.startsWith(`left-`)?t=t.replace(`left-`,`right-`):t.startsWith(`right-`)&&(t=t.replace(`right-`,`left-`)),t},vde=(e,t)=>{let n=Math.max(e.top,0),r=Math.max(e.left,0),i=Math.min(e.right,t.width),a=Math.min(e.bottom,t.height);return{top:n,left:r,right:i,bottom:a,width:Math.max(0,i-r),height:Math.max(0,a-n)}},Hx=({position:e,from:t,to:n,size:r,room:i,otherRoom:a})=>r<=i?{position:e,cap:void 0}:a>i?{position:e.replace(t,n),cap:a}:{position:e,cap:i},Ux=({position:e,sides:t,size:n,rooms:r})=>{let i=t=>t.endsWith(`-`)?e.startsWith(t):e.endsWith(t),[a,o]=t,[s,c]=r;return i(a)?Hx({position:e,from:a,to:o,size:n,room:s,otherRoom:c}):i(o)?Hx({position:e,from:o,to:a,size:n,room:c,otherRoom:s}):{position:e,cap:void 0}},yde=({position:e,anchorRect:t,viewport:n,contentWidth:r,contentHeight:i})=>{let a=vde(t,n),o=a.top-8,s=n.height-a.bottom-8,c=a.left-8,l=n.width-a.right-8,u=n.height-a.top-8,d=a.bottom-8,f=e,p,m=(e,t)=>{let n=Ux({position:f,sides:e,size:i,rooms:t});f=n.position,p=n.cap??p};return m([`bottom-`,`top-`],[s,o]),m([`-top`,`-bottom`],[u,d]),{position:f}=Ux({position:f,sides:[`-left`,`-right`],size:r,rooms:[n.width-a.left-8,a.right-8]}),{position:f}=Ux({position:f,sides:[`right-`,`left-`],size:r,rooms:[l,c]}),{inset:[f.startsWith(`bottom-`)?`${Math.round(a.bottom)}px`:f.endsWith(`-top`)?`${Math.round(a.top)}px`:`auto`,f.startsWith(`left-`)?`${Math.round(n.width-a.left)}px`:f.endsWith(`-right`)?`${Math.round(n.width-a.right)}px`:`auto`,f.startsWith(`top-`)?`${Math.round(n.height-a.top)}px`:f.endsWith(`-bottom`)?`${Math.round(n.height-a.bottom)}px`:`auto`,f.startsWith(`right-`)?`${Math.round(a.right)}px`:f.endsWith(`-left`)?`${Math.round(a.left)}px`:`auto`].join(` `),zIndex:1e3,minWidth:`${Math.round(a.width)}px`,maxWidth:f.startsWith(`right-`)?`${Math.round(l)}px`:f.startsWith(`left-`)?`${Math.round(c)}px`:f.endsWith(`-left`)?`${Math.round(n.width-a.left-8)}px`:`${Math.round(a.right-8)}px`,height:p?`${Math.round(p)}px`:void 0}},bde=(e,t)=>{let n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(n=>Object.hasOwn(t,n)&&e[n]===t[n])},xde=class{#e=j(!1);get open(){return z(this.#e)}set open(e){M(this.#e,e,!0),e?this.checkPosition():this.anchorElement.getAttribute(`aria-expanded`)===`true`&&window.requestAnimationFrame(()=>{let{activeElement:e}=document;(!e||e===document.body||this.popupElement?.contains(e))&&this.anchorElement.focus()}),this.anchorElement.setAttribute(`aria-expanded`,String(e))}#t=j(Xi({inset:void 0,zIndex:void 0,minWidth:void 0,maxWidth:void 0,height:void 0}));get style(){return z(this.#t)}set style(e){M(this.#t,e,!0)}popupElement=void 0;contentElement=void 0;nested=!1;#n=void 0;#r=[];_rafId=0;constructor(e,t,n,r){this.anchorElement=e,this.position=n,this.positionBaseElement=r??e,this.id=Ix(`popup`),this.anchorElement.setAttribute(`aria-expanded`,`false`);let i=ao(e,`click`,t=>{!this.isDisabled&&!this.isReadOnly&&(this.open=t.detail&&e.matches(`[role="menuitem"]`)?!0:!this.open)}),a=ao(e,`keydown`,t=>{let{key:n,ctrlKey:r,metaKey:i,shiftKey:a,altKey:o}=t,s=a||o||r||i;this.isDisabled||this.isReadOnly||([`Enter`,` `].includes(n)&&!s?(t.preventDefault(),t.stopPropagation(),this.open=!this.open):![`ArrowDown`,`ArrowUp`].includes(n)||a||r||i||o&&n!==`ArrowDown`||![`listbox`,`menu`].includes(e.getAttribute(`aria-haspopup`)??``)||e.matches(`[role^="menuitem"]`)||this.open||(t.preventDefault(),t.stopPropagation(),this.open=!0))}),o=ao(e,`transitionstart`,()=>{this.anchorElement.closest(`.hiding, .hidden, [hidden]`)&&this.hideImmediately()});this.#r=[i,a,o],this.intersectionObserver=new IntersectionObserver(e=>{!e.at(-1)?.isIntersecting&&this.open&&this.hideImmediately()}),this.intersectionObserver.observe(this.anchorElement),this.resizeObserver=new ResizeObserver(()=>{cancelAnimationFrame(this._rafId),this._rafId=requestAnimationFrame(()=>this.checkPosition())}),this.resizeObserver.observe(this.positionBaseElement),this.viewportResizeObserver=new ResizeObserver(()=>{this.open&&this.checkPosition()}),t&&this.attachPopupElement(t)}attachPopupElement(e,t,{nested:n=!1}={}){if(this.popupElement===e&&this.contentElement===t)return;this.detachPopupElement(),this.popupElement=e,this.contentElement=t,this.nested=n,this.viewportResizeObserver.observe(e);let r=t??e;r.id=this.id,this.anchorElement.setAttribute(`aria-controls`,this.id);let i=ao(e,`click`,e=>{e.stopPropagation();let t=e.target;this.open&&(t===this.popupElement||t.matches(`[role^="menuitem"], [role="option"]`))&&(this.open=!1)}),a=ao(e,`keydown`,e=>{let{key:t,ctrlKey:n,metaKey:r,shiftKey:i,altKey:a}=e;t===`Escape`&&!(i||a||n||r)&&(e.preventDefault(),e.stopPropagation(),this.open=!1)});this.#n=()=>{i(),a()}}detachPopupElement(){this.#n?.(),this.#n=void 0,this.popupElement&&this.viewportResizeObserver.unobserve(this.popupElement),this.anchorElement.getAttribute(`aria-controls`)===this.id&&this.anchorElement.removeAttribute(`aria-controls`),this.popupElement=void 0,this.contentElement=void 0}get isDisabled(){return this.anchorElement.matches(`[aria-disabled="true"]`)}get isReadOnly(){return this.anchorElement.matches(`[aria-readonly="true"]`)}checkPosition(){if(!this.popupElement)return;let e=this.contentElement??this.popupElement?.querySelector(`.content`)??null;if(!e)return;let t=this.positionBaseElement.getBoundingClientRect(),{maxHeight:n,maxWidth:r}=e.style;e.style.maxHeight=``,e.style.maxWidth=``;let{scrollHeight:i,scrollWidth:a}=e;e.style.maxHeight=n,e.style.maxWidth=r;let o=yde({position:Tc()?_de(this.position):this.position,anchorRect:t,viewport:{width:window.innerWidth,height:window.innerHeight},contentWidth:a,contentHeight:i});bde(o,this.style)||(this.style=o)}async hideImmediately(){let e=this.nested?this.contentElement:this.popupElement;e&&(e.hidden=!0),this.open=!1,await Iu(50),e?.isConnected&&(e.hidden=!1)}destroy(){this.detachPopupElement(),this.#r.forEach(e=>e()),this.#r=[],this.intersectionObserver?.disconnect(),this.resizeObserver?.disconnect(),this.viewportResizeObserver?.disconnect(),this._rafId&&cancelAnimationFrame(this._rafId)}},Sde=(...e)=>new xde(...e),Wx=e=>Math.max(0,...e.split(`,`).map(e=>Number.parseFloat(e)||0))*1e3,Cde=({transitionDuration:e,transitionDelay:t})=>Wx(e)+Wx(t)+100;function Gx(e,t){var n=H();xo(P(n),()=>t.children??Cr),U(e,n)}var Kx=Symbol(`sui-modal-retainer`),wde=new Set([`$$slots`,`$$events`,`$$legacy`,`open`,`dialog`,`class`,`role`,`modal`,`showBackdrop`,`lightDismiss`,`escapeDismiss`,`keepContent`,`restoreFocus`,`children`,`extraContent`,`onOpening`,`onOpen`,`onClosing`,`onOk`,`onCancel`,`onClose`]),Tde=B(`<dialog><!> <!></dialog>`),Ede={hash:`svelte-6rdytg`,code:`dialog.svelte-6rdytg {position:fixed;inset:0;z-index:9999999;display:flex;justify-content:center;align-items:center;overflow:hidden;outline:0;margin:0;border:0;padding:0;width:100dvw;max-width:100dvw;height:100dvh;max-height:100dvh;color:var(--sui-primary-foreground-color);background:transparent;-webkit-user-select:none;user-select:none;touch-action:none;pointer-events:all;cursor:default;}dialog.svelte-6rdytg::backdrop {background:transparent;}dialog.backdrop.svelte-6rdytg {background-color:var(--sui-popup-backdrop-color);}dialog.non-modal.svelte-6rdytg {pointer-events:none;}dialog.non-modal.active.svelte-6rdytg > * {pointer-events:auto;}dialog.open.svelte-6rdytg {transition-duration:50ms;opacity:1;}dialog.svelte-6rdytg:not(.open) {transition-duration:400ms;opacity:0;}dialog[hidden].svelte-6rdytg {transition-duration:1ms !important;}dialog.svelte-6rdytg:not(.active) {pointer-events:none !important;}dialog.svelte-6rdytg:not(.active) * {transition-duration:0ms !important;pointer-events:none !important;}`};function qx(e,t){O(t,!0),K(e,Ede);let n=e=>{var n=H(),u=P(n),d=e=>{var n=Tde(),u=({target:e})=>{T=e},d=({target:e})=>{let t=T;T=void 0,t&&t!==i()||c()&&e?.matches(`dialog`)&&h(`cancel`)},p=e=>{o()||e.key!==`Escape`||e.isComposing||e.defaultPrevented||(e.preventDefault(),l()&&h(`cancel`))},v=e=>{e.preventDefault(),l()&&h(`cancel`)},y=()=>{S&&i()?.isConnected&&!i().open&&(l()?r(!1):m())};fs(n,()=>({tabindex:`-1`,...f,inert:!z(g),role:a(),class:`sui modal ${t.class??``}`,onpointerdown:u,onclick:d,onkeydown:p,oncancel:v,onclose:y,[ss]:{backdrop:s(),"non-modal":!o(),open:z(g),active:z(_)}}),void 0,void 0,void 0,`svelte-6rdytg`);var b=N(n);xo(b,()=>t.extraContent??Cr),xo(I(b,2),()=>t.children??Cr),D(n),gs(n,e=>i(e),()=>i()),U(e,n)};G(u,e=>{z(x)&&e(d)}),U(e,n)},r=J(t,`open`,15,!1),i=J(t,`dialog`,15),a=J(t,`role`,3,`dialog`),o=J(t,`modal`,3,!0),s=J(t,`showBackdrop`,3,!1),c=J(t,`lightDismiss`,3,!1),l=J(t,`escapeDismiss`,3,!0),u=J(t,`keepContent`,3,!1),d=J(t,`restoreFocus`,3,!0),f=vs(t,wde),p=()=>{i()?.focus()},m=()=>{o()?i()?.showModal():i()?.show()},h=e=>{i()&&(i(i().returnValue=e,!0),r(!1))},g=j(!1),_=j(!1),v=j(!1),y=j(0),b=ei(Kx);ti(Kx,{retain:()=>{eo(()=>{M(y,z(y)+1)})},release:()=>{eo(()=>{M(y,z(y)-1)})}});let x=A(()=>u()||z(v)||z(y)>0),S=!1,C=0,w,T,ee,E=()=>{let e=w;w=void 0,d()&&e&&(ee=window.setTimeout(()=>{let{activeElement:t}=document;e.isConnected&&(!t||t===document.body||i()?.contains(t))&&e.focus()}))},te=async()=>{if(await Za(),!i())return;let e=Cde(getComputedStyle(i())),t=new AbortController,{signal:n}=t;i().addEventListener(`transitionend`,e=>{e.target===i()&&t.abort()},{signal:n});let r=window.setTimeout(()=>t.abort(),e);await new Promise(e=>{n.addEventListener(`abort`,()=>e(void 0))}),window.clearTimeout(r)},ne=async()=>{if(S)return;S=!0,C+=1;let e=C,{activeElement:n}=document;window.clearTimeout(ee),w=n instanceof HTMLElement?n:void 0,t.onOpening?.(new CustomEvent(`Opening`)),M(v,!0),await Za(),e===C&&i()&&!i().open&&(m(),t.onOpen?.(new CustomEvent(`Open`)),i().getBoundingClientRect(),M(g,!0),await Za(),e===C&&i()&&(i().contains(document.activeElement)||p(),await te(),e===C&&M(_,!0)))},re=async()=>{if(!S)return;S=!1,C+=1;let e=C,n=z(g),r=i()?.returnValue??``;t.onClosing?.(new CustomEvent(`Closing`)),i()?.open&&(document.body.inert=!0,i().close(),document.body.inert=!1),E(),M(_,!1),M(g,!1),n&&await te(),e===C&&(M(v,!1),r===`ok`&&t.onOk?.(new CustomEvent(`Ok`)),r===`cancel`&&t.onCancel?.(new CustomEvent(`Cancel`)),t.onClose?.(new CustomEvent(`Close`,{detail:{returnValue:r}})),i()&&i(i().returnValue=``,!0))},ie=zee();return So(()=>{let e=go(Gx,{target:document.querySelector(`.sui.app-shell`)??document.body,props:{children:n},context:ie});return()=>{window.clearTimeout(ee),i()?.close(),yo(e)}}),L(()=>{r()?ne():re()}),L(()=>{if(z(v))return b?.retain(),()=>{b?.release()}}),k({focus:p,close:h})}var Dde=new Set([`$$slots`,`$$events`,`$$legacy`,`open`,`hovered`,`content`,`class`,`showBackdrop`,`anchor`,`position`,`positionBaseElement`,`parentDialogElement`,`touchOptimized`,`children`,`onOpen`]),Ode=B(`<div role="none"><!></div>`),kde={hash:`svelte-1aawl8x`,code:`.content.svelte-1aawl8x {position:absolute;overflow-y:auto;outline-width:0 !important;width:auto;transition-property:opacity, transform;color:var(--sui-primary-foreground-color);background-color:var(--sui-secondary-background-color-translucent);box-shadow:0 8px 16px var(--sui-popup-shadow-color);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);}.content.menu.svelte-1aawl8x {border-width:var(--sui-menu-border-width, 1px);border-style:var(--sui-menu-border-style, solid);border-color:var(--sui-menu-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-menu-border-radius, 4px);padding:var(--sui-menu-padding, 4px);}.content.menu.svelte-1aawl8x .sui.menu {border-width:0;border-radius:0;padding:0;background-color:transparent;}.content.listbox.svelte-1aawl8x {border-width:var(--sui-listbox-border-width, 1px);border-style:var(--sui-listbox-border-style, solid);border-color:var(--sui-listbox-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-listbox-border-radius, 4px);padding:var(--sui-listbox-padding, 4px);}.content.listbox.svelte-1aawl8x .sui.listbox {border-width:0;border-radius:0;padding:0;background-color:transparent;}.content.tree.svelte-1aawl8x {border-width:var(--sui-tree-border-width, 1px);border-style:var(--sui-tree-border-style, solid);border-color:var(--sui-tree-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-tree-border-radius, 4px);padding:var(--sui-tree-padding, 4px);}.content.tree.svelte-1aawl8x .sui.tree {margin:0;border-width:0;border-radius:0;padding:0;background-color:transparent;}.content.combobox.svelte-1aawl8x {display:flex;flex-direction:column;overflow:hidden;}.content.touch.svelte-1aawl8x {position:static;border-width:0 !important;border-radius:4px !important;padding:8px;min-width:320px !important;max-width:calc(100dvw - 32px) !important;max-height:calc(100dvh - 32px) !important;}dialog.open .content.touch.svelte-1aawl8x {transform:scale(100%) !important;}dialog:not(.open) .content.touch.svelte-1aawl8x {transform:scale(90%);}.content.touch.combobox.svelte-1aawl8x .sui.listbox {gap:4px;padding:8px 4px !important;}dialog.open .content.svelte-1aawl8x {transition-duration:50ms;opacity:1;transform:translateY(2px);}dialog:not(.open) .content.svelte-1aawl8x {transition-duration:300ms;opacity:0;transform:translateY(-8px);}.content.nested.menu.svelte-1aawl8x {margin-block:calc(-1 * (var(--sui-menu-border-width, 1px) + var(--sui-menu-padding, 4px)));}dialog.open .content.nested.menu.svelte-1aawl8x {transform:none;}`};function Jx(e,t){O(t,!0),K(e,kde);let n=e=>{var n=Ode();let o,s;xo(N(n),()=>t.children??Cr),D(n),gs(n,e=>a(e),()=>a()),R(()=>{q(n,`hidden`,!r()),o=$o(n,1,`content ${t.class??``} ${z(m)??``}`,`svelte-1aawl8x`,o,{touch:z(v),nested:!!l()}),s=ts(n,``,s,{inset:z(h)?.style.inset,"z-index":z(h)?.style.zIndex,"min-width":z(h)?.style.minWidth,"max-width":z(h)?.style.maxWidth,"max-height":z(h)?.style.height,visibility:z(h)?.style.inset?void 0:`hidden`})}),oo(`mouseenter`,n,()=>{i(!0),l()&&window.clearTimeout(g)}),oo(`mouseleave`,n,()=>{i(!1),l()&&(g=window.setTimeout(()=>{r(!1)},200))}),U(e,n)},r=J(t,`open`,15,!1),i=J(t,`hovered`,15,!1),a=J(t,`content`,15,void 0),o=J(t,`showBackdrop`,3,void 0),s=J(t,`position`,3,`bottom-left`),c=J(t,`positionBaseElement`,3,void 0),l=J(t,`parentDialogElement`,3,void 0),u=J(t,`touchOptimized`,3,!1),d=vs(t,Dde),f=j(void 0),p=j(!1),m=j(void 0),h=j(void 0),g=0,_=({tabStopOnly:e=!1}={})=>{if(!a())return!1;let t=[...a().querySelectorAll(`[tabindex="0"]:not([aria-disabled="true"])`),...e?[]:a().querySelectorAll(`[tabindex]:not([aria-disabled="true"])`)].some(e=>(e.focus(),document.activeElement===e));return!t&&!e&&(a(a().tabIndex=-1,!0),a().focus()),t};L(()=>{z(h)&&r(z(h).open)}),L(()=>{z(h)&&z(h).open!==r()&&(z(h).open=r())}),L(()=>{l()&&!z(f)&&a()&&(M(f,l()),z(f).append(a()))}),L(()=>{t.anchor&&!z(h)&&(M(h,Sde(t.anchor,void 0,s(),c()),!0),M(m,t.anchor.getAttribute(`aria-haspopup`)??void 0,!0))}),L(()=>{if(z(h)&&z(f)&&a())return z(h).attachPopupElement(z(f),a(),{nested:!!l()}),()=>{z(h)?.detachPopupElement()}}),L(()=>{r()&&z(f)&&z(h)?.checkPosition()});let v=A(()=>u()&&z(p));So(()=>(M(p,globalThis.matchMedia(`(pointer: coarse)`).matches,!0),()=>{z(h)?.destroy?.(),globalThis.clearTimeout(g)}));var y=H(),b=P(y),x=e=>{n(e)},S=e=>{{let i=A(()=>o()??z(v));qx(e,ys(()=>d,{role:`none`,class:`popup`,get showBackdrop(){return z(i)},lightDismiss:!0,onOpen:async e=>{t.onOpen?.(e),await Za(),a()&&!_({tabStopOnly:!0})&&(await Iu(100),a()&&!a().contains(document.activeElement)&&_())},get dialog(){return z(f)},set dialog(e){M(f,e,!0)},get open(){return r()},set open(e){r(e)},children:(e,t)=>{n(e)},$$slots:{default:!0}}))}};G(b,e=>{l()?e(x):e(S,-1)}),U(e,y),k()}var Ade=new Set(`$$slots.$$events.$$legacy.element.class.type.role.name.value.valueType.hidden.disabled.readonly.pressed.keyShortcuts.label.labelDir.lines.variant.size.iconic.pill.flex.popupPosition.showPopupBackdrop.children.startIcon.endIcon.popup`.split(`.`)),Yx=B(`<span role="none" class="label svelte-6408uz"><!></span>`),jde=B(`<!> <!>`,1),Mde=B(`<button><!> <!> <!></button> <!>`,1),Nde={hash:`svelte-6408uz`,code:`button.svelte-6408uz {flex:none;display:inline-flex;align-items:center;gap:4px;margin:var(--sui-focus-ring-width);border-width:0;border-style:solid;border-color:transparent;padding:0;color:var(--sui-control-foreground-color, inherit);background-color:transparent;box-shadow:none;font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);font-weight:var(--sui-font-weight-normal, normal);text-align:start;cursor:pointer;transition:all 200ms;}button[hidden].svelte-6408uz {display:none !important;}button.svelte-6408uz:not(:disabled):focus-visible {z-index:1;}button.svelte-6408uz:is(.primary:where(.svelte-6408uz), .secondary:where(.svelte-6408uz), .tertiary:where(.svelte-6408uz), .ghost:where(.svelte-6408uz)) {justify-content:center;border-width:1px;}button.svelte-6408uz:is(.primary:where(.svelte-6408uz), .secondary:where(.svelte-6408uz), .tertiary:where(.svelte-6408uz), .ghost:where(.svelte-6408uz)) .label:where(.svelte-6408uz):only-child {padding:0 4px;}button.primary.svelte-6408uz {border-width:var(--sui-button-primary-border-width, 1px);border-style:var(--sui-button-primary-border-style, solid);border-color:var(--sui-button-primary-border-color, var(--sui-primary-accent-color));color:var(--sui-button-primary-foreground-color, var(--sui-primary-accent-color-inverted));background-color:var(--sui-button-primary-background-color, var(--sui-primary-accent-color));font-weight:var(--sui-button-primary-font-weight, var(--sui-font-weight-normal, normal));}button.primary.svelte-6408uz:is(:where(.svelte-6408uz):hover, :where(.svelte-6408uz):focus-visible, [aria-expanded=true]:where(.svelte-6408uz)) {color:var(--sui-button-primary-foreground-color-focus, var(--sui-button-primary-foreground-color, var(--sui-primary-accent-color-inverted)));background-color:var(--sui-button-primary-background-color-focus, var(--sui-primary-accent-color-light));}button.primary.svelte-6408uz:active {color:var(--sui-button-primary-foreground-color-active, var(--sui-button-primary-foreground-color, var(--sui-primary-accent-color-inverted)));background-color:var(--sui-button-primary-background-color-active, var(--sui-primary-accent-color-dark));}button.secondary.svelte-6408uz {border-width:var(--sui-button-secondary-border-width, 1px);border-style:var(--sui-button-secondary-border-style, solid);border-color:var(--sui-button-secondary-border-color, var(--sui-primary-accent-color));color:var(--sui-button-secondary-foreground-color, var(--sui-primary-accent-color-text));background-color:var(--sui-button-secondary-background-color, var(--sui-button-background-color));font-weight:var(--sui-button-secondary-font-weight, var(--sui-font-weight-normal, normal));}button.secondary.svelte-6408uz:is(:where(.svelte-6408uz):hover, :where(.svelte-6408uz):focus-visible, [aria-expanded=true]:where(.svelte-6408uz)) {color:var(--sui-button-secondary-foreground-color-focus, var(--sui-button-secondary-foreground-color, var(--sui-primary-accent-color-text)));background-color:var(--sui-button-secondary-background-color-focus, var(--sui-hover-background-color));}button.secondary.svelte-6408uz:active {color:var(--sui-button-secondary-foreground-color-active, var(--sui-button-secondary-foreground-color, var(--sui-primary-accent-color-text)));background-color:var(--sui-button-secondary-background-color-active, var(--sui-active-background-color));}button.secondary[aria-pressed=true].svelte-6408uz {color:var(--sui-button-secondary-foreground-color-pressed);background-color:var(--sui-button-secondary-background-color-pressed, var(--sui-primary-accent-color));}button.tertiary.svelte-6408uz {border-width:var(--sui-button-tertiary-border-width, 1px);border-style:var(--sui-button-tertiary-border-style, solid);border-color:var(--sui-button-tertiary-border-color, var(--sui-button-border-color));color:var(--sui-button-tertiary-foreground-color, var(--sui-highlight-foreground-color));background-color:var(--sui-button-tertiary-background-color, var(--sui-button-background-color));font-weight:var(--sui-button-tertiary-font-weight, var(--sui-font-weight-normal, normal));}button.tertiary.svelte-6408uz:is(:where(.svelte-6408uz):hover, :where(.svelte-6408uz):focus-visible, [aria-expanded=true]:where(.svelte-6408uz)) {color:var(--sui-button-tertiary-foreground-color-focus, var(--sui-button-tertiary-foreground-color, var(--sui-highlight-foreground-color)));background-color:var(--sui-button-tertiary-background-color-focus, var(--sui-hover-background-color));}button.tertiary.svelte-6408uz:active {color:var(--sui-button-tertiary-foreground-color-active, var(--sui-button-tertiary-foreground-color, var(--sui-highlight-foreground-color)));background-color:var(--sui-button-tertiary-background-color-active, var(--sui-active-background-color));}button.tertiary[aria-pressed=true].svelte-6408uz {color:var(--sui-button-tertiary-foreground-color-pressed);background-color:var(--sui-button-tertiary-background-color-pressed, var(--sui-selected-background-color));}button.ghost.svelte-6408uz {font-weight:var(--sui-button-ghost-font-weight, var(--sui-font-weight-normal, normal));}button.ghost.svelte-6408uz:is(:where(.svelte-6408uz):hover, :where(.svelte-6408uz):focus-visible, [aria-expanded=true]:where(.svelte-6408uz)) {color:var(--sui-button-ghost-foreground-color-focus);background-color:var(--sui-button-ghost-background-color-focus, var(--sui-hover-background-color));}button.ghost.svelte-6408uz:active {color:var(--sui-button-ghost-foreground-color-active);background-color:var(--sui-button-ghost-background-color-active, var(--sui-active-background-color));}button.ghost[aria-pressed=true].svelte-6408uz {color:var(--sui-button-ghost-foreground-color-pressed);background-color:var(--sui-button-ghost-background-color-pressed, var(--sui-selected-background-color));}button.link.svelte-6408uz {margin:0;padding:0 !important;height:auto !important;color:var(--sui-button-link-foreground-color, var(--sui-primary-accent-color-text));}button.link.svelte-6408uz:hover .label:where(.svelte-6408uz) {outline:none !important;text-decoration:underline;}button.link.svelte-6408uz .label:where(.svelte-6408uz) {padding:0;line-height:var(--sui-line-height-compact);text-decoration:var(--sui-button-link-text-decoration, none);text-underline-offset:2px;white-space:normal;}:is(:root, :host)[data-underline-links='true'] button.link.svelte-6408uz .label:where(.svelte-6408uz) {text-decoration:underline;}button.small.svelte-6408uz {border-radius:var(--sui-button-small-border-radius);padding:var(--sui-button-small-padding);height:var(--sui-button-small-height);font-size:var(--sui-button-small-font-size, var(--sui-font-size-small));}button.small.svelte-6408uz .icon {font-size:var(--sui-font-size-large);}button.medium.svelte-6408uz {border-radius:var(--sui-button-medium-border-radius);padding:var(--sui-button-medium-padding);height:var(--sui-button-medium-height);font-size:var(--sui-button-medium-font-size, var(--sui-font-size-default));}button.large.svelte-6408uz {border-radius:var(--sui-button-large-border-radius);padding:var(--sui-button-large-padding);height:var(--sui-button-large-height);font-size:var(--sui-button-large-font-size, var(--sui-font-size-large));}button.pill.svelte-6408uz {border-radius:80px;padding:var(--sui-button-medium-pill-padding, 0 12px);}button.flex.svelte-6408uz:not([hidden]) {display:inline-flex;flex:auto;width:-moz-available;width:-webkit-fill-available;width:stretch;}button.iconic.svelte-6408uz {justify-content:center;padding:0;aspect-ratio:1/1;}button.danger.svelte-6408uz {background-color:var(--sui-error-background-color);}button.svelte-6408uz .label:where(.svelte-6408uz) {padding:0 4px;}button.svelte-6408uz > * {pointer-events:none;}`};function Xx(e,t){O(t,!0),K(e,Nde);let n=e=>{var t=Yx();Nx(N(t),{get lines(){return _()},children:(e,t)=>{Ur();var n=V();R(()=>W(n,h())),U(e,n)},$$slots:{default:!0}}),D(t),R(()=>{q(t,`dir`,g()),t.dir=t.dir}),U(e,t)},r=J(t,`element`,15),i=J(t,`class`,3,``),a=J(t,`type`,3,`button`),o=J(t,`role`,3,`button`),s=J(t,`name`,3,void 0),c=J(t,`value`,3,void 0),l=J(t,`valueType`,19,()=>Mx(c())),u=J(t,`hidden`,3,!1),d=J(t,`disabled`,3,!1),f=J(t,`readonly`,3,!1),p=J(t,`pressed`,3,void 0),m=J(t,`keyShortcuts`,3,void 0),h=J(t,`label`,3,``),g=J(t,`labelDir`,3,void 0),_=J(t,`lines`,3,1),v=J(t,`variant`,3,void 0),y=J(t,`size`,3,`medium`),b=J(t,`iconic`,3,!1),x=J(t,`pill`,3,!1),S=J(t,`flex`,3,!1),C=J(t,`popupPosition`,3,`bottom-left`),w=J(t,`showPopupBackdrop`,3,!1),T=vs(t,Ade);var ee=Mde(),E=P(ee);fs(E,()=>({...T,class:[`sui`,`button`,v(),y(),i()],type:a(),name:s(),value:c(),hidden:u(),disabled:d(),role:o(),"aria-hidden":u(),"aria-disabled":d(),"aria-readonly":f()||void 0,"aria-pressed":p(),"data-type":l(),"data-name":s(),"data-label":h(),"data-value":c(),[ss]:{iconic:b(),pill:x(),flex:S()}}),void 0,void 0,void 0,`svelte-6408uz`);var te=N(E);xo(te,()=>t.startIcon??Cr);var ne=I(te,2),re=e=>{var r=H(),i=P(r),a=e=>{n(e)},o=e=>{var n=Yx();xo(N(n),()=>t.children??Cr),D(n),U(e,n)};G(i,e=>{h()?e(a):e(o,-1)}),U(e,r)},ie=e=>{var r=jde(),i=P(r),a=e=>{n(e)};G(i,e=>{h()&&e(a)}),xo(I(i,2),()=>t.children??Cr),U(e,r)};G(ne,e=>{v()===`link`?e(re):e(ie,-1)}),xo(I(ne,2),()=>t.endIcon??Cr),D(E),gs(E,e=>r(e),()=>r()),qo(E,()=>m()&&jx(m()));var ae=I(E,2),oe=e=>{Jx(e,{get anchor(){return r()},get position(){return C()},get showBackdrop(){return w()},touchOptimized:!0,children:(e,n)=>{var r=H();xo(P(r),()=>t.popup),U(e,r)},$$slots:{default:!0}})};G(ae,e=>{t.popup&&e(oe)}),U(e,ee),k()}var Pde=B(`<div role="none"><!></div>`),Fde=B(`<div role="none"><div class="message svelte-19p6mta"><!></div> <!></div>`),Ide={hash:`svelte-19p6mta`,code:`.infobar.svelte-19p6mta {flex:none;display:flex;align-items:center;gap:var(--sui-infobar-gap, 8px);border-width:var(--sui-infobar-border-width, 0 0 1px);border-style:var(--sui-infobar-border-style, solid);padding:var(--sui-infobar-padding, 0);min-height:var(--sui-infobar-min-height, 32px);font-size:var(--sui-infobar-font-size, var(--sui-font-size-small));}.infobar.info.svelte-19p6mta {border-color:var(--sui-info-border-color);color:var(--sui-info-foreground-color);background-color:var(--sui-info-background-color);}.infobar.warning.svelte-19p6mta {border-color:var(--sui-warning-border-color);color:var(--sui-warning-foreground-color);background-color:var(--sui-warning-background-color);}.infobar.error.svelte-19p6mta {border-color:var(--sui-error-border-color);color:var(--sui-error-foreground-color);background-color:var(--sui-error-background-color);}.infobar.success.svelte-19p6mta {border-color:var(--sui-success-border-color);color:var(--sui-success-foreground-color);background-color:var(--sui-success-background-color);}.message.svelte-19p6mta {flex:auto;display:flex;align-items:center;justify-content:var(--sui-infobar-message-justify-content, start);gap:var(--sui-infobar-message-gap, 6px);padding:var(--sui-infobar-message-padding, 6px);}.message.svelte-19p6mta button {font-size:inherit !important;}.message.svelte-19p6mta .icon {font-size:16px; /* !hardcoded */}`};function Zx(e,t){O(t,!0),K(e,Ide);let n=J(t,`show`,15,!0),r=J(t,`dismissible`,3,!0),i=J(t,`status`,3,`info`),a=J(t,`ariaLive`,3,void 0),o=J(t,`children`,3,void 0),s=J(t,`icon`,3,void 0),c=A(()=>vx(i()));var l=H(),u=P(l),d=e=>{var l=Fde(),u=N(l);_x(N(u),{get status(){return i()},get children(){return o()},get icon(){return s()}}),D(u);var d=I(u,2),f=e=>{var r=Pde(),i=N(r);{let e=A(()=>Y(`_sui.dismiss`));Xx(i,{iconic:!0,size:`small`,variant:`ghost`,get"aria-label"(){return z(e)},onclick:()=>{n(!1),t.onDismiss?.()},children:(e,t)=>{gx(e,{name:`close`})},$$slots:{default:!0}})}D(r),U(e,r)};G(d,e=>{r()&&e(f)}),D(l),R(e=>{$o(l,1,Yo([`infobar`,i()]),`svelte-19p6mta`),q(u,`role`,z(c)),q(u,`aria-live`,e)},[()=>yx(z(c),a())]),U(e,l)};G(u,e=>{n()&&e(d)}),U(e,l),k()}var Lde=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`children`]),Rde=B(`<div><!></div>`),zde={hash:`svelte-6zligd`,code:`.bottom-navigation.svelte-6zligd {height:var(--sui-bottom-navigation-height, var(--sui-primary-toolbar-size));border-top-width:var(--sui-bottom-navigation-border-color, 1px);border-top-style:var(--sui-bottom-navigation-border-style, solid);border-top-color:var(--sui-bottom-navigation-border-color, var(--sui-secondary-border-color));}.bottom-navigation.svelte-6zligd:is([inert]:where(.svelte-6zligd), [hidden]:where(.svelte-6zligd)) {display:none;}.bottom-navigation.svelte-6zligd .buttons {flex:auto;display:flex;align-items:center;justify-content:space-evenly;}`};function Bde(e,t){K(e,zde);let n=vs(t,Lde);var r=Rde();fs(r,()=>({role:`none`,class:`sui bottom-navigation ${t.class??``}`,...n}),void 0,void 0,void 0,`svelte-6zligd`),xo(N(r),()=>t.children??Cr),D(r),U(e,r)}var Vde=B(`<div role="none" class="sui floating-action-button-wrapper svelte-y7nbhn"><!></div>`),Hde={hash:`svelte-y7nbhn`,code:`.floating-action-button-wrapper.svelte-y7nbhn {display:contents;}
@media (width < 768px) {.floating-action-button-wrapper.svelte-y7nbhn {display:block;position:fixed;inset-inline-end:16px;inset-block-end:72px;z-index:100;}.floating-action-button-wrapper.svelte-y7nbhn button {border-radius:50%;height:56px;box-shadow:0 4px 8px rgba(0, 0, 0, 0.4);}.floating-action-button-wrapper.svelte-y7nbhn button .icon {font-size:32px;}
}`};function Qx(e,t){K(e,Hde);let n=J(t,`children`,3,void 0);var r=Vde();xo(N(r),()=>n()??Cr),D(r),U(e,r)}var $x=e=>{try{e.scrollIntoView({block:`nearest`,inline:`nearest`,behavior:`auto`})}catch{e.scrollIntoView(!0)}},eS=Symbol(`sui-option-registry`),Ude=class{#e=j(!1);get expanded(){return z(this.#e)}set expanded(e){M(this.#e,e,!0)}#t=new Set;#n=j(0);#r=[];#i=-1;get#a(){return this.#i!==z(this.#n)&&(this.#r=[...this.#t],this.#i=z(this.#n)),this.#r}get count(){return this.#a.length}get entries(){return this.#a}get selectedEntry(){return this.#a.find(e=>e.selected)}register(e){return this.#t.add(e),M(this.#n,z(this.#n)+1),()=>{this.#t.delete(e),M(this.#n,z(this.#n)+1)}}find(e){return this.#a.find(t=>t.value===e)}selectOnly(e){this.#a.forEach(t=>{let n=t.value===e;t.selected!==n&&(t.selected=n)})}},Wde=()=>ti(eS,new Ude),Gde=()=>ei(eS),tS=e=>{let{type:t=`string`,name:n,label:r}=e.dataset;return{target:e,type:t,name:n,label:r,value:ude(e.dataset.value,t)}},Kde=/\p{Diacritic}/gu,nS=e=>e.normalize(`NFD`).replace(Kde,``).toLocaleLowerCase(),rS=e=>nS(e.trim()),iS=(e,t)=>e===`horizontal`?t?{prevKey:`ArrowRight`,nextKey:`ArrowLeft`}:{prevKey:`ArrowLeft`,nextKey:`ArrowRight`}:{prevKey:`ArrowUp`,nextKey:`ArrowDown`},qde=({key:e,index:t,count:n,prevKey:r,nextKey:i})=>e===r?t>0?t-1:n-1:e===i?t<n-1?t+1:0:-1,Jde=({key:e,index:t,count:n,columnCount:r,prevKey:i,nextKey:a})=>{let o=n-1,s=e===`ArrowUp`||e===i,c=e===`ArrowDown`||e===a;return t===-1?c?0:s?o:-1:s&&t>0?e===`ArrowUp`?Math.max(t-r,0):t-1:c&&t<o?e===`ArrowDown`?Math.min(t+r,o):t+1:-1},aS=class{#e=``;#t=0;push(e){return globalThis.clearTimeout(this.#t),this.#e+=nS(e),this.#t=globalThis.setTimeout(()=>{this.#e=``},500),this.#e}reset(){globalThis.clearTimeout(this.#t),this.#e=``}},oS=(e,t,n)=>{if(!t)return-1;let r=t.length>1&&[...t].every(e=>e===t[0]),i=r?t[0]:t,a=t.length===1||r?n+1:Math.max(n,0),{length:o}=e;for(let t=0;t<o;t+=1){let n=(a+t)%o;if(e[n].startsWith(i))return n}return-1},sS=(e,t)=>n=>{e.activate(),t(n)},cS=async(e,t)=>{await Iu(100),t()||e.activate()},lS=`[aria-disabled="true"], [aria-hidden="true"]`,uS=(e,t)=>{e.getAttribute(`tabindex`)!==String(t)&&(e.tabIndex=t)},Yde={grid:{orientation:`vertical`,childRoles:[`row`],childSelectedAttr:`aria-selected`,focusChild:!0,selectFirst:!1,controlsPanel:!1,rovingTabStop:`selected`},listbox:{orientation:`vertical`,childRoles:[`option`],childSelectedAttr:`aria-selected`,focusChild:!1,selectFirst:!1,controlsPanel:!1,rovingTabStop:`selected`},menu:{orientation:`vertical`,childRoles:[`menuitem`,`menuitemcheckbox`,`menuitemradio`],childSelectedAttr:`aria-checked`,focusChild:!0,selectFirst:!1,controlsPanel:!1,rovingTabStop:`first`},menubar:{orientation:`horizontal`,childRoles:[`menuitem`,`menuitemcheckbox`,`menuitemradio`],childSelectedAttr:`aria-checked`,focusChild:!0,selectFirst:!1,controlsPanel:!1,rovingTabStop:`first`},radiogroup:{orientation:`horizontal`,childRoles:[`radio`],childSelectedAttr:`aria-checked`,focusChild:!0,selectFirst:!1,controlsPanel:!1,rovingTabStop:`selected`},tablist:{orientation:`horizontal`,childRoles:[`tab`],childSelectedAttr:`aria-selected`,focusChild:!0,selectFirst:!0,controlsPanel:!0,rovingTabStop:`selected`}},Xde=`a[href], button, input, select, textarea, summary, [tabindex]`,Zde=(e,t)=>{let n=[...document.querySelectorAll(Xde)].filter(t=>t===e||t.tabIndex>=0&&!t.matches(`:disabled, [aria-disabled="true"], [hidden], [inert], [inert] *`)),r=n.indexOf(e);if(r===-1)return;let i=t?-1:1;for(let e=r+i;e>=0&&e<n.length;e+=i)if(n[e].getClientRects().length){n[e].focus();return}},Qde=e=>{let t=e;for(;t;){if(t.id){let e=document.querySelector(`[aria-haspopup="menu"][aria-controls="${CSS.escape(t.id)}"]`);if(e)return e}t=t.parentElement}return null},dS=(e,t=e.getAttribute(`role`))=>t!==`menuitem`&&e.dataset.selectable!==`false`,$de=class{activated=!1;selectionObserver=void 0;#e=!1;#t=void 0;#n=void 0;#r=new WeakMap;#i=new WeakMap;#a=new aS;#o=!1;#s(e){let t=e.dataset.searchValue??e.dataset.label??e.querySelector(`.label`)?.textContent??e.textContent,n=this.#r.get(e);if(n?.raw===t)return n.normalized;let r=rS(t);return this.#r.set(e,{raw:t,normalized:r}),r}#c(e){let t=this.controlsPanel?e.getAttribute(`aria-controls`):null;return t?document.getElementById(t):null}#l(e,t){e.inert=!t,e.setAttribute(`aria-hidden`,String(!t))}constructor(e,{clickToSelect:t=!0}={}){e.dispatchEvent(new CustomEvent(`Initializing`)),this.parent=e,this.role=e.getAttribute(`role`),this.multi=this.parent.getAttribute(`aria-multiselectable`)===`true`,this.id=Ix(this.role),this.parentGroupSelector=`[role="group"], [role="${this.role}"]`,this.clickToSelect=t,this._onClick=sS(this,e=>this.onClick(e)),this._onKeyDown=sS(this,e=>this.onKeyDown(e));let{orientation:n,childRoles:r,childSelectedAttr:i,focusChild:a,selectFirst:o,controlsPanel:s,rovingTabStop:c}=Yde[this.role];this.orientation=this.grid?`horizontal`:this.parent.getAttribute(`aria-orientation`)??n,this.childRoles=r,this.childSelectedAttr=i,this.childSelectedProp=i.replace(`aria-`,``),this.focusChild=a,this.selectFirst=o,this.controlsPanel=s,this.rovingTabStop=c,this.parent.tabIndex=a?-1:0,this.observer=new globalThis.MutationObserver(e=>{this.#d(e)&&(this.#n=void 0,this.activated&&e.some(({type:e})=>e===`childList`)&&this.updateTabStop())}),this.observer.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`aria-disabled`,`aria-hidden`]}),(s||a&&c===`selected`)&&(this.selectionObserver=new globalThis.MutationObserver(()=>{this.activated&&this.syncSelection()}),this.selectionObserver.observe(e,{subtree:!0,attributes:!0,attributeFilter:[i]})),e.addEventListener(`click`,this._onClick),e.addEventListener(`keydown`,this._onKeyDown),cS(this,()=>this.#e)}activate(){if(this.activated)return;let{parent:e,allMembers:t,selected:n}=this;this.activated=!0,t.forEach((e,t)=>{let r=e.getAttribute(this.childSelectedAttr)===`true`||(n?e===n:this.selectFirst&&t===0),i=this.#c(e);e.id||=`${this.id}-item-${t+1}`,dS(e)&&e.setAttribute(this.childSelectedAttr,String(r)),i&&(i.setAttribute(`aria-labelledby`,e.id),this.#l(i,r),r&&globalThis.setTimeout(()=>{$x(i)},300))}),this.updateTabStop(),e.dispatchEvent(new CustomEvent(`Initialized`))}updateTabStop(){let{allMembers:e,activeMembers:t}=this;if(!this.focusChild){e.forEach(e=>{e.tabIndex=-1});return}let{activeElement:n}=document,r=t.find(e=>e===n||e.contains(n)),i=t.filter(e=>e.getAttribute(`tabindex`)===`0`),a=r??(i.length===1?i[0]:(this.rovingTabStop===`selected`?this.selected:void 0)??t.find(e=>e.dataset.selectable!==`false`)??t[0]);e.forEach(e=>{uS(e,e===a?0:-1)})}syncSelection(){let{allMembers:e,parent:t}=this;if(this.controlsPanel&&e.forEach(e=>{let t=this.#c(e);t&&this.#l(t,e.getAttribute(this.childSelectedAttr)===`true`)}),this.focusChild&&!t.contains(document.activeElement)){let{selected:t}=this;t&&e.forEach(e=>{uS(e,e===t?0:-1)})}}get columnCount(){let e=this.allMembers.filter(e=>e.getClientRects().length),t=e[0]?.getBoundingClientRect().top,n=e.findIndex(e=>Math.abs(e.getBoundingClientRect().top-t)>1);return Math.max(1,n===-1?e.length:n)}get selector(){return this.childRoles.map(e=>`[role="${e}"]`).join(`,`)}get#u(){if(this.#d(this.observer.takeRecords())&&(this.#n=void 0),!this.#n){let e=[...this.parent.querySelectorAll(this.selector)];this.#n={all:e,active:e.filter(e=>!e.matches(lS))}}return this.#n}#d(e){let{selector:t}=this,n=e=>e instanceof Element&&(e.matches(t)||!!e.querySelector(t));return e.some(({type:e,target:r,addedNodes:i,removedNodes:a})=>e===`attributes`?r instanceof Element&&r.matches(t):[...i].some(n)||[...a].some(n))}get allMembers(){return this.#u.all}get activeMembers(){return this.#u.active}get opener(){return Qde(this.parent)}get parentMenuItem(){let{opener:e}=this;return e?.matches(`[role^="menuitem"]`)?e:null}closeMenuChain(){let{opener:e}=this,t=e,n=null;for(let e=0;e<10&&t;e+=1){n=t,t.getAttribute(`aria-expanded`)===`true`&&t.click();let e=t.closest(`[role="menu"], [role="menubar"]`);t=e?Qde(e):null}return n}async leaveMenu(e){let t=this.closeMenuChain();t&&(t.focus(),await Iu(50),Zde(t,e))}async enterSubmenu(e){let t=e.getAttribute(`aria-controls`);if(!t)return;e.getAttribute(`aria-expanded`)!==`true`&&e.click();let n=document.getElementById(t);for(let e=0;e<20;e+=1){let e=[...n?.querySelectorAll(this.selector)??[]].find(e=>!e.matches(lS));if(e?.focus(),e&&document.activeElement===e)return;await Iu(20)}}leaveSubmenu(e){e.getAttribute(`aria-expanded`)===`true`&&e.click(),e.focus()}get selected(){return this.activeMembers.find(e=>e.getAttribute(this.childSelectedAttr)===`true`)}get isDisabled(){return this.parent.matches(`[aria-disabled="true"]`)}get isReadOnly(){return this.parent.matches(`[aria-readonly="true"]`)}get grid(){return this.role===`grid`||this.role===`listbox`&&this.parent.matches(`.grid`)}#f(e,t){e.setAttribute(this.childSelectedAttr,String(t)),e.dispatchEvent(new CustomEvent(`Change`,{detail:{[this.childSelectedProp]:t}}))}#p(e){this.#o=!0;try{e.click()}finally{this.#o=!1}}#m(e,t,{role:n,isTarget:r,targetSelectable:i,selecting:a}){let o=n===`menuitemradio`,s=dS(t,n),c=s&&(n===`menuitemcheckbox`||this.multi),l=s&&i&&(o||!c),u=t.getAttribute(this.childSelectedAttr)===`true`,d=!1;return n===`menuitem`&&r&&a&&(d=!0,t.dispatchEvent(new CustomEvent(`Select`))),c&&r&&a&&(d=!0,this.#f(t,!u),u||t.dispatchEvent(new CustomEvent(`Select`))),l&&u!==r&&(!o||a)&&(d=!0,this.#f(t,r),r&&(e.type===`keydown`&&n===`radio`&&this.#p(t),t.dispatchEvent(new CustomEvent(`Select`)))),d}#h(e,t,n){let r=this.#c(e);this.focusChild||(e.classList.toggle(`focused`,t),t&&e.dispatchEvent(new CustomEvent(`Focus`))),r&&(this.#l(r,t),t&&n.push(r)),t&&(this.parent.setAttribute(`aria-activedescendant`,e.id),n.push(e))}#g(e,t,n){e.forEach(e=>{uS(e,e===t?0:-1)}),n&&(t.focus(),t.dispatchEvent(new CustomEvent(`Focus`)))}selectTarget(e,t){if(this.isDisabled||this.isReadOnly){e.preventDefault();return}let n=t.getAttribute(`role`),r=t.closest(this.parentGroupSelector),i=dS(t,n),a=e.type===`click`||e.type===`keydown`&&e.key===` `,o=[],s=!1,c=[],l=!1;this.activeMembers.forEach(u=>{let d=u.getAttribute(`role`);if((d===`menuitemcheckbox`||d===`menuitemradio`)&&(d!==n||u.closest(this.parentGroupSelector)!==r))return;let f=u===t;o.push(u),s||=f,this.#m(e,u,{role:d,isTarget:f,targetSelectable:i,selecting:a})&&(l=!0),this.#h(u,f,c)}),c.length&&this.scrollIntoViewLater(c),this.focusChild&&this.#g(o,t,s),l&&this.parent.dispatchEvent(new CustomEvent(`Change`,{detail:tS(t)}))}scrollIntoViewLater(e){globalThis.clearTimeout(this.#t),this.#t=globalThis.setTimeout(()=>{this.#t=void 0,e.forEach($x)},300)}onClick(e){let t=e.target,n=t.matches(this.selector)?t:t.closest(this.selector);!n||e.button!==0||!this.clickToSelect||this.#o||(this.selectTarget(e,n),!this.focusChild&&document.activeElement!==this.parent&&n.contains(document.activeElement)&&this.parent.focus({preventScroll:!0}))}onKeyDown(e){let{key:t,ctrlKey:n,metaKey:r,shiftKey:i,altKey:a}=e,o=i||a||n||r,s=this.childRoles.includes(`menuitem`);if(t===`Tab`&&s&&!n&&!r&&!a){e.preventDefault(),this.leaveMenu(i);return}if(o)return;let c=e.target,{activeMembers:l}=this;if(c!==this.parent&&c.matches(`input, textarea, select, [contenteditable]:not([contenteditable="false"])`)&&t!==`Escape`&&t!==`Tab`)return;let u=this.#_(c);[`Enter`,` `,`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`].includes(t)&&e.preventDefault();let d=c===this.parent||c.matches(this.selector);if(t===`Home`||t===`End`){if(!d)return;e.preventDefault();let n=l[t===`Home`?0:l.length-1];n&&n!==u&&this.selectTarget(e,n);return}if(t.length===1&&t!==` `&&d&&(this.role===`listbox`||s)){e.preventDefault();let n=this.#v(t,u);n&&n!==u&&this.selectTarget(e,n);return}if(t===`Enter`){u?.click();return}if(t===` `){u&&this.selectTarget(e,u);return}if(t===`Escape`&&s){let{parentMenuItem:t}=this;if(t){e.preventDefault(),e.stopPropagation(),this.leaveSubmenu(t);return}}let f=Tc();if(this.orientation===`vertical`&&s){let{prevKey:e,nextKey:n}=iS(`horizontal`,f);if(t===n&&u?.getAttribute(`aria-haspopup`)===`menu`){this.enterSubmenu(u);return}if(t===e){let{parentMenuItem:e}=this;if(e){this.leaveSubmenu(e);return}}}let p=this.#y(t,u,f);p&&p!==u&&this.selectTarget(e,p)}#_(e){if(!this.focusChild)return this.activeMembers.find(e=>e.matches(`.focused`));let t=e.closest(this.selector);return t&&this.parent.contains(t)?t:void 0}#v(e,t){let{activeMembers:n}=this,r=oS(n.map(e=>rS(e.dataset.label??e.querySelector(`.label`)?.textContent??e.textContent??``)),this.#a.push(e),t?n.indexOf(t):-1);return r===-1?void 0:n[r]}#y(e,t,n){let{allMembers:r,activeMembers:i}=this;if(!this.grid){let r=t?i.indexOf(t):-1,a=iS(this.orientation,n);return i[qde({key:e,index:r,count:i.length,...a})]}let{columnCount:a}=this,o=r.filter(e=>e.getAttribute(`aria-hidden`)!==`true`),s=t?o.indexOf(t):-1,c=s===-1?i:o,l=iS(`horizontal`,n),u=c[Jde({key:e,index:s,count:c.length,columnCount:a,...l})];return u?.matches(`[aria-disabled="true"]`)?void 0:u}destroy(){this.#e=!0,globalThis.clearTimeout(this.#t),this.#a.reset(),this.observer.disconnect(),this.selectionObserver?.disconnect(),this.parent.removeEventListener(`click`,this._onClick),this.parent.removeEventListener(`keydown`,this._onKeyDown)}onUpdate({searchTerms:e}){let t=rS(e),n=t?t.split(/\s+/):[],{allMembers:r,parent:i}=this,a=r.map(e=>{let t=this.#s(e),r=!n.every(e=>t.includes(e));return this.#i.get(e)!==r&&(this.#i.set(e,r),e.dispatchEvent(new CustomEvent(`Toggle`,{detail:{hidden:r}}))),r}).filter(e=>!e).length;i.dispatchEvent(new CustomEvent(`Filter`,{detail:{matched:a,total:r.length}}))}},fS=e=>t=>{let n=typeof e==`function`,r=new $de(t,n?eo(()=>e()):e);return n&&L(()=>{r.onUpdate(e())}),()=>{r.destroy()}},efe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`ariaLabel`,`children`]),tfe=B(`<div><div role="none" class="inner svelte-1dmdir4"><!></div></div>`),nfe={hash:`svelte-1dmdir4`,code:`.select-button-group.svelte-1dmdir4 {flex:none;display:inline-flex;align-items:center;margin:var(--sui-focus-ring-width);}.select-button-group.svelte-1dmdir4:focus-visible {outline-width:0 !important;}.select-button-group.svelte-1dmdir4 button {margin:0 !important;border-radius:0 !important;color:var(--sui-primary-foreground-color);}.select-button-group.svelte-1dmdir4 button:first-child {border-start-start-radius:4px !important;border-end-start-radius:4px !important;}.select-button-group.svelte-1dmdir4 button:not(:first-child) {border-inline-start-width:0;}.select-button-group.svelte-1dmdir4 button:last-child {border-start-end-radius:4px !important;border-end-end-radius:4px !important;}.select-button-group.svelte-1dmdir4 button[aria-checked=true] {color:var(--sui-highlight-foreground-color);background-color:var(--sui-selected-background-color);}.select-button-group[aria-invalid=true].svelte-1dmdir4 button {border-color:var(--sui-error-border-color);}.select-button-group[aria-disabled=false].svelte-1dmdir4 button[aria-disabled='true'] {filter:grayscale(0) opacity(1);}.select-button-group[aria-disabled=false].svelte-1dmdir4 button[aria-disabled='true'] * {filter:grayscale(1) opacity(var(--sui-disabled-opacity, 0.35));}.select-button-group[aria-readonly=true].svelte-1dmdir4 button {pointer-events:none;}.inner.svelte-1dmdir4 {display:contents;}`};function pS(e,t){O(t,!0),K(e,nfe);let n=J(t,`hidden`,3,!1),r=J(t,`disabled`,3,!1),i=J(t,`readonly`,3,!1),a=J(t,`required`,3,!1),o=J(t,`invalid`,3,!1),s=J(t,`ariaLabel`,3,void 0),c=vs(t,efe);var l=tfe();fs(l,()=>({...c,role:`radiogroup`,class:`sui select-button-group ${t.class??``}`,hidden:n(),tabindex:`-1`,"aria-hidden":n(),"aria-disabled":r(),"aria-readonly":i(),"aria-required":a(),"aria-invalid":o(),"aria-label":s()}),void 0,void 0,void 0,`svelte-1dmdir4`);var u=N(l);xo(N(u),()=>t.children??Cr),D(u),D(l),qo(l,fS),R(()=>u.inert=r()),U(e,l),k()}var rfe=new Set([`$$slots`,`$$events`,`$$legacy`,`selected`,`class`,`onChange`]);function mS(e,t){O(t,!0);let n=J(t,`selected`,15,!1),r=vs(t,rfe);Xx(e,ys(()=>r,{role:`radio`,get class(){return`sui select-button ${t.class??``}`},get"aria-checked"(){return n()},onChange:e=>{n(e.detail.checked),t.onChange?.(e)}})),k()}var ife=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`popupPosition`,`popupPositionBaseElement`,`showPopupBackdrop`,`label`,`variant`,`size`,`iconic`,`children`,`startIcon`,`endIcon`,`popup`]),afe=B(`<!> <!>`,1);function hS(e,t){O(t,!0);let n=J(t,`hidden`,3,!1),r=J(t,`disabled`,3,!1),i=J(t,`popupPosition`,3,`bottom-left`),a=J(t,`popupPositionBaseElement`,3,void 0),o=J(t,`showPopupBackdrop`,3,!1),s=J(t,`label`,3,``),c=J(t,`variant`,3,void 0),l=J(t,`size`,3,`medium`),u=J(t,`iconic`,3,!1),d=vs(t,ife),f=j(void 0);var p={focus:()=>{z(f)?.focus()}},m=afe(),h=P(m);return Xx(h,ys(()=>d,{get class(){return`sui menu-button ${t.class??``}`},get hidden(){return n()},get disabled(){return r()},get label(){return s()},get variant(){return c()},get size(){return l()},get iconic(){return u()},"aria-haspopup":`menu`,get element(){return z(f)},set element(e){M(f,e,!0)},startIcon:e=>{var n=H();xo(P(n),()=>t.startIcon??Cr),U(e,n)},children:e=>{var n=H();xo(P(n),()=>t.children??Cr),U(e,n)},endIcon:e=>{var n=H(),r=P(n),i=e=>{var n=H();xo(P(n),()=>t.endIcon),U(e,n)},a=e=>{gx(e,{name:`more_vert`})},o=e=>{gx(e,{name:`arrow_drop_down`,class:`small-arrow`})};G(r,e=>{t.endIcon?e(i):u()?e(a,1):e(o,-1)}),U(e,n)},$$slots:{startIcon:!0,default:!0,endIcon:!0}})),Jx(I(h,2),{get anchor(){return z(f)},get position(){return i()},get positionBaseElement(){return a()},get showBackdrop(){return o()},children:(e,n)=>{var r=H();xo(P(r),()=>t.popup??Cr),U(e,r)},$$slots:{default:!0}}),U(e,m),k(p)}var ofe=new Set([`$$slots`,`$$events`,`$$legacy`,`hidden`,`disabled`,`label`,`variant`,`size`,`popupPosition`,`showPopupBackdrop`,`chevronIcon`,`popup`]),sfe=B(`<div role="group" class="sui split-button svelte-e2utpw"><!> <!></div>`),cfe={hash:`svelte-e2utpw`,code:`.split-button.svelte-e2utpw {flex:none;display:inline-flex;margin:var(--sui-focus-ring-width);}.split-button.svelte-e2utpw button {margin:0;}.split-button.svelte-e2utpw button.menu-button {border-inline-start-width:0;border-start-start-radius:0;border-end-start-radius:0;aspect-ratio:3/4;}.split-button.svelte-e2utpw button:not(.menu-button) {border-start-end-radius:0;border-end-end-radius:0;}`};function gS(e,t){O(t,!0),K(e,cfe);let n=J(t,`hidden`,3,!1),r=J(t,`disabled`,3,!1),i=J(t,`label`,3,``),a=J(t,`variant`,3,void 0),o=J(t,`size`,3,`medium`),s=J(t,`popupPosition`,3,`bottom-left`),c=J(t,`showPopupBackdrop`,3,!1),l=vs(t,ofe),u=j(void 0);var d=sfe(),f=N(d);Xx(f,ys(()=>l,{get hidden(){return n()},get disabled(){return r()},get label(){return i()},get variant(){return a()},get size(){return o()}}));var p=I(f,2);{let e=e=>{var n=H(),r=P(n),i=e=>{var n=H();xo(P(n),()=>t.chevronIcon),U(e,n)},a=e=>{gx(e,{name:`arrow_drop_down`,class:`small-arrow`})};G(r,e=>{t.chevronIcon?e(i):e(a,-1)}),U(e,n)},i=e=>{var n=H();xo(P(n),()=>t.popup??Cr),U(e,n)},l=A(()=>Y(`_sui.split_button.more_options`));hS(p,{iconic:!0,get hidden(){return n()},get disabled(){return r()},get variant(){return a()},get size(){return o()},get"aria-label"(){return z(l)},get popupPosition(){return s()},get popupPositionBaseElement(){return z(u)},get showPopupBackdrop(){return c()},endIcon:e,popup:i,$$slots:{endIcon:!0,popup:!0}})}D(d),gs(d,e=>M(u,e),()=>z(u)),R(e=>{q(d,`hidden`,n()),q(d,`aria-hidden`,n()),q(d,`aria-disabled`,r()),q(d,`aria-label`,e)},[()=>Y(`_sui.split_button.x_options`,{values:{name:i()}})]),U(e,d),k()}var lfe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`orientation`,`ariaLabel`,`children`]),ufe=B(`<div><div role="none" class="inner svelte-1q8o22f"><!></div></div>`),dfe={hash:`svelte-1q8o22f`,code:`.checkbox-group.svelte-1q8o22f {display:inline-flex;}.checkbox-group.horizontal.svelte-1q8o22f {gap:8px;align-items:center;flex-wrap:wrap;}.checkbox-group.vertical.svelte-1q8o22f {gap:4px;flex-direction:column;}
@media (pointer: coarse) {.checkbox-group.vertical.svelte-1q8o22f {gap:8px;}
}.inner.svelte-1q8o22f {display:contents;}`};function ffe(e,t){O(t,!0),K(e,dfe);let n=J(t,`hidden`,3,!1),r=J(t,`disabled`,3,!1),i=J(t,`orientation`,3,`horizontal`),a=J(t,`ariaLabel`,3,void 0),o=vs(t,lfe);var s=ufe();fs(s,e=>({...o,role:`group`,class:[`sui`,`checkbox-group`,t.class,i()],hidden:n(),"aria-hidden":n(),"aria-disabled":r(),"aria-roledescription":e,"aria-label":a()}),[()=>Y(`_sui.role_descriptions.checkbox_group`)],void 0,void 0,`svelte-1q8o22f`);var c=N(s);xo(N(c),()=>t.children??Cr),D(c),D(s),R(()=>c.inert=r()),U(e,s),k()}var _S=({id:e,ariaLabel:t,hasVisibleLabel:n})=>({"aria-label":t||void 0,"aria-labelledby":!t&&n?`${e}-label`:void 0}),pfe=new Set([`$$slots`,`$$events`,`$$legacy`,`checked`,`class`,`name`,`value`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`label`,`ariaLabel`,`group`,`onChange`,`children`,`checkIcon`]),mfe=B(`<label class="svelte-1sjuhwp"><!></label>`),hfe=B(`<div role="none"><div role="none" class="inner svelte-1sjuhwp"><!> <!></div></div>`),gfe={hash:`svelte-1sjuhwp`,code:`.checkbox.svelte-1sjuhwp {display:inline-flex;align-items:center;gap:8px;margin:var(--sui-focus-ring-width);min-width:24px;min-height:24px;color:var(--sui-control-foreground-color);font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);cursor:pointer;-webkit-user-select:none;user-select:none;}.checkbox.svelte-1sjuhwp:hover button {background-color:var(--sui-hover-background-color);}.checkbox.svelte-1sjuhwp:hover button[aria-checked=true] {background-color:var(--sui-primary-accent-color-light);}.checkbox.svelte-1sjuhwp:active button {background-color:var(--sui-active-background-color);}.checkbox.svelte-1sjuhwp:active button[aria-checked=true] {background-color:var(--sui-primary-accent-color-dark);}.checkbox.svelte-1sjuhwp button {flex:none;align-items:center;justify-content:center;overflow:hidden;margin:0 !important;border-width:var(--sui-checkbox-border-width, 1.5px);border-color:var(--sui-checkbox-border-color);border-radius:var(--sui-checkbox-border-radius);padding:0;width:var(--sui-checkbox-height);height:var(--sui-checkbox-height);color:var(--sui-primary-accent-text-color);background-color:var(--sui-checkbox-background-color);transition:all 200ms;}.checkbox.svelte-1sjuhwp button[aria-checked=true] {border-color:var(--sui-checkbox-border-color-checked, var(--sui-primary-accent-color));color:var(--sui-checkbox-foreground-color-checked, var(--sui-primary-accent-color-inverted));background-color:var(--sui-checkbox-background-color-checked, var(--sui-primary-accent-color));}.checkbox.svelte-1sjuhwp button[aria-invalid=true] {border-color:var(--sui-error-border-color);color:var(--sui-error-foreground-color);}.checkbox.svelte-1sjuhwp button[aria-checked=true][aria-invalid=true] {background-color:var(--sui-checkbox-background-color);}.checkbox.svelte-1sjuhwp button .icon {font-size:calc(var(--sui-checkbox-height) - 2px);}.checkbox.svelte-1sjuhwp label:where(.svelte-1sjuhwp) {cursor:inherit;}.checkbox.readonly.svelte-1sjuhwp {cursor:default;}.checkbox.readonly.svelte-1sjuhwp button, .checkbox.readonly.svelte-1sjuhwp:is(:where(.svelte-1sjuhwp):hover, :where(.svelte-1sjuhwp):active) button {background-color:var(--sui-checkbox-background-color);}.checkbox.readonly.svelte-1sjuhwp button[aria-checked='true']:not([aria-invalid='true']), .checkbox.readonly.svelte-1sjuhwp:is(:where(.svelte-1sjuhwp):hover, :where(.svelte-1sjuhwp):active) button[aria-checked='true']:not([aria-invalid='true']) {border-color:var(--sui-readonly-accent-color);color:var(--sui-readonly-accent-color-inverted);background-color:var(--sui-readonly-accent-color);}.inner.svelte-1sjuhwp {display:contents;}`};function vS(e,t){let n=mo();O(t,!0),K(e,gfe);let r=J(t,`checked`,15,!1),i=J(t,`name`,3,void 0),a=J(t,`value`,3,void 0),o=J(t,`hidden`,3,!1),s=J(t,`disabled`,3,!1),c=J(t,`readonly`,3,!1),l=J(t,`required`,3,!1),u=J(t,`invalid`,3,!1),d=J(t,`label`,3,void 0),f=J(t,`ariaLabel`,3,void 0),p=J(t,`group`,15),m=vs(t,pfe),h=j(void 0),g=A(()=>!!(t.children||d())),_=A(()=>_S({id:n,ariaLabel:f()??m[`aria-label`],hasVisibleLabel:z(g)})),v=A(()=>r()===`mixed`);L(()=>{Array.isArray(p())&&(p().includes(a())?r()!==!0&&r(!0):r()!==!1&&r(!1))});var y=hfe();let b;var x=N(y),S=N(x);Xx(S,ys(()=>m,{role:`checkbox`,get id(){return n},get name(){return i()},get value(){return a()},get hidden(){return o()},get disabled(){return s()},get readonly(){return c()},get"aria-required"(){return l()},get"aria-invalid"(){return u()},get"aria-checked"(){return r()}},()=>z(_),{onclick:e=>{e.preventDefault(),e.stopPropagation(),s()||c()||(r(z(v)?!0:!r()),Array.isArray(p())&&(r()?p().includes(a())||p([...p(),a()]):p().includes(a())&&p(p().filter(e=>e!==a()))),t.onChange?.(new CustomEvent(`Change`,{detail:{checked:r()}})))},get element(){return z(h)},set element(e){M(h,e,!0)},startIcon:e=>{var n=H(),i=P(n),a=e=>{var n=H();xo(P(n),()=>t.checkIcon),U(e,n)},o=e=>{gx(e,{name:`remove`})},s=e=>{gx(e,{name:`check`})};G(i,e=>{t.checkIcon?e(a):z(v)?e(o,1):r()&&e(s,2)}),U(e,n)},$$slots:{startIcon:!0}}));var C=I(S,2),w=e=>{var r=mfe(),i=N(r),a=e=>{var n=H();xo(P(n),()=>t.children),U(e,n)},o=e=>{var t=V();R(()=>W(t,d())),U(e,t)};G(i,e=>{t.children?e(a):e(o,-1)}),D(r),R(()=>q(r,`id`,`${n}-label`)),U(e,r)};G(C,e=>{z(g)&&e(w)}),D(x),D(y),R(()=>{b=$o(y,1,`sui checkbox ${t.class??``}`,`svelte-1sjuhwp`,b,{checked:r(),indeterminate:z(v),disabled:s(),readonly:c()}),q(y,`hidden`,o()),x.inert=s()}),so(`click`,y,e=>{e.preventDefault(),e.stopPropagation(),e.target.matches(`button`)||z(h)?.click()}),U(e,y),k()}co([`click`]);var _fe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`flex`]),vfe=B(`<div></div>`),yfe={hash:`svelte-633w0c`,code:`.spacer.flex.svelte-633w0c:not([hidden]) {display:block;flex:auto;}.spacer.svelte-633w0c:not(.flex) {width:8px;height:8px;}`};function yS(e,t){K(e,yfe);let n=J(t,`flex`,3,!1),r=vs(t,_fe);var i=vfe();fs(i,()=>({...r,role:`none`,class:`sui spacer ${t.class??``}`,[ss]:{flex:n()}}),void 0,void 0,void 0,`svelte-633w0c`),U(e,i)}function bS(e,t){O(t,!0);let n=J(t,`class`,3,void 0),r=J(t,`closeIcon`,3,void 0);{let i=e=>{var t=H(),n=P(t),i=e=>{var t=H();xo(P(t),r),U(e,t)},a=e=>{gx(e,{name:`close`})};G(n,e=>{r()?e(i):e(a,-1)}),U(e,t)},a=A(()=>Y(`_sui.close`));Xx(e,{variant:`ghost`,iconic:!0,get class(){return n()},get"aria-label"(){return z(a)},get"aria-controls"(){return t.controls},onclick:()=>{t.onClose()},startIcon:i,$$slots:{startIcon:!0}})}k()}var xS=(e,t,n)=>Math.min(Math.max(e,-t),Math.max(n,0)),bfe=new Set(`$$slots.$$events.$$legacy.open.value.title.ariaLabelledby.role.size.modal.showBackdrop.movable.class.showClose.showOk.showCancel.okLabel.okShortcuts.okDisabled.cancelLabel.cancelShortcuts.cancelDisabled.focusInput.children.header.headerExtra.footer.footerExtra.closeIcon.input`.split(`.`)),xfe=B(`<div role="none" class="title svelte-vcbvkj"> </div> <!> <!> <!>`,1),Sfe=B(`<div><!></div>`),Cfe=B(`<!> <!> <!> <!>`,1),wfe=B(`<div role="none" class="footer svelte-vcbvkj"><!></div>`),Tfe=B(`<div role="none"><!> <div role="none" class="body svelte-vcbvkj"><!></div> <!></div>`),Efe={hash:`svelte-vcbvkj`,code:`.content.svelte-vcbvkj {position:relative;display:flex;flex-direction:column;overflow:hidden;border-width:var(--sui-dialog-content-border-width, var(--sui-modal-border-width, 0));border-style:solid;border-color:var(--sui-dialog-content-border-color, var(--sui-primary-border-color));border-radius:var(--sui-dialog-content-border-radius, 4px);max-width:calc(100dvw - var(--sui-dialog-content-margin, 16px) * 2);background-color:var(--sui-dialog-content-background-color, var(--sui-secondary-background-color-translucent));box-shadow:var(--sui-dialog-content-box-shadow, 0 8px 16px var(--sui-popup-shadow-color));-webkit-backdrop-filter:var(--sui-dialog-content-backdrop-filter, blur(16px));backdrop-filter:var(--sui-dialog-content-backdrop-filter, blur(16px));transition-property:transform;}dialog.open .content.svelte-vcbvkj {transition-duration:150ms;transform:scale(100%);}dialog:not(.open) .content.svelte-vcbvkj {transition-duration:300ms;transform:scale(90%);}.content.x-small.svelte-vcbvkj {width:var(--sui-dialog-x-small-content-width, var(--sui-dialog-content-width, 300px));max-height:var(--sui-dialog-x-small-content-max-height, var(--sui-dialog-content-max-height, 300px));--sui-textbox-singleline-min-width: 0;}
@media (max-height: 300px) {.content.x-small.svelte-vcbvkj {max-height:calc(100dvh - 32px);}
}.content.small.svelte-vcbvkj {width:var(--sui-dialog-small-content-width, var(--sui-dialog-content-width, 400px));max-height:var(--sui-dialog-small-content-max-height, var(--sui-dialog-content-max-height, 400px));}
@media (max-height: 400px) {.content.small.svelte-vcbvkj {max-height:calc(100dvh - 32px);}
}.content.medium.svelte-vcbvkj {width:var(--sui-dialog-medium-content-width, var(--sui-dialog-content-width, 600px));max-height:var(--sui-dialog-medium-content-max-height, var(--sui-dialog-content-max-height, 600px));}
@media (max-height: 600px) {.content.medium.svelte-vcbvkj {max-height:calc(100dvh - 32px);}
}.content.large.svelte-vcbvkj {width:var(--sui-dialog-large-content-width, var(--sui-dialog-content-width, 800px));max-height:var(--sui-dialog-large-content-max-height, var(--sui-dialog-content-max-height, 800px));}
@media (max-height: 800px) {.content.large.svelte-vcbvkj {max-height:calc(100dvh - 32px);}
}.content.x-large.svelte-vcbvkj {width:var(--sui-dialog-x-large-content-width, var(--sui-dialog-content-width, 1000px));max-height:var(--sui-dialog-x-large-content-max-height, var(--sui-dialog-content-max-height, 1000px));}
@media (max-height: 1000px) {.content.x-large.svelte-vcbvkj {max-height:calc(100dvh - 32px);}
}:is(.header.svelte-vcbvkj, .footer.svelte-vcbvkj) {display:flex;align-items:center;gap:4px;}.header.svelte-vcbvkj {box-sizing:content-box;margin:var(--sui-dialog-header-margin, 0 16px);border-width:var(--sui-dialog-header-border-width, 0 0 1px);border-color:var(--sui-dialog-header-border-color, var(--sui-secondary-border-color));padding:var(--sui-dialog-header-padding, 16px 8px);height:var(--sui-dialog-header-height, 32px);}.header.movable.svelte-vcbvkj {cursor:move;}.header.svelte-vcbvkj .title:where(.svelte-vcbvkj) {font-size:var(--sui-font-size-large);font-weight:var(--sui-font-weight-bold);}.footer.svelte-vcbvkj {margin:var(--sui-dialog-footer-margin, 0 24px 24px);}
@media (width < 768px) {.footer.svelte-vcbvkj {margin:var(--sui-dialog-footer-margin, 0 16px 16px);}
}.body.svelte-vcbvkj {overflow:auto;padding:var(--sui-dialog-body-padding, var(--sui-dialog-body-margin, 24px 24px));white-space:normal;line-height:var(--sui-line-height-compact);}
@media (width < 768px) {.body.svelte-vcbvkj {padding:var(--sui-dialog-body-padding, var(--sui-dialog-body-margin, 16px 16px));}
}`};function SS(e,t){let n=mo();O(t,!0),K(e,Efe);let r=J(t,`open`,15,!1);J(t,`value`,11,``);let i=J(t,`ariaLabelledby`,3,void 0),a=J(t,`role`,3,`dialog`),o=J(t,`size`,3,`medium`),s=J(t,`modal`,3,!0),c=J(t,`showBackdrop`,3,void 0),l=J(t,`movable`,3,!1),u=J(t,`showClose`,3,!1),d=J(t,`showOk`,3,!0),f=J(t,`showCancel`,3,!0),p=J(t,`okLabel`,3,``),m=J(t,`okShortcuts`,3,void 0),h=J(t,`okDisabled`,3,!1),g=J(t,`cancelLabel`,3,``),_=J(t,`cancelShortcuts`,3,void 0),v=J(t,`cancelDisabled`,3,!1),y=J(t,`focusInput`,3,!0),b=vs(t,bfe),x=A(()=>i()??(!t.header&&t.title?`${n}-title`:void 0)),S=A(()=>z(x)?void 0:t.title||void 0),C=j(void 0),w=j(void 0),T=j(Xi({x:0,y:0})),ee,E=()=>{M(T,{x:0,y:0},!0),ee=void 0};L(()=>{if(r()&&(E(),l()))return window.addEventListener(`resize`,E),()=>{window.removeEventListener(`resize`,E)}});let te=e=>{let{button:t,pointerId:n,clientX:r,clientY:i,currentTarget:a,target:o}=e,s=a,c=o.closest(`button, input, select, textarea, a, [tabindex]`);t!==0||c&&s.contains(c)||(e.preventDefault(),s.setPointerCapture(n),ee={pointerId:n,x:r,y:i,offset:{...z(T)},rect:z(w).getBoundingClientRect()})},ne=({pointerId:e,buttons:t,clientX:n,clientY:r})=>{if(!ee||ee.pointerId!==e)return;if(t%2==0){ee=void 0;return}let{x:i,y:a,offset:o,rect:s}=ee;M(T,{x:o.x+xS(n-i,s.left,window.innerWidth-s.right),y:o.y+xS(r-a,s.top,window.innerHeight-s.bottom)},!0)},re=({pointerId:e})=>{ee?.pointerId===e&&(ee=void 0)},ie={onpointerdown:te,onpointermove:ne,onpointerup:re,onpointercancel:re};L(()=>{if(r()&&z(w)){let e=!1;return(async()=>{if(await Iu(50),e||z(w)?.contains(document.activeElement))return;let t=y()?z(w)?.querySelector(`input, button.primary`):null;t?(t.focus(),t instanceof HTMLInputElement&&t.select()):z(C)?.focus()})(),()=>{e=!0}}});{let i=A(()=>c()??s());gs(qx(e,ys(()=>b,{get role(){return a()},get id(){return n},class:`dialog`,get"aria-label"(){return z(S)},get"aria-labelledby"(){return z(x)},get"aria-describedby"(){return`${n}-body`},get modal(){return s()},get showBackdrop(){return z(i)},get open(){return r()},set open(e){r(e)},children:(e,r)=>{var i=Tfe();let a;var s=N(i),c=e=>{var r=Sfe();fs(r,()=>({role:`none`,class:`header`,...l()?ie:{},[ss]:{movable:l()}}),void 0,void 0,void 0,`svelte-vcbvkj`);var i=N(r),a=e=>{var n=H();xo(P(n),()=>t.header),U(e,n)},o=e=>{var r=xfe(),i=P(r),a=F(i,!0),o=I(i,2);yS(o,{flex:!0});var s=I(o,2);xo(s,()=>t.headerExtra??Cr);var c=I(s,2),l=e=>{bS(e,{get controls(){return n},get closeIcon(){return t.closeIcon},onClose:()=>{z(C)?.close(`close`)}})};G(c,e=>{u()&&e(l)}),R(()=>{q(i,`id`,`${n}-title`),W(a,t.title)}),U(e,r)};G(i,e=>{t.header?e(a):e(o,-1)}),D(r),U(e,r)};G(s,e=>{(t.title||u()||t.header||t.headerExtra)&&e(c)});var y=I(s,2);xo(N(y),()=>t.children??Cr),D(y);var b=I(y,2),x=e=>{var n=wfe(),r=N(n),i=e=>{var n=H();xo(P(n),()=>t.footer??Cr),U(e,n)},a=e=>{var n=Cfe(),r=P(n);xo(r,()=>t.footerExtra??Cr);var i=I(r,2);yS(i,{flex:!0});var a=I(i,2),o=e=>{{let t=A(()=>p()||Y(`_sui.ok`));Xx(e,{variant:`primary`,get label(){return z(t)},get keyShortcuts(){return m()},get disabled(){return h()},onclick:()=>{z(C)?.close(`ok`)}})}};G(a,e=>{d()&&e(o)});var s=I(a,2),c=e=>{{let t=A(()=>g()||Y(`_sui.cancel`));Xx(e,{variant:`secondary`,get label(){return z(t)},get keyShortcuts(){return _()},get disabled(){return v()},onclick:()=>{z(C)?.close(`cancel`)}})}};G(s,e=>{f()&&e(c)}),U(e,n)};G(r,e=>{t.footer?e(i):e(a,-1)}),D(n),U(e,n)};G(b,e=>{(d()||f()||t.footer||t.footerExtra)&&e(x)}),D(i),gs(i,e=>M(w,e),()=>z(w)),R(()=>{$o(i,1,Yo([`content`,t.class,o()]),`svelte-vcbvkj`),a=ts(i,``,a,{translate:l()?`${z(T).x}px ${z(T).y}px`:void 0}),q(y,`id`,`${n}-body`)}),U(e,i)},$$slots:{default:!0}})),e=>M(C,e,!0),()=>z(C))}k()}var Dfe=new Set([`$$slots`,`$$events`,`$$legacy`,`open`]);function CS(e,t){O(t,!0);let n=J(t,`open`,15,!1),r=vs(t,Dfe);SS(e,ys(()=>r,{role:`alertdialog`,showCancel:!1,get open(){return n()},set open(e){n(e)}})),k()}var Ofe=new Set([`$$slots`,`$$events`,`$$legacy`,`open`]);function wS(e,t){O(t,!0);let n=J(t,`open`,15,!1),r=vs(t,Ofe);SS(e,ys(()=>r,{role:`alertdialog`,get open(){return n()},set open(e){n(e)}})),k()}var kfe=`boxSizing.width.borderTopWidth.borderRightWidth.borderBottomWidth.borderLeftWidth.paddingTop.paddingRight.paddingBottom.paddingLeft.fontFamily.fontSize.fontStretch.fontStyle.fontVariant.fontWeight.letterSpacing.lineHeight.tabSize.textAlign.textIndent.textTransform.wordBreak.wordSpacing.overflowWrap.direction`.split(`.`),Afe=(e,t,n)=>{let r=e.getBoundingClientRect();if(!r.width&&!r.height)return;let i=globalThis.getComputedStyle(e),a=e.tagName===`INPUT`,o=document.createElement(`div`),s=document.createElement(`span`);kfe.forEach(e=>{o.style[e]=i[e]}),Object.assign(o.style,{position:`absolute`,top:`0`,left:`0`,height:`auto`,minHeight:`0`,maxHeight:`none`,overflow:`hidden`,visibility:`hidden`,pointerEvents:`none`,whiteSpace:a?`pre`:`pre-wrap`}),o.setAttribute(`aria-hidden`,`true`),o.textContent=e.value.slice(0,t),s.textContent=e.value.slice(t,n)||`​`,o.append(s),document.body.append(o);let c=o.getBoundingClientRect(),l=s.getClientRects(),u=l[l.length-1]??s.getBoundingClientRect(),d=u.top-c.top,f=u.left-c.left,p=u.right-c.left,m=u.height||Number.parseFloat(i.lineHeight)||0;o.remove();let h=r.top+d-e.scrollTop,g=r.left+f-e.scrollLeft,_=r.left+p-e.scrollLeft;return{top:h,bottom:h+m,left:g,right:_}},jfe=/(?<=^|[\s([{"'«])(?::)(?<query>[a-zA-Z0-9_+-]{1,64})$/,TS=/[-_]/,ES,Mfe=e=>e.split(`
`).map(e=>{let[t,n,r=``]=e.split(` `),[i,...a]=n.split(` `);return{emoji:t,name:i,aliases:[...a,...r?r.split(` `):[]]}}),DS=(e,t)=>{let n=e.split(TS);return e===t?0:e.startsWith(t)&&TS.test(e.charAt(t.length))?1:n.includes(t)?2:e.startsWith(t)||n.some(e=>e.startsWith(t))?4:9},Nfe=(e,t)=>e.includes(t)?3:e.some(e=>e.startsWith(t))?5:9,Pfe=({name:e,aliases:t},n)=>{let r=DS(e,n),i=Nfe(t,n);return{rank:Math.min(r,i),nameRank:r}},Ffe=({name:e,aliases:t},n)=>{if(DS(e,n)<9)return e.split(TS).length;let r=t.findIndex(e=>e===n||e.startsWith(n));return(r>-1?r:t.length)*100+t.length},Ife=e=>{let t=e.toLowerCase();return t?(ES??=Mfe(`😀 grinning face
😃 smiley smiling face open mouth
😄 smile smiling face open mouth eyes
😁 grin grinning face smiling eyes
😆 laughing satisfied smiling face open mouth tightly-closed eyes
😅 sweat_smile smiling face open mouth cold
🤣 rolling_on_the_floor_laughing
😂 joy face tears
🙂 slightly_smiling_face
🙃 upside_down_face upside-down
🫠 melting_face
😉 wink winking face
😊 blush smiling face eyes
😇 innocent smiling face halo
🥰 smiling_face_with_3_hearts eyes three
😍 heart_eyes smiling face heart-shaped
🤩 star-struck grinning_face_with_star_eyes
😘 kissing_heart face throwing kiss
😗 kissing face
☺️ relaxed white smiling face
😚 kissing_closed_eyes face
😙 kissing_smiling_eyes face
🥲 smiling_face_with_tear
😋 yum face savouring delicious food
😛 stuck_out_tongue face stuck-out
😜 stuck_out_tongue_winking_eye face stuck-out
🤪 zany_face grinning_face_with_one_large_and_one_small_eye
😝 stuck_out_tongue_closed_eyes face stuck-out tightly-closed
🤑 money_mouth_face money-mouth
🤗 hugging_face
🤭 face_with_hand_over_mouth smiling_face_with_smiling_eyes_and_hand_covering_mouth
🫢 face_with_open_eyes_and_hand_over_mouth
🫣 face_with_peeking_eye
🤫 shushing_face face_with_finger_covering_closed_lips
🤔 thinking_face
🫡 saluting_face
🤐 zipper_mouth_face zipper-mouth
🤨 face_with_raised_eyebrow face_with_one_eyebrow_raised
😐 neutral_face
😑 expressionless face
😶 no_mouth face without
🫥 dotted_line_face
😶‍🌫️ face_in_clouds
😏 smirk smirking face
😒 unamused face
🙄 face_with_rolling_eyes
😬 grimacing face
😮‍💨 face_exhaling
🤥 lying_face
🫨 shaking_face
🙂‍↔️ head_shaking_horizontally
🙂‍↕️ head_shaking_vertically
😌 relieved face
😔 pensive face
😪 sleepy face
🤤 drooling_face
😴 sleeping face
🫩 face_with_bags_under_eyes
😷 mask face medical
🤒 face_with_thermometer
🤕 face_with_head_bandage head-bandage
🤢 nauseated_face
🤮 face_vomiting face_with_open_mouth_vomiting
🤧 sneezing_face
🥵 hot_face overheated
🥶 cold_face freezing
🥴 woozy_face uneven eyes wavy mouth
😵 dizzy_face
😵‍💫 face_with_spiral_eyes
🤯 exploding_head shocked_face_with_exploding_head
🤠 face_with_cowboy_hat
🥳 partying_face party horn hat
🥸 disguised_face
😎 sunglasses smiling face
🤓 nerd_face
🧐 face_with_monocle
😕 confused face
🫤 face_with_diagonal_mouth
😟 worried face
🙁 slightly_frowning_face
☹️ white_frowning_face
😮 open_mouth face
😯 hushed face
😲 astonished face
😳 flushed face
🥺 pleading_face eyes
🥹 face_holding_back_tears
😦 frowning face open mouth
😧 anguished face
😨 fearful face
😰 cold_sweat face open mouth
😥 disappointed_relieved but face
😢 cry crying face
😭 sob loudly crying face
😱 scream face screaming fear
😖 confounded face
😣 persevere persevering face
😞 disappointed face
😓 sweat face cold
😩 weary face
😫 tired_face
🥱 yawning_face
😤 triumph face look
😡 rage pouting face
😠 angry face
🤬 face_with_symbols_on_mouth serious_face_with_symbols_covering_mouth
😈 smiling_imp face horns
👿 imp
💀 skull
☠️ skull_and_crossbones
💩 hankey poop shit pile poo
🤡 clown_face
👹 japanese_ogre
👺 japanese_goblin
👻 ghost
👽 alien extraterrestrial
👾 space_invader alien monster
🤖 robot_face
😺 smiley_cat smiling face open mouth
😸 smile_cat grinning face smiling eyes
😹 joy_cat face tears
😻 heart_eyes_cat smiling face heart-shaped
😼 smirk_cat face wry smile
😽 kissing_cat face closed eyes
🙀 scream_cat weary face
😿 crying_cat_face
😾 pouting_cat face
🙈 see_no_evil see-no-evil monkey
🙉 hear_no_evil hear-no-evil monkey
🙊 speak_no_evil speak-no-evil monkey
💌 love_letter
💘 cupid heart arrow
💝 gift_heart ribbon
💖 sparkling_heart
💗 heartpulse growing heart
💓 heartbeat beating heart
💞 revolving_hearts
💕 two_hearts
💟 heart_decoration
❣️ heavy_heart_exclamation_mark_ornament
💔 broken_heart
❤️‍🔥 heart_on_fire
❤️‍🩹 mending_heart
❤️ heart heavy black
🩷 pink_heart
🧡 orange_heart
💛 yellow_heart
💚 green_heart
💙 blue_heart
🩵 light_blue_heart
💜 purple_heart
🤎 brown_heart
🖤 black_heart
🩶 grey_heart
🤍 white_heart
💋 kiss mark
💯 100 hundred points symbol
💢 anger symbol
💥 boom collision symbol
💫 dizzy symbol
💦 sweat_drops splashing symbol
💨 dash symbol
🕳️ hole
💬 speech_balloon
👁️‍🗨️ eye-in-speech-bubble
🗨️ left_speech_bubble
🗯️ right_anger_bubble
💭 thought_balloon
💤 zzz sleeping symbol
👋 wave waving hand sign
🤚 raised_back_of_hand
🖐️ raised_hand_with_fingers_splayed
✋ hand raised_hand
🖖 spock-hand raised part between middle ring fingers
🫱 rightwards_hand
🫲 leftwards_hand
🫳 palm_down_hand
🫴 palm_up_hand
🫷 leftwards_pushing_hand
🫸 rightwards_pushing_hand
👌 ok_hand sign
🤌 pinched_fingers
🤏 pinching_hand
✌️ v victory hand
🤞 crossed_fingers hand_with_index_and_middle_fingers_crossed
🫰 hand_with_index_finger_and_thumb_crossed
🤟 i_love_you_hand_sign
🤘 the_horns sign_of_the_horns
🤙 call_me_hand
👈 point_left white pointing backhand index
👉 point_right white pointing backhand index
👆 point_up_2 white pointing backhand index
🖕 middle_finger reversed_hand_with_middle_finger_extended
👇 point_down white pointing backhand index
☝️ point_up white pointing index
🫵 index_pointing_at_the_viewer
👍 +1 thumbsup thumbs up sign
👎 -1 thumbsdown thumbs down sign
✊ fist raised
👊 facepunch punch fisted hand sign
🤛 left-facing_fist left-facing
🤜 right-facing_fist right-facing
👏 clap clapping hands sign
🙌 raised_hands person raising both celebration
🫶 heart_hands
👐 open_hands sign
🤲 palms_up_together
🤝 handshake
🙏 pray person folded hands
✍️ writing_hand
💅 nail_care polish
🤳 selfie
💪 muscle flexed biceps
🦾 mechanical_arm
🦿 mechanical_leg
🦵 leg
🦶 foot
👂 ear
🦻 ear_with_hearing_aid
👃 nose
🧠 brain
🫀 anatomical_heart
🫁 lungs
🦷 tooth
🦴 bone
👀 eyes
👁️ eye
👅 tongue
👄 lips mouth
🫦 biting_lip
👶 baby
🧒 child
👦 boy
👧 girl
🧑 adult
👱 person_with_blond_hair
👨 man
🧔 bearded_person
🧔‍♂️ man_with_beard
🧔‍♀️ woman_with_beard
👨‍🦰 red_haired_man hair
👨‍🦱 curly_haired_man hair
👨‍🦳 white_haired_man hair
👨‍🦲 bald_man
👩 woman
👩‍🦰 red_haired_woman hair
🧑‍🦰 red_haired_person hair
👩‍🦱 curly_haired_woman hair
🧑‍🦱 curly_haired_person hair
👩‍🦳 white_haired_woman hair
🧑‍🦳 white_haired_person hair
👩‍🦲 bald_woman
🧑‍🦲 bald_person
👱‍♀️ blond-haired-woman hair
👱‍♂️ blond-haired-man hair
🧓 older_adult
👴 older_man
👵 older_woman
🙍 person_frowning
🙍‍♂️ man-frowning
🙍‍♀️ woman-frowning
🙎 person_with_pouting_face
🙎‍♂️ man-pouting
🙎‍♀️ woman-pouting
🙅 no_good face gesture
🙅‍♂️ man-gesturing-no
🙅‍♀️ woman-gesturing-no
🙆 ok_woman face gesture
🙆‍♂️ man-gesturing-ok
🙆‍♀️ woman-gesturing-ok
💁 information_desk_person
💁‍♂️ man-tipping-hand
💁‍♀️ woman-tipping-hand
🙋 raising_hand happy person one
🙋‍♂️ man-raising-hand
🙋‍♀️ woman-raising-hand
🧏 deaf_person
🧏‍♂️ deaf_man
🧏‍♀️ deaf_woman
🙇 bow person bowing deeply
🙇‍♂️ man-bowing
🙇‍♀️ woman-bowing
🤦 face_palm
🤦‍♂️ man-facepalming
🤦‍♀️ woman-facepalming
🤷 shrug
🤷‍♂️ man-shrugging
🤷‍♀️ woman-shrugging
🧑‍⚕️ health_worker
👨‍⚕️ male-doctor man health worker
👩‍⚕️ female-doctor woman health worker
🧑‍🎓 student
👨‍🎓 male-student man
👩‍🎓 female-student woman
🧑‍🏫 teacher
👨‍🏫 male-teacher man
👩‍🏫 female-teacher woman
🧑‍⚖️ judge
👨‍⚖️ male-judge man
👩‍⚖️ female-judge woman
🧑‍🌾 farmer
👨‍🌾 male-farmer man
👩‍🌾 female-farmer woman
🧑‍🍳 cook
👨‍🍳 male-cook man
👩‍🍳 female-cook woman
🧑‍🔧 mechanic
👨‍🔧 male-mechanic man
👩‍🔧 female-mechanic woman
🧑‍🏭 factory_worker
👨‍🏭 male-factory-worker man
👩‍🏭 female-factory-worker woman
🧑‍💼 office_worker
👨‍💼 male-office-worker man
👩‍💼 female-office-worker woman
🧑‍🔬 scientist
👨‍🔬 male-scientist man
👩‍🔬 female-scientist woman
🧑‍💻 technologist
👨‍💻 male-technologist man
👩‍💻 female-technologist woman
🧑‍🎤 singer
👨‍🎤 male-singer man
👩‍🎤 female-singer woman
🧑‍🎨 artist
👨‍🎨 male-artist man
👩‍🎨 female-artist woman
🧑‍✈️ pilot
👨‍✈️ male-pilot man
👩‍✈️ female-pilot woman
🧑‍🚀 astronaut
👨‍🚀 male-astronaut man
👩‍🚀 female-astronaut woman
🧑‍🚒 firefighter
👨‍🚒 male-firefighter man
👩‍🚒 female-firefighter woman
👮 cop police officer
👮‍♂️ male-police-officer man
👮‍♀️ female-police-officer woman
🕵️ sleuth_or_spy detective
🕵️‍♂️ male-detective man
🕵️‍♀️ female-detective woman
💂 guardsman
💂‍♂️ male-guard man
💂‍♀️ female-guard woman
🥷 ninja
👷 construction_worker
👷‍♂️ male-construction-worker man
👷‍♀️ female-construction-worker woman
🫅 person_with_crown
🤴 prince
👸 princess
👳 man_with_turban
👳‍♂️ man-wearing-turban
👳‍♀️ woman-wearing-turban
👲 man_with_gua_pi_mao
🧕 person_with_headscarf
🤵 person_in_tuxedo man
🤵‍♂️ man_in_tuxedo
🤵‍♀️ woman_in_tuxedo
👰 bride_with_veil
👰‍♂️ man_with_veil
👰‍♀️ woman_with_veil
🤰 pregnant_woman
🫃 pregnant_man
🫄 pregnant_person
🤱 breast-feeding
👩‍🍼 woman_feeding_baby
👨‍🍼 man_feeding_baby
🧑‍🍼 person_feeding_baby
👼 angel baby
🎅 santa father christmas
🤶 mrs_claus mother_christmas
🧑‍🎄 mx_claus
🦸 superhero
🦸‍♂️ male_superhero man
🦸‍♀️ female_superhero woman
🦹 supervillain
🦹‍♂️ male_supervillain man
🦹‍♀️ female_supervillain woman
🧙 mage
🧙‍♂️ male_mage man
🧙‍♀️ female_mage woman
🧚 fairy
🧚‍♂️ male_fairy man
🧚‍♀️ female_fairy woman
🧛 vampire
🧛‍♂️ male_vampire man
🧛‍♀️ female_vampire woman
🧜 merperson
🧜‍♂️ merman
🧜‍♀️ mermaid
🧝 elf
🧝‍♂️ male_elf man
🧝‍♀️ female_elf woman
🧞 genie
🧞‍♂️ male_genie man
🧞‍♀️ female_genie woman
🧟 zombie
🧟‍♂️ male_zombie man
🧟‍♀️ female_zombie woman
🧌 troll
💆 massage face
💆‍♂️ man-getting-massage
💆‍♀️ woman-getting-massage
💇 haircut
💇‍♂️ man-getting-haircut
💇‍♀️ woman-getting-haircut
🚶 walking pedestrian
🚶‍♂️ man-walking
🚶‍♀️ woman-walking
🚶‍➡️ person_walking_facing_right
🚶‍♀️‍➡️ woman_walking_facing_right
🚶‍♂️‍➡️ man_walking_facing_right
🧍 standing_person
🧍‍♂️ man_standing
🧍‍♀️ woman_standing
🧎 kneeling_person
🧎‍♂️ man_kneeling
🧎‍♀️ woman_kneeling
🧎‍➡️ person_kneeling_facing_right
🧎‍♀️‍➡️ woman_kneeling_facing_right
🧎‍♂️‍➡️ man_kneeling_facing_right
🧑‍🦯 person_with_probing_cane white
🧑‍🦯‍➡️ person_with_white_cane_facing_right
👨‍🦯 man_with_probing_cane white
👨‍🦯‍➡️ man_with_white_cane_facing_right
👩‍🦯 woman_with_probing_cane white
👩‍🦯‍➡️ woman_with_white_cane_facing_right
🧑‍🦼 person_in_motorized_wheelchair
🧑‍🦼‍➡️ person_in_motorized_wheelchair_facing_right
👨‍🦼 man_in_motorized_wheelchair
👨‍🦼‍➡️ man_in_motorized_wheelchair_facing_right
👩‍🦼 woman_in_motorized_wheelchair
👩‍🦼‍➡️ woman_in_motorized_wheelchair_facing_right
🧑‍🦽 person_in_manual_wheelchair
🧑‍🦽‍➡️ person_in_manual_wheelchair_facing_right
👨‍🦽 man_in_manual_wheelchair
👨‍🦽‍➡️ man_in_manual_wheelchair_facing_right
👩‍🦽 woman_in_manual_wheelchair
👩‍🦽‍➡️ woman_in_manual_wheelchair_facing_right
🏃 runner running
🏃‍♂️ man-running
🏃‍♀️ woman-running
🏃‍➡️ person_running_facing_right
🏃‍♀️‍➡️ woman_running_facing_right
🏃‍♂️‍➡️ man_running_facing_right
💃 dancer
🕺 man_dancing
🕴️ man_in_business_suit_levitating person
👯 dancers woman bunny ears
👯‍♂️ men-with-bunny-ears-partying man-with-bunny-ears-partying
👯‍♀️ women-with-bunny-ears-partying woman-with-bunny-ears-partying
🧖 person_in_steamy_room
🧖‍♂️ man_in_steamy_room
🧖‍♀️ woman_in_steamy_room
🧗 person_climbing
🧗‍♂️ man_climbing
🧗‍♀️ woman_climbing
🤺 fencer
🏇 horse_racing
⛷️ skier
🏂 snowboarder
🏌️ golfer person golfing
🏌️‍♂️ man-golfing
🏌️‍♀️ woman-golfing
🏄 surfer
🏄‍♂️ man-surfing
🏄‍♀️ woman-surfing
🚣 rowboat
🚣‍♂️ man-rowing-boat
🚣‍♀️ woman-rowing-boat
🏊 swimmer
🏊‍♂️ man-swimming
🏊‍♀️ woman-swimming
⛹️ person_with_ball bouncing
⛹️‍♂️ man-bouncing-ball
⛹️‍♀️ woman-bouncing-ball
🏋️ weight_lifter person lifting weights
🏋️‍♂️ man-lifting-weights
🏋️‍♀️ woman-lifting-weights
🚴 bicyclist
🚴‍♂️ man-biking
🚴‍♀️ woman-biking
🚵 mountain_bicyclist
🚵‍♂️ man-mountain-biking
🚵‍♀️ woman-mountain-biking
🤸 person_doing_cartwheel
🤸‍♂️ man-cartwheeling
🤸‍♀️ woman-cartwheeling
🤼 wrestlers
🤼‍♂️ man-wrestling men
🤼‍♀️ woman-wrestling women
🤽 water_polo
🤽‍♂️ man-playing-water-polo
🤽‍♀️ woman-playing-water-polo
🤾 handball
🤾‍♂️ man-playing-handball
🤾‍♀️ woman-playing-handball
🤹 juggling
🤹‍♂️ man-juggling
🤹‍♀️ woman-juggling
🧘 person_in_lotus_position
🧘‍♂️ man_in_lotus_position
🧘‍♀️ woman_in_lotus_position
🛀 bath
🛌 sleeping_accommodation
🧑‍🤝‍🧑 people_holding_hands
👭 two_women_holding_hands women_holding_hands
👫 man_and_woman_holding_hands woman_and_man_holding_hands couple
👬 two_men_holding_hands men_holding_hands
💏 couplekiss kiss
👩‍❤️‍💋‍👨 woman-kiss-man
👨‍❤️‍💋‍👨 man-kiss-man
👩‍❤️‍💋‍👩 woman-kiss-woman
💑 couple_with_heart
👩‍❤️‍👨 woman-heart-man couple
👨‍❤️‍👨 man-heart-man couple
👩‍❤️‍👩 woman-heart-woman couple
👨‍👩‍👦 man-woman-boy family
👨‍👩‍👧 man-woman-girl family
👨‍👩‍👧‍👦 man-woman-girl-boy family
👨‍👩‍👦‍👦 man-woman-boy-boy family
👨‍👩‍👧‍👧 man-woman-girl-girl family
👨‍👨‍👦 man-man-boy family
👨‍👨‍👧 man-man-girl family
👨‍👨‍👧‍👦 man-man-girl-boy family
👨‍👨‍👦‍👦 man-man-boy-boy family
👨‍👨‍👧‍👧 man-man-girl-girl family
👩‍👩‍👦 woman-woman-boy family
👩‍👩‍👧 woman-woman-girl family
👩‍👩‍👧‍👦 woman-woman-girl-boy family
👩‍👩‍👦‍👦 woman-woman-boy-boy family
👩‍👩‍👧‍👧 woman-woman-girl-girl family
👨‍👦 man-boy family
👨‍👦‍👦 man-boy-boy family
👨‍👧 man-girl family
👨‍👧‍👦 man-girl-boy family
👨‍👧‍👧 man-girl-girl family
👩‍👦 woman-boy family
👩‍👦‍👦 woman-boy-boy family
👩‍👧 woman-girl family
👩‍👧‍👦 woman-girl-boy family
👩‍👧‍👧 woman-girl-girl family
🗣️ speaking_head_in_silhouette
👤 bust_in_silhouette
👥 busts_in_silhouette
🫂 people_hugging
👪 family
🧑‍🧑‍🧒 family_adult_adult_child
🧑‍🧑‍🧒‍🧒 family_adult_adult_child_child
🧑‍🧒 family_adult_child
🧑‍🧒‍🧒 family_adult_child_child
👣 footprints
🫆 fingerprint
🐵 monkey_face
🐒 monkey
🦍 gorilla
🦧 orangutan
🐶 dog face
🐕 dog2 dog
🦮 guide_dog
🐕‍🦺 service_dog
🐩 poodle
🐺 wolf face
🦊 fox_face
🦝 raccoon
🐱 cat face
🐈 cat2 cat
🐈‍⬛ black_cat
🦁 lion_face
🐯 tiger face
🐅 tiger2 tiger
🐆 leopard
🐴 horse face
🫎 moose
🫏 donkey
🐎 racehorse horse
🦄 unicorn_face
🦓 zebra_face
🦌 deer
🦬 bison
🐮 cow face
🐂 ox
🐃 water_buffalo
🐄 cow2 cow
🐷 pig face
🐖 pig2 pig
🐗 boar
🐽 pig_nose
🐏 ram
🐑 sheep
🐐 goat
🐪 dromedary_camel
🐫 camel bactrian
🦙 llama
🦒 giraffe_face
🐘 elephant
🦣 mammoth
🦏 rhinoceros
🦛 hippopotamus
🐭 mouse face
🐁 mouse2 mouse
🐀 rat
🐹 hamster face
🐰 rabbit face
🐇 rabbit2 rabbit
🐿️ chipmunk
🦫 beaver
🦔 hedgehog
🦇 bat
🐻 bear face
🐻‍❄️ polar_bear
🐨 koala
🐼 panda_face
🦥 sloth
🦦 otter
🦨 skunk
🦘 kangaroo
🦡 badger
🐾 feet paw_prints
🦃 turkey
🐔 chicken
🐓 rooster
🐣 hatching_chick
🐤 baby_chick
🐥 hatched_chick front-facing baby
🐦 bird
🐧 penguin
🕊️ dove_of_peace
🦅 eagle
🦆 duck
🦢 swan
🦉 owl
🦤 dodo
🪶 feather
🦩 flamingo
🦚 peacock
🦜 parrot
🪽 wing
🐦‍⬛ black_bird
🪿 goose
🐦‍🔥 phoenix
🐸 frog face
🐊 crocodile
🐢 turtle
🦎 lizard
🐍 snake
🐲 dragon_face
🐉 dragon
🦕 sauropod
🦖 t-rex
🐳 whale spouting
🐋 whale2 whale
🐬 dolphin flipper
🦭 seal
🐟 fish
🐠 tropical_fish
🐡 blowfish
🦈 shark
🐙 octopus
🐚 shell spiral
🪸 coral
🪼 jellyfish
🦀 crab
🦞 lobster
🦐 shrimp
🦑 squid
🦪 oyster
🐌 snail
🦋 butterfly
🐛 bug
🐜 ant
🐝 bee honeybee
🪲 beetle
🐞 ladybug lady_beetle
🦗 cricket
🪳 cockroach
🕷️ spider
🕸️ spider_web
🦂 scorpion
🦟 mosquito
🪰 fly
🪱 worm
🦠 microbe
💐 bouquet
🌸 cherry_blossom
💮 white_flower
🪷 lotus
🏵️ rosette
🌹 rose
🥀 wilted_flower
🌺 hibiscus
🌻 sunflower
🌼 blossom
🌷 tulip
🪻 hyacinth
🌱 seedling
🪴 potted_plant
🌲 evergreen_tree
🌳 deciduous_tree
🌴 palm_tree
🌵 cactus
🌾 ear_of_rice
🌿 herb
☘️ shamrock
🍀 four_leaf_clover
🍁 maple_leaf
🍂 fallen_leaf
🍃 leaves leaf fluttering wind
🪹 empty_nest
🪺 nest_with_eggs
🍄 mushroom
🪾 leafless_tree
🍇 grapes
🍈 melon
🍉 watermelon
🍊 tangerine
🍋 lemon
🍋‍🟩 lime
🍌 banana
🍍 pineapple
🥭 mango
🍎 apple red
🍏 green_apple
🍐 pear
🍑 peach
🍒 cherries
🍓 strawberry
🫐 blueberries
🥝 kiwifruit
🍅 tomato
🫒 olive
🥥 coconut
🥑 avocado
🍆 eggplant aubergine
🥔 potato
🥕 carrot
🌽 corn ear maize
🌶️ hot_pepper
🫑 bell_pepper
🥒 cucumber
🥬 leafy_green
🥦 broccoli
🧄 garlic
🧅 onion
🥜 peanuts
🫘 beans
🌰 chestnut
🫚 ginger_root
🫛 pea_pod
🍄‍🟫 brown_mushroom
🫜 root_vegetable
🍞 bread
🥐 croissant
🥖 baguette_bread
🫓 flatbread
🥨 pretzel
🥯 bagel
🥞 pancakes
🧇 waffle
🧀 cheese_wedge
🍖 meat_on_bone
🍗 poultry_leg
🥩 cut_of_meat
🥓 bacon
🍔 hamburger
🍟 fries french
🍕 pizza slice
🌭 hotdog hot dog
🥪 sandwich
🌮 taco
🌯 burrito
🫔 tamale
🥙 stuffed_flatbread
🧆 falafel
🥚 egg
🍳 fried_egg cooking
🥘 shallow_pan_of_food
🍲 stew pot food
🫕 fondue
🥣 bowl_with_spoon
🥗 green_salad
🍿 popcorn
🧈 butter
🧂 salt shaker
🥫 canned_food
🍱 bento box
🍘 rice_cracker
🍙 rice_ball
🍚 rice cooked
🍛 curry rice
🍜 ramen steaming bowl
🍝 spaghetti
🍠 sweet_potato roasted
🍢 oden
🍣 sushi
🍤 fried_shrimp
🍥 fish_cake swirl design
🥮 moon_cake
🍡 dango
🥟 dumpling
🥠 fortune_cookie
🥡 takeout_box
🍦 icecream soft ice cream
🍧 shaved_ice
🍨 ice_cream
🍩 doughnut
🍪 cookie
🎂 birthday cake
🍰 cake shortcake
🧁 cupcake
🥧 pie
🍫 chocolate_bar
🍬 candy
🍭 lollipop
🍮 custard
🍯 honey_pot
🍼 baby_bottle
🥛 glass_of_milk
☕ coffee hot beverage
🫖 teapot
🍵 tea teacup without handle
🍶 sake bottle cup
🍾 champagne bottle popping cork
🍷 wine_glass
🍸 cocktail glass
🍹 tropical_drink
🍺 beer mug
🍻 beers clinking beer mugs
🥂 clinking_glasses
🥃 tumbler_glass
🫗 pouring_liquid
🥤 cup_with_straw
🧋 bubble_tea
🧃 beverage_box
🧉 mate_drink
🧊 ice_cube
🥢 chopsticks
🍽️ knife_fork_plate
🍴 fork_and_knife
🥄 spoon
🔪 hocho knife
🫙 jar
🏺 amphora
🌍 earth_africa globe europe-africa
🌎 earth_americas globe
🌏 earth_asia globe asia-australia
🌐 globe_with_meridians
🗺️ world_map
🗾 japan silhouette
🧭 compass
🏔️ snow_capped_mountain snow-capped
⛰️ mountain
🌋 volcano
🗻 mount_fuji
🏕️ camping
🏖️ beach_with_umbrella
🏜️ desert
🏝️ desert_island
🏞️ national_park
🏟️ stadium
🏛️ classical_building
🏗️ building_construction
🧱 bricks brick
🪨 rock
🪵 wood
🛖 hut
🏘️ house_buildings houses
🏚️ derelict_house_building
🏠 house building
🏡 house_with_garden
🏢 office building
🏣 post_office japanese
🏤 european_post_office
🏥 hospital
🏦 bank
🏨 hotel
🏩 love_hotel
🏪 convenience_store
🏫 school
🏬 department_store
🏭 factory
🏯 japanese_castle
🏰 european_castle
💒 wedding
🗼 tokyo_tower
🗽 statue_of_liberty
⛪ church
🕌 mosque
🛕 hindu_temple
🕍 synagogue
⛩️ shinto_shrine
🕋 kaaba
⛲ fountain
⛺ tent
🌁 foggy
🌃 night_with_stars
🏙️ cityscape
🌄 sunrise_over_mountains
🌅 sunrise
🌆 city_sunset cityscape at dusk
🌇 city_sunrise sunset over buildings
🌉 bridge_at_night
♨️ hotsprings hot springs
🎠 carousel_horse
🛝 playground_slide
🎡 ferris_wheel
🎢 roller_coaster
💈 barber pole
🎪 circus_tent
🚂 steam_locomotive
🚃 railway_car
🚄 bullettrain_side high-speed train
🚅 bullettrain_front high-speed train bullet nose
🚆 train2 train
🚇 metro
🚈 light_rail
🚉 station
🚊 tram
🚝 monorail
🚞 mountain_railway
🚋 train tram car
🚌 bus
🚍 oncoming_bus
🚎 trolleybus
🚐 minibus
🚑 ambulance
🚒 fire_engine
🚓 police_car
🚔 oncoming_police_car
🚕 taxi
🚖 oncoming_taxi
🚗 car red_car automobile
🚘 oncoming_automobile
🚙 blue_car recreational vehicle
🛻 pickup_truck
🚚 truck delivery
🚛 articulated_lorry
🚜 tractor
🏎️ racing_car
🏍️ racing_motorcycle
🛵 motor_scooter
🦽 manual_wheelchair
🦼 motorized_wheelchair
🛺 auto_rickshaw
🚲 bike bicycle
🛴 scooter
🛹 skateboard
🛼 roller_skate
🚏 busstop bus stop
🛣️ motorway
🛤️ railway_track
🛢️ oil_drum
⛽ fuelpump fuel pump
🛞 wheel
🚨 rotating_light police cars revolving
🚥 traffic_light horizontal
🚦 vertical_traffic_light
🛑 octagonal_sign
🚧 construction sign
⚓ anchor
🛟 ring_buoy
⛵ boat sailboat
🛶 canoe
🚤 speedboat
🛳️ passenger_ship
⛴️ ferry
🛥️ motor_boat
🚢 ship
✈️ airplane
🛩️ small_airplane
🛫 airplane_departure
🛬 airplane_arriving
🪂 parachute
💺 seat
🚁 helicopter
🚟 suspension_railway
🚠 mountain_cableway
🚡 aerial_tramway
🛰️ satellite
🚀 rocket
🛸 flying_saucer
🛎️ bellhop_bell
🧳 luggage
⌛ hourglass
⏳ hourglass_flowing_sand
⌚ watch
⏰ alarm_clock
⏱️ stopwatch
⏲️ timer_clock
🕰️ mantelpiece_clock
🕛 clock12 clock face twelve oclock
🕧 clock1230 clock face twelve-thirty
🕐 clock1 clock face one oclock
🕜 clock130 clock face one-thirty
🕑 clock2 clock face two oclock
🕝 clock230 clock face two-thirty
🕒 clock3 clock face three oclock
🕞 clock330 clock face three-thirty
🕓 clock4 clock face four oclock
🕟 clock430 clock face four-thirty
🕔 clock5 clock face five oclock
🕠 clock530 clock face five-thirty
🕕 clock6 clock face six oclock
🕡 clock630 clock face six-thirty
🕖 clock7 clock face seven oclock
🕢 clock730 clock face seven-thirty
🕗 clock8 clock face eight oclock
🕣 clock830 clock face eight-thirty
🕘 clock9 clock face nine oclock
🕤 clock930 clock face nine-thirty
🕙 clock10 clock face ten oclock
🕥 clock1030 clock face ten-thirty
🕚 clock11 clock face eleven oclock
🕦 clock1130 clock face eleven-thirty
🌑 new_moon symbol
🌒 waxing_crescent_moon symbol
🌓 first_quarter_moon symbol
🌔 moon waxing_gibbous_moon symbol
🌕 full_moon symbol
🌖 waning_gibbous_moon symbol
🌗 last_quarter_moon symbol
🌘 waning_crescent_moon symbol
🌙 crescent_moon
🌚 new_moon_with_face
🌛 first_quarter_moon_with_face
🌜 last_quarter_moon_with_face
🌡️ thermometer
☀️ sunny black sun rays
🌝 full_moon_with_face
🌞 sun_with_face
🪐 ringed_planet
⭐ star white medium
🌟 star2 glowing star
🌠 stars shooting star
🌌 milky_way
☁️ cloud
⛅ partly_sunny sun behind cloud
⛈️ thunder_cloud_and_rain lightning
🌤️ mostly_sunny sun_small_cloud behind
🌥️ barely_sunny sun_behind_cloud large
🌦️ partly_sunny_rain sun_behind_rain_cloud
🌧️ rain_cloud
🌨️ snow_cloud
🌩️ lightning lightning_cloud
🌪️ tornado tornado_cloud
🌫️ fog
🌬️ wind_blowing_face
🌀 cyclone
🌈 rainbow
🌂 closed_umbrella
☂️ umbrella
☔ umbrella_with_rain_drops
⛱️ umbrella_on_ground
⚡ zap high voltage sign
❄️ snowflake
☃️ snowman
⛄ snowman_without_snow
☄️ comet
🔥 fire
💧 droplet
🌊 ocean water wave
🎃 jack_o_lantern jack-o-lantern
🎄 christmas_tree
🎆 fireworks
🎇 sparkler firework
🧨 firecracker
✨ sparkles
🎈 balloon
🎉 tada party popper
🎊 confetti_ball
🎋 tanabata_tree
🎍 bamboo pine decoration
🎎 dolls japanese
🎏 flags carp streamer
🎐 wind_chime
🎑 rice_scene moon viewing ceremony
🧧 red_envelope gift
🎀 ribbon
🎁 gift wrapped present
🎗️ reminder_ribbon
🎟️ admission_tickets
🎫 ticket
🎖️ medal military
🏆 trophy
🏅 sports_medal
🥇 first_place_medal
🥈 second_place_medal
🥉 third_place_medal
⚽ soccer ball
⚾ baseball
🥎 softball
🏀 basketball hoop
🏐 volleyball
🏈 football american
🏉 rugby_football
🎾 tennis racquet ball
🥏 flying_disc
🎳 bowling
🏏 cricket_bat_and_ball
🏑 field_hockey_stick_and_ball
🏒 ice_hockey_stick_and_puck
🥍 lacrosse stick ball
🏓 table_tennis_paddle_and_ball
🏸 badminton_racquet_and_shuttlecock
🥊 boxing_glove
🥋 martial_arts_uniform
🥅 goal_net
⛳ golf flag hole
⛸️ ice_skate
🎣 fishing_pole_and_fish
🤿 diving_mask
🎽 running_shirt_with_sash
🎿 ski boot
🛷 sled
🥌 curling_stone
🎯 dart direct hit
🪀 yo-yo
🪁 kite
🔫 gun pistol
🎱 8ball billiards
🔮 crystal_ball
🪄 magic_wand
🎮 video_game
🕹️ joystick
🎰 slot_machine
🎲 game_die
🧩 jigsaw puzzle piece
🧸 teddy_bear
🪅 pinata
🪩 mirror_ball
🪆 nesting_dolls
♠️ spades black spade suit
♥️ hearts black heart suit
♦️ diamonds black diamond suit
♣️ clubs black club suit
♟️ chess_pawn
🃏 black_joker playing card
🀄 mahjong tile red dragon
🎴 flower_playing_cards
🎭 performing_arts
🖼️ frame_with_picture framed
🎨 art artist palette
🧵 thread spool
🪡 sewing_needle
🧶 yarn ball
🪢 knot
👓 eyeglasses
🕶️ dark_sunglasses
🥽 goggles
🥼 lab_coat
🦺 safety_vest
👔 necktie
👕 shirt tshirt t-shirt
👖 jeans
🧣 scarf
🧤 gloves
🧥 coat
🧦 socks
👗 dress
👘 kimono
🥻 sari
🩱 one-piece_swimsuit one-piece
🩲 briefs
🩳 shorts
👙 bikini
👚 womans_clothes
🪭 folding_hand_fan
👛 purse
👜 handbag
👝 pouch
🛍️ shopping_bags
🎒 school_satchel
🩴 thong_sandal
👞 mans_shoe shoe
👟 athletic_shoe
🥾 hiking_boot
🥿 womans_flat_shoe
👠 high_heel high-heeled shoe
👡 sandal womans
🩰 ballet_shoes
👢 boot womans boots
🪮 hair_pick
👑 crown
👒 womans_hat
🎩 tophat top hat
🎓 mortar_board graduation cap
🧢 billed_cap
🪖 military_helmet
⛑️ helmet_with_white_cross rescue worker s
📿 prayer_beads
💄 lipstick
💍 ring
💎 gem stone
🔇 mute speaker cancellation stroke
🔈 speaker
🔉 sound speaker one wave
🔊 loud_sound speaker three waves
📢 loudspeaker public address
📣 mega cheering megaphone
📯 postal_horn
🔔 bell
🔕 no_bell cancellation stroke
🎼 musical_score
🎵 musical_note
🎶 notes multiple musical
🎙️ studio_microphone
🎚️ level_slider
🎛️ control_knobs
🎤 microphone
🎧 headphones headphone
📻 radio
🎷 saxophone
🪗 accordion
🎸 guitar
🎹 musical_keyboard
🎺 trumpet
🎻 violin
🪕 banjo
🥁 drum_with_drumsticks
🪘 long_drum
🪇 maracas
🪈 flute
🪉 harp
📱 iphone mobile phone
📲 calling mobile phone rightwards arrow at left
☎️ phone telephone black
📞 telephone_receiver
📟 pager
📠 fax machine
🔋 battery
🪫 low_battery
🔌 electric_plug
💻 computer personal
🖥️ desktop_computer
🖨️ printer
⌨️ keyboard
🖱️ three_button_mouse computer
🖲️ trackball
💽 minidisc
💾 floppy_disk
💿 cd optical disc
📀 dvd
🧮 abacus
🎥 movie_camera
🎞️ film_frames
📽️ film_projector
🎬 clapper board
📺 tv television
📷 camera
📸 camera_with_flash
📹 video_camera
📼 vhs videocassette
🔍 mag left-pointing magnifying glass
🔎 mag_right right-pointing magnifying glass
🕯️ candle
💡 bulb electric light
🔦 flashlight electric torch
🏮 izakaya_lantern lantern
🪔 diya_lamp
📔 notebook_with_decorative_cover
📕 closed_book
📖 book open_book
📗 green_book
📘 blue_book
📙 orange_book
📚 books
📓 notebook
📒 ledger
📃 page_with_curl
📜 scroll
📄 page_facing_up
📰 newspaper
🗞️ rolled_up_newspaper rolled-up
📑 bookmark_tabs
🔖 bookmark
🏷️ label
💰 moneybag money bag
🪙 coin
💴 yen banknote sign
💵 dollar banknote sign
💶 euro banknote sign
💷 pound banknote sign
💸 money_with_wings
💳 credit_card
🧾 receipt
💹 chart upwards trend yen sign
✉️ email envelope
📧 e-mail symbol
📨 incoming_envelope
📩 envelope_with_arrow downwards above
📤 outbox_tray
📥 inbox_tray
📦 package
📫 mailbox closed raised flag
📪 mailbox_closed lowered flag
📬 mailbox_with_mail open raised flag
📭 mailbox_with_no_mail open lowered flag
📮 postbox
🗳️ ballot_box_with_ballot
✏️ pencil2 pencil
✒️ black_nib
🖋️ lower_left_fountain_pen
🖊️ lower_left_ballpoint_pen
🖌️ lower_left_paintbrush
🖍️ lower_left_crayon
📝 memo pencil
💼 briefcase
📁 file_folder
📂 open_file_folder
🗂️ card_index_dividers
📅 date calendar
📆 calendar tear-off
🗒️ spiral_note_pad notepad
🗓️ spiral_calendar_pad
📇 card_index
📈 chart_with_upwards_trend
📉 chart_with_downwards_trend
📊 bar_chart
📋 clipboard
📌 pushpin
📍 round_pushpin
📎 paperclip
🖇️ linked_paperclips
📏 straight_ruler
📐 triangular_ruler
✂️ scissors black
🗃️ card_file_box
🗄️ file_cabinet
🗑️ wastebasket
🔒 lock
🔓 unlock open lock
🔏 lock_with_ink_pen
🔐 closed_lock_with_key
🔑 key
🗝️ old_key
🔨 hammer
🪓 axe
⛏️ pick
⚒️ hammer_and_pick
🛠️ hammer_and_wrench
🗡️ dagger_knife
⚔️ crossed_swords
💣 bomb
🪃 boomerang
🏹 bow_and_arrow
🛡️ shield
🪚 carpentry_saw
🔧 wrench
🪛 screwdriver
🔩 nut_and_bolt
⚙️ gear
🗜️ compression clamp
⚖️ scales balance scale
🦯 probing_cane
🔗 link symbol
⛓️‍💥 broken_chain
⛓️ chains
🪝 hook
🧰 toolbox
🧲 magnet
🪜 ladder
🪏 shovel
⚗️ alembic
🧪 test_tube
🧫 petri_dish
🧬 dna double helix
🔬 microscope
🔭 telescope
📡 satellite_antenna
💉 syringe
🩸 drop_of_blood
💊 pill
🩹 adhesive_bandage
🩼 crutch
🩺 stethoscope
🩻 x-ray
🚪 door
🛗 elevator
🪞 mirror
🪟 window
🛏️ bed
🛋️ couch_and_lamp
🪑 chair
🚽 toilet
🪠 plunger
🚿 shower
🛁 bathtub
🪤 mouse_trap
🪒 razor
🧴 lotion_bottle
🧷 safety_pin
🧹 broom
🧺 basket
🧻 roll_of_paper
🪣 bucket
🧼 soap bar
🫧 bubbles
🪥 toothbrush
🧽 sponge
🧯 fire_extinguisher
🛒 shopping_trolley
🚬 smoking symbol
⚰️ coffin
🪦 headstone
⚱️ funeral_urn
🧿 nazar_amulet
🪬 hamsa
🗿 moyai
🪧 placard
🪪 identification_card
🏧 atm automated teller machine
🚮 put_litter_in_its_place symbol
🚰 potable_water symbol
♿ wheelchair symbol
🚹 mens symbol
🚺 womens symbol
🚻 restroom
🚼 baby_symbol
🚾 wc water closet
🛂 passport_control
🛃 customs
🛄 baggage_claim
🛅 left_luggage
⚠️ warning sign
🚸 children_crossing
⛔ no_entry
🚫 no_entry_sign
🚳 no_bicycles
🚭 no_smoking symbol
🚯 do_not_litter symbol
🚱 non-potable_water non-potable symbol
🚷 no_pedestrians
📵 no_mobile_phones
🔞 underage no one under eighteen symbol
☢️ radioactive_sign
☣️ biohazard_sign
⬆️ arrow_up upwards black
↗️ arrow_upper_right north east
➡️ arrow_right black rightwards
↘️ arrow_lower_right south east
⬇️ arrow_down downwards black
↙️ arrow_lower_left south west
⬅️ arrow_left leftwards black
↖️ arrow_upper_left north west
↕️ arrow_up_down
↔️ left_right_arrow
↩️ leftwards_arrow_with_hook
↪️ arrow_right_hook rightwards
⤴️ arrow_heading_up pointing rightwards then curving upwards
⤵️ arrow_heading_down pointing rightwards then curving downwards
🔃 arrows_clockwise downwards upwards open circle
🔄 arrows_counterclockwise anticlockwise downwards upwards open circle
🔙 back leftwards arrow above
🔚 end leftwards arrow above
🔛 on exclamation mark left right arrow above
🔜 soon rightwards arrow above
🔝 top upwards arrow above
🛐 place_of_worship
⚛️ atom_symbol
🕉️ om_symbol
✡️ star_of_david
☸️ wheel_of_dharma
☯️ yin_yang
✝️ latin_cross
☦️ orthodox_cross
☪️ star_and_crescent
☮️ peace_symbol
🕎 menorah_with_nine_branches
🔯 six_pointed_star middle dot
🪯 khanda
♈ aries
♉ taurus
♊ gemini
♋ cancer
♌ leo
♍ virgo
♎ libra
♏ scorpius
♐ sagittarius
♑ capricorn
♒ aquarius
♓ pisces
⛎ ophiuchus
🔀 twisted_rightwards_arrows
🔁 repeat clockwise rightwards leftwards open circle arrows
🔂 repeat_one clockwise rightwards leftwards open circle arrows circled overlay
▶️ arrow_forward black right-pointing triangle
⏩ fast_forward black right-pointing double triangle
⏭️ black_right_pointing_double_triangle_with_vertical_bar next track button
⏯️ black_right_pointing_triangle_with_double_vertical_bar play pause button
◀️ arrow_backward black left-pointing triangle
⏪ rewind black left-pointing double triangle
⏮️ black_left_pointing_double_triangle_with_vertical_bar last track button
🔼 arrow_up_small up-pointing red triangle
⏫ arrow_double_up black up-pointing triangle
🔽 arrow_down_small down-pointing red triangle
⏬ arrow_double_down black down-pointing triangle
⏸️ double_vertical_bar pause button
⏹️ black_square_for_stop button
⏺️ black_circle_for_record button
⏏️ eject button
🎦 cinema
🔅 low_brightness symbol
🔆 high_brightness symbol
📶 signal_strength antenna bars
🛜 wireless
📳 vibration_mode
📴 mobile_phone_off
♀️ female_sign
♂️ male_sign
⚧️ transgender_symbol
✖️ heavy_multiplication_x
➕ heavy_plus_sign
➖ heavy_minus_sign
➗ heavy_division_sign
🟰 heavy_equals_sign
♾️ infinity
‼️ bangbang double exclamation mark
⁉️ interrobang exclamation question mark
❓ question black mark ornament
❔ grey_question white mark ornament
❕ grey_exclamation white mark ornament
❗ exclamation heavy_exclamation_mark symbol
〰️ wavy_dash
💱 currency_exchange
💲 heavy_dollar_sign
⚕️ medical_symbol staff_of_aesculapius
♻️ recycle black universal recycling symbol
⚜️ fleur_de_lis fleur-de-lis
🔱 trident emblem
📛 name_badge
🔰 beginner japanese symbol
⭕ o heavy large circle
✅ white_check_mark heavy
☑️ ballot_box_with_check
✔️ heavy_check_mark
❌ x cross mark
❎ negative_squared_cross_mark
➰ curly_loop
➿ loop double curly
〽️ part_alternation_mark
✳️ eight_spoked_asterisk
✴️ eight_pointed_black_star
❇️ sparkle
©️ copyright sign
®️ registered sign
™️ tm trade mark sign
🫟 splatter
#️⃣ hash key
*️⃣ keycap_star
0️⃣ zero keycap 0
1️⃣ one keycap 1
2️⃣ two keycap 2
3️⃣ three keycap 3
4️⃣ four keycap 4
5️⃣ five keycap 5
6️⃣ six keycap 6
7️⃣ seven keycap 7
8️⃣ eight keycap 8
9️⃣ nine keycap 9
🔟 keycap_ten
🔠 capital_abcd input symbol latin letters
🔡 abcd input symbol latin small letters
🔢 1234 input symbol numbers
🔣 symbols input symbol
🔤 abc input symbol latin letters
🅰️ a negative squared latin capital letter
🆎 ab negative squared
🅱️ b negative squared latin capital letter
🆑 cl squared
🆒 cool squared
🆓 free squared
ℹ️ information_source
🆔 id squared
Ⓜ️ m circled latin capital letter
🆕 new squared
🆖 ng squared
🅾️ o2 negative squared latin capital letter o
🆗 ok squared
🅿️ parking negative squared latin capital letter p
🆘 sos squared
🆙 up squared exclamation mark
🆚 vs squared
🈁 koko squared katakana
🈂️ sa squared katakana
🈷️ u6708 squared cjk unified ideograph-6708
🈶 u6709 squared cjk unified ideograph-6709
🈯 u6307 squared cjk unified ideograph-6307
🉐 ideograph_advantage circled
🈹 u5272 squared cjk unified ideograph-5272
🈚 u7121 squared cjk unified ideograph-7121
🈲 u7981 squared cjk unified ideograph-7981
🉑 accept circled ideograph
🈸 u7533 squared cjk unified ideograph-7533
🈴 u5408 squared cjk unified ideograph-5408
🈳 u7a7a squared cjk unified ideograph-7a7a
㊗️ congratulations circled ideograph congratulation
㊙️ secret circled ideograph
🈺 u55b6 squared cjk unified ideograph-55b6
🈵 u6e80 squared cjk unified ideograph-6e80
🔴 red_circle large
🟠 large_orange_circle
🟡 large_yellow_circle
🟢 large_green_circle
🔵 large_blue_circle
🟣 large_purple_circle
🟤 large_brown_circle
⚫ black_circle medium
⚪ white_circle medium
🟥 large_red_square
🟧 large_orange_square
🟨 large_yellow_square
🟩 large_green_square
🟦 large_blue_square
🟪 large_purple_square
🟫 large_brown_square
⬛ black_large_square
⬜ white_large_square
◼️ black_medium_square
◻️ white_medium_square
◾ black_medium_small_square
◽ white_medium_small_square
▪️ black_small_square
▫️ white_small_square
🔶 large_orange_diamond
🔷 large_blue_diamond
🔸 small_orange_diamond
🔹 small_blue_diamond
🔺 small_red_triangle up-pointing
🔻 small_red_triangle_down down-pointing
💠 diamond_shape_with_a_dot_inside
🔘 radio_button
🔳 white_square_button
🔲 black_square_button
🏁 checkered_flag chequered
🚩 triangular_flag_on_post
🎌 crossed_flags
🏴 waving_black_flag
🏳️ waving_white_flag
🏳️‍🌈 rainbow-flag
🏳️‍⚧️ transgender_flag
🏴‍☠️ pirate_flag
🇦🇨 flag-ac ascension island
🇦🇩 flag-ad andorra
🇦🇪 flag-ae united arab emirates
🇦🇫 flag-af afghanistan
🇦🇬 flag-ag antigua barbuda
🇦🇮 flag-ai anguilla
🇦🇱 flag-al albania
🇦🇲 flag-am armenia
🇦🇴 flag-ao angola
🇦🇶 flag-aq antarctica
🇦🇷 flag-ar argentina
🇦🇸 flag-as american samoa
🇦🇹 flag-at austria
🇦🇺 flag-au australia
🇦🇼 flag-aw aruba
🇦🇽 flag-ax land islands
🇦🇿 flag-az azerbaijan
🇧🇦 flag-ba bosnia herzegovina
🇧🇧 flag-bb barbados
🇧🇩 flag-bd bangladesh
🇧🇪 flag-be belgium
🇧🇫 flag-bf burkina faso
🇧🇬 flag-bg bulgaria
🇧🇭 flag-bh bahrain
🇧🇮 flag-bi burundi
🇧🇯 flag-bj benin
🇧🇱 flag-bl st barth lemy
🇧🇲 flag-bm bermuda
🇧🇳 flag-bn brunei
🇧🇴 flag-bo bolivia
🇧🇶 flag-bq caribbean netherlands
🇧🇷 flag-br brazil
🇧🇸 flag-bs bahamas
🇧🇹 flag-bt bhutan
🇧🇻 flag-bv bouvet island
🇧🇼 flag-bw botswana
🇧🇾 flag-by belarus
🇧🇿 flag-bz belize
🇨🇦 flag-ca canada
🇨🇨 flag-cc cocos keeling islands
🇨🇩 flag-cd congo - kinshasa
🇨🇫 flag-cf central african republic
🇨🇬 flag-cg congo - brazzaville
🇨🇭 flag-ch switzerland
🇨🇮 flag-ci c te d ivoire
🇨🇰 flag-ck cook islands
🇨🇱 flag-cl chile
🇨🇲 flag-cm cameroon
🇨🇳 cn flag-cn china
🇨🇴 flag-co colombia
🇨🇵 flag-cp clipperton island
🇨🇶 flag-sark
🇨🇷 flag-cr costa rica
🇨🇺 flag-cu cuba
🇨🇻 flag-cv cape verde
🇨🇼 flag-cw cura ao
🇨🇽 flag-cx christmas island
🇨🇾 flag-cy cyprus
🇨🇿 flag-cz czechia
🇩🇪 de flag-de germany
🇩🇬 flag-dg diego garcia
🇩🇯 flag-dj djibouti
🇩🇰 flag-dk denmark
🇩🇲 flag-dm dominica
🇩🇴 flag-do dominican republic
🇩🇿 flag-dz algeria
🇪🇦 flag-ea ceuta melilla
🇪🇨 flag-ec ecuador
🇪🇪 flag-ee estonia
🇪🇬 flag-eg egypt
🇪🇭 flag-eh western sahara
🇪🇷 flag-er eritrea
🇪🇸 es flag-es spain
🇪🇹 flag-et ethiopia
🇪🇺 flag-eu european union
🇫🇮 flag-fi finland
🇫🇯 flag-fj fiji
🇫🇰 flag-fk falkland islands
🇫🇲 flag-fm micronesia
🇫🇴 flag-fo faroe islands
🇫🇷 fr flag-fr france
🇬🇦 flag-ga gabon
🇬🇧 gb uk flag-gb united kingdom
🇬🇩 flag-gd grenada
🇬🇪 flag-ge georgia
🇬🇫 flag-gf french guiana
🇬🇬 flag-gg guernsey
🇬🇭 flag-gh ghana
🇬🇮 flag-gi gibraltar
🇬🇱 flag-gl greenland
🇬🇲 flag-gm gambia
🇬🇳 flag-gn guinea
🇬🇵 flag-gp guadeloupe
🇬🇶 flag-gq equatorial guinea
🇬🇷 flag-gr greece
🇬🇸 flag-gs south georgia sandwich islands
🇬🇹 flag-gt guatemala
🇬🇺 flag-gu guam
🇬🇼 flag-gw guinea-bissau
🇬🇾 flag-gy guyana
🇭🇰 flag-hk hong kong sar china
🇭🇲 flag-hm heard mcdonald islands
🇭🇳 flag-hn honduras
🇭🇷 flag-hr croatia
🇭🇹 flag-ht haiti
🇭🇺 flag-hu hungary
🇮🇨 flag-ic canary islands
🇮🇩 flag-id indonesia
🇮🇪 flag-ie ireland
🇮🇱 flag-il israel
🇮🇲 flag-im isle man
🇮🇳 flag-in india
🇮🇴 flag-io british indian ocean territory
🇮🇶 flag-iq iraq
🇮🇷 flag-ir iran
🇮🇸 flag-is iceland
🇮🇹 it flag-it italy
🇯🇪 flag-je jersey
🇯🇲 flag-jm jamaica
🇯🇴 flag-jo jordan
🇯🇵 jp flag-jp japan
🇰🇪 flag-ke kenya
🇰🇬 flag-kg kyrgyzstan
🇰🇭 flag-kh cambodia
🇰🇮 flag-ki kiribati
🇰🇲 flag-km comoros
🇰🇳 flag-kn st kitts nevis
🇰🇵 flag-kp north korea
🇰🇷 kr flag-kr south korea
🇰🇼 flag-kw kuwait
🇰🇾 flag-ky cayman islands
🇰🇿 flag-kz kazakhstan
🇱🇦 flag-la laos
🇱🇧 flag-lb lebanon
🇱🇨 flag-lc st lucia
🇱🇮 flag-li liechtenstein
🇱🇰 flag-lk sri lanka
🇱🇷 flag-lr liberia
🇱🇸 flag-ls lesotho
🇱🇹 flag-lt lithuania
🇱🇺 flag-lu luxembourg
🇱🇻 flag-lv latvia
🇱🇾 flag-ly libya
🇲🇦 flag-ma morocco
🇲🇨 flag-mc monaco
🇲🇩 flag-md moldova
🇲🇪 flag-me montenegro
🇲🇫 flag-mf st martin
🇲🇬 flag-mg madagascar
🇲🇭 flag-mh marshall islands
🇲🇰 flag-mk north macedonia
🇲🇱 flag-ml mali
🇲🇲 flag-mm myanmar burma
🇲🇳 flag-mn mongolia
🇲🇴 flag-mo macao sar china
🇲🇵 flag-mp northern mariana islands
🇲🇶 flag-mq martinique
🇲🇷 flag-mr mauritania
🇲🇸 flag-ms montserrat
🇲🇹 flag-mt malta
🇲🇺 flag-mu mauritius
🇲🇻 flag-mv maldives
🇲🇼 flag-mw malawi
🇲🇽 flag-mx mexico
🇲🇾 flag-my malaysia
🇲🇿 flag-mz mozambique
🇳🇦 flag-na namibia
🇳🇨 flag-nc new caledonia
🇳🇪 flag-ne niger
🇳🇫 flag-nf norfolk island
🇳🇬 flag-ng nigeria
🇳🇮 flag-ni nicaragua
🇳🇱 flag-nl netherlands
🇳🇴 flag-no norway
🇳🇵 flag-np nepal
🇳🇷 flag-nr nauru
🇳🇺 flag-nu niue
🇳🇿 flag-nz new zealand
🇴🇲 flag-om oman
🇵🇦 flag-pa panama
🇵🇪 flag-pe peru
🇵🇫 flag-pf french polynesia
🇵🇬 flag-pg papua new guinea
🇵🇭 flag-ph philippines
🇵🇰 flag-pk pakistan
🇵🇱 flag-pl poland
🇵🇲 flag-pm st pierre miquelon
🇵🇳 flag-pn pitcairn islands
🇵🇷 flag-pr puerto rico
🇵🇸 flag-ps palestinian territories
🇵🇹 flag-pt portugal
🇵🇼 flag-pw palau
🇵🇾 flag-py paraguay
🇶🇦 flag-qa qatar
🇷🇪 flag-re r union
🇷🇴 flag-ro romania
🇷🇸 flag-rs serbia
🇷🇺 ru flag-ru russia
🇷🇼 flag-rw rwanda
🇸🇦 flag-sa saudi arabia
🇸🇧 flag-sb solomon islands
🇸🇨 flag-sc seychelles
🇸🇩 flag-sd sudan
🇸🇪 flag-se sweden
🇸🇬 flag-sg singapore
🇸🇭 flag-sh st helena
🇸🇮 flag-si slovenia
🇸🇯 flag-sj svalbard jan mayen
🇸🇰 flag-sk slovakia
🇸🇱 flag-sl sierra leone
🇸🇲 flag-sm san marino
🇸🇳 flag-sn senegal
🇸🇴 flag-so somalia
🇸🇷 flag-sr suriname
🇸🇸 flag-ss south sudan
🇸🇹 flag-st s o tom pr ncipe
🇸🇻 flag-sv el salvador
🇸🇽 flag-sx sint maarten
🇸🇾 flag-sy syria
🇸🇿 flag-sz eswatini
🇹🇦 flag-ta tristan da cunha
🇹🇨 flag-tc turks caicos islands
🇹🇩 flag-td chad
🇹🇫 flag-tf french southern territories
🇹🇬 flag-tg togo
🇹🇭 flag-th thailand
🇹🇯 flag-tj tajikistan
🇹🇰 flag-tk tokelau
🇹🇱 flag-tl timor-leste
🇹🇲 flag-tm turkmenistan
🇹🇳 flag-tn tunisia
🇹🇴 flag-to tonga
🇹🇷 flag-tr t rkiye
🇹🇹 flag-tt trinidad tobago
🇹🇻 flag-tv tuvalu
🇹🇼 flag-tw taiwan
🇹🇿 flag-tz tanzania
🇺🇦 flag-ua ukraine
🇺🇬 flag-ug uganda
🇺🇲 flag-um u s outlying islands
🇺🇳 flag-un united nations
🇺🇸 us flag-us united states
🇺🇾 flag-uy uruguay
🇺🇿 flag-uz uzbekistan
🇻🇦 flag-va vatican city
🇻🇨 flag-vc st vincent grenadines
🇻🇪 flag-ve venezuela
🇻🇬 flag-vg british virgin islands
🇻🇮 flag-vi u s virgin islands
🇻🇳 flag-vn vietnam
🇻🇺 flag-vu vanuatu
🇼🇫 flag-wf wallis futuna
🇼🇸 flag-ws samoa
🇽🇰 flag-xk kosovo
🇾🇪 flag-ye yemen
🇾🇹 flag-yt mayotte
🇿🇦 flag-za south africa
🇿🇲 flag-zm zambia
🇿🇼 flag-zw zimbabwe
🏴󠁧󠁢󠁥󠁮󠁧󠁿 flag-england
🏴󠁧󠁢󠁳󠁣󠁴󠁿 flag-scotland
🏴󠁧󠁢󠁷󠁬󠁳󠁿 flag-wales`),ES.map(e=>{let{rank:n,nameRank:r}=Pfe(e,t);return{entry:e,rank:n,nameRank:r,centrality:Ffe(e,t)}}).filter(({rank:e})=>e<9).sort((e,t)=>e.rank-t.rank||e.nameRank-t.nameRank||e.centrality-t.centrality).slice(0,50).map(({entry:e})=>e)):[]},OS=(e,t)=>/^\s/.test(t)?e:`${e} `,kS=e=>e.match(jfe)?.groups?.query,AS=({anchorRect:e,listMaxHeight:t,viewport:n,rtl:r,listWidth:i=280})=>{let{width:a,height:o}=n,s=o-e.bottom,c=e.top,l=s<t+8&&c>s,u=r?e.right-i:e.left;return{top:l?void 0:`${Math.round(e.bottom+4)}px`,bottom:l?`${Math.round(o-e.top+4)}px`:void 0,left:`${Math.round(Math.max(8,Math.min(u,a-i-8)))}px`,maxHeight:`${Math.round(Math.min(t,(l?c:s)-4-8))}px`}},Lfe=B(`<div role="option" class="option svelte-1o09xgh" tabindex="-1"><span role="none" class="emoji svelte-1o09xgh"> </span> <span role="none" class="name svelte-1o09xgh"> </span></div>`),Rfe=B(`<div role="listbox" class="sui emoji-suggestions svelte-1o09xgh" popover="manual"></div>`),zfe={hash:`svelte-1o09xgh`,code:`.emoji-suggestions.svelte-1o09xgh {position:fixed;inset:auto;z-index:1000;display:flex;flex-direction:column;overflow-y:auto;margin:0;padding:var(--sui-listbox-padding, 4px);width:280px;font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);-webkit-user-select:none;user-select:none;border-width:var(--sui-listbox-border-width, 1px);border-style:var(--sui-listbox-border-style, solid);border-color:var(--sui-listbox-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-listbox-border-radius, 4px);color:var(--sui-primary-foreground-color);background-color:var(--sui-secondary-background-color-translucent);box-shadow:0 8px 16px var(--sui-popup-shadow-color);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);}.option.svelte-1o09xgh {flex:none;display:flex;align-items:center;gap:8px;border-radius:var(--sui-option-border-radius);padding:var(--sui-option-padding);min-height:var(--sui-option-height);cursor:default;}.option[aria-selected=true].svelte-1o09xgh {color:var(--sui-highlight-foreground-color);background-color:var(--sui-hover-background-color);}.option.svelte-1o09xgh .emoji:where(.svelte-1o09xgh) {flex:none;width:1.5em;font-size:var(--sui-font-size-large);text-align:center;}.option.svelte-1o09xgh .name:where(.svelte-1o09xgh) {flex:auto;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}`};function jS(e,t){let n=mo();O(t,!0),K(e,zfe);let r=J(t,`ariaOwner`,3,void 0),i=j(void 0),a=j(Xi([])),o=j(0),s=j(void 0),c=j(void 0),l=j(void 0),u=A(()=>!!z(i)&&!!z(a).length),d=j(0),f=j(0),p=A(()=>z(d)?z(d)*5+z(f):180),m=A(()=>z(s)?AS({anchorRect:z(s),listMaxHeight:z(p),viewport:{width:window.innerWidth,height:window.innerHeight},rtl:Tc()}):void 0),h=()=>z(u),g=(e=!1)=>{eo(()=>{M(l,e&&z(i)?z(i).id:void 0,!0),M(i,void 0),M(a,[],!0),M(o,0),M(s,void 0)})},_=e=>{if(!e){(z(i)||z(l))&&g();return}if(z(l)===e.id)return;let{id:n,query:r}=e;M(l,void 0),M(s,t.getAnchorRect(e),!0),z(i)?.id===n&&z(i).query===r?M(i,e,!0):(M(i,e,!0),M(a,Ife(r),!0),M(o,0))},v=e=>{let{length:t}=z(a);t&&M(o,(z(o)+e+t)%t)},y=()=>{let e=z(a)[z(o)];e&&z(i)&&t.onSelect(e,z(i)),g()},b=e=>{let{key:t,altKey:n,ctrlKey:r,metaKey:i,shiftKey:a}=e;if(!z(u)||n||r||i)return!1;if(t===`ArrowDown`||t===`ArrowUp`)v(t===`ArrowDown`?1:-1);else if((t===`Enter`||t===`Tab`)&&!a)y();else if(t===`Escape`)g(!0);else return!1;return e.preventDefault(),!0};L(()=>{if(z(a),!z(c))return;z(c).matches(`:popover-open`)||z(c).showPopover?.();let e=z(c).querySelector(`.option`);if(e){let{paddingTop:t,paddingBottom:n,borderTopWidth:r,borderBottomWidth:i}=getComputedStyle(z(c));M(d,e.getBoundingClientRect().height,!0),M(f,Number.parseFloat(t)+Number.parseFloat(n)+Number.parseFloat(r)+Number.parseFloat(i))}}),L(()=>{if(!r())return;let e=r();return e.setAttribute(`aria-autocomplete`,`list`),e.setAttribute(`aria-haspopup`,`listbox`),()=>{e.removeAttribute(`aria-autocomplete`),e.removeAttribute(`aria-haspopup`)}}),L(()=>{if(!r())return;let e=r();return z(u)?(e.setAttribute(`aria-controls`,n),e.setAttribute(`aria-activedescendant`,`${n}-option-${z(o)}`)):(e.removeAttribute(`aria-controls`),e.removeAttribute(`aria-activedescendant`)),()=>{e.removeAttribute(`aria-controls`),e.removeAttribute(`aria-activedescendant`)}}),L(()=>{z(o),z(c)?.querySelector(`[aria-selected="true"]`)?.scrollIntoView({block:`nearest`,behavior:`instant`})}),So(()=>{let e=()=>{z(i)&&M(s,t.getAnchorRect(z(i)),!0)},n=({target:e})=>{let t=e;!z(u)||z(c)?.contains(t)||r()?.contains(t)||g()};return window.addEventListener(`scroll`,e,{capture:!0,passive:!0}),window.addEventListener(`resize`,e,{passive:!0}),document.addEventListener(`pointerdown`,n,{capture:!0}),()=>{window.removeEventListener(`scroll`,e,{capture:!0}),window.removeEventListener(`resize`,e),document.removeEventListener(`pointerdown`,n,{capture:!0})}});var x={isOpen:h,close:g,update:_,moveSelection:v,selectHighlighted:y,handleKeyDown:b},S=H(),C=P(S),w=e=>{var t=Rfe();let r;No(t,23,()=>z(a),e=>e.emoji,(e,t,r)=>{var i=Lfe(),a=N(i),s=F(a,!0),c=F(I(a,2),!0);D(i),R(()=>{q(i,`id`,`${n}-option-${z(r)}`),q(i,`aria-selected`,z(r)===z(o)),W(s,z(t).emoji),W(c,`:${z(t).name}:`)}),oo(`mouseenter`,i,()=>{M(o,z(r),!0)}),so(`mousedown`,i,e=>{e.preventDefault(),M(o,z(r),!0),y()}),U(e,i)}),D(t),gs(t,e=>M(c,e),()=>z(c)),R(e=>{q(t,`id`,n),q(t,`aria-label`,e),r=ts(t,``,r,{top:z(m).top,bottom:z(m).bottom,left:z(m).left,"max-height":z(m).maxHeight})},[()=>Y(`_sui.emoji_suggestions`)]),U(e,t)};return G(C,e=>{z(u)&&z(m)&&e(w)}),U(e,S),k(x)}co([`mousedown`]);function MS(e,t){O(t,!0);let n=J(t,`element`,3,void 0),r=j(void 0),i=()=>{if(!n()||n().disabled||n().readOnly)return;let{value:e,selectionStart:t,selectionEnd:r}=n();if(t===null||t!==r)return;let i=kS(e.slice(0,t));if(i===void 0)return;let a=t-i.length-1;return{id:String(a),query:i,start:a,end:t}},a=e=>{let{start:t,end:r}=e;return n()?Afe(n(),t,r):void 0},o=(e,t)=>{let{query:r,start:i,end:a}=t;if(!n()||n().value.slice(i,a)!==`:${r}`)return;let o=OS(e.emoji,n().value.slice(a));n().focus(),n().setSelectionRange(i,a);let s=!1;try{s=document.execCommand(`insertText`,!1,o)}catch{s=!1}s||(n().setRangeText(o,i,a,`end`),n().dispatchEvent(new Event(`input`,{bubbles:!0})))},s=e=>{z(r)?.handleKeyDown(e)};L(()=>{if(!n()||!z(r))return;let e=n(),t=()=>{z(r)?.update(i())},a=()=>{z(r)?.close()};return e.addEventListener(`keydown`,s),e.addEventListener(`keyup`,t),e.addEventListener(`input`,t),e.addEventListener(`mouseup`,t),e.addEventListener(`blur`,a),()=>{e.removeEventListener(`keydown`,s),e.removeEventListener(`keyup`,t),e.removeEventListener(`input`,t),e.removeEventListener(`mouseup`,t),e.removeEventListener(`blur`,a),z(r)?.close()}}),gs(jS(e,{getAnchorRect:a,onSelect:o,get ariaOwner(){return n()}}),e=>M(r,e,!0),()=>z(r)),k()}var Bfe=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`element`,`role`,`keyShortcuts`,`dir`,`name`,`showInlineLabel`,`inputmode`,`flex`,`monospace`,`debounce`,`useEmojiAutocomplete`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`ariaLabel`,`children`,`oninput`]),Vfe=B(`<span aria-hidden="true"><!></span>`),Hfe=B(`<div role="none"><input/> <!> <!></div>`),Ufe={hash:`svelte-1wg3odr`,code:`.text-input.svelte-1wg3odr {display:inline-flex;align-items:center;position:relative;margin:var(--sui-focus-ring-width);min-width:var(--sui-textbox-singleline-min-width);}.text-input.flex.svelte-1wg3odr:not([hidden]) {display:inline-flex;width:-moz-available;width:-webkit-fill-available;width:stretch;min-width:0;}.text-input.monospace.svelte-1wg3odr {--sui-textbox-font-family: var(--sui-font-family-monospace, monospace);}input.svelte-1wg3odr:is(:where(.svelte-1wg3odr):-webkit-autofill, :where(.svelte-1wg3odr):-webkit-autofill:focus) {transition:background-color 0s 600000s, color 0s 600000s;}input.svelte-1wg3odr {display:inline-block;flex:auto;min-width:0;height:var(--sui-textbox-height);border-width:var(--sui-textbox-border-width, 1px);border-color:var(--sui-textbox-border-color);border-radius:var(--sui-textbox-border-radius);padding:var(--sui-textbox-singleline-padding);color:var(--sui-textbox-foreground-color);background-color:var(--sui-textbox-background-color);font-family:var(--sui-textbox-font-family);font-size:var(--sui-textbox-font-size);line-height:var(--sui-textbox-singleline-line-height);font-weight:var(--sui-textbox-font-weight, var(--sui-font-weight-normal, normal));letter-spacing:var(--sui-textbox-letter-spacing, normal);transition:all 200ms;text-align:var(--sui-textbox-text-align, start);text-indent:var(--sui-textbox-text-indent, 0);text-transform:var(--sui-textbox-text-transform, none);word-spacing:var(--sui-word-spacing-normal, normal);}input.svelte-1wg3odr:focus {color:var(--sui-textbox-foreground-color-focus, var(--sui-textbox-foreground-color));background-color:var(--sui-textbox-background-color-focus, var(--sui-textbox-background-color));}input[aria-invalid=true].svelte-1wg3odr {border-color:var(--sui-error-border-color);}input.svelte-1wg3odr:read-only {color:var(--sui-secondary-foreground-color);border-color:var(--sui-textbox-border-color) !important;}input.svelte-1wg3odr:is(:where(.svelte-1wg3odr):disabled, :where(.svelte-1wg3odr):read-only) {background-color:var(--sui-disabled-background-color);}input.svelte-1wg3odr ~ button {flex:none;margin-inline-start:-1px;border-width:1px;border-color:var(--sui-textbox-border-color);height:var(--sui-textbox-height);aspect-ratio:1/1;}input.svelte-1wg3odr ~ button:last-child {border-start-start-radius:0;border-start-end-radius:4px;border-end-end-radius:4px;border-end-start-radius:0;}input.svelte-1wg3odr ~ button .icon {font-size:var(--sui-font-size-xx-large);}.label.svelte-1wg3odr {position:absolute;inset:var(--sui-textbox-singleline-padding);z-index:2;display:flex;align-items:center;justify-content:var(--sui-textbox-placeholder-text-align, var(--sui-textbox-text-align, start));pointer-events:none;}.label.hidden.svelte-1wg3odr {opacity:0;}input.svelte-1wg3odr:focus + .label:where(.svelte-1wg3odr) {opacity:0;}input.svelte-1wg3odr::placeholder,
.label.svelte-1wg3odr {color:var(--sui-textbox-placeholder-foreground-color, var(--sui-textbox-foreground-color));opacity:var(--sui-textbox-placeholder-opacity, 0.5);font-family:var(--sui-textbox-placeholder-font-family, var(--sui-textbox-font-family));font-size:var(--sui-textbox-placeholder-font-size, var(--sui-textbox-font-size));line-height:var(--sui-textbox-placeholder-singleline-line-height, var(--sui-textbox-singleline-line-height));font-weight:var(--sui-textbox-placeholder-font-weight, var(--sui-textbox-font-weight, var(--sui-font-weight-normal, normal)));text-align:var(--sui-textbox-placeholder-text-align, var(--sui-textbox-text-align, start));text-indent:var(--sui-textbox-placeholder-text-indent, var(--sui-textbox-text-indent, 0));letter-spacing:var(--sui-textbox-placeholder-letter-spacing, var(--sui-textbox-letter-spacing, normal));}`};function NS(e,t){let n=mo();O(t,!0),K(e,Ufe);let r=J(t,`value`,15),i=J(t,`element`,15),a=J(t,`role`,3,`textbox`),o=J(t,`keyShortcuts`,3,void 0),s=J(t,`dir`,3,void 0),c=J(t,`name`,3,void 0),l=J(t,`showInlineLabel`,3,!1),u=J(t,`inputmode`,3,`text`),d=J(t,`flex`,3,!1),f=J(t,`monospace`,3,!1),p=J(t,`debounce`,3,!1),m=J(t,`useEmojiAutocomplete`,3,!1),h=J(t,`hidden`,3,!1),g=J(t,`disabled`,3,!1),_=J(t,`readonly`,3,!1),v=J(t,`required`,3,!1),y=J(t,`invalid`,3,!1),b=J(t,`ariaLabel`,3,void 0),x=vs(t,Bfe),S=A(()=>typeof p()==`number`?p():300),C=A(()=>b()??x[`aria-label`]),w=0;L(()=>()=>{clearTimeout(w)});let T=e=>{r(i()?.value),t.oninput?.(e)},ee=e=>{let t=e;p()?(clearTimeout(w),w=setTimeout(()=>{T(t)},z(S))):T(t)};var E=Hfe();let te;var ne=N(E);fs(ne,()=>({type:`text`,...x,value:r(),role:a(),dir:s(),name:c(),tabindex:g()?-1:0,disabled:g()||void 0,readonly:_()||void 0,inputmode:u(),"aria-label":z(C),"aria-hidden":h(),"aria-disabled":g(),"aria-readonly":_(),"aria-required":v(),"aria-invalid":y(),oninputcapture:ee}),void 0,void 0,void 0,`svelte-1wg3odr`,!0),gs(ne,e=>i(e),()=>i()),qo(ne,()=>jx(o()));var re=I(ne,2),ie=e=>{MS(e,{get element(){return i()}})};G(re,e=>{m()&&!g()&&!_()&&e(ie)});var ae=I(re,2),oe=e=>{var t=Vfe();let i;Nx(N(t),{children:(e,t)=>{Ur();var n=V();R(()=>W(n,z(C))),U(e,n)},$$slots:{default:!0}}),D(t),R(()=>{q(t,`id`,`${n}-label`),i=$o(t,1,`label svelte-1wg3odr`,null,i,{hidden:!!r()})}),U(e,t)};G(ae,e=>{z(C)&&l()&&e(oe)}),D(E),R(()=>{te=$o(E,1,`sui text-input ${t.class??``}`,`svelte-1wg3odr`,te,{flex:d(),monospace:f(),disabled:g(),readonly:_()}),q(E,`hidden`,h()),ne.dir=ne.dir}),U(e,E),k()}var Wfe=new Set([`$$slots`,`$$events`,`$$legacy`,`open`,`value`,`title`,`textboxAttrs`,`children`,`input`,`onkeydown`,`onkeyup`,`onkeypress`,`oninput`]),Gfe=B(`<!> <div class="input-outer svelte-jdntpg"><!></div>`,1),Kfe={hash:`svelte-jdntpg`,code:`.input-outer.svelte-jdntpg {margin:12px 0 0;}`};function PS(e,t){O(t,!0),K(e,Kfe);let n=J(t,`open`,15,!1),r=J(t,`value`,15,``),i=J(t,`textboxAttrs`,19,()=>({})),a=vs(t,Wfe);SS(e,ys(()=>a,{get title(){return t.title},role:`alertdialog`,get open(){return n()},set open(e){n(e)},children:(e,n)=>{var a=Gfe(),o=P(a);xo(o,()=>t.children??Cr);var s=I(o,2),c=N(s),l=e=>{var n=H();xo(P(n),()=>t.input),U(e,n)},u=e=>{{let n=A(()=>`aria-labelledby`in i()?void 0:t.title);NS(e,ys({dir:`auto`,flex:!0,autofocus:!0,get"aria-label"(){return z(n)}},i,{get onkeydown(){return t.onkeydown},get onkeyup(){return t.onkeyup},get onkeypress(){return t.onkeypress},get oninput(){return t.oninput},get value(){return r()},set value(e){r(e)}}))}};G(c,e=>{t.input?e(l):e(u,-1)}),D(s),U(e,a)},$$slots:{default:!0}})),k()}var qfe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`orientation`,`ariaLabel`]),Jfe=B(`<div></div>`),Yfe={hash:`svelte-1jh0ljl`,code:`.divider.svelte-1jh0ljl {flex:none;background-color:var(--sui-secondary-border-color);}.divider[aria-orientation=horizontal].svelte-1jh0ljl {margin:8px 0;width:100%;height:1px;}.divider[aria-orientation=vertical].svelte-1jh0ljl {margin:0 8px;width:1px;height:100%;}`};function FS(e,t){K(e,Yfe);let n=J(t,`hidden`,3,!1),r=J(t,`orientation`,3,`horizontal`),i=J(t,`ariaLabel`,3,void 0),a=vs(t,qfe);var o=Jfe();fs(o,()=>({...a,role:`separator`,class:`sui divider ${t.class??``}`,hidden:n(),"aria-hidden":n(),"aria-orientation":r(),"aria-label":i()}),void 0,void 0,void 0,`svelte-1jh0ljl`),U(e,o)}var Xfe=(e,t)=>e===`top`||e===`bottom`?{axis:`Y`,sign:e===`bottom`?1:-1}:{axis:`X`,sign:e===`right`===t?-1:1},Zfe=(e,t)=>Math.max(0,e*t),IS=(e,t)=>[...e.filter(({time:e})=>t.time-e<=100),t],Qfe=e=>{let t=e[0],n=e[e.length-1];return!t||!n||n.time<=t.time?0:(n.offset-t.offset)/(n.time-t.time)},$fe=({offset:e,size:t,velocity:n})=>e>0&&(e>=t*.3||e>=16&&n>=.5),epe=new Set([`$$slots`,`$$events`,`$$legacy`,`open`,`class`,`title`,`ariaLabelledby`,`position`,`size`,`showClose`,`swipeDismiss`,`children`,`header`,`headerExtra`,`footer`,`closeIcon`]),LS=B(`<div role="none" class="handle svelte-3nf8k9"></div>`),tpe=B(`<div role="none" class="header svelte-3nf8k9"><div role="none" class="title svelte-3nf8k9"> </div> <!> <!> <!></div>`),npe=B(`<div role="none" class="footer svelte-3nf8k9"><!></div>`),rpe=B(`<div role="none"><!> <div role="none" class="extra-control svelte-3nf8k9"><!></div> <!> <div role="none" class="main svelte-3nf8k9"><!></div> <!> <!></div>`),ipe={hash:`svelte-3nf8k9`,code:`.content.svelte-3nf8k9 {position:absolute;display:flex;flex-direction:column;max-width:100dvw;max-height:100dvh;border-width:var(--sui-drawer-content-border-width, var(--sui-modal-border-width, 0));border-style:solid;border-color:var(--sui-drawer-content-border-color, var(--sui-primary-border-color));background-color:var(--sui-secondary-background-color-translucent);box-shadow:0 8px 16px var(--sui-popup-shadow-color);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);transition-property:transform;}.content.svelte-3nf8k9 .extra-control:where(.svelte-3nf8k9) {position:absolute;}.content.svelte-3nf8k9 .extra-control:where(.svelte-3nf8k9) button.close {margin:8px;}dialog.open .content.svelte-3nf8k9 {transition-duration:150ms;transform:translateX(0%);}dialog:not(.open) .content.svelte-3nf8k9 {transition-duration:300ms;}.content.right.svelte-3nf8k9 {inset-block:var(--sui-drawer-right-content-inset-block, 0);inset-inline:var(--sui-drawer-right-content-inset-inline, auto 0);border-start-start-radius:var(--sui-drawer-right-content-border-start-start-radius, var(--sui-drawer-content-border-start-start-radius, 4px));border-start-end-radius:var(--sui-drawer-right-content-border-start-end-radius, var(--sui-drawer-content-border-start-end-radius, 0));border-end-end-radius:var(--sui-drawer-right-content-border-end-end-radius, var(--sui-drawer-content-border-end-end-radius, 0));border-end-start-radius:var(--sui-drawer-right-content-border-end-start-radius, var(--sui-drawer-content-border-end-start-radius, 4px));}.content.right.full.svelte-3nf8k9 {border-radius:var(--sui-drawer-right-full-content-border-radius, var(--sui-drawer-right-content-border-radius, 0));}.content.right.svelte-3nf8k9 .extra-control:where(.svelte-3nf8k9) {inset-block-start:0;inset-inline-end:100%;}dialog:not(.open) .content.right.svelte-3nf8k9:dir(ltr) {transform:translateX(105%);}dialog:not(.open) .content.right.svelte-3nf8k9:dir(rtl) {transform:translateX(-105%);}.content.left.svelte-3nf8k9 {inset-block:var(--sui-drawer-left-content-inset-block, 0);inset-inline:var(--sui-drawer-left-content-inset-inline, 0 auto);border-start-start-radius:var(--sui-drawer-left-content-border-start-start-radius, var(--sui-drawer-content-border-start-start-radius, 0));border-start-end-radius:var(--sui-drawer-left-content-border-start-end-radius, var(--sui-drawer-content-border-start-end-radius, 4px));border-end-end-radius:var(--sui-drawer-left-content-border-end-end-radius, var(--sui-drawer-content-border-end-end-radius, 4px));border-end-start-radius:var(--sui-drawer-left-content-border-end-start-radius, var(--sui-drawer-content-border-end-start-radius, 0));}.content.left.full.svelte-3nf8k9 {border-radius:var(--sui-drawer-left-full-content-border-radius, var(--sui-drawer-left-content-border-radius, 0));}.content.left.svelte-3nf8k9 .extra-control:where(.svelte-3nf8k9) {inset-block-start:0;inset-inline-start:100%;}dialog:not(.open) .content.left.svelte-3nf8k9:dir(ltr) {transform:translateX(-105%);}dialog:not(.open) .content.left.svelte-3nf8k9:dir(rtl) {transform:translateX(105%);}dialog.open .content.vertical.svelte-3nf8k9 {transform:translateX(0%);}.content.vertical.small.svelte-3nf8k9 {width:var(--sui-drawer-vertical-small-width, var(--sui-drawer-vertical-width, 400px));max-width:var(--sui-drawer-vertical-small-max-width, var(--sui-drawer-vertical-max-width, calc(100dvw - 56px)));height:var(--sui-drawer-vertical-small-height, var(--sui-drawer-vertical-height, 100dvh));}.content.vertical.medium.svelte-3nf8k9 {width:var(--sui-drawer-vertical-medium-width, var(--sui-drawer-vertical-width, 600px));max-width:var(--sui-drawer-vertical-medium-max-width, var(--sui-drawer-vertical-max-width, calc(100dvw - 56px)));height:var(--sui-drawer-vertical-medium-height, var(--sui-drawer-vertical-height, 100dvh));}.content.vertical.large.svelte-3nf8k9 {width:var(--sui-drawer-vertical-large-width, var(--sui-drawer-vertical-width, 800px));max-width:var(--sui-drawer-vertical-large-max-width, var(--sui-drawer-vertical-max-width, calc(100dvw - 56px)));height:var(--sui-drawer-vertical-large-height, var(--sui-drawer-vertical-height, 100dvh));}.content.vertical.x-large.svelte-3nf8k9 {width:var(--sui-drawer-vertical-x-large-width, var(--sui-drawer-vertical-width, 1000px));max-width:var(--sui-drawer-vertical-x-large-max-width, var(--sui-drawer-vertical-max-width, calc(100dvw - 56px)));height:var(--sui-drawer-vertical-x-large-height, var(--sui-drawer-vertical-height, 100dvh));}.content.vertical.full.svelte-3nf8k9 {width:100dvw;max-width:100dvw;height:100dvh;}.content.top.svelte-3nf8k9 {inset-block-start:var(--sui-drawer-top-content-inset-block, 0);inset-inline:var(--sui-drawer-top-content-inset-inline, 0 0);border-start-start-radius:var(--sui-drawer-top-content-border-start-start-radius, var(--sui-drawer-content-border-start-start-radius, 0));border-start-end-radius:var(--sui-drawer-top-content-border-start-end-radius, var(--sui-drawer-content-border-start-end-radius, 0));border-end-end-radius:var(--sui-drawer-top-content-border-end-end-radius, var(--sui-drawer-content-border-end-end-radius, 4px));border-end-start-radius:var(--sui-drawer-top-content-border-end-start-radius, var(--sui-drawer-content-border-end-start-radius, 4px));}.content.top.full.svelte-3nf8k9 {border-radius:var(--sui-drawer-top-full-content-border-radius, var(--sui-drawer-top-content-border-radius, 0));}.content.top.svelte-3nf8k9 .extra-control:where(.svelte-3nf8k9) {inset-block-start:100%;inset-inline-end:0;}dialog:not(.open) .content.top.svelte-3nf8k9 {transform:translateY(-105%);}.content.bottom.svelte-3nf8k9 {inset-block:var(--sui-drawer-bottom-content-inset-block, auto 0);inset-inline:var(--sui-drawer-bottom-content-inset-inline, 0);border-start-start-radius:var(--sui-drawer-bottom-content-border-start-start-radius, var(--sui-drawer-content-border-start-start-radius, 4px));border-start-end-radius:var(--sui-drawer-bottom-content-border-start-end-radius, var(--sui-drawer-content-border-start-end-radius, 4px));border-end-end-radius:var(--sui-drawer-bottom-content-border-end-end-radius, var(--sui-drawer-content-border-end-end-radius, 0));border-end-start-radius:var(--sui-drawer-bottom-content-border-end-start-radius, var(--sui-drawer-content-border-end-start-radius, 0));}.content.bottom.full.svelte-3nf8k9 {border-radius:var(--sui-drawer-bottom-full-content-border-radius, var(--sui-drawer-bottom-content-border-radius, 0));}.content.bottom.svelte-3nf8k9 .extra-control:where(.svelte-3nf8k9) {inset-block-end:100%;inset-inline-end:0;}dialog:not(.open) .content.bottom.svelte-3nf8k9 {transform:translateY(105%);}dialog.open .content.horizontal.svelte-3nf8k9 {transform:translateY(0%);}.content.horizontal.small.svelte-3nf8k9 {width:var(--sui-drawer-horizontal-small-width, var(--sui-drawer-horizontal-width, 100dvw));height:var(--sui-drawer-horizontal-small-height, var(--sui-drawer-horizontal-height, 400px));max-height:var(--sui-drawer-horizontal-small-max-height, var(--sui-drawer-horizontal-max-height, calc(100dvh - 56px)));}.content.horizontal.medium.svelte-3nf8k9 {width:var(--sui-drawer-horizontal-medium-width, var(--sui-drawer-horizontal-width, 100dvw));height:var(--sui-drawer-horizontal-medium-height, var(--sui-drawer-horizontal-height, 600px));max-height:var(--sui-drawer-horizontal-medium-max-height, var(--sui-drawer-horizontal-max-height, calc(100dvh - 56px)));}.content.horizontal.large.svelte-3nf8k9 {width:var(--sui-drawer-horizontal-large-width, var(--sui-drawer-horizontal-width, 100dvw));height:var(--sui-drawer-horizontal-large-height, var(--sui-drawer-horizontal-height, 800px));max-height:var(--sui-drawer-horizontal-large-max-height, var(--sui-drawer-horizontal-max-height, calc(100dvh - 56px)));}.content.horizontal.x-large.svelte-3nf8k9 {width:var(--sui-drawer-horizontal-x-large-width, var(--sui-drawer-horizontal-width, 100dvw));height:var(--sui-drawer-horizontal-x-large-height, var(--sui-drawer-horizontal-height, 1000px));max-height:var(--sui-drawer-horizontal-x-large-max-height, var(--sui-drawer-horizontal-max-height, calc(100dvh - 56px)));}.content.horizontal.full.svelte-3nf8k9 {width:100dvw;height:100dvh;max-height:100dvh;}.content.swipe-dismiss.svelte-3nf8k9 > :not(.main, .footer, .extra-control) {touch-action:none;user-select:none;}.content.swipe-dismiss.swiping.svelte-3nf8k9, .content.swipe-dismiss.swiping.svelte-3nf8k9 .handle:where(.svelte-3nf8k9) {cursor:grabbing;}.handle.svelte-3nf8k9 {flex:none;display:flex;justify-content:center;padding:8px 0;cursor:grab;}.handle.svelte-3nf8k9::before {content:"";border-radius:2px;width:32px;height:4px;background-color:var(--sui-drawer-handle-color, var(--sui-secondary-foreground-color));opacity:0.5;}:is(.header.svelte-3nf8k9, .footer.svelte-3nf8k9) {display:flex;align-items:center;gap:8px;}.header.svelte-3nf8k9 {flex-direction:var(--sui-drawer-header-flex-direction, row);box-sizing:content-box;margin:var(--sui-drawer-header-margin, 0 16px);border-width:var(--sui-drawer-header-border-width, 0 0 1px);border-color:var(--sui-drawer-header-border-color, var(--sui-secondary-border-color));padding:var(--sui-drawer-header-padding, 16px 8px);height:var(--sui-drawer-header-height, 32px);}.header.svelte-3nf8k9 .title:where(.svelte-3nf8k9) {font-size:var(--sui-font-size-large);font-weight:var(--sui-font-weight-bold);}.footer.svelte-3nf8k9 {margin:0 24px 24px;}.main.svelte-3nf8k9 {flex:auto;overflow:auto;padding:var(--sui-drawer-main-padding, 24px);white-space:normal;}`};function ape(e,t){let n=mo();O(t,!0),K(e,ipe);let r=J(t,`open`,15,!1),i=J(t,`title`,3,``),a=J(t,`ariaLabelledby`,3,void 0),o=J(t,`position`,3,`right`),s=J(t,`size`,3,`small`),c=J(t,`showClose`,3,`outside`),l=J(t,`swipeDismiss`,3,!1),u=vs(t,epe),d=j(void 0),f=A(()=>o()===`right`||o()===`left`?`vertical`:`horizontal`),p=j(void 0),m=j(void 0),h=j(0),g=e=>{let{button:t,isPrimary:n,pointerId:r,target:i,clientX:a,clientY:s}=e;if(!l()||!z(p)||z(m)||t!==0||!n)return;let c=i.closest(`.main, .footer, .extra-control, a, button, input, select, textarea, [contenteditable], [tabindex]`);if(c&&z(p).contains(c))return;let{axis:u,sign:d}=Xfe(o(),z(p).matches(`:dir(rtl)`));M(m,{pointerId:r,axis:u,sign:d,start:u===`Y`?s:a,samples:[]}),M(h,0),z(p).setPointerCapture(r)},_=e=>{let{pointerId:t,clientX:n,clientY:r,timeStamp:i}=e;z(m)&&t===z(m).pointerId&&(M(h,Zfe((z(m).axis===`Y`?r:n)-z(m).start,z(m).sign),!0),z(m).samples=IS(z(m).samples,{offset:z(h),time:i}))},v=e=>{if(!z(m)||!z(p)||e.pointerId!==z(m).pointerId)return;let{width:t,height:n}=z(p).getBoundingClientRect(),r=IS(z(m).samples,{offset:z(h),time:e.timeStamp}),i=e.type===`pointerup`&&$fe({offset:z(h),size:z(m).axis===`Y`?n:t,velocity:Qfe(r)});M(m,void 0),M(h,0),i&&z(d)?.close(`close`)};L(()=>{r()||eo(()=>{M(m,void 0),M(h,0)})});let y=A(()=>a()??(!t.header&&i()?`${n}-title`:void 0)),b=A(()=>z(y)?void 0:i()||void 0);gs(qx(e,ys(()=>u,{get id(){return n},class:`drawer`,get"aria-label"(){return z(b)},get"aria-labelledby"(){return z(y)},showBackdrop:!0,get open(){return r()},set open(e){r(e)},children:(e,r)=>{var a=rpe();let u;var y=N(a),b=e=>{U(e,LS())};G(y,e=>{l()&&o()===`bottom`&&e(b)});var x=I(y,2),S=N(x),C=e=>{bS(e,{class:`close`,get controls(){return n},get closeIcon(){return t.closeIcon},onClose:()=>{z(d)?.close(`close`)}})};G(S,e=>{c()===`outside`&&e(C)}),D(x);var w=I(x,2),T=e=>{var r=H(),a=P(r),o=e=>{var n=H();xo(P(n),()=>t.header),U(e,n)},s=e=>{var r=tpe(),a=N(r),o=F(a,!0),s=I(a,2);yS(s,{flex:!0});var l=I(s,2);xo(l,()=>t.headerExtra??Cr);var u=I(l,2),f=e=>{bS(e,{class:`close`,get controls(){return n},get closeIcon(){return t.closeIcon},onClose:()=>{z(d)?.close(`close`)}})};G(u,e=>{c()===`inside`&&e(f)}),D(r),R(()=>{q(a,`id`,`${n}-title`),W(o,i())}),U(e,r)};G(a,e=>{t.header?e(o):e(s,-1)}),U(e,r)};G(w,e=>{(i()||c()===`inside`||t.header||t.headerExtra)&&e(T)});var ee=I(w,2);xo(N(ee),()=>t.children??Cr),D(ee);var E=I(ee,2),te=e=>{var n=npe();xo(N(n),()=>t.footer??Cr),D(n),U(e,n)};G(E,e=>{t.footer&&e(te)});var ne=I(E,2),re=e=>{U(e,LS())};G(ne,e=>{l()&&o()===`top`&&e(re)}),D(a),gs(a,e=>M(p,e),()=>z(p)),R(()=>{$o(a,1,Yo([`content`,t.class,s(),o(),z(f),{"swipe-dismiss":l(),swiping:!!z(m)}]),`svelte-3nf8k9`),u=ts(a,``,u,{transform:z(m)?`translate${z(m).axis}(${z(m).sign*z(h)}px)`:void 0,"transition-duration":z(m)?`0s`:void 0})}),so(`pointerdown`,a,g),so(`pointermove`,a,_),so(`pointerup`,a,v),oo(`pointercancel`,a,v),U(e,a)},$$slots:{default:!0}})),e=>M(d,e,!0),()=>z(d)),k()}co([`pointerdown`,`pointermove`,`pointerup`]);var ope=B(`<input class="sui file-picker" type="file" hidden=""/>`);function RS(e,t){O(t,!0);let n=J(t,`accept`,3,void 0),r=J(t,`multiple`,3,!1),i=J(t,`onSelect`,3,void 0),a=J(t,`onCancel`,3,void 0),o=j(void 0);var s={open:()=>{z(o)?.click()}},c=ope();return gs(c,e=>M(o,e),()=>z(o)),R(()=>{q(c,`accept`,n()),c.multiple=r()}),so(`change`,c,({target:e})=>{let t=e,n=[...t.files];t.value=``,i()?.({files:n,file:n[0]})}),oo(`cancel`,c,e=>{e.stopPropagation(),a()?.()}),U(e,c),k(s)}co([`change`]);var spe=new Set([`$$slots`,`$$events`,`$$legacy`,`expanded`,`class`,`label`,`collapsible`,`children`,`chevronIcon`,`onChange`]),cpe=B(`<span role="none" class="chevron svelte-1wjtopa"><!></span>`),lpe=B(`<div role="row" class="row-group-caption svelte-1wjtopa" data-selectable="false"><!></div>`),upe=B(`<div><!> <!></div>`),dpe={hash:`svelte-1wjtopa`,code:`[role=rowgroup].svelte-1wjtopa {display:table-row-group;}[role=row].svelte-1wjtopa {display:table-row;}[role=columnheader].svelte-1wjtopa {display:table-cell;padding:8px;color:var(--sui-secondary-foreground-color);background-color:var(--sui-secondary-background-color);font-size:var(--sui-font-size-default);text-align:start;}[role=columnheader].svelte-1wjtopa:has(> .expander) {padding:0;}[role=columnheader].svelte-1wjtopa .expander {justify-content:flex-start;margin:0;border-radius:0;padding:4px 8px 4px 4px;width:100%;height:auto;color:inherit;font-size:inherit;text-align:start;}.chevron.svelte-1wjtopa {flex:none;display:flex;align-items:center;justify-content:center;transition:transform 200ms;}.expander[aria-expanded='true'] > .chevron.svelte-1wjtopa:dir(ltr) {transform:rotate(90deg);}.expander[aria-expanded='true'] > .chevron.svelte-1wjtopa:dir(rtl) {transform:rotate(-90deg);}`};function zS(e,t){let n=mo();O(t,!0),K(e,dpe);let r=J(t,`expanded`,15,!0),i=J(t,`label`,3,``),a=J(t,`collapsible`,3,!1),o=vs(t,spe),s=A(()=>a()&&!!i()),c=()=>{r(!r()),t.onChange?.(new CustomEvent(`Change`,{detail:{expanded:r()}}))},l=e=>{let t=t=>{z(s)&&t.target===e&&c()};return e.addEventListener(`click`,t),()=>{e.removeEventListener(`click`,t)}};var u=upe();fs(u,e=>({...o,role:`rowgroup`,class:`sui grid-body row-group ${t.class??``}`,"aria-labelledby":i()?`${n}-label`:void 0,"aria-roledescription":e}),[()=>Y(`_sui.role_descriptions.grid_body`)],void 0,void 0,`svelte-1wjtopa`);var d=N(u),f=e=>{var a=lpe();Bte(N(a),()=>`th`,!1,(e,a)=>{fs(e,()=>({role:`columnheader`,id:`${n}-label`,colspan:`9999`,class:``}),void 0,void 0,void 0,`svelte-1wjtopa`);var o=H(),l=P(o),u=e=>{Xx(e,{class:`expander`,get label(){return i()},tabindex:`-1`,get"aria-expanded"(){return r()},onclick:c,startIcon:e=>{var n=cpe(),r=N(n),i=e=>{var n=H();xo(P(n),()=>t.chevronIcon),U(e,n)},a=e=>{{let t=A(()=>Tc()?`chevron_left`:`chevron_right`);gx(e,{get name(){return z(t)}})}};G(r,e=>{t.chevronIcon?e(i):e(a,-1)}),D(n),U(e,n)},$$slots:{startIcon:!0}})},d=e=>{var t=V();R(()=>W(t,i())),U(e,t)};G(l,e=>{z(s)?e(u):e(d,-1)}),U(a,o)}),D(a),qo(a,()=>l),U(e,a)};G(d,e=>{i()&&e(f)});var p=I(d,2),m=e=>{var n=H();xo(P(n),()=>t.children??Cr),U(e,n)};G(p,e=>{(!z(s)||r())&&e(m)}),D(u),U(e,u),k()}var fpe=new Set([`$$slots`,`$$events`,`$$legacy`,`role`,`kind`,`class`,`children`]),ppe=B(`<div><!></div>`),mpe={hash:`svelte-thpva3`,code:`.table-head.svelte-thpva3,
.grid-head.svelte-thpva3 {display:table-header-group;}.table-foot.svelte-thpva3,
.grid-foot.svelte-thpva3 {display:table-footer-group;}.table-row.svelte-thpva3,
.grid-row.svelte-thpva3 {display:table-row;height:var(--sui-primary-row-height);}.table-col-header.svelte-thpva3,
.grid-col-header.svelte-thpva3,
.table-cell.svelte-thpva3,
.grid-cell.svelte-thpva3 {display:table-cell;}.table-row-header.svelte-thpva3,
.grid-row-header.svelte-thpva3 {display:table-cell;height:var(--sui-secondary-row-height);}`};function BS(e,t){K(e,mpe);let n=vs(t,fpe);var r=ppe();fs(r,()=>({...n,role:t.role,class:`sui ${t.kind??``} ${t.class??``}`}),void 0,void 0,void 0,`svelte-thpva3`),xo(N(r),()=>t.children??Cr),D(r),U(e,r)}var hpe=new Set([`$$slots`,`$$events`,`$$legacy`]);function VS(e,t){let n=vs(t,hpe);BS(e,ys(()=>n,{role:`gridcell`,kind:`grid-cell`}))}var gpe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`sortOrder`,`children`,`onSort`]),_pe={hash:`svelte-p4j81a`,code:`:where(.sui.grid-col-header.sortable) {position:relative;}.sui.grid-col-header.sortable > .sui.button.sort-button {justify-content:flex-start;margin:0;border-radius:0;padding:0;width:100%;height:auto;color:inherit;font:inherit;text-align:start;}.sui.grid-col-header.sortable > .sui.button.sort-button::after {position:absolute;inset:0;content:"";}.sui.grid-col-header.sortable > .sui.button.sort-button .sort-icon {flex:none;font-size:16px;transition:opacity 200ms;}.sui.grid-col-header.sortable > .sui.button.sort-button .sort-icon.none {opacity:0;}.sui.grid-col-header.sortable > .sui.button.sort-button:is(:hover, :focus-visible) .sort-icon.none {opacity:0.4;}
@media (hover: none) {.sui.grid-col-header.sortable > .sui.button.sort-button .sort-icon.none {opacity:0.4;}
}`};function HS(e,t){O(t,!0),K(e,_pe);let n=J(t,`sortOrder`,3,void 0),r=vs(t,gpe),i=e=>{let r=r=>{r.stopPropagation(),e.focus(),t.onSort?.(new CustomEvent(`Sort`,{detail:{sortOrder:n()===`ascending`?`descending`:`ascending`}}))},i=e=>{let{key:t}=e;(t===`Enter`||t===` `)&&e.stopPropagation()};return e.addEventListener(`click`,r),e.addEventListener(`keydown`,i),()=>{e.removeEventListener(`click`,r),e.removeEventListener(`keydown`,i)}};var a=H(),o=P(a),s=e=>{BS(e,ys(()=>r,{role:`columnheader`,kind:`grid-col-header`,get class(){return t.class},children:(e,n)=>{var r=H();xo(P(r),()=>t.children??Cr),U(e,r)},$$slots:{default:!0}}))},c=e=>{{let a=A(()=>t.class?`sortable ${t.class}`:`sortable`),o=A(()=>n()===`none`?void 0:n());BS(e,ys(()=>r,{role:`columnheader`,kind:`grid-col-header`,get class(){return z(a)},get"aria-sort"(){return z(o)},children:(e,r)=>{{let r=e=>{{let t=A(()=>n()===`descending`?`arrow_downward`:`arrow_upward`);gx(e,{get class(){return`sort-icon ${n()??``}`},get name(){return z(t)}})}};Xx(e,{class:`sort-button`,[wo()]:i,endIcon:r,children:(e,n)=>{var r=H();xo(P(r),()=>t.children??Cr),U(e,r)},$$slots:{endIcon:!0,default:!0}})}},$$slots:{default:!0}}))}};G(o,e=>{n()===void 0?e(s):e(c,-1)}),U(e,a),k()}var vpe=new Set([`$$slots`,`$$events`,`$$legacy`]);function ype(e,t){O(t,!0);let n=vs(t,vpe);ti(`sui:grid-unselectable-rows`,!0);{let t=A(()=>Y(`_sui.role_descriptions.grid_head`));BS(e,ys(()=>n,{role:`rowgroup`,kind:`grid-head`,get"aria-roledescription"(){return z(t)}}))}k()}var bpe=new Set([`$$slots`,`$$events`,`$$legacy`,`selected`]);function US(e,t){O(t,!0);let n=J(t,`selected`,3,!1),r=vs(t,bpe),i=ei(`sui:grid-unselectable-rows`)===!0,a=A(()=>{if(!i)return{...r,"aria-selected":n()};let{"aria-selected":e,...t}=r;return{...t,"data-selectable":`false`}}),o=e=>{let t=t=>{let n=e.querySelector(`.sort-button`);t.target===e&&n&&(t.stopPropagation(),n.focus())};return e.addEventListener(`click`,t),()=>{e.removeEventListener(`click`,t)}};var s=H(),c=P(s),l=e=>{BS(e,ys(()=>z(a),{role:`row`,kind:`grid-row`,tabindex:`0`,[wo()]:o}))},u=e=>{BS(e,ys(()=>z(a),{role:`row`,kind:`grid-row`,tabindex:`0`}))};G(c,e=>{i?e(l):e(u,-1)}),U(e,s),k()}var xpe=new Set([`$$slots`,`$$events`,`$$legacy`,`element`,`class`,`multiple`,`clickToSelect`,`ariaLabel`,`children`,`onChange`]),Spe=B(`<div><!></div>`),Cpe={hash:`svelte-hrfl0r`,code:`.grid.svelte-hrfl0r {display:table;margin:var(--sui-focus-ring-width);width:calc(100% - var(--sui-focus-ring-width) * 2);}.grid.data.svelte-hrfl0r {border-collapse:collapse;}.grid.data.svelte-hrfl0r :is(.grid-col-header, .grid-row-header, .grid-cell) {border:1px solid var(--sui-secondary-border-color);padding:8px 8px;}`};function wpe(e,t){O(t,!0),K(e,Cpe);let n=J(t,`element`,15),r=J(t,`multiple`,3,!1),i=J(t,`clickToSelect`,3,!0),a=J(t,`ariaLabel`,3,void 0),o=vs(t,xpe);ti(`sui:grid-unselectable-rows`,!1);var s=Spe(),c=e=>{t.onChange?.(e)};fs(s,()=>({...o,role:`grid`,class:`sui grid ${t.class??``}`,"aria-multiselectable":r(),"aria-label":a(),onChange:c}),void 0,void 0,void 0,`svelte-hrfl0r`),xo(N(s),()=>t.children??Cr),D(s),gs(s,e=>n(e),()=>n()),qo(s,()=>fS({clickToSelect:i()})),U(e,s),k()}var Tpe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`multiple`,`searchTerms`,`ariaLabel`,`children`,`onFilter`]),Epe=B(`<div><div role="none" class="inner svelte-syg9gt"><!></div></div>`),Dpe={hash:`svelte-syg9gt`,code:`[role=listbox].svelte-syg9gt {display:flex;flex-direction:column;margin:var(--sui-focus-ring-width);border-width:var(--sui-listbox-border-width, 1px);border-style:var(--sui-listbox-border-style, solid);border-color:var(--sui-listbox-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-listbox-border-radius, 4px);padding:var(--sui-listbox-padding, 4px);min-width:var(--sui-listbox-min-width, calc(var(--sui-option-height) * 5));color:var(--sui-listbox-foreground-color);background-color:var(--sui-listbox-background-color);font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);}[role=listbox].svelte-syg9gt [role=separator] {margin:4px 0;background-color:var(--sui-control-border-color);}[role=listbox][aria-invalid=true].svelte-syg9gt {border-color:var(--sui-error-border-color);}[role=listbox].tabs.svelte-syg9gt {padding:0;border-block-start-width:0;border-block-end-width:0;border-inline-end-width:1px;border-inline-start-width:0;border-color:var(--sui-control-border-color);}[role=listbox].tabs.svelte-syg9gt .option button {justify-content:flex-start;border-width:0;border-inline-end-width:2px;border-color:transparent;padding:0 12px;border-start-end-radius:0;border-end-end-radius:0;height:var(--sui-tab-medium-height);}[role=listbox].tabs.svelte-syg9gt .option button[aria-selected=true] {border-color:var(--sui-primary-accent-color-light);}[role=listbox].tabs.svelte-syg9gt .option button .icon {display:none;}[role=listbox].tabs[aria-readonly=true].svelte-syg9gt .option button[aria-selected='true'] {border-color:var(--sui-readonly-accent-color);}[role=listbox].in-combobox.svelte-syg9gt:focus-visible, [role=listbox].svelte-syg9gt:focus-visible:has(.focused) {outline-color:transparent;}[role=listbox].filtered.svelte-syg9gt [role=separator] {display:none;}.inner.svelte-syg9gt {display:contents;}`};function WS(e,t){O(t,!0),K(e,Dpe);let n=J(t,`hidden`,3,!1),r=J(t,`disabled`,3,!1),i=J(t,`readonly`,3,!1),a=J(t,`required`,3,!1),o=J(t,`invalid`,3,!1),s=J(t,`multiple`,3,!1),c=J(t,`searchTerms`,3,``),l=J(t,`ariaLabel`,3,void 0),u=vs(t,Tpe),d=j(!1);var f=Epe(),p=e=>{let{detail:{matched:n,total:r}}=e;M(d,n!==r),t.onFilter?.(e)};fs(f,()=>({...u,role:`listbox`,class:`sui listbox ${t.class??``}`,tabindex:r()?-1:0,hidden:n(),"aria-hidden":n(),"aria-disabled":r(),"aria-readonly":i(),"aria-required":a(),"aria-invalid":o(),"aria-multiselectable":s(),"aria-label":l(),onFilter:p,[ss]:{filtered:z(d)}}),void 0,void 0,void 0,`svelte-syg9gt`);var m=N(f);xo(N(m),()=>t.children??Cr),D(m),D(f),qo(f,()=>fS(()=>({searchTerms:c()}))),R(()=>m.inert=r()),U(e,f),k()}var Ope=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`label`,`children`]),kpe=B(`<div><div role="none" class="label svelte-lqtkkl"><!></div> <div role="none" class="inner svelte-lqtkkl"><!></div></div>`),Ape={hash:`svelte-lqtkkl`,code:`.option-group.svelte-lqtkkl:not(:first-child) {margin:12px 0 0;}.label.svelte-lqtkkl {margin:8px;color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);}.inner.svelte-lqtkkl {display:contents;}`};function GS(e,t){let n=mo();O(t,!0),K(e,Ape);let r=J(t,`hidden`,3,!1),i=J(t,`disabled`,3,!1),a=J(t,`label`,3,``),o=vs(t,Ope);var s=kpe();fs(s,e=>({...o,role:`group`,id:n,class:`sui option-group ${t.class??``}`,hidden:r(),"aria-hidden":r(),"aria-disabled":i(),"aria-labelledby":`${n}-label`,"aria-roledescription":e}),[()=>Y(`_sui.role_descriptions.option_group`)],void 0,void 0,`svelte-lqtkkl`);var c=N(s);Nx(N(c),{children:(e,t)=>{Ur();var n=V();R(()=>W(n,a())),U(e,n)},$$slots:{default:!0}}),D(c);var l=I(c,2);xo(N(l),()=>t.children??Cr),D(l),D(s),R(()=>{q(c,`id`,`${n}-label`),l.inert=i()}),U(e,s),k()}var jpe=new Set([`$$slots`,`$$events`,`$$legacy`,`selected`,`hidden`,`class`,`disabled`,`label`,`value`,`searchValue`,`wrap`,`children`,`checkIcon`,`startIcon`,`onChange`,`onToggle`]),Mpe=B(`<!> <!>`,1),Npe=B(`<div role="none"><!></div>`),Ppe={hash:`svelte-10nr3xf`,code:`.option.svelte-10nr3xf {display:contents;}.option.svelte-10nr3xf:focus-visible {outline-width:0 !important;}.option.wrap.svelte-10nr3xf button {white-space:normal;}.option.svelte-10nr3xf button {flex:none;display:flex;gap:4px;margin:0 !important;border-radius:var(--sui-option-border-radius);padding:var(--sui-option-padding);width:100%;height:auto;min-height:var(--sui-option-height);}.option.svelte-10nr3xf button:active {background-color:var(--sui-active-background-color);}.option.svelte-10nr3xf button[aria-selected=true] .icon.check {color:var(--sui-primary-accent-color-text);}.option.svelte-10nr3xf button * {flex:none;}.option.svelte-10nr3xf button .label {flex:auto;}.option.svelte-10nr3xf :is(.focused, button:hover) {color:var(--sui-highlight-foreground-color);background-color:var(--sui-hover-background-color);}.option.svelte-10nr3xf .icon.check {margin:-2px;}[role='listbox']:focus-visible .option.svelte-10nr3xf .focused {outline-color:var(--sui-focus-ring-color);outline-offset:calc(var(--sui-focus-ring-width) * -1);}[role='listbox'][aria-readonly='true'] .option.svelte-10nr3xf button {cursor:default;}[role='listbox'][aria-readonly='true'] .option.svelte-10nr3xf button:not(.focused):is(:hover, :active) {color:var(--sui-control-foreground-color);background-color:transparent;}[role='listbox'][aria-readonly='true'] .option.svelte-10nr3xf button[aria-selected=true] .icon.check {color:var(--sui-readonly-accent-color);}`};function KS(e,t){let n=mo();O(t,!0),K(e,Ppe);let r=J(t,`selected`,15,!1),i=J(t,`hidden`,15,!1),a=J(t,`disabled`,3,!1),o=J(t,`value`,3,void 0),s=J(t,`searchValue`,3,void 0),c=J(t,`wrap`,3,!1),l=vs(t,jpe),u=A(()=>o()===void 0?t.label:o()),d=A(()=>s()===void 0?t.label:s()),f=Gde();f&&Co(f.register({get value(){return z(u)},get label(){return t.label},get name(){return t.name},get type(){return t.valueType??Mx(z(u))},get selected(){return r()},set selected(e){r(e)},get disabled(){return a()}}));let p=A(()=>!f||f.expanded);var m=H(),h=P(m),g=e=>{var o=Npe();let s;var f=N(o);{let e=e=>{var n=H();xo(P(n),()=>t.startIcon??Cr),U(e,n)},o=A(()=>t.id??n);Xx(f,ys(()=>l,{role:`option`,get id(){return z(o)},tabindex:`-1`,get"aria-selected"(){return r()},get label(){return t.label},get value(){return z(u)},get hidden(){return i()},get disabled(){return a()},get"data-search-value"(){return z(d)},onChange:e=>{r(e.detail.selected),t.onChange?.(e)},onToggle:e=>{i(e.detail.hidden),i()&&r(!1),t.onToggle?.(e)},startIcon:e,children:(e,n)=>{var i=Mpe(),a=P(i),o=e=>{var n=H(),r=P(n),i=e=>{var n=H();xo(P(n),()=>t.checkIcon),U(e,n)},a=e=>{gx(e,{class:`check`,name:`check`})};G(r,e=>{t.checkIcon?e(i):e(a,-1)}),U(e,n)};G(a,e=>{r()&&e(o)}),xo(I(a,2),()=>t.children??Cr),U(e,i)},$$slots:{startIcon:!0,default:!0}}))}D(o),R(()=>{s=$o(o,1,`sui option ${t.class??``}`,`svelte-10nr3xf`,s,{wrap:c()}),q(o,`hidden`,i())}),U(e,o)};G(h,e=>{z(p)&&e(g)}),U(e,m),k()}var Fpe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`ariaLabel`,`children`,`onChange`]),Ipe=B(`<div><!></div>`),Lpe={hash:`svelte-160pq2p`,code:`.menu.svelte-160pq2p {display:flex;flex-direction:column;margin:0;border-width:var(--sui-menu-border-width, 1px);border-style:var(--sui-menu-border-style, solid);border-color:var(--sui-menu-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-menu-border-radius, 4px);padding:var(--sui-menu-padding, 4px);}.menu.svelte-160pq2p [role=separator] {margin:var(--sui-menu-divider-margin, 4px);width:auto;background-color:var(--sui-menu-divider-color, var(--sui-control-border-color));}`};function qS(e,t){O(t,!0),K(e,Lpe);let n=J(t,`hidden`,3,!1),r=J(t,`disabled`,3,!1),i=J(t,`ariaLabel`,3,void 0),a=vs(t,Fpe);var o=Ipe(),s=e=>{t.onChange?.(e)};fs(o,()=>({...a,role:`menu`,class:`sui menu ${t.class??``}`,hidden:n(),"aria-hidden":n(),"aria-disabled":r(),"aria-label":i(),onChange:s}),void 0,void 0,void 0,`svelte-160pq2p`),xo(N(o),()=>t.children??Cr),D(o),qo(o,fS),U(e,o),k()}var Rpe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`role`,`hidden`,`disabled`,`label`,`labelDir`,`popupPosition`,`children`,`startIcon`,`endIcon`,`chevronIcon`,`items`,`onmouseenter`,`onmouseleave`,`onclick`,`onChange`,`onSelect`]),zpe=B(`<span role="none" class="icon-outer svelte-1r0q02h"><!></span>`),Bpe=B(`<div role="none"><!></div> <!>`,1),Vpe=B(`<div role="none"><!> <!></div>`),Hpe={hash:`svelte-1r0q02h`,code:`.menuitem.svelte-1r0q02h {position:relative;}.menuitem.svelte-1r0q02h button {display:flex;gap:var(--sui-menuitem-gap, 4px);align-items:var(--sui-menuitem-align-items, center);border-radius:var(--sui-menuitem-border-radius, var(--sui-option-border-radius, 4px));margin:0 !important;padding:var(--sui-menuitem-padding, 0 16px);width:100%;min-width:var(--sui-menuitem-min-width, 160px);height:var(--sui-menuitem-height, var(--sui-option-height));color:var(--sui-menuitem-foreground-color, var(--sui-control-foreground-color, inherit));background-color:var(--sui-menuitem-background-color, transparent);font-size:var(--sui-menuitem-font-size, var(--sui-option-font-size));font-weight:var(--sui-menuitem-font-weight, var(--sui-option-font-weight, var(--sui-font-weight-normal, normal)));}.menuitem.svelte-1r0q02h button[aria-checked=true] .icon {color:var(--sui-primary-accent-color-text);}.menuitem.svelte-1r0q02h button:hover {color:var(--sui-highlight-foreground-color);background-color:var(--sui-hover-background-color);}.menuitem.svelte-1r0q02h button:active {background-color:var(--sui-active-background-color);}.content.svelte-1r0q02h {flex:auto;}.icon-outer.svelte-1r0q02h {flex:none;width:24px;height:24px;}`};function JS(e,t){O(t,!0),K(e,Hpe);let n=J(t,`role`,3,`menuitem`),r=J(t,`hidden`,3,!1),i=J(t,`disabled`,3,!1),a=J(t,`label`,3,``),o=J(t,`labelDir`,3,void 0),s=J(t,`popupPosition`,3,`right-top`),c=vs(t,Rpe),l=j(!1),u=j(!1),d,f=j(void 0),p=j(void 0),m=A(()=>n()===`menuitem`&&!!t.items),h=e=>{window.clearTimeout(d),d=window.setTimeout(e,200)};So(()=>(M(p,z(f)?.closest(`dialog`)??void 0,!0),()=>{window.clearTimeout(d)}));var g=Vpe(),_=N(g);{let e=e=>{var n=H();xo(P(n),()=>t.startIcon??Cr),U(e,n)},s=e=>{var n=Bpe(),r=P(n);let i;var s=N(r),c=e=>{var t=V();R(()=>W(t,a())),U(e,t)},l=e=>{var n=H();xo(P(n),()=>t.children??Cr),U(e,n)};G(s,e=>{a()?e(c):e(l,-1)}),D(r);var u=I(r,2),d=e=>{var n=zpe(),r=N(n),i=e=>{var n=H();xo(P(n),()=>t.chevronIcon),U(e,n)},a=e=>{{let t=A(()=>Tc()?`chevron_left`:`chevron_right`);gx(e,{get name(){return z(t)}})}};G(r,e=>{t.chevronIcon?e(i):e(a,-1)}),D(n),U(e,n)};G(u,e=>{z(m)&&e(d)}),R(()=>{i=$o(r,1,`content svelte-1r0q02h`,null,i,{label:!!a()}),q(r,`dir`,a()?o():void 0),r.dir=r.dir}),U(e,n)},p=e=>{var n=H();xo(P(n),()=>t.endIcon??Cr),U(e,n)},g=A(()=>z(m)?`menu`:void 0),v=A(()=>z(m)?z(l):void 0);Xx(_,ys(()=>c,{get role(){return n()},get hidden(){return r()},get disabled(){return i()},get"aria-haspopup"(){return z(g)},get"aria-expanded"(){return z(v)},onmouseenter:e=>{z(m)&&h(()=>{M(l,!0)}),t.onmouseenter?.(e)},onmouseleave:e=>{z(m)&&h(()=>{z(u)||M(l,!1)}),t.onmouseleave?.(e)},onclick:e=>{z(m)&&(e.preventDefault(),e.stopPropagation(),window.clearTimeout(d),M(l,e.detail?!0:!z(l),!0)),t.onclick?.(e)},get onChange(){return t.onChange},get onSelect(){return t.onSelect},get element(){return z(f)},set element(e){M(f,e,!0)},startIcon:e,children:s,endIcon:p,$$slots:{startIcon:!0,default:!0,endIcon:!0}}))}var v=I(_,2),y=e=>{Jx(e,{get anchor(){return z(f)},get parentDialogElement(){return z(p)},get position(){return s()},get open(){return z(l)},set open(e){M(l,e,!0)},get hovered(){return z(u)},set hovered(e){M(u,e,!0)},children:(e,n)=>{qS(e,{children:(e,n)=>{var r=H();xo(P(r),()=>t.items??Cr),U(e,r)},$$slots:{default:!0}})},$$slots:{default:!0}})};G(v,e=>{z(m)&&z(f)&&z(p)&&e(y)}),D(g),R(()=>{$o(g,1,`sui menuitem ${t.class??``}`,`svelte-1r0q02h`),q(g,`hidden`,r())}),U(e,g),k()}var Upe=new Set([`$$slots`,`$$events`,`$$legacy`,`role`,`checked`,`class`,`hidden`,`disabled`,`label`,`children`,`startIcon`,`onChange`]);function Wpe(e,t){O(t,!0);let n=J(t,`checked`,15),r=J(t,`hidden`,3,!1),i=J(t,`disabled`,3,!1),a=J(t,`label`,3,``),o=vs(t,Upe),s=A(()=>t.role===`menuitemradio`?`menu-item-radio`:`menu-item-checkbox`);JS(e,ys(()=>o,{get role(){return t.role},get class(){return`sui ${z(s)??``} ${t.class??``}`},get label(){return a()},get hidden(){return r()},get disabled(){return i()},get"aria-checked"(){return n()},onChange:e=>{n(e.detail.checked),t.onChange?.(e)},startIcon:e=>{var n=H();xo(P(n),()=>t.startIcon??Cr),U(e,n)},children:e=>{var n=H();xo(P(n),()=>t.children??Cr),U(e,n)},endIcon:e=>{var t=H(),r=P(t),i=e=>{gx(e,{name:`check`})};G(r,e=>{n()&&e(i)}),U(e,t)},$$slots:{startIcon:!0,default:!0,endIcon:!0}})),k()}var Gpe=new Set([`$$slots`,`$$events`,`$$legacy`,`checked`]);function YS(e,t){O(t,!0);let n=J(t,`checked`,15),r=vs(t,Gpe);Wpe(e,ys(()=>r,{role:`menuitemcheckbox`,get checked(){return n()},set checked(e){n(e)}})),k()}var Kpe=new Set([`$$slots`,`$$events`,`$$legacy`,`checked`]);function XS(e,t){O(t,!0);let n=J(t,`checked`,15),r=vs(t,Kpe);Wpe(e,ys(()=>r,{role:`menuitemradio`,get checked(){return n()},set checked(e){n(e)}})),k()}var qpe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`now`,`min`,`max`,`text`,`ariaLabel`]),Jpe=B(`<div><div role="none" class="svelte-qb1hkd"></div></div>`),Ype={hash:`svelte-qb1hkd`,code:`.progressbar.svelte-qb1hkd {overflow:hidden;border-width:var(--sui-progressbar-border-width, 1px);border-style:var(--sui-progressbar-border-style, solid);border-color:var(--sui-progressbar-border-color, var(--sui-control-border-color));border-radius:var(--sui-progressbar-border-radius, 16px);width:var(--sui-progressbar-width, 240px);height:var(--sui-progressbar-height, 10px);background-color:var(--sui-progressbar-background-color, var(--sui-secondary-background-color));}.progressbar.svelte-qb1hkd div:where(.svelte-qb1hkd) {height:100%;background-color:var(--sui-progressbar-foreground-color, var(--sui-primary-accent-color-light));transition:width 250ms;}`};function Xpe(e,t){K(e,Ype);let n=J(t,`now`,3,0),r=J(t,`min`,3,0),i=J(t,`max`,3,100),a=J(t,`ariaLabel`,3,void 0),o=vs(t,qpe),s=A(()=>i()>r()?Math.min(Math.max((n()-r())/(i()-r())*100,0),100):0);var c=Jpe();fs(c,()=>({...o,role:`progressbar`,class:`sui progressbar ${t.class??``}`,"aria-valuenow":n(),"aria-valuemin":r(),"aria-valuemax":i(),"aria-valuetext":t.text,"aria-label":a()}),void 0,void 0,void 0,`svelte-qb1hkd`);var l=N(c);let u;D(c),R(()=>u=ts(l,``,u,{width:`${z(s)}%`})),U(e,c)}var Zpe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`orientation`,`ariaLabel`,`children`,`onChange`]),Qpe=B(`<div><div role="none" class="inner svelte-o5i0vz"><!></div></div>`),$pe={hash:`svelte-o5i0vz`,code:`.radio-group.svelte-o5i0vz {display:inline-flex;}.radio-group.svelte-o5i0vz:focus-visible {outline-width:0 !important;}.radio-group.horizontal.svelte-o5i0vz {gap:8px;align-items:center;flex-wrap:wrap;}.radio-group.vertical.svelte-o5i0vz {gap:4px;flex-direction:column;}
@media (pointer: coarse) {.radio-group.vertical.svelte-o5i0vz {gap:8px;}
}.radio-group[aria-invalid=true].svelte-o5i0vz button {border-color:var(--sui-error-border-color);}.radio-group[aria-invalid=true].svelte-o5i0vz button[aria-checked=true] {border-color:var(--sui-error-border-color);}.radio-group[aria-invalid=true].svelte-o5i0vz button[aria-checked=true]::before {background-color:var(--sui-error-border-color);}.inner.svelte-o5i0vz {display:contents;}`};function eme(e,t){O(t,!0),K(e,$pe);let n=J(t,`hidden`,3,!1),r=J(t,`disabled`,3,!1),i=J(t,`readonly`,3,!1),a=J(t,`required`,3,!1),o=J(t,`invalid`,3,!1),s=J(t,`orientation`,3,`horizontal`),c=J(t,`ariaLabel`,3,void 0),l=vs(t,Zpe);var u=Qpe(),d=e=>{t.onChange?.(e)};fs(u,()=>({...l,role:`radiogroup`,class:[`sui`,`radio-group`,t.class,s()],tabindex:`-1`,hidden:n(),"aria-hidden":n(),"aria-disabled":r(),"aria-readonly":i(),"aria-required":a(),"aria-invalid":o(),"aria-orientation":s(),"aria-label":c(),onChange:d}),void 0,void 0,void 0,`svelte-o5i0vz`);var f=N(u);xo(N(f),()=>t.children??Cr),D(f),D(u),qo(u,fS),R(()=>f.inert=r()),U(e,u),k()}var tme=new Set([`$$slots`,`$$events`,`$$legacy`,`checked`,`class`,`hidden`,`disabled`,`name`,`value`,`valueType`,`label`,`ariaLabel`,`group`,`children`,`onChange`,`onSelect`]),nme=B(`<label class="svelte-10l2bnt"><!></label>`),rme=B(`<span role="none"><!> <!></span>`),ime={hash:`svelte-10l2bnt`,code:`.radio.svelte-10l2bnt {display:inline-flex;align-items:center;gap:8px;margin:var(--sui-focus-ring-width);min-width:24px;min-height:24px;color:var(--sui-control-foreground-color);font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);cursor:pointer;-webkit-user-select:none;user-select:none;}.radio.svelte-10l2bnt:hover button {background-color:var(--sui-hover-background-color);}.radio.svelte-10l2bnt:hover button[aria-checked=true] {border-color:var(--sui-primary-accent-color-light);color:var(--sui-primary-accent-color-text);}.radio.svelte-10l2bnt:hover button[aria-checked=true]::before {background-color:var(--sui-primary-accent-color-light);}.radio.svelte-10l2bnt:active button {background-color:var(--sui-active-background-color);}.radio.svelte-10l2bnt:active button[aria-checked=true] {border-color:var(--sui-primary-accent-color-dark);color:var(--sui-primary-accent-color-dark);}.radio.svelte-10l2bnt button {flex:none;justify-content:center;overflow:hidden;margin:0 !important;border-width:1.5px;border-color:var(--sui-checkbox-border-color);border-radius:var(--sui-checkbox-height);padding:0;width:var(--sui-checkbox-height);height:var(--sui-checkbox-height);background-color:var(--sui-checkbox-background-color);transition:all 200ms;}.radio.svelte-10l2bnt button::before {content:"";border-radius:var(--sui-checkbox-height);width:calc(var(--sui-checkbox-height) - 7px);height:calc(var(--sui-checkbox-height) - 7px);background-color:var(--sui-primary-accent-color);opacity:0;transition:all 200ms;will-change:opacity;}.radio.svelte-10l2bnt button[aria-checked=true] {border-color:var(--sui-primary-accent-color);}.radio.svelte-10l2bnt button[aria-checked=true]::before {opacity:1;}.radio.svelte-10l2bnt label:where(.svelte-10l2bnt) {cursor:inherit;}[role='radiogroup'][aria-readonly='true'] .radio.svelte-10l2bnt {cursor:default;}[role='radiogroup'][aria-readonly='true'] .radio.svelte-10l2bnt button, [role='radiogroup'][aria-readonly='true'] .radio.svelte-10l2bnt:is(:where(.svelte-10l2bnt):hover, :where(.svelte-10l2bnt):active) button {background-color:var(--sui-checkbox-background-color);}[role='radiogroup'][aria-readonly='true'] .radio.svelte-10l2bnt button[aria-checked='true'], [role='radiogroup'][aria-readonly='true'] .radio.svelte-10l2bnt:is(:where(.svelte-10l2bnt):hover, :where(.svelte-10l2bnt):active) button[aria-checked='true'] {border-color:var(--sui-readonly-accent-color);}[role='radiogroup'][aria-readonly='true'] .radio.svelte-10l2bnt button[aria-checked='true']::before, [role='radiogroup'][aria-readonly='true'] .radio.svelte-10l2bnt:is(:where(.svelte-10l2bnt):hover, :where(.svelte-10l2bnt):active) button[aria-checked='true']::before {background-color:var(--sui-readonly-accent-color);}`};function ZS(e,t){let n=mo();O(t,!0),K(e,ime);let r=J(t,`checked`,7,!1),i=J(t,`hidden`,3,!1),a=J(t,`disabled`,3,!1),o=J(t,`name`,3,void 0),s=J(t,`value`,3,void 0),c=J(t,`valueType`,3,void 0),l=J(t,`label`,3,void 0),u=J(t,`ariaLabel`,3,void 0),d=J(t,`group`,15),f=vs(t,tme),p=j(void 0),m=A(()=>_S({id:n,ariaLabel:u()??f[`aria-label`],hasVisibleLabel:!!(t.children||l())})),h=()=>!!z(p)?.closest(`[role="radiogroup"]`)?.matches(`[aria-readonly="true"]`);L(()=>{typeof d()==`string`&&(d()===s()?r()||r(!0):r()&&r(!1))});var g=rme();let _;var v=N(g);Xx(v,ys(()=>f,{role:`radio`,get id(){return n},get hidden(){return i()},get disabled(){return a()},get name(){return o()},get value(){return s()},get valueType(){return c()},get"aria-checked"(){return r()}},()=>z(m),{onclick:e=>{e.preventDefault(),a()||r()||h()||(r(!0),typeof d()==`string`&&d(s()))},onChange:e=>{r(e.detail.checked),r()&&typeof d()==`string`&&d(s()),t.onChange?.(e)},get onSelect(){return t.onSelect},get element(){return z(p)},set element(e){M(p,e,!0)}}));var y=I(v,2),b=e=>{var r=nme(),i=N(r),a=e=>{var n=H();xo(P(n),()=>t.children??Cr),U(e,n)},o=e=>{var t=V();R(()=>W(t,l())),U(e,t)};G(i,e=>{t.children?e(a):e(o,-1)}),D(r),R(()=>q(r,`id`,`${n}-label`)),U(e,r)};G(y,e=>{(t.children||l())&&e(b)}),D(g),R(()=>{_=$o(g,1,`sui radio ${t.class??``}`,`svelte-10l2bnt`,_,{disabled:a()}),q(g,`hidden`,i())}),so(`click`,g,e=>{e.target.matches(`button`)||z(p)?.click()}),U(e,g),k()}co([`click`]);var QS=(e,t,n)=>{if(typeof e==`number`)return e;if(!e||typeof e!=`string`)return t;let r=e.trim(),i=r.match(/^(-?\d+(?:\.\d+)?)%$/);if(i)return Number(i[1]);let{containerSize:a}=n;if(!a)return t;let o=r.match(/^(-?\d+(?:\.\d+)?)px$/i);if(o)return Number(o[1])/a*100;let s=r.match(/^(-?\d+(?:\.\d+)?)(dvw|vw|dvh|vh)$/i);if(s){let e=Number(s[1]),t=s[2].toLowerCase().endsWith(`w`)?n.viewportWidth:n.viewportHeight;return e/100*t/a*100}return t},$S=(e,t)=>{if(!e)return{minSize:0,maxSize:100};let n=Math.max(0,QS(e.minSize,0,t)),r=Math.min(100,QS(e.maxSize,100,t));return{minSize:n,maxSize:Math.max(n,r)}},ame=(e,t,n,r)=>{let i=r,a=n;for(;a.length&&Math.abs(i)>1e-9;){let n=i/a.length,r=a.map(r=>{let{minSize:i,maxSize:a}=t[r],o=Math.min(a,Math.max(i,e[r]+n)),s=o-e[r];return e[r]=o,s});i-=r.reduce((e,t)=>e+t,0),a=a.filter(r=>n>0?e[r]<t[r].maxSize:e[r]>t[r].minSize)}return i},ome=(e,t)=>{let n=e.filter(e=>!Number.isNaN(e)),r=n.reduce((e,t)=>e+t,0),i=e.length-n.length,a=Math.max(0,100-r),o=i>0?a/i:0,s=e.map(e=>Number.isNaN(e)?o:e);if(!t)return s;let c=s.reduce((e,t)=>e+t,0),l=s.map((e,n)=>t[n]??{minSize:0,maxSize:100}),u=s.map((e,t)=>Math.min(l[t].maxSize,Math.max(l[t].minSize,e))),d=s.map((e,t)=>t);return ame(u,l,d,ame(u,l,d.filter(t=>Number.isNaN(e[t])),c-u.reduce((e,t)=>e+t,0))),u},sme=(e,{sizeBefore:t,sizeAfter:n,constraintsBefore:r,constraintsAfter:i})=>{let a=Math.max(0,Math.min(r.maxSize-t,n-i.minSize)),o=Math.max(0,Math.min(t-r.minSize,i.maxSize-n));return e>0?Math.min(e,a):-Math.min(-e,o)},cme=(e,{neighbors:t,amount:n,exclude:r,getConstraints:i})=>{let a=n;return[...t,...e.map((e,t)=>t)].forEach(t=>{if(Math.abs(a)<.001||t===r||e[t]===void 0)return;let{minSize:n,maxSize:o}=i(t),s=Math.min(Math.max(e[t]+a,n),o);a-=s-e[t],e[t]=s}),a},lme=({key:e,shiftKey:t,isHorizontal:n,rtl:r})=>{if(e===`Enter`)return{type:`toggle`};if(e===`Home`)return{type:`resize`,delta:-100};if(e===`End`)return{type:`resize`,delta:100};let i=t?10:1,{prevKey:a,nextKey:o}=iS(n?`horizontal`:`vertical`,r);if(e===a)return{type:`resize`,delta:-i};if(e===o)return{type:`resize`,delta:i}},ume=new Set([`$$slots`,`$$events`,`$$legacy`,`disabled`,`showHandleBar`,`class`,`ariaLabel`,`children`,`onResizeStart`,`onResizeEnd`]),dme=B(`<div role="none" class="handle-bar svelte-d1909v"></div>`),fme=B(`<div><!></div>`),pme={hash:`svelte-d1909v`,code:`.resizable-handle.svelte-d1909v {position:relative;flex:0 0 auto;display:flex;align-items:center;justify-content:center;touch-action:none;outline-offset:0;background-color:transparent;transition:background-color 200ms;}.resizable-handle.svelte-d1909v:focus-visible, .resizable-handle.svelte-d1909v:hover, .resizable-handle.dragging.svelte-d1909v {outline:none;z-index:1;background-color:var(--sui-primary-accent-color-translucent-light);}.resizable-handle.svelte-d1909v:focus-visible .handle-bar:where(.svelte-d1909v), .resizable-handle.svelte-d1909v:hover .handle-bar:where(.svelte-d1909v), .resizable-handle.dragging.svelte-d1909v .handle-bar:where(.svelte-d1909v) {background-color:var(--sui-primary-accent-color);}.resizable-handle.disabled.svelte-d1909v {pointer-events:none;opacity:0.4;}.resizable-handle.svelte-d1909v::before {content:"";position:absolute;inset:0;z-index:1;}.resizable-handle.horizontal.svelte-d1909v {width:var(--sui-resizable-handle-size, 4px);height:100%;cursor:col-resize;}.resizable-handle.horizontal.svelte-d1909v::before {inset-inline:calc((var(--sui-resizable-handle-size, 4px) - 24px) / 2);}.resizable-handle.horizontal.svelte-d1909v .handle-bar:where(.svelte-d1909v) {width:2px;height:40%;min-height:20px;}.resizable-handle.vertical.svelte-d1909v {width:100%;height:var(--sui-resizable-handle-size, 4px);cursor:row-resize;}.resizable-handle.vertical.svelte-d1909v::before {inset-block:calc((var(--sui-resizable-handle-size, 4px) - 24px) / 2);}.resizable-handle.vertical.svelte-d1909v .handle-bar:where(.svelte-d1909v) {height:2px;width:40%;min-width:20px;}.resizable-handle.svelte-d1909v .handle-bar:where(.svelte-d1909v) {border-radius:1px;background-color:hsl(var(--sui-border-color-1-hsl));transition:background-color 200ms;}`};function mme(e,t){O(t,!0),K(e,pme);let n=J(t,`disabled`,3,!1),r=J(t,`showHandleBar`,3,!1),i=J(t,`ariaLabel`,3,void 0),a=vs(t,ume),o=ei(`paneGroup`);if(!o)throw Error(`<ResizableHandle> must be used inside a <ResizablePaneGroup>`);let s=j(void 0),c=o.registerHandle(()=>z(s)),l=A(()=>c.index);Co(()=>{c.unregister()});let u=A(()=>o.direction===`horizontal`),d=A(()=>o.sizes),f=A(()=>z(d)[z(l)]??0),p=A(()=>o.getPaneConstraints(z(l))),m=A(()=>o.getPaneConstraints(z(l)+1)),h=A(()=>z(f)+(z(d)[z(l)+1]??0)),g=A(()=>Math.max(z(p).minSize,z(h)-z(m).maxSize)),_=A(()=>Math.min(z(p).maxSize,z(h)-z(m).minSize)),v=j(!1),y=j(0),b=0,x=j(0),S=j(!1),C=0,w=e=>{let{screenX:t,screenY:r,pointerId:i}=e;if(n()||!z(v)||i!==z(x))return;e.preventDefault(),e.stopPropagation();let a=(z(u)?t:r)-z(y);if(!C)return;let s=a/C*100;z(u)&&Tc()&&(s=-s),o.resize(z(l),b+s-(z(d)[z(l)]??0))},T=e=>{let{pointerId:n}=e;z(v)&&n===z(x)&&(z(s)?.releasePointerCapture(n),M(v,!1),M(y,0),M(x,0),t.onResizeEnd?.(),document.removeEventListener(`pointermove`,w),document.removeEventListener(`pointerup`,T),document.removeEventListener(`pointercancel`,T))},ee=e=>{if(n())return;e.preventDefault(),e.stopPropagation();let{screenX:r,screenY:i,pointerId:a}=e;M(v,!0),M(y,z(u)?r:i,!0),b=z(d)[z(l)]??0,M(x,a,!0),C=o.measurePaneSpace(),z(s)?.setPointerCapture(a),t.onResizeStart?.(),document.addEventListener(`pointermove`,w),document.addEventListener(`pointerup`,T),document.addEventListener(`pointercancel`,T)},E=e=>{if(n())return;let{key:r,shiftKey:i}=e,a=lme({key:r,shiftKey:i,isHorizontal:z(u),rtl:Tc()});a&&(e.preventDefault(),e.stopPropagation(),a.type===`toggle`?o.toggleCollapse(z(l)):(r!==`Home`&&r!==`End`&&!z(S)&&(M(S,!0),t.onResizeStart?.()),o.resize(z(l),a.delta)))},te=()=>{z(S)&&(M(S,!1),t.onResizeEnd?.())};L(()=>()=>{document.removeEventListener(`pointermove`,w),document.removeEventListener(`pointerup`,T),document.removeEventListener(`pointercancel`,T)});var ne=fme();fs(ne,e=>({...a,role:`separator`,tabindex:n()?-1:0,"aria-orientation":z(u)?`vertical`:`horizontal`,"aria-valuenow":e,"aria-valuemin":z(g),"aria-valuemax":z(_),"aria-controls":o.paneDefs[z(l)]?.id,"aria-disabled":n()||void 0,"aria-label":i(),class:`sui resizable-handle ${t.class??``}`,onpointerdown:ee,onkeydown:E,onblur:te,[ss]:{horizontal:z(u),vertical:!z(u),disabled:n(),dragging:z(v)}}),[()=>Math.round(z(f))],void 0,void 0,`svelte-d1909v`);var re=N(ne),ie=e=>{var n=H();xo(P(n),()=>t.children),U(e,n)},ae=e=>{U(e,dme())};G(re,e=>{t.children?e(ie):r()&&e(ae,1)}),D(ne),gs(ne,e=>M(s,e),()=>z(s)),U(e,ne),k()}var hme=new Set([`$$slots`,`$$events`,`$$legacy`,`direction`,`class`,`children`,`onResize`]),gme=B(`<div><!></div>`),_me={hash:`svelte-1uairpd`,code:`.resizable-pane-group.svelte-1uairpd {display:flex;overflow:hidden;}.resizable-pane-group.horizontal.svelte-1uairpd {flex-direction:row;width:100%;height:100%;}.resizable-pane-group.vertical.svelte-1uairpd {flex-direction:column;width:100%;height:100%;}`};function vme(e,t){O(t,!0),K(e,_me);let n=J(t,`direction`,3,`horizontal`),r=vs(t,hme),i=j([]),a=j([]),o=j(void 0),s=Xi([]),c=Xi([]),l=()=>{if(!z(o))return 0;let e=n()===`horizontal`,t=e?z(o).clientWidth:z(o).clientHeight,r=[...z(o).querySelectorAll(`:scope > .resizable-handle`)].reduce((t,n)=>t+(e?n.offsetWidth:n.offsetHeight),0);return Math.max(t-r,0)},u=()=>({containerSize:l(),viewportWidth:window.innerWidth,viewportHeight:window.innerHeight}),d=e=>$S(z(i)[e],u()),f=``,p=()=>{if(!z(i).length)return;let e=u(),t=z(i).map(t=>t.defaultSize===void 0?NaN:QS(t.defaultSize,NaN,e)),n=z(i).map(t=>$S(t,e));s.splice(0,s.length,...ome(t,n)),f=s.map(e=>Number(e.toFixed(1))).join()},m=()=>{let e=s.map(e=>Number(e.toFixed(1))),n=e.join();n!==f&&(f=n,t.onResize?.({sizes:e}))},h=(e,t)=>{let n=e,r=e+1;if(n<0||r>=s.length)return;let i=s[n],a=s[r],o=sme(t,{sizeBefore:i,sizeAfter:a,constraintsBefore:d(n),constraintsAfter:d(r)});s[n]=i+o,s[r]=a-o,m()},g=e=>{let{minSize:t}=d(e);if(c[e]!==void 0&&Math.abs(s[e]-t)<.1){let t=c[e]-s[e];c[e]=void 0,h(e,t)}else c[e]=s[e],h(e,-(s[e]-t))},_=(e,t,n)=>cme(s,{neighbors:e,amount:t,exclude:n,getConstraints:d}),v=()=>{if(!z(o)||!s.length)return;let e=[...z(o).querySelectorAll(`:scope > .resizable-pane`)].map(({id:e})=>e),t=t=>{let n=e.indexOf(t.id);return n===-1?1/0:n},n=z(i).toSorted((e,n)=>t(e)-t(n)),r=n.map(e=>s[z(i).indexOf(e)]);n.some((e,t)=>e!==z(i)[t])&&(M(i,n),s.splice(0,s.length,...r),c.length=0),s.forEach((e,t)=>{if(!Number.isNaN(e))return;let n=u(),r=z(i)[t],{minSize:a,maxSize:o}=$S(r,n),c=r.defaultSize===void 0?NaN:QS(r.defaultSize,NaN,n),l=Math.min(Math.max(Number.isNaN(c)?100/s.length:c,a),o);s[t]=0,s[t]=l+_([t-1,t+1],-l,t)});let l=[...z(o).querySelectorAll(`:scope > .resizable-handle`)],d=e=>{let t=l.indexOf(e());return t===-1?1/0:t},f=z(a).toSorted((e,t)=>d(e)-d(t));f.some((e,t)=>e!==z(a)[t])&&(M(a,f),c.length=0),s.some(e=>Number.isNaN(e))||m()};ti(`paneGroup`,{get direction(){return n()},sizes:s,registerPane:e=>(M(i,[...z(i),e]),s.length&&s.push(NaN),{get index(){return z(i).indexOf(e)},unregister:()=>{let t=z(i).indexOf(e);if(t!==-1&&(M(i,z(i).toSpliced(t,1)),s.length)){let[e]=s.splice(t,1);c.length=0,s.length&&!Number.isNaN(e)&&_([t-1,t],e)}}}),registerHandle:e=>(M(a,[...z(a),e]),{get index(){return z(a).indexOf(e)},unregister:()=>{M(a,z(a).filter(t=>t!==e)),c.length=0}}),resize:h,toggleCollapse:g,getPaneConstraints:d,measurePaneSpace:l,get paneDefs(){return z(i)}}),L(()=>{z(i).length&&!s.length&&p()}),L(()=>{if(!z(o))return;let e=new MutationObserver(()=>v());return e.observe(z(o),{childList:!0}),()=>{e.disconnect()}});var y=gme();fs(y,()=>({...r,role:`none`,class:[`sui`,`resizable-pane-group`,n(),t.class],"data-direction":n()}),void 0,void 0,void 0,`svelte-1uairpd`),xo(N(y),()=>t.children??Cr),D(y),gs(y,e=>M(o,e),()=>z(o)),U(e,y),k()}var yme=new Set([`$$slots`,`$$events`,`$$legacy`,`defaultSize`,`minSize`,`maxSize`,`class`,`children`,`onResize`]),bme=B(`<div><!></div>`);function eC(e,t){let n=mo();O(t,!0);let r=J(t,`defaultSize`,3,void 0),i=J(t,`minSize`,3,0),a=J(t,`maxSize`,3,100),o=vs(t,yme),s=ei(`paneGroup`);if(!s)throw Error(`<ResizablePane> must be used inside a <ResizablePaneGroup>`);let c=s.registerPane({id:n,get defaultSize(){return r()},get minSize(){return i()},get maxSize(){return a()}}),l=A(()=>s.direction),u=A(()=>s.sizes[c.index]),d=A(()=>z(u)!==void 0&&!Number.isNaN(z(u))?`${z(u)}%`:typeof r()==`number`?`${r()}%`:r()??`0%`);Co(()=>{c.unregister()}),L(()=>{z(u)!==void 0&&!Number.isNaN(z(u))&&eo(()=>t.onResize?.({size:Number(z(u).toFixed(1))}))});var f=bme();fs(f,()=>({...o,id:n,role:`none`,class:`sui resizable-pane ${t.class??``}`,[cs]:{"flex-basis":z(d),"flex-grow":`0`,"flex-shrink":`1`,"overflow-x":z(l)===`horizontal`?`auto`:void 0,"overflow-y":z(l)===`vertical`?`auto`:void 0}})),xo(N(f),()=>t.children??Cr),D(f),U(e,f),k()}var xme=B(`<div role="none" class="spinner svelte-1qbkxne"></div>`),Sme=B(`<!> <!>`,1),Cme={hash:`svelte-1qbkxne`,code:`.spinner.svelte-1qbkxne {height:1px;}`};function tC(e,t){O(t,!0),K(e,Cme);let n=J(t,`itemChunkSize`,3,25),r=j(Xi(n())),i=j(void 0),a=A(()=>t.items.length>z(r)),o=null,s=!1,c=e=>{if(s)return o;let t=null;o=null;for(let n=e.parentElement;n;n=n.parentElement)if(/^(auto|scroll)$/.test(getComputedStyle(n).overflowY)&&(t??=n,n.scrollHeight-n.clientHeight>1)){o=n;break}return s=o===t,o};L(()=>{if(z(r),!z(i))return;let e=new IntersectionObserver(e=>{e.at(-1)?.isIntersecting&&z(a)&&M(r,z(r)+n())},{root:c(z(i)),rootMargin:`0px 0px 500px 0px`});return e.observe(z(i)),()=>{e.disconnect()}});var l=Sme(),u=P(l);No(u,19,()=>t.items.slice(0,z(r)),(e,n)=>e[t.itemKey]??n,(e,n,r)=>{var i=H();xo(P(i),()=>t.renderItem,()=>z(n),()=>z(r)),U(e,i)});var d=I(u,2),f=e=>{var t=xme();gs(t,e=>M(i,e),()=>z(i)),U(e,t)};G(d,e=>{z(a)&&e(f)}),U(e,l),k()}function wme(e){let t=e-1;return t*t*t+1}function nC(e,{from:t,to:n},r={}){var{delay:i=0,duration:a=e=>Math.sqrt(e)*120,easing:o=wme}=r,s=getComputedStyle(e),c=s.transform===`none`?``:s.transform,[l,u]=s.transformOrigin.split(` `).map(parseFloat);l/=e.clientWidth,u/=e.clientHeight;var d=Tme(e),f=e.clientWidth/n.width/d,p=e.clientHeight/n.height/d,m=t.left+t.width*l,h=t.top+t.height*u,g=n.left+n.width*l,_=n.top+n.height*u,v=(m-g)*f,y=(h-_)*p,b=t.width/n.width,x=t.height/n.height;return{delay:i,duration:typeof a==`function`?a(Math.sqrt(v*v+y*y)):a,easing:o,css:(e,t)=>`transform: ${c} translate(${t*v}px, ${t*y}px) scale(${e+t*b}, ${e+t*x});`}}function Tme(e){if(`currentCSSZoom`in e)return e.currentCSSZoom;for(var t=e,n=1;t!==null;)n*=+getComputedStyle(t).zoom,t=t.parentElement;return n}var Eme=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`flex`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`children`,`searchIcon`,`closeIcon`,`onClear`]),Dme=B(`<div><span role="none" class="svelte-1nh3z4x"><!></span> <!> <!></div>`),Ome={hash:`svelte-1nh3z4x`,code:`.search-bar.svelte-1nh3z4x {display:inline-flex;align-items:center;position:relative;margin:var(--sui-focus-ring-width);min-width:var(--sui-textbox-singleline-min-width);}.search-bar.flex.svelte-1nh3z4x:not([hidden]) {display:inline-flex;width:-moz-available;width:-webkit-fill-available;width:stretch;min-width:0;}.search-bar.svelte-1nh3z4x > span:where(.svelte-1nh3z4x) {position:absolute;inset-block:0;inset-inline-start:0;inset-inline-end:auto;z-index:2;display:flex;align-items:center;justify-content:center;width:var(--sui-button-medium-height);height:var(--sui-button-medium-height);}.search-bar.svelte-1nh3z4x .icon {font-size:calc(var(--sui-textbox-height) * 0.6);opacity:0.5;}.search-bar.svelte-1nh3z4x > button {position:absolute;inset-block:0;inset-inline-start:auto;inset-inline-end:0;z-index:2;margin:0 !important;height:var(--sui-button-medium-height);}.search-bar.svelte-1nh3z4x .label {--sui-textbox-singleline-padding: 0 36px;}.search-bar.svelte-1nh3z4x .text-input {flex:auto;margin:0 !important;width:0;min-width:0 !important;}.search-bar.svelte-1nh3z4x input {z-index:1;padding:0 var(--sui-button-medium-height) !important;width:100%;}.search-bar.svelte-1nh3z4x:dir(rtl) {--sui-textbox-text-align: right;}`};function rC(e,t){let n=mo();O(t,!0),K(e,Ome);let r=J(t,`value`,15),i=J(t,`flex`,3,!1),a=J(t,`hidden`,3,!1),o=J(t,`disabled`,3,!1),s=J(t,`readonly`,3,!1),c=J(t,`required`,3,!1),l=J(t,`invalid`,3,!1),u=vs(t,Eme),d=j(void 0);var f={focus:()=>{z(d)?.focus()}},p=Dme();let m;var h=N(p),g=N(h),_=e=>{var n=H();xo(P(n),()=>t.searchIcon),U(e,n)},v=e=>{gx(e,{name:`search`})};G(g,e=>{t.searchIcon?e(_):e(v,-1)}),D(h);var y=I(h,2);NS(y,ys({dir:`auto`},()=>u,{role:`searchbox`,get id(){return n},get flex(){return i()},get hidden(){return a()},get disabled(){return o()},get readonly(){return s()},get required(){return c()},get invalid(){return l()},inputmode:`search`,get element(){return z(d)},set element(e){M(d,e,!0)},get value(){return r()},set value(e){r(e)}}));var b=I(y,2),x=e=>{{let i=e=>{var n=H(),r=P(n),i=e=>{var n=H();xo(P(n),()=>t.closeIcon),U(e,n)},a=e=>{gx(e,{name:`close`})};G(r,e=>{t.closeIcon?e(i):e(a,-1)}),U(e,n)},a=A(()=>o()||s()),c=A(()=>Y(`_sui.clear`));Xx(e,{iconic:!0,get disabled(){return z(a)},get"aria-label"(){return z(c)},get"aria-controls"(){return n},onclick:()=>{r(``),z(d)?.focus(),t.onClear?.()},startIcon:i,$$slots:{startIcon:!0}})}};return G(b,e=>{r()&&e(x)}),D(p),R(()=>{q(p,`role`,a()?void 0:`none`),m=$o(p,1,`sui search-bar ${t.class??``}`,`svelte-1nh3z4x`,m,{flex:i(),disabled:o(),readonly:s()}),q(p,`hidden`,a()),q(p,`aria-hidden`,a())}),U(e,p),k(f)}var kme=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`editable`,`position`,`filterThreshold`,`ariaLabel`,`children`,`chevronIcon`,`onChange`]),Ame=B(`<div><div role="none" class="label svelte-1vz2e50"><!></div></div>`),jme=B(`<div role="status" class="no-options svelte-1vz2e50"> </div>`),Mme=B(`<div role="none" class="combobox-inner svelte-1vz2e50"><!> <div role="none" class="listbox-slot svelte-1vz2e50"></div> <!></div>`),Nme=B(`<div role="none"><!> <!></div> <div role="none" class="idle-host" hidden=""><div role="none" class="option-host svelte-1vz2e50"><!></div></div> <!>`,1),Pme={hash:`svelte-1vz2e50`,code:`:is(.option-host.svelte-1vz2e50, .listbox-slot.svelte-1vz2e50) {display:contents;}.combobox.svelte-1vz2e50 {margin:var(--sui-focus-ring-width);display:flex;align-items:center;position:relative;min-width:var(--sui-combobox-min-width, calc(var(--sui-option-height) * 5));}.combobox.svelte-1vz2e50 div[role=combobox]:where(.svelte-1vz2e50) {display:flex;align-items:center;border-width:1px;border-color:var(--sui-control-border-color);border-radius:var(--sui-textbox-border-radius);padding-block:0;padding-inline-start:calc(var(--sui-textbox-height) / 4);padding-inline-end:var(--sui-textbox-height);width:100%;height:var(--sui-textbox-height);color:var(--sui-control-foreground-color);background-color:var(--sui-disabled-background-color);font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);-webkit-user-select:none;user-select:none;cursor:pointer;transition:all 200ms;}.combobox.svelte-1vz2e50 div[role=combobox]:where(.svelte-1vz2e50):not(.selected) {font-style:italic;}.combobox.svelte-1vz2e50 div[role=combobox]:where(.svelte-1vz2e50):is(:where(.svelte-1vz2e50):hover, :where(.svelte-1vz2e50):focus) {background-color:var(--sui-hover-background-color);}.combobox.svelte-1vz2e50 div[role=combobox][aria-readonly=true]:where(.svelte-1vz2e50) {cursor:default;}.combobox.svelte-1vz2e50 div[role=combobox][aria-readonly=true]:where(.svelte-1vz2e50):is(:where(.svelte-1vz2e50):hover, :where(.svelte-1vz2e50):focus):not(:focus-visible) {background-color:var(--sui-disabled-background-color);}.combobox.svelte-1vz2e50 div[role=combobox][aria-invalid=true]:where(.svelte-1vz2e50) {border-color:var(--sui-error-border-color);}.combobox.svelte-1vz2e50 div[role=combobox]:where(.svelte-1vz2e50) .label:where(.svelte-1vz2e50) {width:100%;}.combobox.svelte-1vz2e50 .icon {font-size:var(--sui-font-size-xx-large);opacity:0.5;}.combobox.svelte-1vz2e50 > button {position:absolute;inset-block-start:0;inset-inline-end:0;z-index:1;margin:0 !important;border-start-start-radius:0;border-end-start-radius:0;background-color:transparent !important;}.combobox.svelte-1vz2e50 > button[tabindex="-1"] {pointer-events:none;}.combobox.svelte-1vz2e50 .text-input {margin:0 !important;width:100% !important;}.combobox.svelte-1vz2e50 input {padding-block:0;padding-inline:8px 32px;width:0;}.combobox-inner.svelte-1vz2e50 {flex:auto;display:flex;flex-direction:column;overflow:hidden;}.combobox-inner.svelte-1vz2e50 .sui.search-bar {flex:none;margin-bottom:calc(8px - var(--sui-focus-ring-width));}.combobox-inner.svelte-1vz2e50 .sui.listbox {flex:auto;overflow-y:auto;}.combobox-inner.svelte-1vz2e50 .no-options:where(.svelte-1vz2e50) {flex:none;display:flex;align-items:center;padding:var(--sui-option-padding);height:var(--sui-option-height);color:var(--sui-tertiary-foreground-color);}`};function Fme(e,t){let n=mo();O(t,!0),K(e,Pme);let r=J(t,`value`,15),i=J(t,`hidden`,3,!1),a=J(t,`disabled`,3,!1),o=J(t,`readonly`,3,!1),s=J(t,`required`,3,!1),c=J(t,`invalid`,3,!1),l=J(t,`editable`,3,!0),u=J(t,`position`,3,`bottom-left`),d=J(t,`filterThreshold`,3,5),f=J(t,`ariaLabel`,3,void 0),p=vs(t,kme),m=j(!1),h=j(void 0),g=j(void 0),_=j(void 0),v=j(void 0),y=j(void 0),b=j(void 0),x=j(``),S=j(!1),C=j(``),w=j(0),T=A(()=>!z(C)||z(w)>0),ee=A(()=>z(h)??z(g)),E=Wde(),te=()=>{let e=E.find(r());M(x,e?.label??``,!0),E.selectOnly(r())},ne=({type:e,name:n,label:r,value:i})=>{t.onChange?.(new CustomEvent(`Change`,{detail:{target:void 0,type:e,name:n,label:r,value:i}}))},re=e=>{let n=tS(e);r(n.value),te(),t.onChange?.(new CustomEvent(`Change`,{detail:n}))},ie=e=>{let{target:n}=e;r(n.value),te(),t.oninput?.(e),t.onChange?.(new CustomEvent(`Change`,{detail:{target:n,type:`string`,name:void 0,label:n.value,value:r()}}))},ae=new aS,oe=e=>{let{key:t,ctrlKey:n,metaKey:i,altKey:s}=e;if(a()||o()||z(m)||t.length!==1||t===` `||n||i||s)return;e.preventDefault();let c=E.entries.filter(e=>!e.disabled),l=oS(c.map(e=>rS(e.label??``)),ae.push(t),c.findIndex(e=>e.value===r()));if(l===-1)return;let u=c[l];u.value!==r()&&(r(u.value),te(),ne(u))},se=()=>z(y)?.querySelector(`[role="listbox"]`),ce=()=>{let e=se(),t=e?.querySelector(`[role="option"][aria-selected="true"]`);e&&t&&(t.classList.add(`focused`),e.setAttribute(`aria-activedescendant`,t.id),t.scrollIntoView(!0))};L(()=>{E.expanded=z(m)}),L(()=>{if(!z(m))return;let e=globalThis.setTimeout(ce,150);return()=>{globalThis.clearTimeout(e),se()?.removeAttribute(`aria-activedescendant`)}}),L(()=>{if(!z(y))return;let e=z(m)?z(b):z(v);e&&z(y).parentElement!==e&&e.append(z(y))}),So(()=>{let e=E.selectedEntry;e&&(r(e.value),M(x,e.label,!0),ne(e))}),L(()=>{r(),te()});var le=Nme(),ue=P(le);let de;var fe=N(ue),pe=e=>{var t=Ame();fs(t,()=>({...p,role:`combobox`,id:n,tabindex:a()?-1:0,"aria-expanded":z(m),"aria-hidden":i(),"aria-disabled":a(),"aria-readonly":o(),"aria-required":s(),"aria-invalid":c(),"aria-haspopup":`listbox`,"aria-label":f(),onkeydown:oe,[ss]:{selected:r()!==void 0}}),void 0,void 0,void 0,`svelte-1vz2e50`);var l=N(t);Nx(N(l),{children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>r()===void 0?Y(`_sui.combobox.select_an_option`):z(x)]),U(e,n)},$$slots:{default:!0}}),D(l),D(t),gs(t,e=>M(h,e),()=>z(h)),U(e,t)},me=e=>{{let t=A(()=>r()===void 0?``:String(r()));NS(e,ys(()=>p,{dir:`auto`,role:`combobox`,get id(){return n},get value(){return z(t)},get hidden(){return i()},get disabled(){return a()},get readonly(){return o()},get required(){return s()},get invalid(){return c()},get"aria-expanded"(){return z(m)},"aria-haspopup":`listbox`,get ariaLabel(){return f()},oninput:ie,get element(){return z(g)},set element(e){M(g,e,!0)}}))}};G(fe,e=>{l()?e(me,-1):e(pe)});var he=I(fe,2);{let e=e=>{var n=H(),r=P(n),i=e=>{var n=H();xo(P(n),()=>t.chevronIcon),U(e,n)},a=e=>{gx(e,{name:`expand_more`})};G(r,e=>{t.chevronIcon?e(i):e(a,-1)}),U(e,n)},r=A(()=>!l()||o()||a()?-1:0),s=A(()=>z(m)?Y(`_sui.collapse`):Y(`_sui.expand`)),c=A(()=>z(m)?`${n}-popup`:void 0);Xx(he,{variant:`ghost`,iconic:!0,get hidden(){return i()},get disabled(){return a()},get tabindex(){return z(r)},get"aria-label"(){return z(s)},get"aria-controls"(){return z(c)},get"aria-expanded"(){return z(m)},onclick:e=>{e.preventDefault(),e.stopPropagation(),!a()&&!o()&&M(m,!z(m))},startIcon:e,$$slots:{startIcon:!0}})}D(ue);var ge=I(ue,2),_e=N(ge);WS(N(_e),{get id(){return`${n}-listbox`},class:`in-combobox`,get searchTerms(){return z(C)},onclick:e=>{e.target.matches(`[role="option"]`)&&re(e.target)},onFilter:e=>{M(w,e.detail.matched,!0)},children:(e,n)=>{var r=H();xo(P(r),()=>t.children??Cr),U(e,r)},$$slots:{default:!0}}),D(_e),gs(_e,e=>M(y,e),()=>z(y)),D(ge),gs(ge,e=>M(v,e),()=>z(v)),Jx(I(ge,2),{get id(){return`${n}-popup`},class:`combobox`,get anchor(){return z(ee)},get position(){return u()},touchOptimized:!0,onOpen:()=>{M(S,d()!==-1&&E.count>d(),!0),M(C,``)},get content(){return z(_)},set content(e){M(_,e,!0)},get open(){return z(m)},set open(e){M(m,e,!0)},children:(e,t)=>{var r=Mme(),i=N(r),a=e=>{{let t=A(()=>Y(`_sui.combobox.filter_options`));rC(e,{flex:!0,get"aria-label"(){return z(t)},get"aria-controls"(){return`${n}-listbox`},onkeydown:e=>{[`ArrowUp`,`ArrowDown`,`Enter`].includes(e.key)&&(e.preventDefault(),z(_)?.querySelector(`.sui.listbox`)?.dispatchEvent(new KeyboardEvent(`keydown`,e)))},get value(){return z(C)},set value(e){M(C,e,!0)}})}};G(i,e=>{z(S)&&e(a)});var o=I(i,2);gs(o,e=>M(b,e),()=>z(b));var s=I(o,2),c=e=>{var t=jme(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`_sui.combobox.no_matching_options`)]),U(e,t)};G(s,e=>{z(T)||e(c)}),D(r),U(e,r)},$$slots:{default:!0}}),R(()=>{de=$o(ue,1,`sui combobox ${t.class??``}`,`svelte-1vz2e50`,de,{editable:l()}),q(ue,`hidden`,i())}),U(e,le),k()}var Ime=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`class`]);function iC(e,t){O(t,!0);let n=J(t,`value`,15),r=vs(t,Ime);Fme(e,ys(()=>r,{get class(){return`sui select ${t.class??``}`},editable:!1,get value(){return n()},set value(e){n(e)}})),k()}var Lme=(e,t,n)=>{if(t===n)return e;let r=[...e],[i]=r.splice(t,1);return r.splice(n,0,i),r},Rme=({key:e,index:t,length:n,rtl:r})=>e===(r?`ArrowRight`:`ArrowLeft`)&&t>0?t-1:e===(r?`ArrowLeft`:`ArrowRight`)&&t<n-1?t+1:e===`Home`&&t>0?0:e===`End`&&t<n-1?n-1:-1,zme=({index:e,clientX:t,rect:n,rtl:r})=>t<n.left+n.width/2===r?e+1:e,Bme=(e,t)=>{if(t!==e&&t!==e+1)return t>e?t-1:t},Vme=new Set([`$$slots`,`$$events`,`$$legacy`,`values`,`options`,`max`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`children`,`onAddValue`,`onRemoveValue`,`onReorder`]),Hme=B(`<span role="gridcell" class="svelte-26j0it"><!></span>`),Ume=B(`<span role="row"><span class="label svelte-26j0it" role="gridcell"> </span> <!></span>`),Wme=B(`<div role="none"><span role="grid" class="svelte-26j0it"></span> <!></div>`),Gme={hash:`svelte-26j0it`,code:`.select-tags.svelte-26j0it {display:flex;flex-wrap:wrap;align-items:center;}.select-tags.disabled.svelte-26j0it {pointer-events:none;}.select-tags.disabled.svelte-26j0it > :where(.svelte-26j0it) {opacity:0.5;}.select-tags.svelte-26j0it span[role=grid]:where(.svelte-26j0it) {display:contents;}.select-tags.svelte-26j0it span[draggable]:where(.svelte-26j0it) {display:inline-flex;align-items:center;position:relative;margin:var(--sui-focus-ring-width);padding:0;padding-inline-start:8px;border-radius:var(--sui-control-medium-border-radius);background-color:var(--sui-secondary-background-color);cursor:grab;outline:none;}.select-tags.svelte-26j0it span[draggable]:where(.svelte-26j0it):focus-within {outline:var(--sui-focus-ring-width) solid var(--sui-focus-ring-color);}.select-tags.svelte-26j0it span[draggable].drag-source:where(.svelte-26j0it) {opacity:0.4;cursor:grabbing;}.select-tags.svelte-26j0it span[draggable].drop-before:where(.svelte-26j0it)::before, .select-tags.svelte-26j0it span[draggable].drop-after:where(.svelte-26j0it)::after {content:"";position:absolute;top:0;bottom:0;margin-inline-start:-1px;border-radius:1px;width:4px;background-color:var(--sui-primary-accent-color);pointer-events:none;}.select-tags.svelte-26j0it span[draggable].drop-before:where(.svelte-26j0it)::before {inset-inline-start:calc(-1 * var(--sui-focus-ring-width) - 1px);}.select-tags.svelte-26j0it span[draggable].drop-after:where(.svelte-26j0it)::after {inset-inline-end:calc(-1 * var(--sui-focus-ring-width) - 1px);}.select-tags.svelte-26j0it span[draggable]:where(.svelte-26j0it) .label:where(.svelte-26j0it) {outline:none;}.select-tags.svelte-26j0it span[draggable]:where(.svelte-26j0it) span[role=gridcell]:where(.svelte-26j0it):not(.label) {display:contents;}.select-tags.svelte-26j0it span[draggable]:where(.svelte-26j0it) button {outline-offset:-2px;}.select-tags.svelte-26j0it span[draggable]:where(.svelte-26j0it) .icon {font-size:var(--sui-font-size-large);}`};function Kme(e,t){O(t,!0),K(e,Gme);let n=J(t,`values`,31,()=>Xi([])),r=J(t,`max`,3,void 0),i=J(t,`hidden`,3,!1),a=J(t,`disabled`,3,!1),o=J(t,`readonly`,3,!1),s=J(t,`required`,3,!1),c=J(t,`invalid`,3,!1),l=vs(t,Vme),u=A(()=>new Map(t.options.map(e=>[e.value,e]))),d=A(()=>new Set(n())),f=A(()=>t.options.some(({value:e})=>!z(d).has(e))),p=j(void 0),m=j(void 0),h=j(void 0),g=j(void 0),_=(e,r)=>{if(e===r)return;let i=Lme(n(),e,r);n(i),t.onReorder?.(new CustomEvent(`Reorder`,{detail:{values:i}}))},v=async(e,t)=>{_(e,t),await Za(),(z(p)?.querySelectorAll(`.label[tabindex]`)?.[t])?.focus()};var y=Wme();let b;var x=N(y);No(x,30,n,e=>e,(e,r,i)=>{let s=A(()=>z(u).get(r)),c=A(()=>z(s)?.label||z(s)?.value||r);var l=Ume();let d;var f=N(l),p=F(f,!0),m=I(f,2),_=e=>{var i=Hme(),s=N(i);{let e=e=>{gx(e,{name:`close`})},i=A(()=>a()||o()),l=A(()=>Y(`_sui.select_tags.remove_x`,{values:{name:z(c)}}));Xx(s,{iconic:!0,size:`small`,get disabled(){return z(i)},get"aria-label"(){return z(l)},onclick:()=>{n(n().filter(e=>e!==r)),t.onRemoveValue?.(new CustomEvent(`RemoveValue`,{detail:{value:r}}))},startIcon:e,$$slots:{startIcon:!0}})}D(i),U(e,i)};G(m,e=>{z(s)&&e(_)}),D(l),R(()=>{q(l,`draggable`,!a()&&!o()),d=$o(l,1,`svelte-26j0it`,null,d,{"drag-source":z(h)===z(i),"drop-before":z(g)===z(i)&&z(h)!==z(i)&&z(h)!==z(i)-1,"drop-after":z(g)===n().length&&z(i)===n().length-1&&z(h)!==n().length-1}),q(f,`tabindex`,a()||o()?void 0:0),W(p,z(c))}),oo(`dragstart`,l,e=>{M(h,z(i),!0),e.dataTransfer&&(e.dataTransfer.setData(`text/plain`,z(c)),e.dataTransfer.effectAllowed=`move`)}),oo(`dragover`,l,e=>{e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`move`),M(g,zme({index:z(i),clientX:e.clientX,rect:e.currentTarget.getBoundingClientRect(),rtl:Tc()}),!0)}),oo(`drop`,l,async e=>{e.preventDefault();let t=z(h),n=z(g);if(M(h,void 0),M(g,void 0),t===void 0||n===void 0)return;let r=Bme(t,n);r!==void 0&&await v(t,r)}),oo(`dragend`,l,()=>{M(h,void 0),M(g,void 0)}),so(`keydown`,f,async e=>{let t=Rme({key:e.key,index:z(i),length:n().length,rtl:Tc()});t!==-1&&(e.preventDefault(),await v(z(i),t))}),Wo(l,()=>nC,()=>({duration:200})),U(e,l)}),D(x);var S=I(x,2),C=e=>{{let r=A(()=>a()||o());iC(e,ys(()=>l,{get disabled(){return z(r)},get readonly(){return o()},get required(){return s()},get invalid(){return c()},onChange:()=>{z(m)!==void 0&&(n([...n(),z(m)]),t.onAddValue?.(new CustomEvent(`AddValue`,{detail:{value:z(m)}})),M(m,void 0))},get value(){return z(m)},set value(e){M(m,e,!0)},children:(e,n)=>{var r=H();No(P(r),17,()=>t.options,({label:e,value:t,searchValue:n})=>t,(e,t)=>{let n=()=>z(t).label,r=()=>z(t).value,i=()=>z(t).searchValue;var a=H(),o=P(a),s=e=>{KS(e,{get label(){return n()},get value(){return r()},get searchValue(){return i()}})},c=A(()=>!z(d).has(r()));G(o,e=>{z(c)&&e(s)}),U(e,a)}),U(e,r)},$$slots:{default:!0}}))}};G(S,e=>{(typeof r()!=`number`||n().length<r())&&z(f)&&e(C)}),D(y),gs(y,e=>M(p,e),()=>z(p)),R(e=>{b=$o(y,1,`sui select-tags ${t.class??``}`,`svelte-26j0it`,b,{disabled:a()||o()}),q(y,`hidden`,i()),q(x,`aria-label`,e)},[()=>Y(`_sui.select_tags.selected_options`)]),U(e,y),k()}co([`keydown`]);var qme=e=>{let[t,n=`0`]=String(e).split(`e`);return Math.min(Math.max((t.split(`.`)[1]??``).length-Number(n),0),100)},Jme=({min:e,max:t,step:n,barWidth:r})=>{let i=(t-e)/n,a=Math.floor(i+1e-9)+1,o=r/i,s=Array.from({length:a}),c=Math.max(qme(e),qme(n));return{valueList:s.map((t,r)=>Number((r*n+e).toFixed(c))),positionList:s.map((e,t)=>t*o)}},Yme=(e,t,n)=>Math.min(t,Math.max(0,n?t-e:e)),Xme=(e,t)=>{let n=e.findLastIndex(e=>e<=t),r=e.findIndex(e=>t<=e);return n===-1?r:r===-1||Math.abs(e[n]-t)<Math.abs(e[r]-t)?n:r},Zme=(e,t)=>{let{prevKey:n,nextKey:r}=iS(`horizontal`,t);return e===`ArrowUp`||e===r?1:e===`ArrowDown`||e===n?-1:0},Qme=({key:e,rtl:t,currentIndex:n,length:r})=>{let i=r-1,a=Math.max(1,Math.round(r/10)),o;if(e===`Home`)o=0;else if(e===`End`)o=i;else if(e===`PageUp`)o=n+a;else if(e===`PageDown`)o=n-a;else{let r=Zme(e,t);if(!r)return-1;o=n+r}return o=Math.min(i,Math.max(0,o)),o===n?-1:o},$me=({valueIndex:e,targetPosition:t,sliderPositions:n})=>e===0&&n[1]<=t||e===1&&n[0]>=t,ehe=({valueList:e,value:t,decreasing:n})=>{let r=e.indexOf(t);if(r!==-1)return r;if(n){let n=e.findIndex(e=>e>t);return n===-1?e.length:n}return e.findLastIndex(e=>e<t)},the=(e,t)=>{let[n,r]=e,i=Math.abs(n-t),a=Math.abs(r-t);return i===a?+(t>r):+(a<i)},nhe=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`min`,`max`,`sliderLabel`,`ariaLabelledby`,`values`,`sliderLabels`,`step`,`optionLabels`,`class`,`hidden`,`disabled`,`readonly`,`invalid`,`children`,`onChange`]),rhe=B(`<div role="slider" class="svelte-sz3hkp"></div>`),ihe=B(`<span role="none" class="label svelte-sz3hkp"> </span>`),ahe=B(`<div><div role="none" class="base svelte-sz3hkp"><div role="none" class="base-bar svelte-sz3hkp"></div> <div class="slider-bar svelte-sz3hkp"></div> <div role="slider" class="svelte-sz3hkp"></div> <!> <!></div></div>`),ohe={hash:`svelte-sz3hkp`,code:`.slider.svelte-sz3hkp {position:relative;display:inline-block;margin:var(--sui-focus-ring-width);padding:4px 6px;touch-action:none;}.slider.svelte-sz3hkp:hover .base-bar:where(.svelte-sz3hkp) {background-color:var(--sui-hover-background-color);}.slider.svelte-sz3hkp:active .base-bar:where(.svelte-sz3hkp) {background-color:var(--sui-active-background-color);}.slider.readonly.svelte-sz3hkp .base-bar:where(.svelte-sz3hkp), .slider.readonly.svelte-sz3hkp:is(:where(.svelte-sz3hkp):hover, :where(.svelte-sz3hkp):active) .base-bar:where(.svelte-sz3hkp) {background-color:var(--sui-slider-background-color, var(--sui-secondary-background-color));}.slider.readonly.svelte-sz3hkp .base:where(.svelte-sz3hkp),
.slider.readonly.svelte-sz3hkp [role=slider]:where(.svelte-sz3hkp) {cursor:default;}.slider.readonly.svelte-sz3hkp:not(.invalid) .slider-bar:where(.svelte-sz3hkp) {background-color:var(--sui-readonly-accent-color);}.slider.readonly.svelte-sz3hkp:not(.invalid) [role=slider]:where(.svelte-sz3hkp) {border-color:var(--sui-readonly-accent-color);}.base.svelte-sz3hkp {position:relative;width:var(--sui-slider-base-width, 240px);height:calc(var(--sui-checkbox-height) / 2);cursor:pointer;}.base-bar.svelte-sz3hkp {border-width:1px;border-style:solid;border-color:var(--sui-control-border-color);border-radius:var(--sui-checkbox-height);background-color:var(--sui-slider-background-color, var(--sui-secondary-background-color));transition:all 200ms;width:100%;height:100%;}.slider-bar.svelte-sz3hkp {position:absolute;top:0;height:calc(var(--sui-checkbox-height) / 2);border-radius:var(--sui-checkbox-height);background-color:var(--sui-primary-accent-color-light);}.invalid.svelte-sz3hkp .slider-bar:where(.svelte-sz3hkp) {background-color:var(--sui-error-border-color);}[role=slider].svelte-sz3hkp {position:absolute;top:0;border:3px solid var(--sui-primary-accent-color-light);border-radius:var(--sui-checkbox-height);width:calc(var(--sui-checkbox-height) - 2px);height:calc(var(--sui-checkbox-height) - 2px);background-color:var(--sui-primary-accent-color-inverted);cursor:pointer;}[role=slider].svelte-sz3hkp::before {content:"";position:absolute;inset:-4px;border-radius:inherit;}[role=slider].svelte-sz3hkp:dir(ltr) {transform:translate(calc((var(--sui-checkbox-height) / 2 - 1px) * -1), calc((var(--sui-checkbox-height) / 4 - 1px) * -1));}[role=slider].svelte-sz3hkp:dir(rtl) {transform:translate(calc(var(--sui-checkbox-height) / 2 - 1px), calc((var(--sui-checkbox-height) / 4 - 1px) * -1));}.invalid.svelte-sz3hkp [role=slider]:where(.svelte-sz3hkp) {border-color:var(--sui-error-border-color);}.label.svelte-sz3hkp {position:absolute;top:calc(var(--sui-checkbox-height) / 2 + 8px);font-size:var(--sui-font-size-x-small);}.label.svelte-sz3hkp:dir(ltr) {transform:translateX(-50%);}.label.svelte-sz3hkp:dir(rtl) {transform:translateX(50%);}`};function she(e,t){O(t,!0),K(e,ohe);let n=J(t,`value`,15,0),r=J(t,`min`,3,0),i=J(t,`max`,3,100),a=J(t,`sliderLabel`,3,``),o=J(t,`ariaLabelledby`,3,void 0),s=J(t,`values`,15,void 0),c=J(t,`sliderLabels`,3,void 0),l=J(t,`step`,3,1),u=J(t,`optionLabels`,19,()=>[]),d=J(t,`hidden`,3,!1),f=J(t,`disabled`,3,!1),p=J(t,`readonly`,3,!1),m=J(t,`invalid`,3,!1),h=vs(t,nhe),g=A(()=>Array.isArray(s())),_=j(void 0),v=j(0),y=j(Xi([])),b=j(Xi([])),x=e=>{if(u().length!==z(b).length||e===void 0)return;let t=z(b).indexOf(e);return t===-1?void 0:String(u()[t])},S=j(0),C=j(0),w=Xi([0,0]),T=j(!1),ee=j(0),E=j(0),te=(e,r)=>{let i=s();(z(g)?i[e]:n())!==r&&(z(g)?(i[e]=r,s([...i]),t.onChange?.({values:s()})):(n(r),t.onChange?.({value:n()})))},ne=e=>{let t=Xme(z(y),Yme(e,z(v),Tc()));z(g)&&$me({valueIndex:z(E),targetPosition:z(y)[t],sliderPositions:w})||te(z(E),z(b)[t])},re=(e,t=0)=>{let{key:r,ctrlKey:i,metaKey:a,shiftKey:o,altKey:c}=e,l=o||c||i||a;if(f()||p()||l)return;let u=z(g)?s()[t]:n(),d=Tc(),m=Qme({key:r,rtl:d,currentIndex:ehe({valueList:z(b),value:u,decreasing:r===`PageDown`||Zme(r,d)===-1}),length:z(b).length});m===-1?[`Home`,`End`,`PageUp`,`PageDown`].includes(r)&&e.preventDefault():(e.preventDefault(),e.stopPropagation(),z(g)&&$me({valueIndex:t,targetPosition:z(y)[m],sliderPositions:w})||te(t,z(b)[m]))},ie=e=>{let{screenX:t,pointerId:n}=e;if(f()||p()||!z(T)||n!==z(ee))return;e.preventDefault(),e.stopPropagation();let r=t-z(C),i=z(S)+r;ne(i)},ae=e=>{let{pointerId:t,target:n}=e;if(f()||p()||!z(T)||t!==z(ee))return;e.stopPropagation();let r=n;if(r.matches(`.base-bar, .slider-bar`)){let t=z(_).getBoundingClientRect(),n=e.clientX-t.left;ne(n)}r.releasePointerCapture(t),M(T,!1),M(S,0),M(C,0),M(ee,0),M(E,0),document.removeEventListener(`pointermove`,ie),document.removeEventListener(`pointerup`,ae),document.removeEventListener(`pointercancel`,ae)},oe=(e,t)=>{if(f()||p())return;e.preventDefault(),e.stopPropagation(),M(T,!0);let{clientX:n,screenX:r,pointerId:i,target:a}=e,o=a,s=z(_).getBoundingClientRect();M(S,n-s.left),M(C,r,!0),M(ee,i,!0),M(E,t??(z(g)?the(w,Yme(z(S),z(v),Tc())):0),!0),o.setPointerCapture(i),document.addEventListener(`pointermove`,ie),document.addEventListener(`pointerup`,ae),document.addEventListener(`pointercancel`,ae)},se=e=>z(y)[Xme(z(b),e)]??0,ce=()=>{if(z(g)){let[e,t]=s();w[0]=se(e),w[1]=se(t)}else w[0]=se(n())},le=()=>{z(_)&&(M(v,z(_).clientWidth,!0),(e=>{M(b,e.valueList,!0),M(y,e.positionList,!0)})(Jme({min:r(),max:i(),step:l(),barWidth:z(v)})),ce())};So(()=>{let e=new ResizeObserver(()=>le()),t=globalThis.matchMedia(`(pointer: coarse)`);return e.observe(z(_)),t.addEventListener(`change`,le),le(),()=>{e.disconnect(),t.removeEventListener(`change`,le),document.removeEventListener(`pointermove`,ie),document.removeEventListener(`pointerup`,ae),document.removeEventListener(`pointercancel`,ae)}}),L(()=>{n(),s(),ce()}),L(()=>{r(),i(),l(),eo(le)});var ue=ahe();oo(`click`,ea.body,()=>{M(T,!1)}),fs(ue,()=>({...h,role:`none`,class:`sui slider ${t.class??``}`,hidden:d(),[ss]:{disabled:f(),readonly:p(),invalid:m()}}),void 0,void 0,void 0,`svelte-sz3hkp`);var de=N(ue),fe=I(N(de),2);let pe;var me=I(fe,2);let he;var ge=I(me,2),_e=e=>{var t=rhe();let n;R(e=>{q(t,`tabindex`,f()?-1:0),q(t,`aria-label`,c()?.[1]||void 0),q(t,`aria-hidden`,d()),q(t,`aria-disabled`,f()),q(t,`aria-readonly`,p()),q(t,`aria-invalid`,m()),q(t,`aria-valuemin`,r()),q(t,`aria-valuemax`,i()),q(t,`aria-valuenow`,s()?.[1]),q(t,`aria-valuetext`,e),n=ts(t,``,n,{"inset-inline-start":`${w[1]}px`})},[()=>x(s()?.[1])]),so(`pointerdown`,t,e=>oe(e,1)),so(`keydown`,t,e=>re(e,1)),U(e,t)};G(ge,e=>{z(g)&&e(_e)});var ve=I(ge,2),ye=e=>{var t=H();No(P(t),19,u,(e,t)=>`${t}-${e}`,(e,t,n)=>{var r=ihe();let i;var a=F(r,!0);R(()=>{i=ts(r,``,i,{"inset-inline-start":`${z(v)/(u().length-1)*z(n)}px`}),W(a,z(t))}),U(e,r)}),U(e,t)};G(ve,e=>{u().length&&e(ye)}),D(de),gs(de,e=>M(_,e),()=>z(_)),D(ue),R(e=>{pe=ts(fe,``,pe,{"inset-inline-start":`${z(g)?w[0]:0}px`,width:`${z(g)?w[1]-w[0]:w[0]}px`}),q(me,`tabindex`,f()?-1:0),q(me,`aria-label`,(z(g)?c()?.[0]:a())||void 0),q(me,`aria-labelledby`,z(g)?void 0:o()),q(me,`aria-hidden`,d()),q(me,`aria-disabled`,f()),q(me,`aria-readonly`,p()),q(me,`aria-invalid`,m()),q(me,`aria-valuemin`,r()),q(me,`aria-valuemax`,i()),q(me,`aria-valuenow`,z(g)?s()?.[0]:n()),q(me,`aria-valuetext`,e),he=ts(me,``,he,{"inset-inline-start":`${w[0]}px`})},[()=>x(z(g)?s()?.[0]:n())]),so(`pointerdown`,de,e=>oe(e)),so(`pointerdown`,me,e=>oe(e,0)),so(`keydown`,me,e=>re(e,0)),U(e,ue),k()}co([`pointerdown`,`keydown`]);var che=new Set([`$$slots`,`$$events`,`$$legacy`,`checked`,`label`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`ariaLabel`,`children`,`onChange`]),lhe=B(`<button><span role="none" class="svelte-1xlgdcj"></span> <!></button>`),uhe={hash:`svelte-1xlgdcj`,code:`button.svelte-1xlgdcj {display:inline-flex;align-items:center;gap:8px;margin:var(--sui-focus-ring-width);border-width:0;border-style:solid;border-color:transparent;padding:0;color:var(--sui-control-foreground-color);background-color:transparent;box-shadow:none;font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);font-weight:var(--sui-font-weight-normal, normal);text-align:start;cursor:pointer;-webkit-user-select:none;user-select:none;}button[aria-invalid=true].svelte-1xlgdcj span:where(.svelte-1xlgdcj) {background-color:var(--sui-error-border-color) !important;}button:hover[aria-checked=false].svelte-1xlgdcj span:where(.svelte-1xlgdcj) {background-color:var(--sui-hover-background-color);}button:hover[aria-checked=true].svelte-1xlgdcj span:where(.svelte-1xlgdcj) {background-color:var(--sui-primary-accent-color-light);}button:active[aria-checked=false].svelte-1xlgdcj span:where(.svelte-1xlgdcj) {background-color:var(--sui-active-background-color);}button:active[aria-checked=true].svelte-1xlgdcj span:where(.svelte-1xlgdcj) {background-color:var(--sui-primary-accent-color-dark);}button.svelte-1xlgdcj:focus-visible {outline:0;}button.svelte-1xlgdcj:focus-visible span:where(.svelte-1xlgdcj) {outline-color:var(--sui-focus-ring-color);}button[aria-checked=true].svelte-1xlgdcj span:where(.svelte-1xlgdcj) {background-color:var(--sui-primary-accent-color);border-color:transparent;}button[aria-checked=true].svelte-1xlgdcj span:where(.svelte-1xlgdcj)::before {--translateX: var(--sui-checkbox-height) * 2 - var(--sui-checkbox-height);border-color:var(--sui-primary-accent-color);background-color:var(--sui-primary-accent-color-inverted);}button[aria-checked=true].svelte-1xlgdcj span:where(.svelte-1xlgdcj):dir(ltr)::before {transform:translateX(calc(var(--translateX)));}button[aria-checked=true].svelte-1xlgdcj span:where(.svelte-1xlgdcj):dir(rtl)::before {transform:translateX(calc((var(--translateX)) * -1));}button[aria-readonly=true].svelte-1xlgdcj {cursor:default;}button[aria-readonly=true][aria-checked=false].svelte-1xlgdcj span:where(.svelte-1xlgdcj), button[aria-readonly=true]:is(:where(.svelte-1xlgdcj):hover, :where(.svelte-1xlgdcj):active)[aria-checked=false].svelte-1xlgdcj span:where(.svelte-1xlgdcj) {background-color:var(--sui-control-background-color);}button[aria-readonly=true][aria-checked=true].svelte-1xlgdcj span:where(.svelte-1xlgdcj), button[aria-readonly=true]:is(:where(.svelte-1xlgdcj):hover, :where(.svelte-1xlgdcj):active)[aria-checked=true].svelte-1xlgdcj span:where(.svelte-1xlgdcj) {background-color:var(--sui-readonly-accent-color);}button[aria-readonly=true][aria-checked=true].svelte-1xlgdcj span:where(.svelte-1xlgdcj)::before, button[aria-readonly=true]:is(:where(.svelte-1xlgdcj):hover, :where(.svelte-1xlgdcj):active)[aria-checked=true].svelte-1xlgdcj span:where(.svelte-1xlgdcj)::before {border-color:var(--sui-readonly-accent-color);background-color:var(--sui-readonly-accent-color-inverted);}span.svelte-1xlgdcj {position:relative;width:calc(var(--sui-checkbox-height) * 2);height:var(--sui-checkbox-height);padding:0 2px;display:inline-flex;align-items:center;border-width:1.5px;border-style:solid;border-color:var(--sui-checkbox-border-color);border-radius:var(--sui-checkbox-height);background-color:var(--sui-control-background-color);transition:all 200ms;}span.svelte-1xlgdcj::before {display:inline-block;width:calc(var(--sui-checkbox-height) - 6px);height:calc(var(--sui-checkbox-height) - 6px);border-radius:var(--sui-checkbox-height);background-color:var(--sui-checkbox-border-color);transition:all 200ms;content:"";}`};function aC(e,t){O(t,!0),K(e,uhe);let n=J(t,`checked`,15,!1),r=J(t,`label`,3,void 0),i=J(t,`hidden`,3,!1),a=J(t,`disabled`,3,!1),o=J(t,`readonly`,3,!1),s=J(t,`required`,3,!1),c=J(t,`invalid`,3,!1),l=J(t,`ariaLabel`,3,void 0),u=vs(t,che);var d=lhe(),f=()=>{!a()&&!o()&&(n(!n()),t.onChange?.(new CustomEvent(`Change`,{detail:{checked:n()}})))};fs(d,()=>({...u,role:`switch`,class:`sui switch ${t.class??``}`,type:`button`,hidden:i(),disabled:a()||void 0,"aria-checked":n(),"aria-hidden":i(),"aria-disabled":a(),"aria-readonly":o(),"aria-required":s(),"aria-invalid":c(),"aria-label":l(),onclick:f}),void 0,void 0,void 0,`svelte-1xlgdcj`);var p=I(N(d),2),m=e=>{var t=V();R(()=>W(t,r())),U(e,t)},h=e=>{var n=H();xo(P(n),()=>t.children??Cr),U(e,n)};G(p,e=>{r()?e(m):e(h,-1)}),D(d),U(e,d),k()}var dhe=new Set([`$$slots`,`$$events`,`$$legacy`]);function fhe(e,t){let n=vs(t,dhe);BS(e,ys(()=>n,{role:`cell`,kind:`table-cell`}))}var phe=new Set([`$$slots`,`$$events`,`$$legacy`]);function mhe(e,t){let n=vs(t,phe);BS(e,ys(()=>n,{role:`row`,kind:`table-row`}))}var hhe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`ariaLabel`,`children`]),ghe=B(`<div><!></div>`),_he={hash:`svelte-1ububp1`,code:`.table.svelte-1ububp1 {display:table;margin:var(--sui-focus-ring-width);width:calc(100% - var(--sui-focus-ring-width) * 2);}.table.data.svelte-1ububp1 {border-collapse:collapse;}.table.data.svelte-1ububp1 :is(.table-col-header, .table-row-header, .table-cell) {border:1px solid var(--sui-secondary-border-color);padding:8px 8px;}`};function vhe(e,t){K(e,_he);let n=J(t,`ariaLabel`,3,void 0),r=vs(t,hhe);var i=ghe();fs(i,()=>({...r,role:`table`,class:`sui table ${t.class??``}`,"aria-label":n()}),void 0,void 0,void 0,`svelte-1ububp1`),xo(N(i),()=>t.children??Cr),D(i),U(e,i)}var yhe=({offsetTop:e,offsetLeft:t,offsetWidth:n,offsetHeight:r})=>Object.entries({top:e,left:t,width:n,height:r}).map(([e,t])=>`${e}: ${t}px`).join(`; `),bhe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`orientation`,`name`,`ariaLabel`,`children`,`onChange`]),xhe=B(`<div><div role="none" class="inner svelte-1ya9ibl"><!></div> <div role="none" class="indicator svelte-1ya9ibl"></div></div>`),She={hash:`svelte-1ya9ibl`,code:`.tab-list.svelte-1ya9ibl {flex:none;position:relative;display:flex;align-items:center;margin:var(--sui-tab-list-margin, var(--sui-focus-ring-width));border-color:var(--sui-tab-list-border-color, var(--sui-control-border-color));border-radius:var(--sui-tab-list-border-radius, 0);background-color:var(--sui-tab-list-background-color, transparent);}.tab-list[aria-orientation=horizontal].svelte-1ya9ibl {gap:var(--sui-horizontal-tab-list-gap, var(--sui-tab-list-gap, 8px));margin-block:var(--sui-horizontal-tab-list-margin-block, 0 32px);margin-inline:var(--sui-horizontal-tab-list-margin-inline, 0);border-block-width:var(--sui-horizontal-tab-list-border-block-width, 0 1px);border-inline-width:var(--sui-horizontal-tab-list-border-inline-width, 0 0);padding:var(--sui-horizontal-tab-list-padding, var(--sui-tab-list-padding, 0 16px));}.tab-list[aria-orientation=horizontal].svelte-1ya9ibl button {width:var(--sui-horizontal-tab-width, var(--sui-tab-width, auto));height:var(--sui-horizontal-tab-height, var(--sui-tab-height, 100%));justify-content:var(--sui-horizontal-tab-justify-content, center);}.tab-list[aria-orientation=horizontal].svelte-1ya9ibl .indicator:where(.svelte-1ya9ibl) {border-block-width:var(--sui-horizontal-tab-list-indicator-border-block-width, 0 2px);border-inline-width:var(--sui-horizontal-tab-list-indicator-border-inline-width, 0 0);}.tab-list[aria-orientation=vertical].svelte-1ya9ibl {gap:var(--sui-vertical-tab-list-gap, var(--sui-tab-list-gap, 8px));flex-direction:column;margin-block:var(--sui-vertical-tab-list-margin-block, 0);margin-inline:var(--sui-vertical-tab-list-margin-inline, 0 32px);border-block-width:var(--sui-vertical-tab-list-border-block-width, 0 0);border-inline-width:var(--sui-vertical-tab-list-border-inline-width, 0 1px);padding:var(--sui-vertical-tab-list-padding, var(--sui-tab-list-padding, 8px 0));width:var(--sui-vertical-tab-list-width, auto);}.tab-list[aria-orientation=vertical].svelte-1ya9ibl button {justify-content:var(--sui-vertical-tab-justify-content, flex-start);padding-inline-end:32px;width:var(--sui-vertical-tab-width, var(--sui-tab-width, 100%));height:var(--sui-vertical-tab-height, var(--sui-tab-height, auto));}.tab-list[aria-orientation=vertical].svelte-1ya9ibl .indicator:where(.svelte-1ya9ibl) {border-block-width:var(--sui-vertical-tab-list-indicator-border-block-width, 0 0);border-inline-width:var(--sui-vertical-tab-list-indicator-border-inline-width, 0 2px);}.tab-list.svelte-1ya9ibl button {position:relative;z-index:1;border-color:transparent;margin:0 !important;border-radius:var(--sui-tab-border-radius, 0);font-family:var(--sui-tab-font-family, var(--sui-control-font-family, inherit));font-size:var(--sui-tab-font-size, var(--sui-control-font-size, inherit));font-weight:var(--sui-tab-font-weight, var(--sui-control-font-weight, var(--sui-font-weight-normal, normal)));}.inner.svelte-1ya9ibl {display:contents;}.indicator.svelte-1ya9ibl {position:absolute;z-index:0;inset:auto;border-radius:var(--sui-tab-list-indicator-border-radius, 0);border-color:var(--sui-tab-list-indicator-border-color, var(--sui-primary-accent-color-light));background-color:var(--sui-tab-list-indicator-background-color, transparent);box-shadow:var(--sui-tab-list-indicator-box-shadow, none);pointer-events:none;transition:var(--sui-tab-list-indicator-transition, all 200ms);}`};function Che(e,t){O(t,!0),K(e,She);let n=J(t,`hidden`,3,!1),r=J(t,`disabled`,3,!1),i=J(t,`orientation`,3,`horizontal`),a=J(t,`name`,3,void 0),o=J(t,`ariaLabel`,3,void 0),s=vs(t,bhe),c=j(void 0),l=j(void 0),u=()=>{globalThis.requestAnimationFrame(()=>{let e=z(c)?.querySelector(`[role="tab"][aria-selected="true"]`);M(l,e?yhe(e):void 0,!0)})};So(()=>{let e=new ResizeObserver(()=>{u()}),t=new MutationObserver(()=>{u()});return e.observe(z(c)),t.observe(z(c),{subtree:!0,attributes:!0,attributeFilter:[`aria-selected`]}),()=>{e.disconnect(),t.disconnect()}});var d=xhe(),f=()=>{u()},p=e=>{u(),t.onChange?.(e)};fs(d,()=>({...s,role:`tablist`,class:`sui tab-list ${t.class??``}`,hidden:n(),"aria-hidden":n(),"aria-disabled":r(),"aria-orientation":i(),"aria-label":o(),"data-name":a()||void 0,onInitialized:f,onChange:p}),void 0,void 0,void 0,`svelte-1ya9ibl`);var m=N(d);xo(N(m),()=>t.children??Cr),D(m);var h=I(m,2);D(d),gs(d,e=>M(c,e),()=>z(c)),qo(d,fS),R(()=>{m.inert=r(),ts(h,z(l))}),U(e,d),k()}var whe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`children`]),The=B(`<div><!></div>`),Ehe={hash:`svelte-1fgmqs3`,code:`.tab-panel.svelte-1fgmqs3 {flex:auto;transition:all 200ms;}.tab-panel[aria-hidden=true].svelte-1fgmqs3, .tab-panel.svelte-1fgmqs3:not([aria-hidden]) {display:none;}`};function Dhe(e,t){K(e,Ehe);let n=vs(t,whe);var r=The();fs(r,()=>({...n,role:`tabpanel`,class:`sui tab-panel ${t.class??``}`}),void 0,void 0,void 0,`svelte-1fgmqs3`),xo(N(r),()=>t.children??Cr),D(r),U(e,r)}var Ohe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`selected`,`children`,`startIcon`,`endIcon`]);function khe(e,t){let n=J(t,`hidden`,3,!1),r=J(t,`disabled`,3,!1),i=J(t,`selected`,3,!1),a=vs(t,Ohe);Xx(e,ys(()=>a,{role:`tab`,get class(){return`sui tab ${t.class??``}`},get hidden(){return n()},get disabled(){return r()},get"aria-selected"(){return i()},startIcon:e=>{var n=H();xo(P(n),()=>t.startIcon??Cr),U(e,n)},children:e=>{var n=H();xo(P(n),()=>t.children??Cr),U(e,n)},endIcon:e=>{var n=H();xo(P(n),()=>t.endIcon??Cr),U(e,n)},$$slots:{startIcon:!0,default:!0,endIcon:!0}}))}var oC=[],Ahe=()=>(oC.splice(0,oC.length,...oC.filter(e=>e.isConnected&&e.matches(`:modal`))),oC.at(-1)??document.querySelector(`.sui.app-shell`)??document.body),sC=e=>{e.showPopover&&(e.matches(`:popover-open`)&&e.hidePopover(),e.querySelector(`.toast`)&&e.showPopover())},cC=e=>{let t=Ahe();if(e.parentElement===t)return!1;let{moveBefore:n}=t;return typeof n==`function`&&e.isConnected?n.call(t,e,null):t.appendChild(e),!0},jhe=(e,t)=>{let n=[...e.children].find(e=>e.dataset.position===t);return n||(n=document.createElement(`div`),n.setAttribute(`role`,`none`),n.className=`toast-lane ${t}`,n.dataset.position=t,e.appendChild(n)),n},lC,uC=0,Mhe=e=>{let{target:t,newState:n}=e;lC&&t instanceof HTMLDialogElement&&n===`open`&&t.matches(`:modal`)&&!oC.includes(t)&&(oC.push(t),cC(lC),sC(lC))},dC=e=>{let{target:t}=e;if(!lC||!(t instanceof HTMLDialogElement)||e.type===`beforetoggle`&&e.newState!==`closed`)return;let n=oC.indexOf(t);n>-1&&oC.splice(n,1),t.contains(lC)&&cC(lC)&&!lC.matches(`:popover-open`)&&sC(lC)},Nhe=()=>(uC+=1,lC||(lC=document.createElement(`div`),lC.setAttribute(`role`,`none`),lC.className=`sui toast-base enabled`,lC.popover=`manual`,oC.push(...document.querySelectorAll(`dialog:modal`)),document.addEventListener(`toggle`,Mhe,!0),document.addEventListener(`beforetoggle`,dC,!0),document.addEventListener(`close`,dC,!0)),cC(lC),lC),Phe=()=>{--uC,uC>0||!lC||(document.removeEventListener(`toggle`,Mhe,!0),document.removeEventListener(`beforetoggle`,dC,!0),document.removeEventListener(`close`,dC,!0),lC.remove(),lC=void 0,oC.length=0)},Fhe=new Set([`$$slots`,`$$events`,`$$legacy`,`show`,`id`,`duration`,`position`,`children`]),Ihe=B(`<div><!></div>`),Lhe={hash:`svelte-o6w6r5`,code:`.sui.toast-base {position:fixed;inset:16px;z-index:99999;overflow:visible;margin:0;border:0;padding:0;width:auto;height:auto;background-color:transparent;font-family:var(--sui-font-family-default);font-size:var(--sui-font-size-default);font-weight:var(--sui-font-weight-normal, normal);text-align:center;pointer-events:none;-webkit-user-select:none;user-select:none;}body:has(.sui.bottom-navigation:not([inert]:not([hidden]))) .toast-base {bottom:calc(var(--sui-bottom-navigation-height) + 16px);}.sui.toast-base > .toast-lane {position:absolute;display:flex;flex-direction:column;margin-block:-4px;max-width:100%;}.sui.toast-base > .toast-lane.top-left, .sui.toast-base > .toast-lane.top-center, .sui.toast-base > .toast-lane.top-right {inset-block-start:0;}.sui.toast-base > .toast-lane.bottom-left, .sui.toast-base > .toast-lane.bottom-center, .sui.toast-base > .toast-lane.bottom-right {inset-block-end:0;}.sui.toast-base > .toast-lane.top-left, .sui.toast-base > .toast-lane.bottom-left {inset-inline-start:0;align-items:flex-start;}.sui.toast-base > .toast-lane.top-center, .sui.toast-base > .toast-lane.bottom-center {inset-inline:0;align-items:center;}.sui.toast-base > .toast-lane.top-right, .sui.toast-base > .toast-lane.bottom-right {inset-inline-end:0;align-items:flex-end;}.toast.svelte-o6w6r5 {margin-block:4px;width:max-content;max-width:80dvw;height:auto;overflow:clip;opacity:1;transition-duration:250ms;will-change:opacity;}
@starting-style {.toast.svelte-o6w6r5 {opacity:0;}
}.toast.svelte-o6w6r5 {pointer-events:auto;}.toast[aria-hidden=true].svelte-o6w6r5 {display:block;opacity:0;pointer-events:none;}
@supports (interpolate-size: allow-keywords) {.toast.svelte-o6w6r5 {interpolate-size:allow-keywords;}
@starting-style {.toast.svelte-o6w6r5 {margin-block:0;height:0;}
}.toast[aria-hidden=true].svelte-o6w6r5 {margin-block:0;height:0;}
}.toast.svelte-o6w6r5:has(.alert) {filter:drop-shadow(0 8px 8px var(--sui-popup-shadow-color));}`};function fC(e,t){O(t,!0),K(e,Lhe);let n=J(t,`show`,15,!1),r=J(t,`id`,3,void 0),i=J(t,`duration`,3,5e3),a=J(t,`position`,7,`auto`),o=vs(t,Fhe),s=j(void 0),c=j(void 0),l=j(!1),u=j(!1),d=A(()=>z(l)||z(u)),f=j(!1);So(()=>(M(s,Nhe(),!0),()=>{z(c)?.remove(),Phe()})),So(()=>{if(a()!==`auto`)return;let e=globalThis.matchMedia(`(width < 1024px)`),t=()=>{a(e.matches?`bottom-center`:`bottom-right`)};return t(),e.addEventListener(`change`,t),()=>{e.removeEventListener(`change`,t)}}),L(()=>{if(!z(s)||!z(c))return;if(!z(f)){z(c).remove(),M(l,!1),M(u,!1),!z(s).querySelector(`.toast`)&&z(s).matches(`:popover-open`)&&z(s).hidePopover();return}cC(z(s));let e=jhe(z(s),a());a().startsWith(`top-`)?e.prepend(z(c)):e.append(z(c)),sC(z(s))}),L(()=>{if(n()){M(f,!0);return}let e=globalThis.setTimeout(()=>{M(f,!1)},250);return()=>{globalThis.clearTimeout(e)}}),L(()=>{if(r(),n(),i(),z(d),!n()||!i()||z(d))return;let e=globalThis.setTimeout(()=>{n(!1)},i());return()=>{globalThis.clearTimeout(e)}});var p=Ihe(),m=()=>{M(l,!0)},h=()=>{M(l,!1)},g=()=>{M(u,!0)},_=e=>{M(u,!!e.relatedTarget&&!!z(c)?.contains(e.relatedTarget),!0)};fs(p,()=>({...o,class:[`sui`,`toast`,a()],"aria-hidden":!n(),onpointerenter:m,onpointerleave:h,onfocusin:g,onfocusout:_}),void 0,void 0,void 0,`svelte-o6w6r5`);var v=N(p),y=e=>{var n=H();xo(P(n),()=>t.children??Cr),U(e,n)};G(v,e=>{z(f)&&e(y)}),D(p),gs(p,e=>M(c,e),()=>z(c)),U(e,p),k()}var pC="```",Rhe=(e,t)=>t?`${pC}${e}\n${t}\n${pC}`:`${pC}${e}\n${pC}`,zhe=e=>{let{lang:t=`plain`,code:n=``}=e.match(/^```(?<lang>[^\s`]+)?\n(?:(?<code>.*)\n)?```/s)?.groups??{};return{lang:t,code:n}};function mC(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function hC(e,...t){throw mC(e,...t)}function gC(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);n.search=r.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Bhe(){return typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0}var _C=Bhe();function Vhe(){return _C&&`documentMode`in document?document.documentMode:null}var Hhe=Vhe();function Uhe(e){return _C&&e.test(navigator.platform)}function vC(e){return _C&&e.test(navigator.userAgent)}var yC=Uhe(/Mac|iPod|iPhone|iPad/),bC=vC(/^(?!.*Seamonkey)(?=.*Firefox).*/i);function Whe(){return!(!_C||!(`InputEvent`in window)||Hhe)&&`getTargetRanges`in new window.InputEvent(`input`)}var xC=Whe();function Ghe(){return _C&&!window.MSStream&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||/Macintosh/.test(navigator.userAgent)&&navigator.maxTouchPoints>1)}var SC=Ghe(),Khe=vC(/Android/),CC=vC(/Version\/[\d.]+.*Safari/)&&!Khe,wC=vC(/^(?=.*Chrome).*/i),TC=_C&&Khe&&wC,EC=vC(/AppleWebKit\/[\d.]+/)&&yC&&!wC;function qhe(){return 2047}var Jhe=qhe(),DC=CC||SC||EC?`\xA0`:`​`,OC=`
`,kC=bC?`\xA0`:DC,Yhe=`֑-߿יִ-﷽ﹰ-ﻼ`,Xhe=`A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿`;function Zhe(e,t){return RegExp(`^[^`+e+`]*[`+t+`]`)}var Qhe=Zhe(Xhe,Yhe),$he=Zhe(Yhe,Xhe),AC={bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},ege={directionless:1,unmergeable:2},jC={center:2,end:6,justify:4,left:1,right:3,start:5};function tge(e){let t={};for(let n of Object.keys(e))t[e[n]]=n;return t}var nge=tge(jC),MC={normal:0,segmented:2,token:1},rge=tge(MC),ige=Symbol.for(`@lexical/ctrlOrOtherKey`),NC=`$config`;function age(e){return()=>{}}function PC(e){return{type:e}}var FC=PC(`SELECTION_CHANGE_COMMAND`),oge=PC(`SELECTION_INSERT_CLIPBOARD_NODES_COMMAND`),IC=PC(`CLICK_COMMAND`),sge=PC(`BEFORE_INPUT_COMMAND`),cge=PC(`INPUT_COMMAND`),lge=PC(`COMPOSITION_START_COMMAND`),uge=PC(`COMPOSITION_END_COMMAND`),LC=PC(`DELETE_CHARACTER_COMMAND`),RC=PC(`INSERT_LINE_BREAK_COMMAND`),zC=PC(`INSERT_PARAGRAPH_COMMAND`),BC=PC(`CONTROLLED_TEXT_INSERTION_COMMAND`),VC=PC(`PASTE_COMMAND`),HC=PC(`REMOVE_TEXT_COMMAND`),UC=PC(`DELETE_WORD_COMMAND`),WC=PC(`DELETE_LINE_COMMAND`),GC=PC(`FORMAT_TEXT_COMMAND`),dge=PC(`SET_TEXT_FORMAT_COMMAND`),KC=PC(`UNDO_COMMAND`),qC=PC(`REDO_COMMAND`),JC=PC(`KEYDOWN_COMMAND`),YC=PC(`KEY_ARROW_RIGHT_COMMAND`),XC=PC(`MOVE_TO_END`),ZC=PC(`KEY_ARROW_LEFT_COMMAND`),QC=PC(`MOVE_TO_START`),$C=PC(`KEY_ARROW_UP_COMMAND`),ew=PC(`KEY_ARROW_DOWN_COMMAND`),tw=PC(`KEY_ENTER_COMMAND`),fge=PC(`KEY_SPACE_COMMAND`),nw=PC(`KEY_BACKSPACE_COMMAND`),rw=PC(`KEY_ESCAPE_COMMAND`),iw=PC(`KEY_DELETE_COMMAND`),aw=PC(`KEY_TAB_COMMAND`),ow=PC(`INSERT_TAB_COMMAND`),sw=PC(`INDENT_CONTENT_COMMAND`),cw=PC(`OUTDENT_CONTENT_COMMAND`),pge=PC(`DROP_COMMAND`),lw=PC(`FORMAT_ELEMENT_COMMAND`),mge=PC(`DRAGSTART_COMMAND`),hge=PC(`DRAGOVER_COMMAND`),gge=PC(`DRAGEND_COMMAND`),uw=PC(`COPY_COMMAND`),dw=PC(`CUT_COMMAND`),fw=PC(`SELECT_ALL_COMMAND`),_ge=PC(`CLEAR_EDITOR_COMMAND`),vge=PC(`CLEAR_HISTORY_COMMAND`),pw=PC(`CAN_REDO_COMMAND`),mw=PC(`CAN_UNDO_COMMAND`),yge=PC(`FOCUS_COMMAND`),bge=PC(`BLUR_COMMAND`),xge=PC(`KEY_MODIFIER_COMMAND`);function Sge(e,t){return{...t,[ige]:e}}var hw=Sge(`metaKey`,{ctrlKey:!yC,metaKey:yC}),Cge=Sge(`altKey`,{altKey:yC,ctrlKey:!yC}),wge=[[`altKey`,1],[`ctrlKey`,2],[`metaKey`,4],[`shiftKey`,8]];function gw(e,t,n){let r=e.get(t);r?r.push(n):e.set(t,[n])}var Tge=class{byKey=new Map;byCode=new Map;add(e){let{key:t,modifiers:n={}}=e;t.length>0||hC(399);let r=t.toLowerCase();for(let i of function(e){let t=[0];for(let[n,r]of wge){let i=e[n]||!1;i===`any`?t=t.concat(t.map(e=>e|r)):i&&(t=t.map(e=>e|r))}return t}(n))gw(this.byKey,`${i}:${r}`,e),t.length===1&&(/[0-9]/.test(t)?gw(this.byCode,`${i}:Digit${t}`,e):/[a-z]/.test(r)&&gw(this.byCode,`${i}:Key${r.toUpperCase()}`,e));return this}matches(e){let t=e.key;if(!t)return[];let n=function(e){let t=0;for(let[n,r]of wge)e[n]&&(t|=r);return t}(e),r=this.byKey.get(`${n}:${t.toLowerCase()}`),i=r?r.slice():[];if(this.byCode.size>0&&!(t.length===1&&t.charCodeAt(0)<=127)){let t=this.byCode.get(`${n}:${e.code}`);t&&i.push(...t)}return i}match(e){return this.matches(e)[0]}};function Ege(e){let t=new Tge;for(let n of e)t.add(n);return t}function Dge(e){let t=new Map;return{dispose(){for(let e of t.values())e.dispose();t.clear()},register(n,r){let i=t.get(n);i===void 0&&(i={dispose:e(n,r),holders:new Set},t.set(n,i));let a=()=>{let e=t.get(n);e&&e.holders.delete(a)&&e.holders.size===0&&(t.delete(n),e.dispose())};return i.holders.add(a),a}}}function Oge(){let e;try{e=`0.53.0+prod.esm`}catch{}return e??`"<unknown>+source"`}var kge=Oge(),_w=class{_front=new Set;_back=new Set;_cache;get size(){return this._front.size+this._back.size}addBack(e){return delete this._cache,this._front.has(e)||this._back.add(e),this}addFront(e){return delete this._cache,this._back.has(e)||this._front.add(e),this}delete(e){return delete this._cache,this._front.delete(e)||this._back.delete(e)}toArray(){let e=Array.from(this._front).reverse();for(let t of this._back)e.push(t);return e}toReadonlyArray(){return this._cache=this._cache||this.toArray(),this._cache}[Symbol.iterator](){return this.toReadonlyArray()[Symbol.iterator]()}},vw=null;function Age(e,t=1e3){return e instanceof yw?e.clone():e.size<t?new Map(e):new yw().init(new Map(e),void 0,e.size)}var yw=class e{_mutable=!1;_old=void 0;_nursery=void 0;_size=0;clone(){return this._mutable=!1,new e().init(this._old,this._nursery,this._size)}init(e,t,n){return this._old=e,this._nursery=t,this._size=n,this}get size(){return this._size}has(e){return this.get(e)!==void 0}getWithTombstone(e){let t=this._nursery&&this._nursery.get(e);return t===void 0?this._old&&this._old.get(e):t}get(e){let t=this.getWithTombstone(e);return t===vw?void 0:t}shouldCompact(){return this._nursery!==void 0&&2*this._nursery.size>this._size}getNursery(){return this._mutable&&this._nursery||(this.compact(),this._nursery=new Map(this._nursery),this._mutable=!0),this._nursery}compact(e=!1){if(this._nursery&&this._nursery.size>0&&(e||this.shouldCompact())){let e=new Map(this._old);for(let[t,n]of this._nursery)n===vw?e.delete(t):e.set(t,n);this._old=e,this._nursery=void 0}return this._mutable=!1,this}set(e,t){let n=this.getWithTombstone(e);if(n===t)return this;let r=this.getNursery();return n!==vw&&n!==void 0||(this._size++,n===vw&&r.delete(e)),r.set(e,t),this}delete(e){let t=this.has(e);return t&&(this.getNursery().set(e,vw),this._size--),t}getOrInsert(e,t){let n=this.get(e);return n===void 0?(this.set(e,t),t):n}getOrInsertComputed(e,t){let n=this.get(e);if(n!==void 0)return n;let r=t(e);return this.set(e,r),r}clear(){this._mutable=!1,this._old=void 0,this._nursery=void 0,this._size=0}*keys(){for(let e of this.entries())yield e[0]}*values(){for(let e of this.entries())yield e[1]}*entries(){let e=this._nursery,t=this._old;if(e){if(t)for(let n of t){let t=n[0],r=e.get(t);r!==vw&&(r!==void 0&&(n[1]=r),yield n)}for(let n of e)n[1]===vw||t&&t.has(n[0])||(yield n)}else t&&(yield*t)}forEach(e,t){t!==void 0&&(e=e.bind(t));for(let[t,n]of this.entries())e(n,t,this)}get[Symbol.toStringTag](){return`GenMap`}[Symbol.iterator](){return this.entries()}},bw=!1;function jge(e,t,...n){let r=bw,i;try{bw=e,i=t()}finally{bw=r}var a;return(a=i)===null||typeof a!=`object`&&typeof a!=`function`||typeof a.then!=`function`||hC(421),i}function Mge(){return bw}function Nge(e){let t=e.exportJSON(bw),n=e.constructor;return t.type!==n.getType()&&hC(130,n.name),Z(e)&&!Array.isArray(t.children)&&hC(59,n.name),t}function xw(){return fO()._blockCursorElement}function Sw(e){return e!==null&&e.nodeType===1&&e.hasAttribute(`data-lexical-slot`)}var Pge=EC||SC||CC;function Fge(){let e=QD().createElement(`img`);e.setAttribute(`data-lexical-decorator-boundary`,`true`),e.alt=``;for(let[t,n]of[[`position`,`absolute`],[`width`,`0px`],[`height`,`0px`],[`border`,`0px`],[`margin`,`0px`],[`padding`,`0px`]])e.style.setProperty(t,n,`important`);return e}function Cw(e){return e!==null&&e.nodeType===1&&e.hasAttribute(`data-lexical-decorator-boundary`)}var Ige=class e{element;before;after;constructor(e,t,n){this.element=e,this.before=t||null,this.after=n||null}withBefore(t){return new e(this.element,t,this.after)}withAfter(t){return new e(this.element,this.before,t)}withElement(t){return this.element===t?this:new e(t,this.before,this.after)}insertChild(e){let t=this.getInsertionAnchor();return t!==null&&t.parentElement!==this.element&&hC(357),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&hC(358),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&hC(359),this.element.replaceChild(e,t),this}getFirstChild(){let e=this.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;return t===this.getInsertionAnchor()?null:t}getFirstChildAnchor(){return this.after}resolveLeafPosition(e,t,n){if(this.element===e)return t===e&&n===0?`before`:`after`;let r=Lge(e,this.element);if(r===null)return`after`;let i=Array.prototype.indexOf.call(e.childNodes,r);if(i<0)return`after`;if(t===e)return n<=i?`before`:`after`;let a=Lge(e,t);if(a===null)return`after`;let o=Array.prototype.indexOf.call(e.childNodes,a);return o>=0&&o<=i?`before`:`after`}getInsertionAnchor(){return this.before}};function Lge(e,t){let n=t;for(;n!==null&&n.parentNode!==e;)n=n.parentNode;return n}var Rge=class e extends Ige{withBefore(t){return new e(this.element,t,this.after)}withAfter(t){return new e(this.element,this.before,t)}withElement(t){return this.element===t?this:new e(t,this.before,this.after)}getInsertionAnchor(){return super.getInsertionAnchor()||this.getManagedLineBreak()||this.getDecoratorBoundaryAnchor(`trailing`)}getFirstChildAnchor(){let e=super.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;for(;Sw(t);)e=t,t=t.nextSibling;Cw(t)&&(e=t,t=t.nextSibling);let n=e?e.nextSibling:this.element.firstChild;return n!==null&&n===xw()?n:e}getDecoratorBoundaryAnchor(e){let t;if(e===`leading`){let e=super.getFirstChildAnchor();for(t=e?e.nextSibling:this.element.firstChild;Sw(t);)t=t.nextSibling}else t=this.before?this.before.previousSibling:this.element.lastChild,t!==null&&t===xw()&&(t=t.previousSibling);return Cw(t)?t:null}setDecoratorBoundaryAnchor(e,t){let n=this.getDecoratorBoundaryAnchor(e);if(t!==(n!==null)){if(n!==null)this.element.removeChild(n);else if(e===`leading`){let e=this.getFirstChildAnchor();this.element.insertBefore(Fge(),e?e.nextSibling:this.element.firstChild)}else this.element.insertBefore(Fge(),this.before)}}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){let t=this.element,n=this.after===null?t.firstChild:this.after.nextSibling,r=e===`empty`&&Sw(n)?null:e;if(t.__lexicalLastChildKind!==r){if(t.__lexicalLastChildKind=r,r===null)this.removeManagedLineBreak();else{let e=r===`decorator`&&Pge;this.insertManagedLineBreak(e)}}}removeManagedLineBreak(){let e=this.element,t=this.getManagedLineBreak();if(t){t.remove();for(let t of e.querySelectorAll(`:scope > [data-lexical-managed-linebreak]`))t.remove();e.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){let t=this.element,n=this.getManagedLineBreak();if(n){let r=e?n.nextSibling:n;if(r&&r===t.querySelector(`:scope > br[data-lexical-managed-linebreak]`))return;this.removeManagedLineBreak()}let r=this.before||this.getDecoratorBoundaryAnchor(`trailing`),i=QD().createElement(`br`);if(i.setAttribute(`data-lexical-managed-linebreak`,`true`),t.insertBefore(i,r),e){let e=QD().createElement(`img`);e.setAttribute(`data-lexical-managed-linebreak`,`true`),e.style.setProperty(`display`,`inline`,`important`),e.style.setProperty(`border`,`0px`,`important`),e.style.setProperty(`margin`,`0px`,`important`),e.alt=``,t.insertBefore(e,i),t.__lexicalLineBreak=e}else t.__lexicalLineBreak=i}getFirstChildOffset(){let e=this.getFirstChild(),t=this.getInsertionAnchor(),n=0;for(let r=this.element.firstChild;r!==null&&r!==e&&r!==t;r=r.nextSibling)n++;return n}resolveChildIndex(e,t,n,r){if(n===this.element){let t=this.getFirstChildOffset(),n=xw(),i=this.element.childNodes,a=Math.min(r,i.length),o=0;for(let e=t;e<a;e++)i[e]!==n&&o++;return[e,Math.min(o,e.getChildrenSize())]}let i=zge(t,n);i.push(r);let a=zge(t,this.element),o=e.getIndexWithinParent();for(let e=0;e<a.length;e++){let t=i[e],n=a[e];if(t===void 0||t<n)break;if(t>n){o+=1;break}}return[e.getParentOrThrow(),o]}};function zge(e,t){let n=[],r=t;for(;r!==e&&r!==null;r=r.parentNode){let e=0;for(let t=r.previousSibling;t!==null;t=t.previousSibling)e++;n.push(e)}return r!==e&&hC(225),n.reverse()}var ww=!1,Bge=0;function Vge(){Bge=performance.now()}function Hge(e){return oO(e)&&e.hasAttribute(`data-lexical-managed-linebreak`)}function Uge(e,t,n){let r=qD(ID(n)),i=r&&tO(r,n._rootElement),a=null,o=null;i!==null&&i.anchorNode===e&&(a=i.anchorOffset,o=i.focusOffset);let s=e.nodeValue;s!==null&&gD(t,s,a,o,!1)}function Wge(e,t,n){if(Q(e)){let t=e.anchor.getNode();if(t.is(n)&&e.format!==t.getFormat())return!1}return WE(t)&&n.isAttached()}function Gge(e,t,n){for(let r=e;r&&!CO(r);r=OD(r)){let e=nD(r,t);if(e!==void 0){let t=$E(e,n);if(t)return VT(t)||!oO(r)?void 0:[r,t]}}}function Kge(e,t,n,r){ww=!0;let i=e._inputState.unprocessedBeforeInputData===null&&performance.now()-Bge>100;try{Vk(e,()=>{let a=$()||function(e){return e.read(`latest`,()=>{let e=$();return e===null?null:e.clone()})}(e),o=new Map,s=e._editorState,c=e._blockCursorElement,l=!1,u=``;for(let n of t){let t=n.type,d=n.target,f=Gge(d,e,s);if(!f)continue;let[p,m]=f;if(t===`characterData`)r?aE(m)&&m.isAttached()&&m.markDirty():i&&aE(m)&&WE(d)&&Wge(a,d,m)&&Uge(d,m,e);else{l=!0;for(let t of n.addedNodes){let n=nD(t,e);if(t!==c&&t.parentNode===d&&(n?e.getElementByKey(n)!==t:!(e._slotsUsed&&oO(t)&&t.hasAttribute(`data-lexical-slot`)||CO(t)))){if(bC){let e=(oO(t)?t.innerText:null)||t.nodeValue;e&&(u+=e)}d.removeChild(t)}}for(let e of n.removedNodes){let t=c===e;if(t||Cw(e)||Hge(e)){let t=n.nextSibling,r=n.previousSibling;d.insertBefore(e,t&&t.parentNode!==d?r?r.parentNode===d?r.nextSibling:null:d.firstChild:t)}t||o.set(p,m)}}}for(let[t,n]of o)n.reconcileObservedMutation(t,e);let d=n.takeRecords();for(let t of d)for(let n of t.addedNodes)n.nodeName!==`BR`||nD(n,e)||Hge(n)||n.remove();n.takeRecords(),a!==null&&(l&&cD(a),bC&&TD(e)&&a.insertRawText(u))})}finally{ww=!1}}function Tw(e,t,n){let r=e._observer;if(r!==null){let i=r.takeRecords();(!n||i.length>0)&&Kge(e,i,r,t)}}function qge(e){(function(e){ID(e).addEventListener(`textInput`,Vge,!0)})(e),e._observer=new MutationObserver((t,n)=>{Kge(e,t,n)})}function Ew(e,t,n){let{isEqual:r}=e;return t===n||r!==void 0&&r(t,n)}function Dw(e,t){return Ew(e,t,e.defaultValue)}function Ow(e){return typeof e==`object`&&!!e}function kw(e,t){let n=Pw(e,t).getter;return Ow(n)&&n.getterTable!==void 0||hC(405,t),Nw(n.getterTable)}function Aw(e,t){let n=Pw(e,t).setter;return Ow(n)&&n.setterTable!==void 0||hC(406,t),Nw(n.setterTable)}function jw(e,t,n){let{meta:r}=Pw(e,t);for(let e=0;;)if(r.kind===`aliased`){if(e===n)return Nw(r.aliases);e++,r=r.inner.meta}else r.kind===`nullable`||r.kind===`optional`?r=r.inner.meta:r.kind===`array`?r=r.item.meta:hC(407,t,String(n))}function Mw(e,t){let n=Pw(e,t),{setter:r}=n;Ow(r)&&r.setterTable!==void 0||hC(408,t);let i=String(n.defaultValue);return Lw(r.setterTable,i)||hC(409,t,i),r.setterTable[i]}function Nw(e){return Object.assign(Object.create(null),e)}function Pw(e,t){let n=e.get(t);return n===void 0&&hC(410,t),n}function Fw(e,t,n,r,i){i!==void 0&&Jge.add(i);let a=n===void 0,o=a?e(void 0):n;return a&&Zge(o),Object.assign(e,{accepts:i,defaultValue:o,isEqual:r,meta:t})}var Jge=new WeakSet,Yge=new WeakSet;function Xge(e){return typeof e==`object`&&e&&Yge.add(e),e}function Zge(e){if(typeof e==`object`&&e&&!Object.isFrozen(e)&&!Yge.has(e)){Object.freeze(e);for(let t of Object.values(e))Zge(t)}}function Qge(e){let{isEqual:t}=e;return t===void 0?void 0:(e,n)=>e==null||n==null?e===n:t(e,n)}function $ge(e,t){return n=>t(n)||Iw(e,n)}function Iw(e,t){let{accepts:n}=e;return n===void 0?function(e,t){let{accepts:n}=e;if(n!==void 0)return Iw(e,t)?{parsed:e(t)}:void 0;let r=e(t);return Dw(e,r)&&t!==e.defaultValue?void 0:{parsed:r}}(e,t)!==void 0:n.call(e,t)}function Lw(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Rw(e=``){return Fw(t=>typeof t==`string`?t:e,{kind:`string`},void 0,void 0,e=>typeof e==`string`)}var e_e=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function zw(e=0,t={}){let{integer:n,clamp:r}=t,i=n&&t.min!==void 0?Math.ceil(t.min):t.min,a=n&&t.max!==void 0?Math.floor(t.max):t.max,o=e=>typeof e==`string`&&e_e.test(e)?Number(e):e,s=e=>typeof e==`number`&&Number.isFinite(e)&&(!n||Number.isInteger(e)),c=e=>s(e)&&(i===void 0||e>=i)&&(a===void 0||e<=a);return Fw(t=>{let n=o(t);return r&&s(n)?i!==void 0&&n<i?i:a!==void 0&&n>a?a:n:c(n)?n:e},{clamp:r,integer:n,kind:`number`,max:a,min:i},void 0,void 0,e=>r?s(o(e)):c(o(e)))}function Bw(e=!1){return Fw(t=>typeof t==`boolean`?t:e,{kind:`boolean`},void 0,void 0,e=>typeof e==`boolean`)}function Vw(e,...t){let n=Xge(t.length===0?e[0]:t[0]),r=new Set(e);return Fw(e=>e!==void 0&&r.has(e)?e:n,{kind:`enum`,values:e},n,void 0,e=>r.has(e)&&(e!==void 0||n===void 0))}function Hw(e,t={}){let{defaultAsNull:n}=t;return Fw(t=>{if(t==null)return null;let r=e(t);return n&&Dw(e,r)?null:r},{defaultAsNull:n,inner:e,kind:`nullable`},void 0,Qge(e),$ge(e,e=>e==null))}function Uw(e,t={}){let{omitDefault:n}=t;return Fw(t=>{if(t===void 0)return;let r=e(t);return n&&Dw(e,r)?void 0:r},{inner:e,kind:`optional`,omitDefault:n},void 0,Qge(e),$ge(e,e=>e===void 0))}function Ww(){return e=>function(e){return{meta:{fields:e,kind:`node`}}}(e)}function Gw(e,t){let n=e=>typeof e==`string`&&Lw(t,e);return Fw(r=>n(r)?t[r]:e(r),{aliases:t,inner:e,kind:`aliased`},e.defaultValue,e.isEqual,t=>n(t)||Iw(e,t))}function t_e(e){return Fw(t=>{if(!Array.isArray(t))return[];let n=Array(t.length);for(let r=0;r<t.length;r++)n[r]=e(t[r]);return n},{item:e,kind:`array`},void 0,(t,n)=>{if(!Array.isArray(t)||!Array.isArray(n)||t.length!==n.length)return!1;for(let r=0;r<t.length;r++)if(!Ew(e,t[r],n[r]))return!1;return!0},e=>Array.isArray(e))}function Kw(e,t){return n_e(0,e,{getter:{field:t.field,getterTable:t.getterTable,method:t.getter,when:t.when},setter:{field:t.field,method:t.setter,setterTable:t.setterTable}},!0===t.derived)}function qw(e,t){return n_e(0,e,{getter:t.getter,setter:t.setter},!0===t.derived)}function n_e(e,t,n,r=!1){return Object.assign(e=>t(e),{accepts:t.accepts,defaultValue:t.defaultValue,...r?{derived:!0}:{},getter:n.getter,isEqual:t.isEqual,meta:t.meta,setter:n.setter})}var r_e=class{key;parse;unparse;isEqual;defaultValue;resetOnCopyNode;derived;schema;constructor(e,t){this.key=e,this.derived=!0===t.derived;let n=`meta`in(r=t.parse)&&typeof r.meta==`object`&&r.meta!==null&&`kind`in r.meta&&typeof r.meta.kind==`string`&&`defaultValue`in r?t.parse:void 0;var r;this.schema=n,this.parse=t.parse.bind(t),this.unparse=(t.unparse||d_e).bind(t),this.isEqual=t.isEqual?t.isEqual.bind(t):n!==void 0&&n.isEqual!==void 0?(e,t)=>Ew(n,e,t):Object.is,this.defaultValue=n===void 0?this.parse(void 0):n.defaultValue,this.resetOnCopyNode=t.resetOnCopyNode||!1}};function Jw(e,t){return new r_e(e,t)}function Yw(e,t,n=`latest`){let r=(n===`latest`?e.getLatest():e).__state;return r?r.getValue(t):t.defaultValue}function Xw(e,t,n){let r;if(Sk(),typeof n==`function`){let i=e.getLatest(),a=Yw(i,t);if(r=i_e(t,n(a)),t.isEqual(a,r))return i}else r=i_e(t,n);let i=e.getWritable();return c_e(i).updateFromKnown(t,r),i}function i_e(e,t){let{schema:n}=e;return n!==void 0&&n.meta.kind===`set`?e.parse(t):t}function a_e(e){let t=new Map,n=new Set;for(let{ownNodeConfig:r}of UO(typeof e==`function`?e:e.replace))if(r&&r.stateConfigs)for(let e of r.stateConfigs){let r;`stateConfig`in e?(r=e.stateConfig,e.flat&&n.add(r.key)):r=e,t.set(r.key,r)}return{flatKeys:n,sharedConfigMap:t}}var o_e=new Set([`__proto__`,`constructor`,`prototype`]),s_e=class e{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,n=void 0,r=new Map,i=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=n,this.knownState=r;let{sharedConfigMap:a}=this.sharedNodeState,o=i===void 0?function(e,t,n){let r=n.size;if(t)for(let i in t){let t=e.get(i);t&&n.has(t)||r++}return r}(a,n,r):i;this.size=o}getValue(e){let t=this.knownState.get(e);if(t!==void 0)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let n=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){let t=this.unknownState[e.key];t!==void 0&&(n=e.parse(t)),this.knownState.set(e,n)}return n}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){let e={...this.unknownState},t={};for(let[t,n]of this.knownState)t.isEqual(n,t.defaultValue)?delete e[t.key]:e[t.key]=t.unparse(n);for(let n of this.sharedNodeState.flatKeys)n in e&&(t[n]=e[n],delete e[n]);return u_e(e)&&(t.$=e),t}getWritable(t){if(this.node===t)return this;let{sharedNodeState:n,unknownState:r}=this,i=new Map(this.knownState);return new e(t,n,function(e,t,n){let r;if(n)for(let[i,a]of Object.entries(n)){if(o_e.has(i))continue;let n=e.get(i);n?t.has(n)||t.set(n,n.parse(a)):(r||={},r[i]=a)}return r}(n.sharedConfigMap,i,r),i,this.size)}resetOnCopyNode(){for(let e of this.knownState.keys())e.resetOnCopyNode&&this.knownState.set(e,e.defaultValue);return this}updateFromKnown(e,t){let n=e.key;this.sharedNodeState.sharedConfigMap.set(n,e);let{knownState:r,unknownState:i}=this;i&&n in i?(delete i[n],this.unknownState=u_e(i)):r.has(e)||this.size++,r.set(e,t)}updateFromUnknown(e,t){if(o_e.has(e))return;let n=this.sharedNodeState.sharedConfigMap.get(e);n?this.updateFromKnown(n,n.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){let{knownState:t}=this;for(let e of t.keys())t.set(e,e.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(let[t,n]of Object.entries(e))this.updateFromUnknown(t,n)}};function c_e(e){let t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new s_e(t,function(e){return e.__state?e.__state.sharedNodeState:PE(fO(),e.getType()).sharedNodeState}(t));return t.__state=n,n}function l_e(e,t){let n=e.getWritable(),r=t.$;return(n.__state||r)&&c_e(e).updateFromJSON(r),n}function u_e(e){if(e)for(let t in e)return e}function d_e(e){return e}function f_e(e,t,n){for(let[r,i]of t.knownState){if(e.has(r.key))continue;e.add(r.key);let t=n?n.getValue(r):r.defaultValue;if(t!==i&&!r.isEqual(t,i))return!0}return!1}function p_e(e,t,n){let{unknownState:r}=t,i=n?n.unknownState:void 0;if(r){for(let[t,n]of Object.entries(r))if(!e.has(t)&&(e.add(t),n!==(i?i[t]:void 0)))return!0}return!1}function m_e(e,t){let n=e.__state;return n&&n.node===e?n.getWritable(t):n}function Zw(e){return!WT(e)&&e.getTextContent!==zT.prototype.getTextContent}var Qw=Symbol.for(`@lexical/CachedTextSize`);function h_e(e,t){return pT.read(()=>{let n=0,r=e;for(let e=0;e<t&&r!==null;e++){let i=fT.get(r);if(i===void 0&&hC(345,r),Z(i)){let a=mT.get(r);if(a!==void 0&&Z(a)&&a.__parent!==i.__parent)n+=i.getTextContentSize();else{let e=hT.get(r),t=e&&e.__lexicalTextContent;typeof t!=`string`&&hC(346,i.getType()),n+=t.length}e<t-1&&!i.isInline()&&(n+=2)}else if(TT(i).size>0)n+=i.getTextContentSize();else{let e=i[Qw];e===void 0&&hC(347,i.getType(),r),n+=e}r=i.__next}return n},{editor:eT})}function g_e(e){Z(e)||TT(e).size>0||e[Qw]===void 0&&(e[Qw]=aE(e)?e.__text.length:e.getTextContentSize())}var __e=4,$w,eT,tT,nT=``,rT=null,iT=null,aT=null;function oT(){return{firstTextKey:aT,format:rT,style:iT}}function sT(e){e.firstTextKey!==null&&(rT=e.format,iT=e.style,aT=e.firstTextKey)}function cT(e){if(aT!==null)return;let t=e.__lexicalFirstTextKey;if(t===void 0&&hC(348),t===null)return;let n=mT.get(t);aE(n)&&(rT=n.getFormat(),iT=n.getStyle(),aT=t)}var lT,uT,dT,fT,pT,mT,hT,gT,_T,vT,yT=!1,bT=!1;function xT(e,t){let n=fT.get(e),r=mT.has(e);if(t!==null){let n=MT(e);n.parentNode===t&&t.removeChild(n)}if(!r){if(eT._keyToDOMMap.delete(e),Z(n)){let e=KO(n,fT);ST(e,0,e.length-1,null)}if(n!==void 0){for(let e of TT(n).values()){let t=ET(e);xT(e,null),t!==null&&t.remove()}SD(_T,tT,lT,n,`destroyed`)}}}function ST(e,t,n,r){for(let i=t;i<=n;++i){let t=e[i];t!==void 0&&xT(t,r)}}function CT(e,t){e.setProperty(`text-align`,t)}var v_e=`40px`;function y_e(e,t){let n=$w.theme.indent;if(typeof n==`string`){let r=e.classList.contains(n);t>0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}e.style.setProperty(`padding-inline-start`,t===0?``:`calc(${t} * var(--lexical-indent-base-value, ${v_e}))`),bD(e,`class`),bD(e,`style`)}function b_e(e,t){let n=e.style;t===0?CT(n,``):t===1?CT(n,`left`):t===2?CT(n,`center`):t===3?CT(n,`right`):t===4?CT(n,`justify`):t===5?CT(n,`start`):t===6&&CT(n,`end`),bD(e,`style`)}function wT(e,t){let n=function(e){let t=e.__dir;if(t!==null)return t;if(WT(e))return null;let n=e.getParent();return n===null||BD(n)&&n.__dir===null?`auto`:null}(t);n===null?e.removeAttribute(`dir`):e.dir=n}function x_e(e){let t=QD().createElement(`div`);return t.setAttribute(`data-lexical-slot`,e),t.style.display=`none`,t}function S_e(e,t,n){t||e.contentEditable===`false`?zve(n,eT):n.removeAttribute(`contenteditable`)}function C_e(e,t,n){let r=nT,i=oT();nT=``;let a=``,o=VT(e);for(let[r,i]of n){let n=x_e(r);S_e(t,o,n),t.appendChild(n),nT=``;let s=oT();DT(i,mO(e,n,eT)),sT(s),w_e(e,r,t,n),a+=nT}return sT(i),nT=r,a}function TT(e){return Ej(e)&&e.__slots!==null?e.__slots:Tj}function w_e(e,t,n,r){let i=vT.$getSlotTargetElement(e,t,n,eT);i!==null&&(r.parentElement!==i&&i.appendChild(r),r.style.display=``)}function ET(e){let t=hT.get(e);return t===void 0?null:t.parentElement}function T_e(e,t,n){let r=TT(e),i=TT(t);for(let[e,t]of r)if(!i.has(e)){let e=ET(t);xT(t,null),e!==null&&e.remove()}let a=nT,o=oT(),s=``,c=null,l=VT(t);for(let[e,a]of i){let i=r.get(e),o=i===void 0?null:ET(i);nT=``;let u=oT();if(o===null){o=x_e(e);let r=null;for(let e of n.children)if(!e.hasAttribute(`data-lexical-slot`)){r=e;break}n.insertBefore(o,r),DT(a,mO(t,o,eT))}else i===a?AT(a,o):(i!==void 0&&xT(i,o),DT(a,mO(t,o,eT)));if(sT(u),S_e(n,l,o),w_e(t,e,n,o),s+=nT,o.parentElement===n){let e=c===null?n.firstChild:c.nextSibling;e!==o&&n.insertBefore(o,e),c=o}}return sT(o),nT=a,s}function DT(e,t){let n=mT.get(e);if(n===void 0&&hC(60),t!==null){let r=fT.get(e);if(r!==void 0){let i=hT.get(e);if(i!==void 0){let a=Dj(r)?r.__slotHost:null,o=Dj(n)?n.__slotHost:null,s=r.__parent!==n.__parent||a!==o,c=o!==null&&i.parentElement!==t.element;if(s||c)return t.insertChild(i),AT(e,t.element)}}}let r=vT.$createDOM(n,eT);if(function(e,t,n){let r=n._keyToDOMMap;tD(t,n,e),r.set(e,t)}(e,r,eT),aE(n)?r.setAttribute(`data-lexical-text`,`true`):VT(n)&&(r.setAttribute(`data-lexical-decorator`,`true`),SO(r,{captureSelection:!0})),Z(n)){let e=nT,t=n.__indent,i=n.__size;wT(r,n),t!==0&&y_e(r,t);let a=TT(n),o=a.size>0?C_e(n,r,a):``;if(i===0)r.__lexicalTextContent=o,r.__lexicalFirstTextKey=null,nT+=o,a.size>0&&(r.__lexicalSlotTextLength=o.length);else{let t=i-1;if(OT(KO(n,mT),n,0,t,mO(n,r,eT)),o!==``){let t=r.__lexicalTextContent||``;r.__lexicalTextContent=o+t,nT=e+o+t}a.size>0&&(r.__lexicalSlotTextLength=o.length)}if(Zw(n)){let t=n.getTextContent();r.__lexicalTextContent=t,nT=e+t}let s=n.__format;s!==0&&b_e(r,s),n.isInline()||(D_e(0,n,r),kT(n,r))}else{let t=n.getTextContent();if(VT(n)){let t=n.decorate(eT,$w);t!==null&&k_e(e,t),r.contentEditable=`false`;let i=TT(n);i.size>0&&C_e(n,r,i)}nT+=t}return t!==null&&t.insertChild(r),vT.$decorateDOM(n,null,r,eT),g_e(n),SD(_T,tT,lT,n,`created`),r}function OT(e,t,n,r,i){let a=nT,o=oT();nT=``,rT=null,iT=null,aT=null;let s=n;for(;s<=r;++s){let t=oT();DT(e[s],i);let n=mT.get(e[s]);n!==null&&aE(n)?rT===null&&(rT=n.getFormat(),iT=n.getStyle(),aT=n.__key):Z(n)&&s<r&&!n.isInline()&&(nT+=OC),sT(t)}let c=eT._keyToDOMMap.get(t.__key);c===void 0&&hC(349,t.__key),c.__lexicalTextContent=nT,c.__lexicalFirstTextKey=aT,nT=a+nT,sT(o)}function E_e(e){return VT(e)&&!e.isInline()}function kT(e,t,n=mO(e,t,eT)){n.setDecoratorBoundaryAnchor(`leading`,E_e(e.getFirstChild())),n.setDecoratorBoundaryAnchor(`trailing`,E_e(e.getLastChild()))}function D_e(e,t,n){let r=mO(t,n,eT),i=function(e,t){if(e){let n=e.__last;if(n){let e=t.get(n);if(e)return tk(e)?`line-break`:VT(e)&&e.isInline()?`decorator`:null}return`empty`}return null}(t,mT);r.setManagedLineBreak(i)}function O_e(e,t,n){let r=t.__lexicalFirstTextKey;if(r!=null){let t=e.__key,i=r;for(;i!==null;){let e=mT.get(i);if(e===void 0){i=null;break}if(e.__parent===t)break;i=e.__parent}if(i!==null&&!n.has(i)){let e=mT.get(r);if(aE(e))return rT=e.getFormat(),void(iT=e.getStyle())}}t.__lexicalFirstTextKey=aT}function AT(e,t){let n=fT.get(e),r=mT.get(e);n!==void 0&&r!==void 0||hC(61);let i=yT||dT.has(e)||uT.has(e),a=DD(eT,e);if(n===r&&!i){let e;if(Z(n)){let t=a.__lexicalTextContent;typeof t!=`string`&&hC(355,n.getType()),e=t,cT(a)}else e=n.getTextContent();return nT+=e,a}if(n!==r&&i&&SD(_T,tT,lT,r,`updated`),vT.$updateDOM(r,n,a,eT)){let n=DT(e,null);return t===null&&hC(62),t.replaceChild(n,a),xT(e,null),n}if(Z(n)){Z(r)||hC(334,e);let t=r.__indent;(yT||t!==n.__indent)&&y_e(a,t);let o=r.__format;(yT||o!==n.__format)&&b_e(a,o);let s=i&&(TT(r).size>0||TT(n).size>0)?T_e(n,r,a):``;if(i){let e=nT;if(function(e,t,n){var r;rT=null,iT=null,aT=null,function(e,t,n){let r=nT,i=e.__size,a=t.__size;nT=``;let o=n.element,s=eT._keyToDOMMap.get(t.__key);s===void 0&&hC(351,t.__key);let c=a-i;if(!yT&&Math.abs(c)<=1&&i>=__e&&e.__first===t.__first&&(c!==0||!eT._cloneNotNeeded.has(e.__key))){let i=s.__lexicalTextContent,l=gT.get(e.__key);if(!yT&&!Zw(t)&&typeof i==`string`&&l!==void 0){let a=function(e,t){let n=t.size;if(n===0||n>=e.__size)return null;let r=e.__last,i=null,a=0;for(;r!==null&&a<n;){if(!t.has(r))return null;i=r;let e=mT.get(r);if(e===void 0)return null;r=e.__prev,a++}return a!==n||r!==null&&t.has(r)?null:i}(t,l);if(a!==null){let u=l.size;if(c===0){let e=h_e(a,u),n=a,c=0;for(;n!==null&&c<u;){let e=mT.get(n);if(e===void 0)break;let t=oT();AT(n,o),aE(e)&&rT===null&&(rT=e.getFormat(),iT=e.getStyle(),aT=e.__key),sT(t),n=e.__next,c++}let d=``;for(n=a,c=0;n!==null&&c<u;){let e=mT.get(n);if(e===void 0)break;let t;if(Z(e)){let r=eT._keyToDOMMap.get(n),i=r&&r.__lexicalTextContent;typeof i!=`string`&&hC(352,e.getType()),t=i}else t=e.getTextContent();d+=t,c<u-1&&Z(e)&&!e.isInline()&&(d+=OC),n=e.__next,c++}let f=s.__lexicalSlotTextLength||0,p=f>0?i.slice(f):i,m=p.slice(0,p.length-e)+d;s.__lexicalTextContent=m,nT=r+m,O_e(t,s,l);return}if(function(e,t,n,r,i,a,o,s){if(s!==1&&s!==-1||o!==(s===1?2:1))return!1;let c=o-s,l=e.__last;for(let e=0;e<c-1;e++){if(l===null)return!1;let e=fT.get(l);if(e===void 0)return!1;l=e.__prev}if(l===null)return!1;let u=mT.get(a),d=fT.get(l);if(u===void 0||d===void 0||u.__prev!==d.__prev)return!1;let f=[],p=a;for(let e=0;e<o;e++){if(p===null)return!1;f.push(p);let e=mT.get(p);p=e?e.__next:null}let m=[];p=l;for(let e=0;e<c;e++){if(p===null)return!1;m.push(p);let e=fT.get(p);p=e?e.__next:null}let h=new Set(m),g=new Set(f),_=[],v=0,y=0;for(;v<c&&y<o;)if(f[y]===m[v])_.push({key:f[y],kind:`reconcile`}),v++,y++;else if(g.has(m[v])){if(h.has(f[y]))return!1;_.push({key:f[y],kind:`create`,nextIndex:y}),y++}else _.push({key:m[v],kind:`destroy`}),v++;for(;v<c;)_.push({key:m[v++],kind:`destroy`});for(;y<o;)_.push({key:f[y],kind:`create`,nextIndex:y}),y++;let b=h_e(l,c);for(let e of _){let t=oT();if(e.kind===`reconcile`)AT(e.key,n.element);else if(e.kind===`destroy`)xT(e.key,n.element);else{let t=null;for(let n=e.nextIndex+1;n<o;n++){let e=eT._keyToDOMMap.get(f[n]);if(e!==void 0){t=e;break}}DT(e.key,n.withBefore(t??n.before))}if(e.kind!==`destroy`){let t=mT.get(e.key);t&&aE(t)&&rT===null&&(rT=t.getFormat(),iT=t.getStyle(),aT=t.__key)}sT(t)}let x=``;for(let e=0;e<o;e++){let t=mT.get(f[e]);if(t===void 0)return!1;let n;if(Z(t)){let r=eT._keyToDOMMap.get(f[e]),i=r&&r.__lexicalTextContent;typeof i!=`string`&&hC(350,t.getType()),n=i}else n=t.getTextContent();x+=n,e<o-1&&Z(t)&&!t.isInline()&&(x+=OC)}let S=r.__lexicalSlotTextLength||0,C=S>0?i.slice(S):i;return r.__lexicalTextContent=C.slice(0,C.length-b)+x,!0}(e,0,n,s,i,a,u,c)){let e=s.__lexicalTextContent;typeof e!=`string`&&hC(353),nT=r+e,O_e(t,s,l);return}}}if(c===0){let t=e.__first,n=0;for(;t!==null;){let e=mT.get(t);if(e===void 0)break;let r=yT||dT.has(t)||uT.has(t),i=oT();if(r)AT(t,o);else{let n,r;if(Z(e)){r=hT.get(t);let i=r&&r.__lexicalTextContent;typeof i!=`string`&&hC(354,e.getType()),n=i}else n=e.getTextContent();nT+=n,r!==void 0&&cT(r)}aE(e)?rT===null&&(rT=e.getFormat(),iT=e.getStyle(),aT=e.__key):Z(e)&&n<a-1&&!e.isInline()&&(nT+=OC),sT(i),t=e.__next,n++}s.__lexicalTextContent=nT,s.__lexicalFirstTextKey=aT,nT=r+nT;return}}if(i===1&&a===1){let r=e.__first,i=t.__first;if(r===i)AT(r,o);else{let e=MT(r),t=DT(i,null);try{e.parentNode===o?o.replaceChild(t,e):n.insertChild(t)}catch(n){if(typeof n==`object`&&n){let a=`${n.toString()} Parent: ${o.tagName}, new child: {tag: ${t.tagName} key: ${i}}, old child: {tag: ${e.tagName}, key: ${r}}.`;throw Error(a)}throw n}xT(r,null)}let a=mT.get(i);aE(a)&&rT===null&&(rT=a.getFormat(),iT=a.getStyle(),aT=a.__key)}else{let r=KO(e,fT),s=KO(t,mT);if(r.length!==i&&hC(227),s.length!==a&&hC(228),i===0)a!==0&&OT(s,t,0,a-1,n);else if(a===0){if(i!==0){let e=n.after==null&&n.before==null&&TT(t).size===0&&n.element.__lexicalLineBreak==null;ST(r,0,i-1,e?null:o),e&&(o.textContent=``)}}else(function(e,t,n,r,i,a){let o=r-1,s=i-1,c,l,u=a.getFirstChild(),d=0,f=0;for(;d<=o&&f<=s;){let e=t[d],r=n[f],i=oT();if(e===r)u=jT(AT(r,a.element)),d++,f++;else{if(l===void 0&&(l=A_e(n,f)),c===void 0)c=A_e(t,d);else if(!c.has(e)){d++,sT(i);continue}if(!l.has(e)){let t=MT(e);t.parentNode===a.element&&(u=jT(t)),xT(e,a.element),d++,c.delete(e),sT(i);continue}if(c.has(r)){let e=DD(eT,r);e!==u&&a.withBefore(u??a.before).insertChild(e),u=jT(AT(r,a.element)),d++,f++}else DT(r,a.withBefore(u??a.before)),f++}let o=mT.get(r);o!==null&&aE(o)?rT===null&&(rT=o.getFormat(),iT=o.getStyle(),aT=o.__key):Z(o)&&f<=s&&!o.isInline()&&(nT+=OC),sT(i)}let p=d>o,m=f>s;if(p&&!m){let t=n[s+1],r=t===void 0?null:eT.getElementByKey(t);OT(n,e,f,s,a.withBefore(r??a.before))}else m&&!p&&ST(t,d,o,a.element)})(t,r,s,i,a,n)}s.__lexicalTextContent=nT,s.__lexicalFirstTextKey=aT,nT=r+nT}(e,t,mO(t,n,eT)),BD(t)||(r=t,rT==null||rT===r.__textFormat||bT||r.setTextFormat(rT),function(e){iT==null||iT===e.__textStyle||bT||e.setTextStyle(iT)}(t))}(n,r,a),r.isInline()||(WT(r)||D_e(0,r,a),kT(r,a)),s!==``){let t=a.__lexicalTextContent||``;a.__lexicalTextContent=s+t,nT=e+s+t,a.__lexicalSlotTextLength=s.length}else(TT(r).size>0||TT(n).size>0)&&(a.__lexicalSlotTextLength=0);if(Zw(r)){let t=r.getTextContent();a.__lexicalTextContent=t,nT=e+t}}else{let e=a.__lexicalTextContent;typeof e!=`string`&&hC(356,n.getType()),nT+=e,cT(a)}if((yT||r.__dir!==n.__dir||r.__parent!==n.__parent)&&(wT(a,r),WT(r)&&!yT))for(let e of r.getChildren())Z(e)&&wT(DD(eT,e.getKey()),e)}else{let t=r.getTextContent();if(VT(r)){let t=r.decorate(eT,$w);t!==null&&k_e(e,t),i&&(TT(r).size>0||TT(n).size>0)&&T_e(n,r,a)}nT+=t}if(!bT&&WT(r)){let e=r.getLatest();if(e.__cachedText!==nT){let t=e.getWritable();t.__cachedText=nT,r=t}}return vT.$decorateDOM(r,n,a,eT),g_e(r),a}function k_e(e,t){let n=eT._pendingDecorators,r=eT._decorators;if(n===null){if(r[e]===t)return;n=iD(eT)}n[e]=t}function jT(e){let t=e.nextSibling;return t!==null&&t===eT._blockCursorElement&&(t=t.nextSibling),t}function A_e(e,t){let n=new Set;for(let r=t;r<e.length;r++)n.add(e[r]);return n}function j_e(e,t,n,r,i,a){nT=``,rT=null,iT=null,aT=null,yT=r===2,eT=n,$w=n._config,vT=n._config.dom||ok,tT=n._nodes,lT=eT._listeners.mutation,uT=i,dT=a,fT=e._nodeMap,pT=e,mT=t._nodeMap,bT=t._readOnly,hT=Age(n._keyToDOMMap),gT=function(){let e=new Map,t=t=>{for(let n of t){let t=mT.get(n);if(t===void 0)continue;let r=t.__parent;if(r===null)continue;let i=e.get(r);i===void 0&&(i=new Set,e.set(r,i)),i.add(n)}};return t(uT.keys()),t(dT),e}();let o=new Map;return _T=o,AT(`root`,null),eT=void 0,tT=void 0,uT=void 0,dT=void 0,fT=void 0,pT=void 0,mT=void 0,$w=void 0,hT=void 0,gT=void 0,_T=void 0,vT=ok,o}function MT(e){let t=hT.get(e);return t===void 0&&hC(75,e),t}function NT(e,t,n){Sk();let r=e.__key,i=e.getParent();if(i===null)return void(Oj(e)!==null&&hC(367,r,String(Oj(e))));let a=function(e){let t=$();if(!Q(t)||!Z(e))return t;let{anchor:n,focus:r}=t,i=n.getNode(),a=r.getNode();return PD(i,e)&&n.set(e.__key,0,`element`),PD(a,e)&&r.set(e.__key,0,`element`),t}(e),o=!1;if(Q(a)&&t){let t=a.anchor,n=a.focus;t.key===r&&(aj(t,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0),n.key===r&&(aj(n,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0)}else AA(a)&&t&&e.isSelected()&&e.selectPrevious();xj(e.getWritable(),t&&!o&&Q(a)?a:null),n||BD(i)||i.canBeEmpty()||!i.isEmpty()||NT(i,t),t&&a&&WT(i)&&i.isEmpty()&&i.selectEnd()}function M_e(e){return e}var N_e=Symbol.for(`ephemeral`);function PT(e){return e[N_e]||!1}var P_e={configurable:!0,enumerable:!1,value:void 0,writable:!0},FT=class{__type;__key;__parent;__prev;__next;__state;static getType(){let{ownNodeType:e}=zO(this);return e===void 0&&hC(64,this.name),e}static clone(e){hC(65,this.name)}$config(){return{}}config(e,t){let n=t.extends||qO(this.constructor);return Object.assign(t,{extends:n}),typeof e==`string`&&Object.assign(t,{type:e}),{[e]:t}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}resetOnCopyNodeFrom(e){this.__state&&=this.__state.getWritable(this).resetOnCopyNode()}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",P_e),Object.defineProperty(this,Qw,P_e),JE(this,e)}getType(){return this.__type}isInline(){hC(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e===`root`)return!0;let t=$E(e);if(t===null)break;e=t.__parent===null?Oj(t):t.__parent}return!1}isSelected(e){let t=e||$();if(t==null)return!1;let n=t.getNodes().some(e=>e.__key===this.__key);if(aE(this))return n;if(Q(t)&&t.anchor.type===`element`&&t.focus.type===`element`){if(t.isCollapsed())return!1;let e=this.getParent();if(VT(this)&&this.isInline()&&e){let n=t.isBackward()?t.focus:t.anchor;if(e.is(n.getNode())&&n.offset===e.getChildrenSize()&&this.is(e.getLastChild()))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){let e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),n=0;for(;t!==null;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){let e=this.getLatest().__parent;return e===null?null:$E(e)}getParentOrThrow(){let e=this.getParent();return e===null&&hC(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){let t=e.getParent();if(BD(t)||Oj(e)!==null)return Z(e)||e===this&&VT(e)||hC(194),e;e=t}return null}getTopLevelElementOrThrow(){let e=this.getTopLevelElement();return e===null&&hC(67,this.__key),e}getParents(){let e=[],t=this.getParent();for(;t!==null;)e.push(t),t=t.getParent();return e}getParentKeys(){let e=[],t=this.getParent();for(;t!==null;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){let e=this.getLatest().__prev;return e===null?null:$E(e)}getPreviousSiblings(){return wj(this.getPreviousSibling(),`previous`).reverse()}getNextSibling(){let e=this.getLatest().__next;return e===null?null:$E(e)}getNextSiblings(){return wj(this.getNextSibling(),`next`)}is(e){return e!=null&&this.__key===e.__key}isBefore(e){let t=mM(this,e);return t!==null&&(t.type===`descendant`||(t.type===`branch`?dM(t)===-1:(t.type!==`same`&&t.type!==`ancestor`&&hC(279),!1)))}isParentOf(e){return PD(e,this)}getNodesBetween(e){let t=this.isBefore(e),n=[],r=this,i=!0,a=0;for(;r!==null&&((i||a===0)&&n.push(r),!r.is(e));){!i&&a>0&&a--;let e=i&&Z(r)?t?r.getFirstChild():r.getLastChild():null;e!==null&&a++;let n=e||(t?r.getNextSibling():r.getPreviousSibling());i=n!==null,r=n||r.getParent()}return t?n:n.reverse()}isDirty(){let e=Tk()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){if(PT(this))return this;let e=$E(this.__key);return e===null&&hC(442,this.__key,this.__type),e}getWritable(){if(PT(this))return this;Sk();let e=wk(),t=Tk(),n=this.__key,r=t._cloneNotNeeded,i=r.get(n),a=e._selection;if(a!==null&&a.setCachedNodes(null),i!==void 0)return YE(i),i;let o=e._nodeMap,s=o.get(n);s===void 0&&hC(442,n,this.__type);let c=vO(s);return r.set(n,c),o.set(n,c),YE(c),c}getTextContent(){return Rj(this)}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){hC(70)}updateDOM(e,t,n){hC(71)}getDOMSlot(e){return new Ige(e)}exportDOM(e){return{element:pO(e).$createDOM(this,e)}}exportJSON(e=!1){let t=function(e,t){let n=OO(DO(e.constructor)),{generated:r,isCompactDefault:i}=n,a=r===null?void 0:t?r.exportCompactJSON:r.exportJSON;return a===void 0?function(e,t,n){let r=n?{type:e.__type}:{};return Z(e)&&(r.children=[]),function(e,t,n,r){for(let i=0;i<t.length;i++){let a=t[i];if(r&&a.derived)continue;let o;if(a.kind===`ownField`){let t=IO(e)[a.field];o=a.getterTable===void 0?t:Lw(a.getterTable,t)?a.getterTable[t]:void 0}else o=a.getter.call(e);a.kind===`ownField`&&a.when!==void 0&&(!LO(a,o)&&a.when.call(e)||(o=void 0)),r&&LO(a,o)||(n[a.key]=o)}}(e,t,r,n),n||(r.type=e.__type,r.version=1),r}(e,n.getters,t):t?a(e,i):a(e)}(this,e),n=this.__state?this.__state.toJSON():void 0;return n!==void 0&&Object.assign(t,n),t}static importJSON(e){hC(18,this.name)}updateFromJSON(e){return RO(l_e(this,e),e)}static transform(){return null}remove(e){NT(this,!0,e)}replace(e,t){Sk();let n=$();n!==null&&(n=n.clone()),UD(this,e);let r=this.getLatest(),i=this.__key,a=kj(r);a!==null&&hC(400,i,r.getType(),a.getKey(),a.getType());let o=e.__key,s=e.getWritable(),c=this.getParentOrThrow().getWritable(),l=c.__size,u=s.getParent();xj(s,Q(n)?n:null);let d=r.getPreviousSibling(),f=r.getNextSibling();NT(r,!1,!0),yj(c,s,d&&d.getWritable(),f&&f.getWritable()),c.__size=u!==null&&u.is(c)?l-1:l;let p=0;if(t&&(Z(this)&&Z(s)||hC(139),p=s.getChildrenSize(),s.splice(p,0,this.getChildren())),Q(n)){cD(n);for(let e of[n.anchor,n.focus])e.key===i&&(t&&e.type===`element`?e.set(s.__key,p+e.offset,`element`):wye(e,s))}return ZE()===i&&XE(o),s}insertAfter(e,t=!0){return Sj(this,`next`,e,t)}insertBefore(e,t=!0){return Sj(this,`previous`,e,t)}isParentRequired(){return!1}createParentElementNode(){return EE()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){return Cj(Yj(this,`previous`),e,t)}selectNext(e,t){return Cj(Yj(this,`next`),e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}};function F_e(e){return e instanceof FT}function I_e(e,t){let n=e.__mode,r=e.__format,i=e.__style,a=t.__mode,o=t.__format,s=t.__style,c=e.__state,l=t.__state;return(n===null||n===a)&&(r===null||r===o)&&(i===null||i===s)&&(e.__state===null||c===l||function(e,t){if(e===t)return!0;let n=new Set;return!(e&&f_e(n,e,t)||t&&f_e(n,t,e)||e&&p_e(n,e,t)||t&&p_e(n,t,e))}(c,l))}function L_e(e,t){let n=e.mergeWithSibling(t),r=Tk()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function R_e(e){let t,n,r=e;if(!QE(r)){if(r.__text!==``||!r.isSimpleText()||r.isUnmergeable()){for(;(t=r.getPreviousSibling())!==null&&aE(t)&&t.isSimpleText()&&!t.isUnmergeable()&&!QE(t);){if(t.__text!==``){if(I_e(t,r)){r=L_e(t,r);break}break}t.remove()}for(;(n=r.getNextSibling())!==null&&aE(n)&&n.isSimpleText()&&!n.isUnmergeable()&&!QE(n);){if(n.__text!==``){if(I_e(r,n)){r=L_e(r,n);break}break}n.remove()}}else r.remove()}}function IT(e){return z_e(e.anchor),z_e(e.focus),e}function z_e(e){for(;e.type===`element`;){let t=e.getNode(),n=e.offset,r,i;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),i=!0):(r=t.getChildAtIndex(n),i=!1),aE(r)){e.set(r.__key,i?r.getTextContentSize():0,`text`,!0);break}if(!Z(r))break;e.set(r.__key,i?r.getChildrenSize():0,`element`,!0)}}var B_e=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function LT(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e!=`string`||!B_e.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}function V_e(e,t,n,r,i){let a=LT(e,t);return a>=n&&a<=r&&Number.isInteger(a)?a:t}var H_e=e=>{let t=kw(e,`format`),n=Aw(e,`format`),r=Mw(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__dir;o!=null&&(a.direction=o);let s=t[e.__format];s!==void 0&&s!==``&&(a.format=s);let c=e.__indent;return c!==void 0&&c!==0&&(a.indent=c),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=V_e(t.indent,0,0,1/0),e.__textFormat=LT(t.textFormat,0);let o=t.textStyle;return e.__textStyle=typeof o==`string`?o:``,e}}};function U_e(e,t){e.__detail=t.__detail,e.__format=t.__format,e.__mode=t.__mode,e.__style=t.__style,e.__text=t.__text}var W_e=e=>{let t=kw(e,`mode`),n=jw(e,`detail`,0),r=jw(e,`format`,0),i=Aw(e,`mode`),a=Mw(e,`mode`);return{exportJSON:function(e){return{detail:e.__detail,format:e.__format,mode:t[e.__mode],style:e.__style,text:e.__text,type:e.__type,version:1}},exportCompactJSON:function(e){let n={type:e.__type},r=e.__detail;r!==void 0&&r!==0&&(n.detail=r);let i=e.__format;i!==void 0&&i!==0&&(n.format=i);let a=t[e.__mode];a!==void 0&&a!==`normal`&&(n.mode=a);let o=e.__style;o!==void 0&&o!==``&&(n.style=o);let s=e.__text;return s!==void 0&&s!==``&&(n.text=s),n},updateFromJSON:function(e,t){let o=t.detail;e.__detail=typeof o==`string`&&o in n?n[o]:LT(o,0);let s=t.format;e.__format=typeof s==`string`&&s in r?r[s]:LT(s,0);let c=t.mode;e.__mode=typeof c==`string`&&c in i?i[c]:a;let l=t.style;e.__style=typeof l==`string`?l:``;let u=t.text;return e.__text=typeof u==`string`?u:``,e},afterCloneFrom:U_e}},G_e=e=>{let t=kw(e,`format`),n=Aw(e,`format`),r=Mw(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__dir;o!=null&&(a.direction=o);let s=t[e.__format];s!==void 0&&s!==``&&(a.format=s);let c=e.__indent;return c!==void 0&&c!==0&&(a.indent=c),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=V_e(t.indent,0,0,1/0),e.__textFormat=LT(t.textFormat,0);let o=t.textStyle;return e.__textStyle=typeof o==`string`?o:``,e}}},K_e=()=>({exportJSON:function(e){return{type:e.__type,version:1}},exportCompactJSON:function(e){return{type:e.__type}}}),q_e=e=>{let t=kw(e,`mode`),n=jw(e,`format`,0);return{exportJSON:function(e){return{detail:e.__detail,mode:t[e.__mode],text:e.__text,format:e.__format,style:e.__style,type:e.__type,version:1}},exportCompactJSON:function(e){let t={type:e.__type},n=e.__format;n!==void 0&&n!==0&&(t.format=n);let r=e.__style;return r!==void 0&&r!==``&&(t.style=r),t},updateFromJSON:function(e,t){let r=t.format;e.__format=typeof r==`string`&&r in n?n[r]:LT(r,0);let i=t.style;return e.__style=typeof i==`string`?i:``,e}}},J_e=new WeakMap;function Y_e(e,t){for(let n=e;n!==null&&n!==t;n=Object.getPrototypeOf(n)){let t=n.prototype;if(t!==void 0&&Object.prototype.hasOwnProperty.call(t,`isInline`)&&typeof t.isInline==`function`&&!qve(t.isInline))try{let t=e.prototype.isInline.call(Object.create(e.prototype));return typeof t==`boolean`?t:null}catch{return null}}}function X_e(e){for(let{ownNodeConfig:t}of UO(e))if(t&&t.children!==void 0)return t.children}function Z_e(e){let t=J_e.get(e);if(t===void 0){let n={},r={},i=!1;for(let{klass:t,ownNodeConfig:a}of UO(e))a&&(r.inline===void 0&&a.inline!==void 0&&(n.inline=a.inline,r.inline=t),r.children===void 0&&a.children!==void 0&&(n.children=a.children,r.children=t),i||a.mergeAdjacent===void 0||(i=!0,!1!==a.mergeAdjacent&&(n.mergeAdjacent=a.mergeAdjacent,r.mergeAdjacent=t)));let a=function(e){let t=new Set,n=FO(e);for(let e of Object.keys(n))!0===n[e].derived&&t.add(e);for(let{ownNodeConfig:n}of UO(e)){let e=n&&n.stateConfigs;if(e)for(let n of e){let e=n instanceof r_e?n:n.stateConfig;e.derived&&t.add(e.key)}}return t}(e);r.inline!==void 0&&r.inline!==e&&Y_e(e,r.inline)!==void 0&&Y_e(e,r.inline)!==n.inline&&(delete n.inline,delete r.inline),r.mergeAdjacent===void 0||r.mergeAdjacent===e||function(e,t,n){let r=FO(e);for(let e of t.by)if(typeof e==`string`){if(!(e in r))return{entry:e,reason:`unknown`};if(n.has(e))return{entry:e,reason:`derived`}}else if(e.derived)return{entry:String(e.key),reason:`derived-state`};return null}(e,n.mergeAdjacent,a)===null&&function(e,t){if(!Array.isArray(t)||t.includes(`inline`))return null;for(let n of t){if(n===`inline`)continue;let t=X_e(n);if(!(t===`inline`||Array.isArray(t)&&t.includes(`inline`)&&t.every(t=>t===`inline`||t===e||e.prototype instanceof t)))return n}return null}(e,n.children)===null||(delete n.mergeAdjacent,delete r.mergeAdjacent),t=Object.freeze({...n,declaredBy:Object.freeze(r),derived:a,derivedNames:a}),J_e.set(e,t)}return t}function Q_e(e){let{derivedNames:t,...n}=Z_e(e);return Object.freeze({...n,derived:new Set(t)})}function RT(e){return!1}function $_e(){return{...nge,0:``}}function eve(){return{...jC,"":0}}var tve=$_e(),nve=eve(),rve=Ww()({direction:Kw(Vw([null,`ltr`,`rtl`]),{field:`__dir`}),format:Kw(Vw([``,`left`,`start`,`center`,`right`,`end`,`justify`]),{field:`__format`,getter:`getFormatType`,getterTable:tve,setter:`setFormat`,setterTable:nve}),indent:Kw(zw(0,{integer:!0,min:0}),{field:`__indent`}),textFormat:qw(zw(),{getter:{field:`__textFormat`,method:`getSerializedTextFormat`,when:`shouldSerializeTextStyles`},setter:{field:`__textFormat`}}),textStyle:qw(Rw(),{getter:{field:`__textStyle`,method:`getSerializedTextStyle`,when:`shouldSerializeTextStyles`},setter:{field:`__textStyle`}})});function ive(e){if(BD(e)&&!RT(Tk())){let t=null;for(let n of e.getChildren())t=n.isInline()?(t||n.replace(n.createParentElementNode())).append(n):null}}var zT=class extends FT{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;__slotHost;__slots;$config(){return this.config(Symbol.for(`ElementNode`),{$transform:ive,extends:FT,generated:H_e,json:rve})}constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style=``,this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=``,this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__slotHost=e.__slotHost,this.__slotHost!==null&&this.__parent!==null&&hC(384,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots),this.__style=e.__style,function(e,t){e.__dir=t.__dir,e.__format=t.__format,e.__indent=t.__indent,e.__textFormat=t.__textFormat,e.__textStyle=t.__textStyle}(this,e)}getFormat(){return this.getLatest().__format}getFormatType(){return nge[this.getFormat()]||``}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){return wj(this.getFirstChild(),`next`)}getChildrenKeys(){let e=[],t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0&&Nj(this).length===0}isDirty(){let e=Tk()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){let e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){let e=[];for(let t of Nj(this)){let n=Pj(this,t);if(Z(n))for(let t of n.getAllTextNodes())e.push(t)}let t=this.getFirstChild();for(;t!==null;){if(aE(t)&&e.push(t),Z(t))for(let n of t.getAllTextNodes())e.push(n);t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;Z(e);){let t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;Z(e);){let t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){let t=e>=this.getChildrenSize(),n=t?this.getLastChild():this.getChildAtIndex(e);return Z(n)&&(t?n.getLastDescendant():n.getFirstDescendant())||n}getFirstChild(){let e=this.getLatest().__first;return e===null?null:$E(e)}getFirstChildOrThrow(){let e=this.getFirstChild();return e===null&&hC(45,this.__key),e}getLastChild(){let e=this.getLatest().__last;return e===null?null:$E(e)}getLastChildOrThrow(){let e=this.getLastChild();return e===null&&hC(96,this.__key),e}getChildAtIndex(e){let t=this.getChildrenSize(),n,r;if(e<t/2){for(n=this.getFirstChild(),r=0;n!==null&&r<=e;){if(r===e)return n;n=n.getNextSibling(),r++}return null}for(n=this.getLastChild(),r=t-1;n!==null&&r>=e;){if(r===e)return n;n=n.getPreviousSibling(),r--}return null}getTextContent(){let e=Rj(this),t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let i=t[r];e+=i.getTextContent(),Z(i)&&r!==n-1&&!i.isInline()&&(e+=OC)}return e}getTextContentSize(){let e=function(e){let t=0;for(let n of Mj(e).values()){let e=$E(n);e!==null&&(t+=e.getTextContentSize())}return t}(this),t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let i=t[r];e+=i.getTextContentSize(),Z(i)&&r!==n-1&&!i.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(e!==``){let t=jC[e];return(this.getFormat()&t)!==0}return!1}hasTextFormat(e){let t=AC[e];return(this.getTextFormat()&t)!==0}getFormatFlags(e,t){return qE(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){Sk();let n=$(),r=e,i=t,a=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){let e=this.getFirstChild();if(aE(e)||Z(e))return e.select(0,0)}else if(!(e!==void 0&&e!==a||t!==void 0&&t!==a)){let e=this.getLastChild();if(aE(e)||Z(e))return e.select()}}r===void 0&&(r=a),i===void 0&&(i=a);let o=this.__key;return Q(n)?(n.anchor.set(o,r,`element`),n.focus.set(o,i,`element`),n.dirty=!0,n):XA(o,r,o,i,`element`,`element`)}selectStart(){let e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){let e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){let e=this.getWritable();return this.getChildren().forEach(e=>e.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){let t=this.getWritable();return t.__dir=e,t}setFormat(e){let t=this.getWritable();return t.__format=e!==``&&jC[e]||0,t}setStyle(e){let t=this.getWritable();return t.__style=e||``,t}setTextFormat(e){let t=this.getWritable();return t.__textFormat=e,t}setTextStyle(e){let t=this.getWritable();return t.__textStyle=e,t}setIndent(e){let t=this.getWritable();return t.__indent=e,t}splice(e,t,n){PT(this)&&hC(324,this.__key,this.__type);let r=this.getChildrenSize(),i=this.getWritable();e+t<=r||hC(226,String(e),String(t),String(r));for(let e of n);let a=i.__key,o=[],s=[],c=this.getChildAtIndex(e+t),l=null,u=r-t+n.length;if(e!==0){if(e===r)l=this.getLastChild();else{let t=this.getChildAtIndex(e);t!==null&&(l=t.getPreviousSibling())}}t>0&&(s=function(e,t,n,r){let i=[],a=t;for(let e=0;e<n;e++){a===null&&hC(100);let e=a.getNextSibling();i.push(a.getWritable()),a=e}return _j(e,r&&r.getWritable(),a&&a.getWritable()),e.__size-=i.length,i.map(e=>(vj(e),e.__prev=null,e.__next=null,e.__parent=null,e.__key))}(i,l===null?this.getFirstChild():l.getNextSibling(),t,l));let d=n.length>0&&l!==null?l.getWritable():null;for(let e of n){d!==null&&e.is(d)&&(l=d.getPreviousSibling(),d=l&&l.getWritable()),c!==null&&e.is(c)&&(c=c.getNextSibling());let t=e.getWritable();t.__parent===a&&u--,bj(t);let n=e.__key;yj(i,t,d,c&&c.getWritable()),e.__key===a&&hC(76),o.push(n),d=t}if(i.__size=u,s.length){let e=$();if(Q(e)){let t=new Set(s),n=new Set(o);for(let r of[e.anchor,e.focus])ave(r,t,n)&&aj(r,r.getNode(),this,l,c);u!==0||this.canBeEmpty()||BD(this)||this.remove()}}return i}getDOMSlot(e){return new Rge(e)}exportDOM(e){let{element:t}=super.exportDOM(e);if(oO(t)){let e=this.getIndent();e>0&&(t.style.paddingInlineStart=40*e+`px`,t.setAttribute(`data-lexical-indent`,String(e)));let n=this.getDirection();n&&(t.dir=n)}return{element:t}}shouldSerializeTextStyles(){if(BD(this))return!1;for(let e=this.getFirstChild();e!==null;e=e.getNextSibling())if(aE(e))return!1;return!0}getSerializedTextFormat(){let e=this.getTextFormat();return e!==0&&this.shouldSerializeTextStyles()?e:void 0}getSerializedTextStyle(){let e=this.getTextStyle();return e!==``&&this.shouldSerializeTextStyles()?e:void 0}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,n){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){t.read(`latest`,()=>{let n=mO(this,e,t),r=n.element;n.after&&n.after.parentNode!==r&&(n=n.withAfter(null)),n.before&&n.before.parentNode!==r&&(n=n.withBefore(null));let i=n.getManagedLineBreak();i&&n.insertManagedLineBreak(i.nodeName===`IMG`);let a=n.getFirstChild();for(let e of this.getChildrenKeys()){let i=t.getElementByKey(e);if(!i)continue;let o,s=a;for(;s&&!(o=nD(s,t))&&CO(s);)s=s.nextSibling;s!==i&&r.insertBefore(i,o?s:a||n.getInsertionAnchor()),a=i.nextSibling}kT(this,e,n)})}};function Z(e){return e instanceof zT}function ave(e,t,n){let r=e.getNode();for(;r;){let e=r.__key;if(t.has(e)&&!n.has(e))return!0;r=r.getParent()}return!1}var BT=class extends FT{__slotHost;__slots;constructor(e){super(e),this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__slotHost=e.__slotHost,this.__slotHost!==null&&this.__parent!==null&&hC(383,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots)}decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}};function VT(e){return e instanceof BT}function HT(e){let t=e.getLatest().__cachedText;return t===null||!xk()&&Tk()._dirtyType!==0?null:t}var UT=class extends zT{__cachedText;$config(){return this.config(`root`,{extends:zT})}constructor(){super(`root`),this.__cachedText=null}getTopLevelElementOrThrow(){hC(51)}getTextContent(){let e=HT(this);return e===null?super.getTextContent():e}getTextContentSize(){let e=HT(this);return e===null?super.getTextContentSize():e.length}remove(){hC(52)}replace(e){hC(53)}insertBefore(e){hC(54)}insertAfter(e){hC(55)}updateDOM(e,t){return!1}splice(e,t,n){for(let e of n)Z(e)||VT(e)||hC(282);return super.splice(e,t,n)}static importJSON(e){return oD().updateFromJSON(e)}collapseAtStart(){return!0}};function WT(e){return e instanceof UT}function GT(e){let t={};if(!e)return t;let n=``,r=``,i=null,a=!1,o=!1,s=!1,c=0,l=e.length,u=-1;for(let d=0;d<l;d++){let l=e[d];if(a)l===`*`&&e[d+1]===`/`&&(a=!1,d++);else if(o)u===-1&&(u=d),o=!1;else if(i===null){if(l!==`/`||e[d+1]!==`*`){if(l!==`"`&&l!==`'`){if(l!==`(`){if(l!==`)`){if(s||l!==`:`||c!==0){if(l===`;`&&c===0){u!==-1&&(s?r+=e.slice(u,d):n+=e.slice(u,d),u=-1);let i=n.trim(),a=r.trim();i!==``&&a!==``&&(t[i]=a),n=``,r=``,s=!1;continue}u===-1&&(u=d)}else u!==-1&&(n+=e.slice(u,d),u=-1),s=!0}else u===-1&&(u=d),c=Math.max(0,c-1)}else u===-1&&(u=d),c++}else u===-1&&(u=d),i=l}else u!==-1&&(s?r+=e.slice(u,d):n+=e.slice(u,d),u=-1),a=!0,d++}else u===-1&&(u=d),l===`\\`?o=!0:l===i&&(i=null)}u!==-1&&(s?r+=e.slice(u,l):n+=e.slice(u,l));let d=n.trim(),f=r.trim();return d!==``&&f!==``&&(t[d]=f),t}function ove(e,t,n){let r=n.trimEnd(),i=r.length-10;i>=0&&r.slice(i).toLowerCase()===`!important`?e.setProperty(t,r.slice(0,i).trim(),`important`):e.setProperty(t,n,``)}function KT(e,t,n=``){if(t===n)return;let r=GT(n),i=GT(t);for(let t in i)delete r[t],ove(e,t,i[t]);for(let t in r)e.removeProperty(t)}var sve=Ww()({detail:Kw(Gw(zw(),ege),{field:`__detail`}),format:Kw(Gw(zw(),AC),{field:`__format`}),mode:Kw(Vw([`normal`,`token`,`segmented`]),{field:`__mode`,getterTable:rge,setterTable:MC}),style:Kw(Rw(),{field:`__style`}),text:Kw(Rw(),{field:`__text`,getter:`getTextContent`,setter:`setTextContent`})});function qT(e,t){return 16&t?`code`:128&t?`mark`:32&t?`sub`:64&t?`sup`:null}function JT(e,t){return 1&t?`strong`:2&t?`em`:`span`}function YT(e,t,n,r,i){let a=r.classList,o=xD(i,`base`);o!==void 0&&a.add(...o),o=xD(i,`underlineStrikethrough`);let s=!1,c=8&t&&4&t;o!==void 0&&(8&n&&4&n?(s=!0,c||a.add(...o)):c&&a.remove(...o));for(let e in AC){let r=AC[e];if(o=xD(i,e),o!==void 0){if(n&r){if(s&&(e===`underline`||e===`strikethrough`)){t&r&&a.remove(...o);continue}((t&r)===0||c&&e===`underline`||e===`strikethrough`)&&a.add(...o)}else t&r&&a.remove(...o)}}bD(r,`class`)}function XT(e,t,n){let r=n.isComposing(),i=e+(r?DC:``),a=fO(),o=pO(a).$getDOMSlot(n,t,a),s=o.getFirstChild();if(s===null||s.nodeType!==Node.TEXT_NODE)return void o.insertChild(QD().createTextNode(i));let c=s,l=c.nodeValue;if(l!==i){if(r||bC||wC){let[e,t,n]=function(e,t){let n=e.length,r=t.length,i=0,a=0;for(;i<n&&i<r&&e[i]===t[i];)i++;for(;a+i<n&&a+i<r&&e[n-a-1]===t[r-a-1];)a++;return[i,n-i-a,t.slice(i,r-a)]}(l,i);c.replaceData(e,t,n)}else c.nodeValue=i}}function ZT(e,t,n,r,i,a){XT(i,e,t);let o=a.theme.text;o!==void 0&&YT(0,0,r,e,o)}function QT(e,t){let n=QD().createElement(t);return n.appendChild(e),n}function $T(e){return e!=null&&!0===e.__isInlineFormattable}var eE=class extends FT{__text;__format;__style;__mode;__detail;get __isInlineFormattable(){return!0}$config(){return this.config(`text`,{extends:FT,generated:W_e,importDOM:{"#text":()=>({conversion:dve,priority:0}),b:()=>({conversion:lve,priority:0}),code:()=>({conversion:rE,priority:0}),em:()=>({conversion:rE,priority:0}),i:()=>({conversion:rE,priority:0}),mark:()=>({conversion:rE,priority:0}),s:()=>({conversion:rE,priority:0}),span:()=>({conversion:cve,priority:0}),strong:()=>({conversion:rE,priority:0}),sub:()=>({conversion:rE,priority:0}),sup:()=>({conversion:rE,priority:0}),u:()=>({conversion:rE,priority:0})},json:sve})}constructor(e=``,t){super(t),this.__text=e,this.__format=0,this.__style=``,this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){return rge[this.getLatest().__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===ZE()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){let t=AC[e];return(this.getFormat()&t)!==0}isSimpleText(){let e=this.getLatest();return e.__type===`text`&&e.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return qE(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){let n=this.__format,r=qT(0,n),i=JT(0,n),a=r===null?i:r,o=QD().createElement(a),s=o;this.hasFormat(`code`)&&o.setAttribute(`spellcheck`,`false`),r!==null&&(s=QD().createElement(i),o.appendChild(s)),ZT(s,this,0,n,this.__text,e);let c=this.__style;return c!==``&&KT(o.style,c),o}updateDOM(e,t,n){let r=this.__text,i=e.__format,a=this.__format,o=qT(0,i),s=qT(0,a),c=JT(0,i),l=JT(0,a);if((o===null?c:o)!==(s===null?l:s))return!0;if(o===s&&c!==l){let e=t.firstChild;e??hC(48);let i=QD().createElement(l);return ZT(i,this,0,a,r,n),t.replaceChild(i,e),!1}let u=t;s!==null&&o!==null&&(u=t.firstChild,u??hC(49)),XT(r,u,this);let d=n.theme.text;d!==void 0&&i!==a&&YT(0,i,a,u,d);let f=e.__style,p=this.__style;return f!==p&&(KT(t.style,p,f),bD(t,`style`)),!1}exportDOM(e){let{element:t}=super.exportDOM(e);return oO(t)||hC(132),t.style.whiteSpace=`pre-wrap`,this.hasFormat(`lowercase`)?t.style.textTransform=`lowercase`:this.hasFormat(`uppercase`)?t.style.textTransform=`uppercase`:this.hasFormat(`capitalize`)&&(t.style.textTransform=`capitalize`),this.hasFormat(`bold`)&&(t=QT(t,`b`)),this.hasFormat(`italic`)&&(t=QT(t,`i`)),this.hasFormat(`strikethrough`)&&(t=QT(t,`s`)),this.hasFormat(`underline`)&&(t=QT(t,`u`)),{element:t}}selectionTransform(e,t){}setFormat(e){let t=this.getWritable();return t.__format=typeof e==`string`?AC[e]:e,t}setDetail(e){let t=this.getWritable();return t.__detail=typeof e==`string`?ege[e]:e,t}setStyle(e){let t=this.getWritable();return t.__style=e,t}toggleFormat(e){let t=qE(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){let e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){let e=this.getWritable();return e.__detail^=2,e}setMode(e){let t=MC[e];if(this.getLatest().__mode===t)return this;let n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.getLatest().__text===e)return this;let t=this.getWritable();return t.__text=e,t}select(e,t){Sk();let n=e,r=t,i=$(),a=this.getTextContent(),o=this.__key;if(typeof a==`string`){let e=a.length;n===void 0&&(n=e),r===void 0&&(r=e)}else n=0,r=0;if(!Q(i))return XA(o,n,o,r,`text`,`text`);{let e=ZE();e!==i.anchor.key&&e!==i.focus.key||XE(o),i.setTextNodeRange(this,n,this,r)}return i}selectStart(){return this.select(0,0)}selectEnd(){let e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,r){let i=this.getWritable(),a=i.__text,o=n.length,s=e;s<0&&(s=o+s,s<0&&(s=0));let c=$();if(r&&Q(c)){let t=e+o;c.setTextNodeRange(i,t,i,t)}return i.__text=a.slice(0,s)+n+a.slice(s+t),i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){Sk();let t=this.getLatest(),n=t.getTextContent();if(n===``)return[];let r=t.__key,i=ZE(),a=n.length;e.sort((e,t)=>e-t),e.push(a);let o=[],s=e.length;for(let t=0,r=0;t<a&&r<=s;r++){let i=e[r];i>t&&(o.push(n.slice(t,i)),t=i)}let c=o.length;if(c===1)return[t];let l=o[0],u=t.getParent(),d,f=t.getFormat(),p=t.getStyle(),m=t.__detail,h=!1,g=null,_=null,v=$();if(Q(v)){let[e,t]=v.isBackward()?[v.focus,v.anchor]:[v.anchor,v.focus];e.type===`text`&&e.key===r&&(g=e),t.type===`text`&&t.key===r&&(_=t)}t.isSegmented()?(d=iE(l),d.__format=f,d.__style=p,d.__detail=m,d.__state=m_e(t,d),h=!0):d=t.setTextContent(l);let y=[d];for(let e=1;e<c;e++){let n=iE(o[e]);n.__format=f,n.__style=p,n.__detail=m,n.__state=m_e(t,n);let a=n.__key;i===r&&XE(a),y.push(n)}let b=g?g.offset:null,x=_?_.offset:null,S=0;for(let e of y){if(!g&&!_)break;let t=S+e.getTextContentSize();if(g!==null&&b!==null&&b<=t&&b>=S&&(g.set(e.getKey(),b-S,`text`),b<t&&(g=null)),_!==null&&x!==null&&x<=t&&x>=S){_.set(e.getKey(),x-S,`text`);break}S=t}if(u!==null){(function(e){let t=e.getPreviousSibling(),n=e.getNextSibling();t!==null&&YE(t),n!==null&&YE(n)})(this);let e=u.getWritable(),t=this.getIndexWithinParent();h?(e.splice(t,0,y),this.remove()):e.splice(t,1,y),Q(v)&&ij(v,u,t,c-1)}return y}mergeWithSibling(e){let t=e===this.getPreviousSibling();t||e===this.getNextSibling()||hC(50);let n=this.__key,r=e.__key,i=this.__text,a=i.length;ZE()===r&&XE(n);let o=$();if(Q(o)){let i=o.anchor,s=o.focus;i!==null&&i.key===r&&oj(i,t,n,e,a),s!==null&&s.key===r&&oj(s,t,n,e,a)}let s=e.__text,c=t?s+i:i+s;this.setTextContent(c);let l=this.getWritable();return e.remove(),l}isTextEntity(){return!1}};function cve(e){return{forChild:oE(e.style),node:null}}function lve(e){let t=e,n=t.style.fontWeight===`normal`;return{forChild:oE(t.style,n?void 0:`bold`),node:null}}var tE=new WeakMap;function uve(e){if(!oO(e))return!1;if(e.nodeName===`PRE`)return!0;let t=e.style.whiteSpace;return typeof t==`string`&&t.startsWith(`pre`)}function dve(e){let t=e;e.parentElement===null&&hC(129);let n=t.textContent||``;if(function(e){let t,n=e.parentNode,r=[e];for(;n!==null&&(t=tE.get(n))===void 0&&!uve(n);)r.push(n),n=n.parentNode;let i=t===void 0?n:t;for(let e=0;e<r.length;e++)tE.set(r[e],i);return i}(t)!==null)return{node:dj(n)};if(n=n.replace(/\r/g,``).replace(/[ \t\n]+/g,` `),n===``)return{node:null};if(n[0]===` `){let e=t,r=!0;for(;e!==null&&(e=nE(e,!1))!==null;){let t=e.textContent||``;if(t.length>0){/[ \t\n]$/.test(t)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(n[n.length-1]===` `){let e=t,r=!0;for(;e!==null&&(e=nE(e,!0))!==null;)if((e.textContent||``).replace(/^( |\t|\r?\n)+/,``).length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return n===``?{node:null}:{node:iE(n)}}function nE(e,t){let n=e;for(;;){let e;for(;(e=t?n.nextSibling:n.previousSibling)===null;){let e=n.parentElement;if(e===null)return null;n=e}if(n=e,oO(n)){let e=n.style.display;if(e===``&&!lO(n)||e!==``&&!e.startsWith(`inline`))return null}let r=n;for(;(r=t?n.firstChild:n.lastChild)!==null;)n=r;if(WE(n))return n;if(n.nodeName===`BR`)return null}}var fve={code:`code`,em:`italic`,i:`italic`,mark:`highlight`,s:`strikethrough`,strong:`bold`,sub:`subscript`,sup:`superscript`,u:`underline`};function rE(e){let t=fve[e.nodeName.toLowerCase()];return t===void 0?{node:null}:{forChild:oE(e.style,t),node:null}}function iE(e=``){return HD(new eE(e))}function aE(e){return e instanceof eE}function oE(e,t){let n=e.fontWeight,r=e.textDecoration.split(` `),i=n===`700`||n===`bold`,a=r.includes(`line-through`),o=e.fontStyle===`italic`,s=r.includes(`underline`),c=e.verticalAlign,l=e.textTransform;return e=>((aE(e)||$T(e))&&(i&&!e.hasFormat(`bold`)&&e.toggleFormat(`bold`),a&&!e.hasFormat(`strikethrough`)&&e.toggleFormat(`strikethrough`),o&&!e.hasFormat(`italic`)&&e.toggleFormat(`italic`),s&&!e.hasFormat(`underline`)&&e.toggleFormat(`underline`),c!==`sub`||e.hasFormat(`subscript`)||e.toggleFormat(`subscript`),c!==`super`||e.hasFormat(`superscript`)||e.toggleFormat(`superscript`),l!==`lowercase`&&l!==`uppercase`&&l!==`capitalize`||e.hasFormat(l)||e.toggleFormat(l),t&&!e.hasFormat(t)&&e.toggleFormat(t)),e)}function sE(e,t){let{type:n,key:r,offset:i}=e,a=WD(e.key);return n===`text`?(aE(a)||hC(266,a.getType(),r),Xj(a,t,i)):(Z(a)||hC(267,a.getType(),r),vE(a,e.offset,t))}function cE(e,t){let{origin:n,direction:r}=t,i=r===`next`;Kj(t)?e.set(n.getKey(),t.offset,`text`):qj(t)?aE(n)?e.set(n.getKey(),Zj(n,r),`text`):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+ +!!i,`element`):(Jj(t)&&Z(n)||hC(268),e.set(n.getKey(),i?0:n.getChildrenSize(),`element`))}function lE(e){let t=$(),n=Q(t)?t:ZA();return uE(n,e),cD(n),n}function uE(e,t){cE(e.anchor,t.anchor),cE(e.focus,t.focus)}function dE(e){let{anchor:t,focus:n}=e,r=sE(t,`next`),i=sE(n,`next`),a=cM(r,i)<=0?`next`:`previous`;return oM(rM(r,a),rM(i,a))}function fE(e){let{direction:t,origin:n}=e,r=Yj(n,Hj(t)).getNodeAtCaret();return r?Yj(r,t):$j(n.getParentOrThrow(),t)}function pE(e,t=`root`){let n=[e];for(let r=Jj(e)?e.getParentCaret(t):e.getSiblingCaret();r!==null;r=r.getParentCaret(t))n.push(fE(r));return n}function pve(e){return!!e&&e.origin.isAttached()}function mve(e,t=`removeEmptySlices`){if(e.isCollapsed())return e;let n=`root`,r=`next`,i=t,a=_E(e,r),o=a.anchor.origin;for(;o!==null&&!BD(o);)o=o.getParent();let s=Z(o)?o.getFirstChild():null,c=pE(a.anchor,n),l=pE(a.focus.getFlipped(),n),u=new Set,d=[];for(let e of a.iterNodeCarets(n))if(Jj(e))u.add(e.origin.getKey());else if(qj(e)){let{origin:t}=e;Z(t)&&!u.has(t.getKey())||d.push(t)}let f=new Set;for(let e of d){let t=e.getParent();t===null||u.has(t.getKey())||f.add(t),Cve(e)}for(let e of f)!e.canBeEmpty()&&!BD(e)&&e.isEmpty()&&e.isAttached()&&e.remove();for(let e of a.getTextSlices()){if(!e)continue;let{origin:t}=e.caret,n=t.getTextContentSize(),a=fE(Yj(t,r)),o=t.getMode();if(Math.abs(e.distance)===n&&i===`removeEmptySlices`||o===`token`&&e.distance!==0)a.remove();else if(e.distance!==0){i=`removeEmptySlices`;let t=e.removeTextSlice(),n=e.caret.origin;if(o===`segmented`){let e=t.origin,n=iE(e.getTextContent()).setStyle(e.getStyle()).setFormat(e.getFormat());a.replaceOrInsert(n),t=Xj(n,r,t.offset)}n.is(c[0].origin)&&(c[0]=t),n.is(l[0].origin)&&(l[0]=t.getFlipped())}}let p=mE(c),m=mE(l),h=function(e,t,n){let r=e&&e.getParentAtCaret(),i=t&&t.getParentAtCaret(),a=r&&i&&mM(r,i);if(!a||a.type!==`branch`)return null;let o=(e,t)=>{let r;for(let i=e;i&&!i.is(a.commonAncestor);i=i.getParent()){if(BD(i))return;t&&!n.has(i.__key)||!dO(i)||(r=i)}return r},s=o(r,!1),c=s&&o(i,!0);return s&&c&&Nj(c).length===0?[s,c]:null}(p,m,u);if(h){let[e,t]=h;$j(e,`previous`).splice(0,t.getChildren());let n=t.getParent();for(t.remove(!0);n&&n.isEmpty();){let e=n;n=n.getParent(),e.remove(!0)}}else if(m){let e=function(e){if(Jj(e)){let t=e.origin;if(dO(t))return t}else{let t=e.getParentAtCaret();if(t&&dO(t))return t}return null}(m),t=e&&e.getParent(),n=e&&e.getParents().findLast(zD);if(e&&t&&!WT(t)&&e.isEmpty()&&u.has(e.getKey())&&Nj(e).length===0&&(!n||u.has(n.getKey()))){e.remove(!0);let n=t;for(;n&&!WT(n)&&n.isEmpty();){let e=n.getParent();if(e&&WT(e)&&e.getChildrenSize()<=1&&n.canBeEmpty())break;let t=n;n=e,t.remove(!0)}}}sD(o,s)!==null||o===null||o.isAttached()||sD(oD(),null);let g=mE([p,m,...c,...l]);if(g)return aM(rM(g,e.direction));hC(269,JSON.stringify(c.map(e=>e.origin.__key)))}function mE(e){let t=e.find(pve);return t&&hE(t)}function hE(e){let t=function(e){let t=e;for(;Jj(t);){let e=tM(t);if(!Jj(e))break;t=e}return t}(e.getLatest()),{direction:n}=t;if(aE(t.origin))return Kj(t)?t:Xj(t.origin,n,n);let r=t.getAdjacentCaret();return qj(r)&&aE(r.origin)?Xj(r.origin,n,Hj(n)):t}function gE(e){return Kj(e)&&e.offset!==Zj(e.origin,e.direction)}function _E(e,t){return e.direction===t?e:oM(rM(e.focus,t),rM(e.anchor,t))}function vE(e,t,n){let r=e.getChildrenSize(),i=(t>0?Math.min(Math.ceil(t),r):0)-+(n===`next`),a=i<0||i>=r?null:e.getChildAtIndex(i);return a===null?$j(e,n):Yj(a,n)}function yE(e,t=`root`){let n=0,r=e,i=tM(r);for(;i===null;){if(n--,i=r.getParentCaret(t),!i)return null;r=i,i=tM(r)}return i&&[i,n]}function hve(e){let{origin:t,offset:n,direction:r}=e;if(n===Zj(t,r))return e.getSiblingCaret();if(n===Zj(t,Hj(r)))return fE(e.getSiblingCaret());let[i]=t.splitText(n);return aE(i)||hC(281),rM(Yj(i,`next`),r)}function bE(e,t){for(let n of e)if(n!==null&&n.caret.origin.is(t))return n}function xE(e,t=null){let{origin:n}=e.caret,[r,i]=e.getSliceIndices();if(r===i)return null;if(r===0&&i===n.getTextContentSize())return n;let a=n.getParent(),o=t&&a&&rj(t,a)?n.getIndexWithinParent():-1,s=t?[t.anchor,t.focus].map(e=>[e,e.key===n.__key&&e.type===`text`?e.offset-r:a!==null&&e.key===a.__key&&e.offset===o?0:null]):[],c=n.splitText(r,i),l=c[r===0?0:1];a&&t&&t!==$()&&ij(t,a,o,c.length-1);for(let[e,t]of s)t!==null&&e.set(l.__key,t,`text`);return l}function gve(e,t){return!0}function SE(e,{$copyElementNode:t=VD,$splitTextPointCaretNext:n=hve,rootMode:r=`shadowRoot`,$shouldSplit:i=gve,removeEmptyDestination:a=!1}={}){if(Kj(e))return n(e);let o=e.getParentCaret(r);if(o){let{origin:n}=o;if(Jj(e)){let e=fE(o);if(a&&n.isEmpty())return n.remove(),e;if(!n.canBeEmpty()||!i(n,`first`))return e}let r=wj((s=e).getNodeAtCaret(),s.direction);(r.length>0||!a&&n.canBeEmpty()&&i(n,`last`))&&o.insert(t(n).splice(0,0,r))}var s;return o}function CE(e,t,n){let r=rM(t,`next`);Kj(r)&&(r.offset===0?r=Yj(r.origin,`previous`).getFlipped():r.offset===r.origin.getTextContentSize()&&(r=Yj(r.origin,`next`))),r.origin.is(e)&&(qj(r)||hC(342,e.getKey(),e.getType()),r=fE(r)),(e.is(r.getNodeAtCaret())||e.is(r.getFlipped().getNodeAtCaret()))&&e.remove(!0);for(let e=r;e;e=SE(e,n))r=e;return Kj(r)&&hC(283),r.insert(e.isInline()?EE().append(e):e),rM(Yj(e.getLatest(),`next`),t.direction)}function wE(e,t){let n=_E(Q(t)?dE(t):t,`next`),r=Aj(n.anchor.origin),i=Aj(e.getLatest());if(r===null?i!==null:!r.is(i))return!1;let a=hE($j(e,`next`)),o=rM(hE($j(e,`previous`)),`next`);return cM(n.anchor,a)<=0&&cM(n.focus,o)>=0}var TE=class extends zT{$config(){return this.config(`paragraph`,{children:`inline`,extends:zT,generated:G_e,importDOM:{p:()=>({conversion:_ve,priority:0})}})}createDOM(e){let t=QD().createElement(`p`),n=xD(e.theme,`paragraph`);return n!==void 0&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}exportDOM(e){let{element:t}=super.exportDOM(e);if(oO(t)){this.isEmpty()&&t.append(QD().createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e)}return{element:t}}exportJSON(e=!1){let t=super.exportJSON(e);if(t.textFormat===void 0||t.textStyle===void 0){let n=this.getChildren().find(aE),r=n?n.getFormat():this.getTextFormat(),i=n?n.getStyle():this.getTextStyle();e&&r===0||(t.textFormat=r),e&&i===``||(t.textStyle=i)}return t}extractWithChild(e,t,n){if(!Q(t)||this.getFormatType()===``&&this.getIndent()===0&&this.getStyle()===``)return!1;if(wE(this,t)){let e=this.getTextContent();return e!==``&&t.getTextContent()===e}return!1}insertNewAfter(e,t){let n=EE();n.setTextFormat(e.format),n.setTextStyle(e.style);let r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,t),n}collapseAtStart(){if(this.getChildren().every(e=>aE(e)&&!/\S/.test(e.getTextContent()))){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}};function _ve(e){let t=EE();if(xO(t,e),yO(e,t),t.getFormatType()===``){let n=e.getAttribute(`align`);n&&n&&n in jC&&t.setFormat(n)}return bO(t,e),{node:t}}function EE(){return HD(new TE)}function DE(e){return e instanceof TE}var vve=Ww()({detail:qw(zw(2),{getter:{field:`__detail`},setter:null}),mode:qw(Vw([`normal`]),{getter:{field:`__mode`,getterTable:{0:`normal`}},setter:null}),text:qw(Rw(` `),{getter:{field:`__text`,method:`getTextContent`},setter:null})}),OE=class extends eE{$config(){return this.config(`tab`,{extends:eE,generated:q_e,json:vve})}constructor(e=void 0){super(` `,e),this.__detail=2}createDOM(e){let t=super.createDOM(e),n=xD(e.theme,`tab`);return n!==void 0&&t.classList.add(...n),t}setTextContent(e){return super.setTextContent(` `)}spliceText(e,t,n,r){return n===``&&t===0||n===` `&&t===1||hC(286),this}setDetail(e){return e!==2&&hC(127),this}setMode(e){return e!==`normal`&&hC(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}};function kE(){return HD(new OE)}function AE(e){return e instanceof OE}var jE=null;function ME(e){jE=e}var NE=Symbol(`INTERNAL_SKIP_AFTER_CLONE_FROM`),yve=1;function PE(e,t){let n=FE(e,t);return n===void 0&&hC(30,t),n}function FE(e,t){return e._nodes.get(t)}var bve=typeof queueMicrotask==`function`?queueMicrotask:e=>{Promise.resolve().then(e)};function IE(e,t){let n=t===void 0?(()=>{let t=e.getRootNode();return GE(t)||JD(t)?rO(t):null})():t;if(!oO(n)||n.hasAttribute(`data-lexical-slot`))return!1;let r=rD(n),i=n.nodeName;return F_e(r)&&(i===`INPUT`||i===`TEXTAREA`||n.contentEditable===`true`&&VE(n)==null)}function LE(e){let t=e===null?null:iO(e);return sO(t)&&IE(t)}function RE(e,t,n){let r=e.getRootElement();if(!r)return!1;try{if(!t||!r.contains(t)||!r.contains(n))return!1}catch{return!1}return BE(t)===e&&e.read(`latest`,()=>!IE(t))}function zE(e){return e instanceof lk}function BE(e){let t=e;for(;t!=null;){let e=VE(t);if(zE(e))return e;t=OD(t)}return null}function VE(e){return e?e.__lexicalEditor:null}function xve(e){return Qhe.test(e)?`rtl`:$he.test(e)?`ltr`:null}function HE(e){return AE(e)||e.isToken()}function UE(e){return HE(e)||e.isSegmented()}function WE(e){return sO(e)&&e.nodeType===3}function GE(e){return sO(e)&&e.nodeType===9}function KE(e){let t=e;for(;t!=null;){if(WE(t))return t;t=t.firstChild}return null}function qE(e,t,n){let r=AC[t];if(n!==null&&(e&r)===(n&r))return e;let i=e^r;return t===`subscript`?i&=~AC.superscript:t===`superscript`?i&=~AC.subscript:t===`lowercase`?(i&=~AC.uppercase,i&=~AC.capitalize):t===`uppercase`?(i&=~AC.lowercase,i&=~AC.capitalize):t===`capitalize`&&(i&=~AC.lowercase,i&=~AC.uppercase),i}function Sve(e){return aE(e)||tk(e)||VT(e)}function JE(e,t){let n=function(){let e=jE;return jE=null,e}();if((t||=n&&n.__key)!=null)return void(e.__key=t);Sk(),Ck();let r=Tk(),i=wk(),a=``+yve++;i._nodeMap.set(a,e),Z(e)?r._dirtyElements.set(a,!0):r._dirtyLeaves.add(a),r._cloneNotNeeded.set(a,e),r._dirtyType===0&&(r._dirtyType=1),e.__key=a}function Cve(e){bj(e.getParent()===null?e:e.getWritable())}function YE(e){Ck(),PT(e)&&hC(323,e.__key,e.__type);let t=e.__parent===null?Dj(e)?e.__slotHost:null:e.__parent,n=wk(),r=Tk(),i=n._nodeMap,a=r._dirtyElements;t!==null&&function(e,t,n){let r=e;for(;r!==null;){if(n.has(r))return;let e=t.get(r);if(e===void 0)break;n.set(r,!1),r=e.__parent===null?Dj(e)?e.__slotHost:null:e.__parent}}(t,i,a);let o=e.__key;r._dirtyType===0&&(r._dirtyType=1),Z(e)?a.set(o,!0):r._dirtyLeaves.add(o)}function XE(e){Sk();let t=Tk(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,n!==null){let e=$E(n);e!==null&&e.getWritable()}if(e!==null){let t=$E(e);t!==null&&t.getWritable()}}}function ZE(){return xk()?null:Tk()._compositionKey}function QE(e){return!SC&&(CC||EC)&&e.__text===``&&e.__key===Tk()._compositionKey}function $E(e,t){let n=(t||wk())._nodeMap.get(e);return n===void 0?null:n}function eD(e,t){let n=nD(e,Tk());return n===void 0?null:$E(n,t)}function tD(e,t,n){e[`__lexicalKey_${t._key}`]=n}function nD(e,t){return e[`__lexicalKey_${t._key}`]}function rD(e,t){let n=e;for(;n!=null;){let e=eD(n,t);if(e!==null)return e;n=OD(n)}return null}function iD(e){let t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function aD(e){return e.read(()=>oD().getTextContent())}function wve(e,t){let n=_O(e.getEditorState()),r=[];for(let e of t){let t=n.get(e);t&&r.push(t)}r.length!==0&&e.update(()=>{for(let e of r)for(let t of e.keys()){let e=$E(t);e&&e.markDirty()}},e._pendingEditorState===null?{tag:`history-merge`}:void 0)}function oD(){return wk()._nodeMap.get(`root`)}function sD(e,t){if(!(BD(e)&&e.isAttached()&&(WT(e)?e.getChildrenSize()===0:e.isEmpty())&&(WT(e)||t!==null&&dO(t))))return null;let n=EE();return e.append(n),n}function cD(e){Sk();let t=wk();e!==null&&(e.dirty=!0,e.setCachedNodes(null),Q(e)&&Tk()._slotsUsed&&KA(e)),t._selection=e}function lD(e){Sk(),Tw(Tk(),e)}function uD(e){let t=function(e,t){let n=e;for(;n!=null;){let e=nD(n,t);if(e!==void 0)return e;n=OD(n)}return null}(e,Tk());return t===null?null:$E(t)}function dD(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function fD(e){let t=[];for(let n=e;n!==null;n=n._parentEditor)t.push(n);return t}var Tve=0;function pD(){return _C?Math.random().toString(36).replace(/[^a-z]+/g,``).substring(0,5):`s${(++Tve).toString(36)}`}function mD(e){return WE(e)?e.nodeValue:null}function hD(e,t,n){let r=qD(ID(t));if(r===null)return;let i=tO(r,t._rootElement),a=i.anchorNode,{anchorOffset:o,focusOffset:s}=i;if(a!==null){let t=mD(a),r=rD(a);if(t!==null&&aE(r)){if((t===DC||t===kC)&&n){let e=n.length;t=n,o=e,s=e}t!==null&&gD(r,t,o,s,e)}}}function gD(e,t,n,r,i){let a=e;if(a.isAttached()&&(i||!a.isDirty())){let o=a.isComposing(),s=!SC&&(CC||EC);if(a.isToken()&&o)return;let c=t;if((o||i)&&(!t.endsWith(DC)||s&&t===a.getTextContent()||(c=t.slice(0,-DC.length)),i&&!s)){let e=kC,t;for(;(t=c.indexOf(e))!==-1;)c=c.slice(0,t)+c.slice(t+e.length),n!==null&&n>t&&(n=Math.max(t,n-e.length)),r!==null&&r>t&&(r=Math.max(t,r-e.length))}let l=a.getTextContent();if(i||c!==l){let t=$();if(c===``){if(o&&!i&&s)return void _D(a,``,t);if(XE(null),CC||SC||EC)a.remove();else{let e=Tk();_D(a,``,t),setTimeout(()=>{e.update(()=>{a.isAttached()&&a.getTextContent()===``&&a.remove()})},20)}return}let l=a.getParent(),u=nj(),d=a.getTextContentSize(),f=ZE(),p=a.getKey();if(a.isToken()&&!o||f!==null&&p===f&&!o||Q(u)&&(l!==null&&!l.canInsertTextBefore()&&u.anchor.offset===0||u.anchor.key===e.__key&&u.anchor.offset===0&&!a.canInsertTextBefore()&&!o||u.focus.key===e.__key&&u.focus.offset===d&&!a.canInsertTextAfter()&&!o))return void a.markDirty();if(!Q(t)||n===null||r===null)return void _D(a,c,t);if(t.setTextNodeRange(a,n,a,r),a.isSegmented()){let e=iE(a.getTextContent());a.replace(e),a=e}_D(a,c,t)}}}function _D(e,t,n){if(e.setTextContent(t),Q(n)){let t=e.getKey(),r=!1;for(let i of[`anchor`,`focus`]){let a=n[i];a.type===`text`&&a.key===t&&(a.offset=Zj(e,a.offset,`clamp`),r=!0)}r&&(n._cachedNodes=null,n._cachedIsBackward=null)}}function vD(e){let t=e;for(;t!==null;){let e=t.getParent();if(e===null)return null;if(WT(e))return t;t=e}return null}function yD(e,t){let{anchor:n,focus:r}=e,i=n.key,a=n.offset,o=n.type,s=r.key,c=r.offset,l=r.type;if(IT(e),!WT(t))return e;let u=vD(n.getNode());return Z(u)&&u.isShadowRoot()&&u.is(vD(r.getNode()))&&(n.set(i,a,o),r.set(s,c,l)),e}function Eve(e){let t=oD();if(Q(e)){let t=e.anchor,n=e.focus,r=t.getNode();if(WT(r))return t.set(r.getKey(),0,`element`),n.set(r.getKey(),r.getChildrenSize(),`element`),yD(e,r),e;let i=r.getTopLevelElementOrThrow(),a=i.getParent();return a===null?(Z(i)&&(t.set(i.getKey(),0,`element`),n.set(i.getKey(),i.getChildrenSize(),`element`),yD(e,i)),e):(t.set(a.getKey(),0,`element`),n.set(a.getKey(),a.getChildrenSize(),`element`),yD(e,a),e)}{let e=t.select(0,t.getChildrenSize());return cD(yD(e,t)),e}}function bD(e,t){e.getAttribute(t)===``&&e.removeAttribute(t)}function xD(e,t){e.__lexicalClassNameCache===void 0&&(e.__lexicalClassNameCache={});let n=e.__lexicalClassNameCache,r=n[t];if(r!==void 0)return r;let i=e[t];if(typeof i==`string`){let e=gM(i);return n[t]=e,e}return i}function SD(e,t,n,r,i){if(n.size===0)return;let a=r.__type,o=r.__key,s=t.get(a);s===void 0&&hC(33,a);let c=s.klass,l=e.get(c);l===void 0&&(l=new Map,e.set(c,l));let u=l.get(o),d=u===`destroyed`&&i===`created`;(u===void 0||d)&&l.set(o,d?`updated`:i)}function CD(e,t,n){let r=e.getParent(),i=n,a=e;return r!==null&&(t&&n===0?(i=a.getIndexWithinParent(),a=r):t||n!==a.getChildrenSize()||(i=a.getIndexWithinParent()+1,a=r)),a.getChildAtIndex(t?i-1:i)}function wD(e,t){let n=e.offset;if(e.type===`element`)return CD(e.getNode(),t,n);{let r=e.getNode();if(t&&n===0||!t&&n===r.getTextContentSize()){let e=t?r.getPreviousSibling():r.getNextSibling();return e===null?CD(r.getParentOrThrow(),t,r.getIndexWithinParent()+ +!t):e}}return null}function TD(e){let t=ID(e).event,n=t&&t.inputType;return n===`insertFromPaste`||n===`insertFromPasteAsQuotation`}function ED(e,t,...n){return Lk(e,t,n[0],e)}function DD(e,t){let n=e._keyToDOMMap.get(t);return n===void 0&&hC(75,t),n}function OD(e){let t=e.assignedSlot||e.parentElement;if(t!==null)return t;let n=e.parentNode;return JD(n)?n.host:null}function kD(e){return GE(e)?e:oO(e)?e.ownerDocument:null}function AD(e,t){let n=parseFloat(e);return isFinite(n)?e.endsWith(`%`)?n*t/100:n:0}function Dve(e,t,n,r){let i=t.clientWidth,a=t.scrollWidth-i;if(a<=0)return 0;let o=e.getComputedStyle(t);if(o.overflowX!==`auto`&&o.overflowX!==`scroll`)return 0;let s=t.getBoundingClientRect(),c=t.offsetWidth,l=c>0&&Math.abs(s.width-c)>1?s.width/c:1,u=o.direction===`rtl`,d=s.left+t.clientLeft*l,f=d+AD(o.scrollPaddingLeft,i)*l,p=d+(i-AD(o.scrollPaddingRight,i))*l,m=n,h=Math.max(r,n+1);h-m>p-f&&(u?m=h-1:h=m+1);let g=0;if(m<f?g=m-f:h>p&&(g=h-p),g===0)return 0;let _=t.scrollLeft,v=_+g/l,y=g>0?Math.ceil(v):Math.floor(v),b=u?Math.min(0,Math.max(-a,y)):Math.max(0,Math.min(a,y)),x=_*l;return Math.abs(b)<Math.abs(_)&&m+x>=f&&h+x<=p&&(b=0),b===_?0:(t.scrollLeft=b,(t.scrollLeft-_)*l)}function jD(e){return Tk()._updateTags.has(e)}function MD(e){Sk(),Tk()._updateTags.add(e)}function ND(e){Sk(),Tk()._deferred.push(e)}function PD(e,t){let n=e.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}function FD(e){let t=kD(e);return t?t.defaultView:null}function ID(e){let t=e._window;return t===null&&hC(78),t}function LD(e){return Z(e)&&e.isInline()||VT(e)&&e.isInline()}function RD(e){let t=e.getLatest();for(;t!==null;){if(Oj(t)!==null&&Z(t))return t;let e=t.getParentOrThrow();if(BD(e))return e;t=e}return t}function zD(e){return Z(e)&&e.isShadowRoot()}function BD(e){return WT(e)||zD(e)}function VD(e,t=!1){let n=e.constructor.clone(e,NE);return JE(n,null),n.afterCloneFrom(e),t||n.resetOnCopyNodeFrom(e),n}function HD(e){let t=Tk(),n=e.getType(),r=FE(t,n);r===void 0&&hC(200,e.constructor.name,n);let{replace:i,replaceWithKlass:a}=r;if(i!==null){let t=i(e),r=t.constructor;return a===null?t instanceof e.constructor&&r!==e.constructor||hC(202,r.name,r.getType(),e.constructor.name,n):t instanceof a||hC(201,a.name,a.getType(),r.name,r.getType(),e.constructor.name,n),t.__key===e.__key&&hC(203,e.constructor.name,n,r.name,r.getType()),t}return e}function UD(e,t){!WT(e.getParent())||Z(t)||VT(t)||hC(99)}function WD(e){let t=$E(e);return t===null&&hC(63,e),t}function GD(e){if(!e||e.isInline())return!1;if(VT(e))return!0;if(Z(e)){if(e.isShadowRoot()){let t=e.getParent();return!(Z(t)&&t.isShadowRoot())}return!e.canBeEmpty()}return!1}function KD(e,t,n){n.style.removeProperty(`caret-color`),t._blockCursorElement=null;let r=e.parentElement;r!==null&&r.removeChild(e)}function qD(e){return _C?(e||window).getSelection():null}function Ove(e){let t=FD(e);return t?t.getSelection():null}function JD(e){return cO(e)&&`host`in e}var kve=[];function YD(e){let t=e.getRootNode();if(t===e||!JD(t))return kve;let n=[t],r=t.host;for(;;){let e=r.getRootNode();if(e===r||!JD(e))break;n.push(e),r=e.host}return n}function*XD(e){let t=[e],n;for(;n=t.pop();){yield*n.querySelectorAll(`[data-lexical-editor="true"]`);let e=(GE(n)?n:n.ownerDocument).createTreeWalker(n,NodeFilter.SHOW_ELEMENT),r;for(;r=e.nextNode();)r.shadowRoot&&t.push(r.shadowRoot)}}function ZD(e){return e===null?document:e.ownerDocument}function QD(){let e=Ok();return ZD(e===null?null:e._rootElement)}function $D(e,t){if(t===null||typeof e.getComposedRanges!=`function`)return null;let n=YD(t);if(n.length===0)return null;let r=e.getComposedRanges;try{let t=r.call(e,{shadowRoots:n})[0];if(t!==void 0)return t}catch{}try{let t=r.apply(e,n)[0];if(t!==void 0)return t}catch{}return null}function eO(e,t){let n=$D(e,t);if(n!==null){let e=Ave(n);if(e!==null)return e}return e.rangeCount>0?e.getRangeAt(0):null}function tO(e,t){let n=$D(e,t);return n===null?e:jve(n,Mve(e))}function Ave(e){let t=e.startContainer.ownerDocument;if(t===null)return null;let n=t.createRange();try{return n.setStart(e.startContainer,e.startOffset),n.setEnd(e.endContainer,e.endOffset),n}catch{return null}}function jve(e,t){let{startContainer:n,startOffset:r,endContainer:i,endOffset:a}=e;return t===`backward`?{anchorNode:i,anchorOffset:a,direction:t,focusNode:n,focusOffset:r}:{anchorNode:n,anchorOffset:r,direction:t,focusNode:i,focusOffset:a}}function Mve(e){return e.direction}function nO(e){let t=e.getRootNode();return GE(t)||JD(t)?t.activeElement:null}function rO(e){let t=e.activeElement;for(;t!==null&&t.shadowRoot!==null;){let e=t.shadowRoot.activeElement;if(e===null)break;t=e}return t}function iO(e){let t=e.target;if(t!==null&&oO(t)&&t.shadowRoot!==null&&typeof e.composedPath==`function`){let t=e.composedPath();if(t.length>0)return t[0]}return t}function aO(e){return oO(e)&&e.tagName===`A`}function Nve(e){return oO(e)&&e.tagName===`TR`}function oO(e){return sO(e)&&e.nodeType===1}function sO(e){return typeof e==`object`&&!!e&&`nodeType`in e&&typeof e.nodeType==`number`}function cO(e){return sO(e)&&e.nodeType===11}var Pve=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/i;function lO(e){return!(!oO(e)||!e.style.display.startsWith(`inline`))||Pve.test(e.nodeName)}var Fve=/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/i;function uO(e){return(!oO(e)||!e.style.display.startsWith(`inline`))&&Fve.test(e.nodeName)}function dO(e){if(VT(e)&&!e.isInline())return!0;if(!Z(e)||BD(e))return!1;let t=e.getFirstChild(),n=t===null||tk(t)||aE(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function fO(){return Tk()}function pO(e=fO()){return e._config.dom||ok}function mO(e,t,n=fO()){let r=pO(n).$getDOMSlot(e,t,n);return Z(e)&&(Ive(r)||hC(344,e.getKey(),e.getType())),r}function Ive(e){return e instanceof Rge}function hO(e,t,n=fO()){return KE(mO(e,t,n).element)}var gO=new WeakMap,Lve=new Map;function _O(e){if(!e._readOnly&&e.isEmpty())return Lve;e._readOnly||hC(192);let t=gO.get(e);return t||(t=function(e){let t=new Map;for(let[n,r]of e._nodeMap){let e=r.__type,i=t.get(e);i||(i=new Map,t.set(e,i)),i.set(n,r)}return t}(e),gO.set(e,t)),t}function vO(e){let t=e.constructor.clone(e,NE);return t.afterCloneFrom(e),t}function Rve(e){return(t=vO(e))[N_e]=!0,t;var t}function yO(e,t){let n=e.getAttribute(`data-lexical-indent`);if(n!==null){let e=parseInt(n,10);if(Number.isFinite(e)&&e>=0)return void t.setIndent(e)}let r=parseInt(e.style.paddingInlineStart,10)||0,i=Math.round(r/40);t.setIndent(i)}function bO(e,t){let n=t.getAttribute(`dir`);return n===`ltr`||n===`rtl`?e.setDirection(n):e}function xO(e,t){let n=t.style.textAlign;return n&&n in jC?e.setFormat(n):e}function SO(e,t){e.__lexicalUnmanaged=!0,t&&t.captureSelection!==void 0&&(e.__lexicalCapturedSelection=t.captureSelection)}function CO(e){return!0===e.__lexicalUnmanaged}function zve(e,t=fO()){let n=t.isEditable();e.contentEditable=n?`true`:`false`,n?e.__lexicalEditor=t:delete e.__lexicalEditor}function wO(e,t){let n=e;for(;n!=null;){if(!0===n.__lexicalCapturedSelection)return!0;if(oO(n)&&n.hasAttribute(`data-lexical-slot`)||nD(n,t)!==void 0)return!1;n=OD(n)}return!1}function TO(e,t){return Lw(e,t)&&e[t]!==FT[t]}var EO=new WeakMap;function DO(e){let t=EO.get(e);return t===void 0?function(e){let t=e.prototype!=null&&NC in e.prototype?e.prototype[NC]():void 0,n=function(e){if(!(e===FT||e.prototype instanceof FT)){let t=`<unknown>`,n=`<unknown>`;try{t=e.getType()}catch{}try{lk.version&&(n=JSON.parse(lk.version))}catch{}hC(290,e.name,t,n)}return e===BT||e===zT||e===FT}(e),r=!n&&TO(e,`getType`)?e.getType:void 0,i=r&&!(kO in r)?r.call(e):void 0,a,o=i;if(t){if(i)a=t[i];else{for(let[e,n]of Object.entries(t))o=e,a=n;if(!a)for(let e of Object.getOwnPropertySymbols(t)){let n=t[e];if(n){a=n;break}}}}let s={compiled:void 0,composed:void 0,config:{declaresOwnConfig:Lw(e.prototype,NC),klass:e,ownNodeConfig:a,ownNodeType:o},ownFieldsValidated:!1};EO.set(e,s);try{let t=function(e){let t=e.prototype,n=new Map,{fieldsBaseFirst:r}=PO(e);for(let[i,a]of r){let r=Wve(e,i,a);if(r===null)continue;if(Ow(r)){let t=r.field;if(t===`__proto__`&&hC(430,e.name,i),r.setterTable!==void 0){let{setterTable:t}=r,{meta:n}=a;for(let r of n.kind===`enum`?n.values:[a.defaultValue])Lw(t,String(r))||hC(431,e.name,i,JSON.stringify(r))}n.set(i,{field:t,key:i,kind:`ownField`,schema:a,setterTable:r.setterTable});continue}let o=t[r];typeof o!=`function`&&hC(432,e.name,i,r),n.set(i,{key:i,kind:`field`,schema:a,setter:o})}return n.size===0?Bve:[...n.values()]}(e),r=function(e){let t=e.prototype,n=new Map;for(let[r,i]of PO(e).fieldsDerivedFirst){let a=Uve(e,r,i);if(a===null)continue;if(Ow(a)){let o=a.field;o===`__proto__`&&hC(426,e.name,r);let s=a.when,c;if(s!==void 0){let n=t[s];typeof n!=`function`&&hC(427,e.name,r,s),c=n}n.set(r,{defaultValue:i.defaultValue,derived:i.setter===null,field:o,getterTable:a.getterTable,isEqual:i.isEqual,key:r,kind:`ownField`,schema:i,when:c});continue}let o=t[a];typeof o!=`function`&&hC(428,e.name,r,a),n.set(r,{defaultValue:i.defaultValue,derived:i.setter===null,getter:o,isEqual:i.isEqual,key:r,kind:`method`,schema:i})}return n.size===0?Hve:[...n.values()]}(e),i=PO(e),c=function(e,t,n){let r,i=e;for(let{klass:t,ownNodeConfig:n}of UO(e))n&&n.generated!==void 0&&(r===void 0?(r=n.generated,i=t):n.generated===r&&(i=t));return r===void 0?null:i===e||function(e,t){if(e.getters.length!==t.getters.length||e.setters.length!==t.setters.length)return!1;for(let n=0;n<e.getters.length;n++){let r=e.getters[n],i=t.getters[n];if(r.kind!==i.kind||r.key!==i.key||r.schema!==i.schema||r.derived!==i.derived||r.isEqual!==i.isEqual||!Object.is(r.defaultValue,i.defaultValue)||r.kind===`ownField`&&i.kind===`ownField`&&(r.field!==i.field||r.getterTable===void 0!=(i.getterTable===void 0)))return!1}for(let n=0;n<e.setters.length;n++){let r=e.setters[n],i=t.setters[n];if(r.kind!==i.kind||r.key!==i.key||r.schema!==i.schema||r.kind===`ownField`&&i.kind===`ownField`&&(r.field!==i.field||r.setterTable===void 0!=(i.setterTable===void 0)))return!1}return!0}(n,OO(DO(i)))?r:null}(e,0,{getters:r,setters:t});s.compiled={flatStates:i.flatStates,generated:c===null?null:c(i.fields),getters:r,isCompactDefault:Gve(r),setters:t},function(e,t,n,r){if(!t&&n){if(!TO(e,`getType`)){let t=e,r=function(){return this===t?n:FT.getType.call(this)};r[kO]=!0,e.getType=r}if(TO(e,`clone`)||(e.clone=(t,n)=>{ME(t);let r=new e;return n!==NE&&r.afterCloneFrom(t),r}),TO(e,`importJSON`)||(e.importJSON=r&&r.$importJSON||function(e){return t=>{let n=WO(e);return n.updateFromJSON===FT.prototype.updateFromJSON?function(e,t){return RO(e.__state||t.$!==void 0?l_e(e,t):e,t)}(n,t):n.updateFromJSON(t)}}(e)),!TO(e,`importDOM`)&&r){let{importDOM:t}=r;t&&(e.importDOM=()=>t)}let t=e.prototype;Lw(t,`getTextContent`)&&!Lw(t,`getTextContentSize`)&&(e.prototype.getTextContentSize=FT.prototype.getTextContentSize)}}(e,n,o,a),function(e){for(let{klass:t,ownNodeConfig:n}of UO(e)){let e=t.prototype;if(Lw(e,`afterCloneFrom`))continue;let r=Xve(t);if(r.length===0)continue;let i=Object.getPrototypeOf(e),a=n&&n.generated!==void 0?OO(DO(t)).generated:null,o=a!==null&&a.afterCloneFrom||((e,t)=>{let n=e,i=t;for(let e=0;e<r.length;e++){let t=r[e];n[t]=i[t]}});e.afterCloneFrom=function(e){i.afterCloneFrom.call(this,e),o(this,e)},e.afterCloneFrom[Yve]=!0}}(e),function(e,t){t&&t.inline!==void 0&&Lw(e.prototype,NC)&&!Object.prototype.hasOwnProperty.call(e.prototype,`isInline`)&&Object.defineProperty(e.prototype,"isInline",{configurable:!0,value:t.inline?BO:VO,writable:!0})}(e,a)}catch(t){throw EO.delete(e),t}return s}(e):t}function OO(e){let{compiled:t}=e;return t===void 0&&hC(422,e.config.klass.name),t}var kO=Symbol(`lexical.synthesizedGetType`),Bve=[];function AO(e,t,n,r){let i=n.method===void 0?r:n.method,a=PO(e).declaredBy.get(t);if(a===void 0)return n;let o=e.prototype,s=a.prototype;return jO(o,s,i)&&jO(o,s,r)?n:i}function jO(e,t,n){return e[n]===t[n]}function MO(e){return`set${e.charAt(0).toUpperCase()}${e.slice(1)}`}function NO(e){return`get${e.charAt(0).toUpperCase()}${e.slice(1)}`}var Vve={declaredBy:new Map,fields:new Map,fieldsBaseFirst:[],fieldsDerivedFirst:[],flatStates:[]};function PO(e){let t=DO(e);return t.composed===void 0&&(t.composed=function(e){let t=[],n=[],r=[];for(let{klass:i,ownNodeConfig:a}of UO(e)){let e=a&&a.json;n.push(i),t.push(e&&e.meta.kind===`node`?Object.entries(e.meta.fields):[]);let o=[];if(a&&a.stateConfigs)for(let e of a.stateConfigs)`stateConfig`in e&&e.flat&&o.push(e.stateConfig);r.push(o)}let i=new Map;for(let e=0;e<t.length;e++)for(let[n,r]of t[e])i.has(n)||i.set(n,r);let a=new Map,o=new Map,s=new Map;for(let e=t.length-1;e>=0;e--){for(let[r,s]of t[e]){let t=i.get(r);t===void 0||a.has(r)||a.set(r,t),t===void 0||s!==t||o.has(r)||o.set(r,n[e])}for(let t of r[e])s.has(t.key)||s.set(t.key,t)}return i.size===0&&s.size===0?Vve:{declaredBy:o,fields:a,fieldsBaseFirst:[...a],fieldsDerivedFirst:[...i],flatStates:[...s.values()]}}(e)),t.composed}function FO(e){let{fieldsDerivedFirst:t,flatStates:n}=PO(e),r={};for(let e of n)e.schema&&(r[e.key]=e.schema);for(let[e,n]of t)r[e]=n;return r}var Hve=[];function Uve(e,t,n){let r=n.getter;if(r===null)return null;let i=r===void 0?NO(t):r;return Ow(i)?AO(e,t,i,NO(t)):i}function Wve(e,t,n){let r=n.setter;if(r===null)return null;let i=r===void 0?MO(t):r;return Ow(i)?AO(e,t,i,MO(t)):i}function IO(e){return e}function LO(e,t){let{defaultValue:n,isEqual:r}=e;return t===void 0||t===n||r!==void 0&&r(t,n)}function Gve(e){let t;return(n,r)=>{t===void 0&&(t=new Map(e.map(e=>[e.key,e])));let i=t.get(n);return i!==void 0&&LO(i,r)}}function Kve(e){let{setterTable:t,schema:n}=e,{defaultValue:r}=n;return t===void 0?r:t[String(r)]}function RO(e,t){let{flatStates:n,generated:r,setters:i}=OO(DO(e.constructor)),a=function(e,t,n){let r=e;for(let e=0;e<n.length;e++){let i=n[e],a=t[i.key];if(a!==void 0){let e=i.parse(a);r=Xw(r,i,()=>e)}}return r}(e,t,n);return r!==null&&r.updateFromJSON!==void 0?r.updateFromJSON(a,t):function(e,t,n){for(let r=0;r<n.length;r++){let i=n[r],a=i.schema(t[i.key]);i.kind===`ownField`?IO(e)[i.field]=i.setterTable===void 0?a:Lw(i.setterTable,a)?i.setterTable[a]:Kve(i):i.setter.call(e,a)}return e}(a,t,i)}function zO(e){return DO(e).config}function BO(){return!0}function VO(){return!1}function qve(e){return e===BO||e===VO}function Jve(e){let t=[];for(let n of[e.getter,e.setter])Ow(n)&&n.field!==`__proto__`&&!t.includes(n.field)&&t.push(n.field);return t}var Yve=`__lexicalSynthesizedAfterCloneFrom`;function HO(e){let{declaredBy:t,fieldsBaseFirst:n}=PO(e),r=[];for(let[i,a]of n)if(t.get(i)===e)for(let e of Jve(a))r.includes(e)||r.push(e);return r}function Xve(e){let t=HO(e);if(t.length===0)return t;let n=new Set;for(let{klass:t}of UO(e))if(t!==e)for(let e of HO(t))n.add(e);return n.size===0?t:t.filter(e=>!n.has(e))}function*UO(e){for(let t=e;t&&(t===FT||F_e(t.prototype));){let e=zO(t),n=e.declaresOwnConfig;yield n?e:{...e,ownNodeConfig:void 0},t=n&&e.ownNodeConfig&&e.ownNodeConfig.extends||qO(t)}}function WO(e){let t=fO();Sk();let n=t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e)),r=new n.klass;return n.replace===null?r:HD(r)}var GO=(e,t)=>{let n=e;for(;n!=null&&!WT(n);){if(t(n))return n;n=n.getParent()}return null};function KO(e,t){let n=[],r=e.__first;for(;r!==null;){let e=t===null?$E(r):t.get(r);e??hC(174),n.push(r),r=e.__next}return n}function qO(e){let t=Object.getPrototypeOf(e);if(typeof t==`function`&&t!==Function.prototype)return t;let n=e.prototype&&Object.getPrototypeOf(e.prototype);return n?n.constructor:null}function JO(e){return new ZO(Age(e._nodeMap),null,e._slotsUsed)}function YO(){return new ZO(new Map([[`root`,new UT]]),null,!1)}function XO(e){let t=e.constructor,n=Nge(e);if(Z(e)){let t=n.children,r=e.getChildren();for(let e=0;e<r.length;e++)t.push(XO(r[e]))}let r=Nj(e);if(r.length>0){let i={};for(let n of r){let r=Pj(e,n);r===null&&hC(366,t.name,n),i[n]=XO(r)}n.$slots=i}return n}function Zve(e){return e instanceof ZO}var ZO=class e{_nodeMap;_movedNodes;_selection;_flushSync;_readOnly;_parsed;_slotsUsed;constructor(e,t=null,n=!1){this._nodeMap=e,this._movedNodes=null,this._selection=t||null,this._flushSync=!1,this._readOnly=!1,this._parsed=!1,this._slotsUsed=n}isEmpty(){return this._nodeMap.size<=1&&this._selection===null}read(e,t){return Nk(t&&t.editor||null,this,e)}clone(t){let n=new e(this._nodeMap,t===void 0?this._selection:t,this._slotsUsed);return n._readOnly=!0,n._parsed=this._parsed,n}toJSON(e){return jge(typeof e==`boolean`&&e,()=>Nk(null,this,()=>({root:XO(oD())})))}},QO=class extends zT{$config(){return this.config(`artificial`,{extends:zT})}createDOM(e){return QD().createElement(`div`)}},$O=class extends FT{$config(){return this.config(`linebreak`,{extends:FT,generated:K_e,importDOM:{br:e=>nk(e)||rk(e)?null:{conversion:Qve,priority:0}}})}getTextContent(){return`
`}createDOM(){return QD().createElement(`br`)}updateDOM(){return!1}isInline(){return!0}};function Qve(e){return{node:ek()}}function ek(){return HD(new $O)}function tk(e){return e instanceof $O}function nk(e){let t=e.parentElement;if(t!==null&&uO(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&ik(n)){let n=t.lastChild;if(n===e||n.previousSibling===e&&ik(n))return!0}}return!1}function rk(e){let t=e.parentElement;if(t!==null&&uO(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&ik(n))return!1;let r=t.lastChild;if(r===e||r.previousSibling===e&&ik(r))return!0}return!1}function ik(e){return WE(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||``)}function $ve(e){console.warn(e)}function ak(e,t,n,r,i){let a=e._keyToDOMMap;a.clear(),e._editorState=YO(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,i&&i.preserveUpdateQueue||(e._updateTags=new Set,e._updates=[],e._cascadeCount=0),e._blockCursorElement=null,e._inputState.handledSelectionCommandTimeoutId!==null&&clearTimeout(e._inputState.handledSelectionCommandTimeoutId),t!==null&&nA(e,t),e._inputState={collapsedSelectionFormat:{format:0,key:`root`,offset:0,style:``,timeStamp:0},composedSegmentedKey:null,compositionPhase:`idle`,hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,isShiftKeyDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,lastPointerType:``,mouseDrag:null,postDeleteSelectionToRestore:null,savedInputMode:void 0,selectionChangeFromDOMUpdatePoints:null,unprocessedBeforeInputData:null};let o=e._observer;o!==null&&(o.disconnect(),e._observer=null),t!==null&&(t.textContent=``,function(e,t){delete e[`__lexicalKey_${t._key}`]}(t,e)),n!==null&&(n.textContent=``,a.set(`root`,n),tD(n,e,`root`))}function eye(e){let t=new Set,n=new Set;for(let{klass:r,ownNodeConfig:i}of UO(e)){let e=r.transform;if(!n.has(e)){n.add(e);let i=r.transform();i&&t.add(i)}if(i){let e=i.$transform;e&&t.add(e)}}return t}var ok={$createDOM:(e,t)=>e.createDOM(t._config,t),$decorateDOM:(e,t,n,r)=>{},$exportDOM:(e,t)=>{let n=FE(t,e.getType());return n&&n.exportDOM!==void 0?n.exportDOM(t,e):e.exportDOM(t)},$extractWithChild:(e,t,n,r,i)=>Z(e)&&e.extractWithChild(t,n,r),$getDOMSlot:(e,t,n)=>e.getDOMSlot(t),$getSlotTargetElement:(e,t,n,r)=>null,$shouldExclude:(e,t,n)=>Z(e)&&e.excludeFromCopy(`html`),$shouldInclude:(e,t,n)=>!t||e.isSelected(t),$updateDOM:(e,t,n,r)=>e.updateDOM(t,n,r._config)};function sk(e){let t=e||{},n=Ok(),r=t.theme||{},i=e===void 0?n:t.parentEditor||null,a=t.disableEvents||!1,o=YO(),s=t.namespace||(i===null?pD():i._config.namespace),c=t.editorState,l=[UT,eE,$O,OE,TE,QO,...t.nodes||[]],{onError:u,onWarn:d,html:f}=t,p=t.editable===void 0||t.editable,m;if(e===void 0&&n!==null)m=n._nodes;else{m=new Map;for(let e=0;e<l.length;e++){let n=l[e],r=null,i=null;if(n&&typeof n==`object`){let e=n;n=e.replace,r=e.with,i=e.withKlass||null}if(typeof n!=`function`||!n.prototype||!(n===FT||n.prototype instanceof FT)){let r=`<unknown>`;try{r=JSON.parse(kge)}catch{}hC(365,String(e-l.length+(t.nodes?t.nodes.length:0)),typeof n==`function`?`${n.name}${typeof n.getType==`function`?` (type ${String(n.getType())})`:``}`:String(n),String(r))}zO(n);let a=n.getType(),o=eye(n);m.set(a,{exportDOM:f&&f.export?f.export.get(n):void 0,klass:n,replace:r,replaceWithKlass:i,sharedNodeState:a_e(l[e]),transforms:o})}}let h=new lk(o,i,m,{disableEvents:a,dom:{...ok,...e&&e.dom},namespace:s,theme:r},u||console.error,d||$ve,function(e,t){let n=new Map,r=new Set,i=e=>{Object.keys(e).forEach(t=>{let r=n.get(t);r===void 0&&(r=[],n.set(t,r)),r.push(e[t])})};return e.forEach(e=>{let t=e.klass.importDOM;if(t==null||r.has(t))return;r.add(t);let n=t.call(e.klass);n!==null&&i(n)}),t&&i(t),n}(m,f?f.import:void 0),p,e);return c!==void 0&&(h._pendingEditorState=c,h._dirtyType=2),function(e){e.registerCommand(sge,dye,0),e.registerCommand(cge,pye,0),e.registerCommand(lge,hye,0),e.registerCommand(uge,gye,0),e.registerCommand(JC,bye,0)}(h),h}function tye(e,t){let n=e.get(t);e.delete(t),n&&n()}function ck(e,t,n){return e.set(t,n),tye.bind(null,e,t)}var lk=class{static version=kge;_headless;_recordNodeMoves;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_cascadeCount;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_onWarn;_htmlConversions;_window;_editable;_blockCursorElement;_slotsUsed;_keyDownShortcuts;_inputState;_lastNotifiedSelection;_createEditorArgs;constructor(e,t,n,r,i,a,o,s,c){this._createEditorArgs=c,this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new yw,this._updates=[],this._updating=!1,this._cascadeCount=0,this._listeners={decorator:new Map,editable:new Map,mutation:new Map,root:new Map,textcontent:new Map,update:new Map},this._commands=new Map,this._config=r,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Map,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=pD(),this._onError=i,this._onWarn=a,this._htmlConversions=o,this._editable=s,this._headless=t!==null&&t._headless,this._recordNodeMoves=!1,this._window=null,this._blockCursorElement=null,this._slotsUsed=!1,this._keyDownShortcuts=null,this._inputState={collapsedSelectionFormat:{format:0,key:`root`,offset:0,style:``,timeStamp:0},composedSegmentedKey:null,compositionPhase:`idle`,hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,isShiftKeyDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,lastPointerType:``,mouseDrag:null,postDeleteSelectionToRestore:null,savedInputMode:void 0,selectionChangeFromDOMUpdatePoints:null,unprocessedBeforeInputData:null},this._lastNotifiedSelection=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){return ck(this._listeners.update,e)}registerEditableListener(e){return ck(this._listeners.editable,e)}registerDecoratorListener(e){return ck(this._listeners.decorator,e)}registerTextContentListener(e){return ck(this._listeners.textcontent,e)}registerRootListener(e){let t=this._listeners.root;return Hk(ck(t,e,e(this._rootElement,null)||void 0),()=>function(e,t,n){let r=e.get(t);r&&r(),e.set(t,t(...n)||void 0)}(t,e,[null,this._rootElement]))}registerCommand(e,t,n){n===void 0&&hC(35);let r=this._commands;r.has(e)||r.set(e,[new _w,new _w,new _w,new _w,new _w]);let i=r.get(e);i===void 0&&hC(36,String(e));let a=function(e){return 7&e}(n),o=i[a];return a===n?o.addBack(t):o.addFront(t),()=>{o.delete(t),i.every(e=>e.size===0)&&r.delete(e)}}registerMutationListener(e,t,n){let r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,i=this._listeners.mutation,a=i.get(t);a===void 0&&(a=new Set,i.set(t,a)),a.add(r);let o=n&&n.skipInitialization;return o!==void 0&&o||this.initializeMutationListener(t,r),()=>{a.delete(r),a.size===0&&i.delete(t)}}getRegisteredNode(e){let t=this._nodes.get(e.getType());return t===void 0&&hC(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){let n=this._editorState,r=_O(n).get(t.getType());if(!r)return;let i=new Map;for(let e of r.keys())i.set(e,`created`);i.size>0&&e(i,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set([`registerMutationListener`])})}registerNodeTransformToKlass(e,t){let n=this.getRegisteredNode(e);return n.transforms.add(t),n}registerNodeTransform(e,t){let n=this.registerNodeTransformToKlass(e,t),r=[n],i=n.replaceWithKlass;if(i!=null){let e=this.registerNodeTransformToKlass(i,t);r.push(e)}return wve(this,r.map(e=>e.klass.getType())),()=>{r.forEach(e=>e.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,...t){return ED(this,e,...t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){let t=this._rootElement;if(e!==t){let n=xD(this._config.theme,`root`),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,ak(this,t,e,r,{preserveUpdateQueue:!0}),t!==null&&(this._config.disableEvents||function(e){let t=Kk.get(e);if(t===void 0)return void xA();let n=qk.get(t);if(n===void 0)return void xA();Kk.delete(e);let r=VE(e);zE(r)?(function(e){if(e._parentEditor!==null){let t=fD(e),n=t[t.length-1]._key;yA.get(n)===e&&yA.delete(n)}else yA.delete(e._key)}(r),n.editors.delete(r),n.hasShadowEditor=void 0,e.__lexicalEditor=null):r&&hC(198);let i=_A(e);for(let e=0;e<i.length;e++)i[e]();e.__lexicalEventHandles=[]}(t),n!=null&&t.classList.remove(...n)),e!==null){let t=FD(e),r=e.style;r.userSelect=`text`,r.whiteSpace=`pre-wrap`,r.wordBreak=`break-word`,e.setAttribute(`data-lexical-editor`,`true`),this._window=t,this._dirtyType=2,qge(this),this._updateTags.add(`history-merge`),Pk(this),this._config.disableEvents||function(e,t){let n=e.ownerDocument;Kk.set(e,n);let r=qk.get(n);r===void 0&&(r={editors:new Set,hasShadowEditor:void 0},qk.set(n,r)),r.editors.add(t),r.hasShadowEditor=void 0,e.__lexicalEditor=t;let i=_A(e);i.push(aye.register(n));let a={blur:bge,click:oye,compositionend:_ye,compositionstart:mye,copy:uw,cut:dw,dragend:gge,dragover:hge,dragstart:mge,drop:pge,focus:yge,input:fye,keydown:vye,paste:VC,pointerdown:lye,...xC&&{beforeinput:uye},...SC&&{keyup:yye,mousedown:cye}};for(let[n,r]of Object.entries(a))i.push(Uk(e,n,i=>{Sye(i)||(xye(i),n===`blur`&&(nA(t,e),t._inputState.isShiftKeyDown=!1,t._inputState.isInsertLineBreak=!1),(t.isEditable()||n===`click`||n===`copy`)&&(typeof r==`function`?r(i,t):ED(t,r,i)))}));let o,s=()=>{t._inputState.mouseDrag=null},c=n=>{let i=t._inputState,a=i.mouseDrag;if(o&&o.defaultPrevented&&!n.buttons&&(i.isSelectionChangeFromMouseDown=!1),!a||n.pointerType!==`mouse`)return;let c=n.type===`pointerup`;if(n.type===`pointercancel`||!c&&n.buttons!==1)return s();i.mouseDrag=c?null:n,Vk(t,()=>{let o=qD(ID(t));if(a.type!==`mousedown`){let r=c&&o&&Q($())&&ej(nj(),o,t,new Event(`selectionchange`));return r&&cD(r),iA(t,n,c&&o?tO(o,e).focusNode:null)}let l=$A(o,t);if(a.defaultPrevented||!a.shiftKey&&l&&!l.isCollapsed())s();else if(o&&i.isSelectionChangeFromMouseDown){vA(t,o,new Event(`selectionchange`),r),iA(t,a,tO(o,e).focusNode);let n=$();Q(n)&&n.isCollapsed()&&!n.is(nj())&&$k(t,n)}})};i.push(Wk(n,{pointercancel:c,pointermove:c,pointerup:c},!0),Uk(ID(t),`blur`,s),t.registerEditableListener(s),Wk(e,{contextmenu:s,dragstart:s,keydown:e=>e.getModifierState&&e.getModifierState(e.key)||s(),mousedown:e=>{let n=t._inputState;n.mouseDrag=e.button!==0||e.detail!==1||e.defaultPrevented||n.lastPointerType!==`mouse`||!t.isEditable()||t.isComposing()||wO(iO(e),t)?null:e}}),Uk(e,`pointerdown`,e=>{o=e,t._inputState.lastPointerType=e.pointerType},!0)),SC&&i.push(function(e,t){let n=null,r={capture:!0,passive:!0};return Hk(Uk(e,`touchstart`,e=>{let t=e.touches.length===1?e.touches[0]:null;n=t?{x:t.clientX,y:t.clientY}:null},r),Uk(e,`touchend`,e=>{let r=e.changedTouches[0];n!==null&&r&&e.touches.length===0&&Math.abs(r.clientX-n.x)<=eA&&Math.abs(r.clientY-n.y)<=eA&&t(e),n=null},r))}(e,n=>function(e,t,n){t._inputState.savedInputMode!==void 0&&(tA(e,t,n)||(rO(n.ownerDocument)===n&&n.blur(),nA(t,n)))}(n,t,e)))}(e,this),n!=null&&e.classList.add(...n)}else this._window=null,this._updateTags.add(`history-merge`),Pk(this);Fk(`root`,this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){let n=e.isEmpty(),r=e;r._readOnly&&(r=JO(e),r._selection=e._selection?e._selection.clone():null),Tw(this);let i=this._pendingEditorState,a=t===void 0?null:t.tag;i===null||i.isEmpty()||(a!=null&&this._updateTags.add(a),Pk(this)),this._pendingEditorState=r,this._dirtyType=2,this._dirtyElements.set(`root`,!1),this._compositionKey=null,this._slotsUsed=this._slotsUsed||e._slotsUsed,Vk(this,()=>{if(a&&this._updateTags.add(a),n&&(gC(38),oD().append(EE())),e._parsed)for(let[e,t]of r._nodeMap.entries())Z(t)?this._dirtyElements.set(e,!0):this._dirtyLeaves.add(e)},{discrete:!this._updating||void 0})}parseEditorState(e,t){return function(e,t,n){let r=YO(),i=dk,a=pk,o=fk,s=t._dirtyElements,c=t._dirtyLeaves,l=t._cloneNotNeeded,u=t._dirtyType;t._dirtyElements=new Map,t._dirtyLeaves=new Set,t._cloneNotNeeded=new Map,t._dirtyType=0,dk=r,pk=!1,fk=t,ME(null);try{let i=t._nodes;Mk(e.root,i),n&&n(),r._readOnly=!0,r._parsed=!0}catch(e){e instanceof Error&&t._onError(e)}finally{t._dirtyElements=s,t._dirtyLeaves=c,t._cloneNotNeeded=l,t._dirtyType=u,dk=i,pk=a,fk=o}return r}(typeof e==`string`?JSON.parse(e):e,this,t)}read(...e){let[t,n]=e.length===1?[`force-commit`,e[0]]:e;return t===`force-commit`&&(vk.has(this)||Pk(this)),(t===`pending`?this._pendingEditorState||this._editorState:this.getEditorState()).read(n,{editor:this})}update(e,t){(function(e,t,n){e._updating?e._updates.push([t,n]):Bk(e,t,n)})(this,e,t)}focus(e,t={}){let n=this._rootElement;n!==null&&(n.setAttribute(`autocapitalize`,`off`),Vk(this,()=>{let r=$(),i=oD();r===null?i.getChildrenSize()!==0&&(t.defaultSelection===`rootStart`?i.selectStart():i.selectEnd()):r.dirty||cD(r.clone()),MD(`focus`),ND(()=>{n.removeAttribute(`autocapitalize`),e&&e()})}),this._pendingEditorState===null&&n.removeAttribute(`autocapitalize`))}blur(){let e=this._rootElement;e!==null&&e.blur();let t=qD(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,Fk(`editable`,this,!0,e),this._slotsUsed&&this.update(()=>Ek()))}toJSON(){return{editorState:this._editorState.toJSON(Mge())}}};function uk(e,t,n,r,i,a){if(Z(e)){let o=e.__first;for(;o!==null;){let e=r.get(o);if(e===void 0)break;let s=Z(e);e.__parent!==t||s&&a.has(o)||((s||Ej(e)&&e.__slots!==null)&&uk(e,o,n,r,i,a),n.has(o)||a.delete(o),i.push(o)),o=e.__next}}for(let o of Ej(e)&&e.__slots!==null?e.__slots.values():[]){let e=r.get(o);e!==void 0&&Dj(e)&&e.__slotHost===t&&((Z(e)||Ej(e)&&e.__slots!==null)&&uk(e,o,n,r,i,a),n.has(o)||a.delete(o),i.push(o))}}var dk=null,fk=null,pk=!1,mk=!1,hk=!1,gk=new Set,_k=new Set,vk=new Set,yk=0,bk={characterData:!0,childList:!0,subtree:!0};function xk(){return pk||dk!==null&&dk._readOnly}function Sk(){pk&&hC(13)}function Ck(){yk>99&&hC(14)}function wk(){return dk===null&&hC(195,Dk()),dk}function nye(e){wk()!==null&&fk===null&&(fk=e),fk!==e&&gC(378)}function Tk(){return fk===null&&hC(337,Dk()),fk}function Ek(){Tk()._dirtyType=2}function Dk(){let e=0,t=new Set,n=lk.version;if(typeof window<`u`)for(let r of XD(document)){let i=VE(r);if(zE(i))e++;else if(i){let e=String(i.constructor.version||`<0.17.1`);e===n&&(e+=` (separately built, likely a bundler configuration issue)`),t.add(e)}}let r=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(r+=` and incompatible editors with versions ${Array.from(t).join(`, `)}`),r}function Ok(){return fk}function kk(e,t,n){let r=t.__type,i=PE(e,r),a=n.get(r);a===void 0&&(a=Array.from(i.transforms),n.set(r,a));let o=a.length;for(let e=0;e<o&&(a[e](t),t.isAttached());e++);}function Ak(e,t){return e!==void 0&&e.__key!==t&&e.isAttached()}function jk(e,t){if(!t)return;let n=e._updateTags,r=t;Array.isArray(t)||(r=[t]);for(let e of r)n.add(e)}function rye(e){return Mk(e,Tk()._nodes)}function Mk(e,t){let n=e.type,r=t.get(n);r===void 0&&hC(17,n);let i=r.klass;e.type!==i.getType()&&hC(18,i.name);let a=i.importJSON(e),o=e.children;if(Z(a)&&Array.isArray(o))for(let e=0;e<o.length;e++){let n=Mk(o[e],t);a.append(n)}let s=e.$slots;if(s){Ej(a)||hC(379,i.name);for(let e in s)Iye(a,e,Mk(s[e],t))}return a}function Nk(e,t,n){let r=dk,i=pk,a=fk;dk=t,pk=!0,fk=e;try{return n()}finally{dk=r,pk=i,fk=a}}function Pk(e,t){e._pendingEditorState!==null&&fk!==e&&Tw(e,!1,!0);let n=hk;hk=!0;try{let n=function(e){if(_k.has(e))return!1;_k.add(e);try{for(let t=0;e._pendingEditorState!==null;t++){let n=e._pendingEditorState._selection,r=e._rootElement;if(!Ik(e,n))return!1;let i=(n===null||Q(n))&&(e._headless||r===null||!r.isConnected);if(i||t===100)return e._lastNotifiedSelection=n===null?null:n.clone(),!i;Bk(e,()=>e.dispatchCommand(FC),void 0,!0)}return!1}finally{_k.delete(e)}}(e);(function(e,t){let n=e._pendingEditorState,r=e._rootElement,i=e._headless||r===null;if(n===null)return void(!e._updating&&e._deferred.length>0&&Rk(e,e._deferred));let a=e._editorState,o=a._selection,s=n._selection,c=e._dirtyType!==0,l=dk,u=pk,d=fk,f=e._updating,p=e._observer,m=null;if(e._pendingEditorState=null,e._editorState=n,!i&&c&&p!==null){fk=e,dk=n,pk=!1,e._updating=!0;try{let t=e._dirtyType,r=e._dirtyElements,i=e._dirtyLeaves;p.disconnect(),m=j_e(a,n,e,t,r,i)}catch(t){if(t instanceof Error&&e._onError(t),mk)throw t;ak(e,null,r,n),qge(e),e._dirtyType=2,mk=!0,Pk(e,a),mk=!1;return}finally{p.observe(r,bk),e._updating=f,dk=l,pk=u,fk=d}}n._readOnly||=!0;let h=e._dirtyLeaves,g=e._dirtyElements,_=e._normalizedNodes,v=e._updateTags;c&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set),e._updateTags=new Set;let y=e._deferred;f||(e._deferred=[]),function(e,t){let n=e._decorators,r=e._pendingDecorators||n,i=t._nodeMap,a;for(a in r)i.has(a)||(r===n&&(r=iD(e)),delete r[a])}(e,n);let b=i?null:qD(ID(e));if(e._editable&&b!==null&&(c||s===null||s.dirty||!s.is(o))&&r!==null&&!v.has(`skip-dom-selection`)){fk=e,dk=n;try{if(p!==null&&p.disconnect(),c||s===null||s.dirty){let t=e._blockCursorElement;t!==null&&KD(t,e,r),kye(o,s,e,b,v,r)}(function(e,t,n){let r=e._blockCursorElement;if(Q(n)&&n.isCollapsed()&&n.anchor.type===`element`&&t.contains(nO(t))){let i=n.anchor,a=i.getNode(),o=i.offset,s=!1,c=null;if(o===a.getChildrenSize())GD(a.getChildAtIndex(o-1))&&(s=!0);else{let t=a.getChildAtIndex(o);t!==null&&GD(t)&&(s=!0,c=e.getElementByKey(t.__key))}if(s){let n=mO(a,e.getElementByKey(a.__key),e).element;r===null&&(e._blockCursorElement=r=function(e){let t=e.theme,n=QD().createElement(`div`);n.contentEditable=`false`,n.setAttribute(`data-lexical-cursor`,`true`);let r=t.blockCursor;return r!==void 0&&(typeof r==`string`&&(r=t.blockCursor=gM(r)),r!==void 0&&n.classList.add(...r)),n}(e._config)),t.style.caretColor=`transparent`,c===null?n.appendChild(r):n.insertBefore(r,c);return}}r!==null&&KD(r,e,t)})(e,r,s)}finally{p!==null&&p.observe(r,bk),fk=d,dk=l}}let x=vk.has(e);vk.add(e);try{m!==null&&function(e,t,n,r,i){let a=Array.from(e._listeners.mutation),o=a.length;for(let e=0;e<o;e++){let[o,s]=a[e];for(let e of s){let a=t.get(e);a!==void 0&&o(a,{dirtyLeaves:r,prevEditorState:i,updateTags:n})}}}(e,m,v,h,a);let r=e._pendingDecorators;r!==null&&(e._decorators=r,e._pendingDecorators=null,Fk(`decorator`,e,!0,r)),function(e,t,n){let r=aD(t),i=aD(n);r!==i&&Fk(`textcontent`,e,!0,i)}(e,t||a,n),Fk(`update`,e,!0,{dirtyElements:g,dirtyLeaves:h,editorState:n,mutatedNodes:m,normalizedNodes:_,prevEditorState:t||a,tags:v})}finally{x||vk.delete(e)}f||Rk(e,y),function(e){let t=e._updates;if(t.length===0)return void(e._cascadeCount=0);if(function(e){gk.has(e)||(gk.add(e),setTimeout(()=>{gk.delete(e),e._cascadeCount=0},0))}(e),e._cascadeCount++>99)return e._updates=[],e._cascadeCount=0,void e._onWarn(mC(437,e._config.namespace));let n=t.shift();if(n){let[t,r]=n;Bk(e,t,r)}}(e)})(e,t),n&&e._onWarn(mC(436))}finally{hk=n}}function Fk(e,t,n,...r){let i=t._updating;t._updating=n;try{let n=t._listeners[e],i=Array.from(n);for(let[e,t]of i){t&&t();let i=e(...r),a=typeof i==`function`?i:void 0;n.has(e)?n.set(e,a):a&&a()}}finally{t._updating=i}}function Ik(e,t){let n=e._lastNotifiedSelection;return t===null?n!==null:!t.is(n)}function Lk(e,t,n,r){let i=fD(e),a;if(!hk)for(let e=0;e<i.length;e++)i[e]._updating||(i[e]._cascadeCount=0);if(t===FC){if(fk!==e||pk){let i=!1;return Vk(e,()=>{i=Lk(e,t,n,r)}),i}let i=wk()._selection;e._lastNotifiedSelection=i===null?null:i.clone()}for(let e=4;e>=0;e--)for(let o=0;o<i.length;o++){let s=i[o];if(o>0&&s._updating){a=s;break}let c=s._commands.get(t);if(c!==void 0){let t=c[e];if(t.size>0){let e=!1;if(Vk(s,()=>{for(let i of t)if(i(n,r))return void(e=!0)}),e)return e}}}return a&&a.update(()=>{Lk(a,t,n,r)}),!1}function Rk(e,t){if(e._deferred===t&&(e._deferred=[]),t.length!==0){let n=e._updating;e._updating=!0;try{for(let e=0;e<t.length;e++)t[e]()}finally{e._updating=n}}}function zk(e,t){let n=e._updates,r=t||!1;for(;n.length!==0;){let t=n.shift();if(t){let[n,i]=t,a=e._pendingEditorState,o;i!==void 0&&(o=i.onUpdate,i.skipTransforms&&(r=!0),i.discrete&&(a===null&&hC(191),a._flushSync=!0),o&&e._deferred.push(o),jk(e,i.tag)),a==null?Bk(e,n,i):n()}}return r}function iye(){let e=wk();Sk(),e._flushSync=!0}function Bk(e,t,n,r=!1){let i=e._updateTags,a,o=!1,s=!1;n!==void 0&&(a=n.onUpdate,jk(e,n.tag),o=n.skipTransforms||!1,s=n.discrete||!1),a&&e._deferred.push(a);let c=e._editorState,l=e._pendingEditorState,u=!1;(l===null||l._readOnly)&&(l=e._pendingEditorState=JO(l||c),u=!0),l._flushSync=s;let d=dk,f=pk,p=fk,m=e._updating,h=e._lastNotifiedSelection;dk=l,pk=!1,e._updating=!0,fk=e;let g=e._headless||e.getRootElement()===null;ME(null);try{u&&(g?c._selection!==null&&(l._selection=c._selection.clone()):l._selection=function(e,t){let n=e.getEditorState()._selection,r=qD(ID(e));return Q(n)||n==null?ej(n,r,e,t):n.clone()}(e,n&&n.event||null));let r=e._compositionKey;t(),o=zk(e,o),function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(Q(r)){let e=r.anchor,t=r.focus,i;if(e.type===`text`&&(i=e.getNode(),i.selectionTransform(n,r)),t.type===`text`){let e=t.getNode();i!==e&&e.selectionTransform(n,r)}}}(l,e),e._dirtyType!==0&&(o?function(e,t){let n=t._dirtyLeaves,r=e._nodeMap;for(let e of n){let t=r.get(e);aE(t)&&t.isAttached()&&t.isSimpleText()&&!t.isUnmergeable()&&R_e(t)}}(l,e):function(e,t){let n=t._dirtyLeaves,r=t._dirtyElements,i=e._nodeMap,a=ZE(),o=new Map,s=n,c=s.size,l=r,u=l.size;for(;c>0||u>0;){if(c>0){t._dirtyLeaves=new Set;for(let e of s){let r=i.get(e);aE(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&R_e(r),r!==void 0&&Ak(r,a)&&kk(t,r,o),n.add(e)}if(s=t._dirtyLeaves,c=s.size,c>0){yk++;continue}}t._dirtyLeaves=new Set,t._dirtyElements=new Map,l.delete(`root`)&&l.set(`root`,!0);for(let e of l){let n=e[0],s=e[1];if(r.set(n,s),!s)continue;let c=i.get(n);c!==void 0&&Ak(c,a)&&kk(t,c,o)}s=t._dirtyLeaves,c=s.size,l=t._dirtyElements,u=l.size,yk++}t._dirtyLeaves=n,t._dirtyElements=r}(l,e),zk(e),function(e,t,n,r){let i=e._nodeMap,a=t._nodeMap,o=[];for(let[e]of r){let t=a.get(e);t!==void 0&&(t.isAttached()||(Z(t)&&uk(t,e,i,a,o,r),i.has(e)||r.delete(e),o.push(e)))}for(let e of n){let t=a.get(e);t===void 0||t.isAttached()||(Ej(t)&&t.__slots!==null&&uk(t,e,i,a,o,n),i.has(e)||n.delete(e),o.push(e))}let s=Tk(),c=s._cloneNotNeeded;for(let e of o)a.delete(e),c.delete(e);let l=s._compositionKey;l===null||a.has(l)||(s._compositionKey=null)}(c,l,e._dirtyLeaves,e._dirtyElements)),r!==e._compositionKey&&(l._flushSync=!0);let i=l._selection;if(Q(i)){e._slotsUsed&&KA(i);let t=l._nodeMap,n=i.anchor.key,r=i.focus.key;t.get(n)!==void 0&&t.get(r)!==void 0||hC(19)}else AA(i)&&i._nodes.size===0&&(l._selection=null)}catch(t){t instanceof Error&&e._onError(t),e._pendingEditorState=c;let n=c._selection;e._lastNotifiedSelection=n===null?null:n.clone(),e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),Pk(e);return}finally{dk=d,pk=f,fk=p,e._updating=m,yk=0}r||(e._dirtyType!==0||e._deferred.length>0||function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(r!==null){if(r.dirty||!r.is(n))return!0}else if(n!==null)return!0;return!1}(l,e)?l._flushSync?(l._flushSync=!1,Pk(e)):u&&bve(()=>{Pk(e)}):(l._flushSync=!1,u&&(i.clear(),e._deferred=[],e._pendingEditorState=null,e._lastNotifiedSelection=h)))}function Vk(e,t,n){fk===e&&n===void 0?xk()?Bk(e,t,n):t():Bk(e,t,n)}function Hk(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function Uk(e,t,n,r){return e.addEventListener(t,n,r),e.removeEventListener.bind(e,t,n,r)}function Wk(e,t,n){return Hk(...Object.entries(t).map(([t,r])=>Uk(e,t,r,n)))}var Gk=30,Kk=new WeakMap,qk=new WeakMap,aye=Dge(e=>(e.addEventListener(`selectionchange`,bA),()=>e.removeEventListener(`selectionchange`,bA)));function Jk(e,t,n,r,i,a){let o=e.anchor,s=e.focus,c=o.getNode(),l=Tk(),u;if(a!==void 0)u=a;else{let e=qD(ID(l));u=e===null?null:tO(e,l._rootElement)}let d=u===null?null:u.anchorNode,f=o.key,p=l.getElementByKey(f),m=n.length;return f!==s.key||!aE(c)||(!i&&(!xC||l._inputState.lastBeforeInputInsertTextTimeStamp<r+50)||c.isDirty()&&m<2||dD(n))&&o.offset!==s.offset&&!c.isComposing()||UE(c)||c.isDirty()&&m>1||(i||!xC)&&p!==null&&!c.isComposing()&&d!==hO(c,p,l)||u!==null&&t!==null&&(!t.collapsed||t.startContainer!==u.anchorNode||t.startOffset!==u.anchorOffset)||!c.isComposing()&&(c.getFormat()!==e.format||c.getStyle()!==e.style)||function(e,t){if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;let n=e.anchor.offset,r=t.getParentOrThrow(),i=HE(t);return n===0?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||i||function(e){let t=e.getPreviousSibling();return(aE(t)||Z(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||i)}(e,c)}function Yk(e,t){return WE(e)&&e.nodeValue!==null&&t!==0&&t!==e.nodeValue.length}function Xk(e,t,n){let{anchorNode:r,anchorOffset:i,focusNode:a,focusOffset:o}=tO(e,t._rootElement),s=t._inputState;if(s.isSelectionChangeFromDOMUpdate){s.isSelectionChangeFromDOMUpdate=!1;let e=s.selectionChangeFromDOMUpdatePoints;if(s.selectionChangeFromDOMUpdatePoints=null,Yk(r,i)&&Yk(a,o)&&!s.postDeleteSelectionToRestore&&(e===null||e.anchorNode===r&&e.anchorOffset===i&&e.focusNode===a&&e.focusOffset===o))return}Vk(t,()=>{if(!n)return void cD(null);if(!RE(t,r,a))return;let c=s.mouseDrag;!c||c.type===`mousedown`&&c.defaultPrevented||iA(t,c,a);let l=rA.has(c),u=$();if(s.postDeleteSelectionToRestore&&Q(u)&&u.isCollapsed()){let e=u.anchor,t=s.postDeleteSelectionToRestore.anchor;(e.key===t.key&&e.offset===t.offset+1||e.offset===1&&t.getNode().is(e.getNode().getPreviousSibling()))&&(u=s.postDeleteSelectionToRestore.clone(),cD(u))}if(s.postDeleteSelectionToRestore=null,Q(u)){let n=u.anchor;if(u.isCollapsed())e.type===`Range`&&r===a&&(u.dirty=!0),$k(t,u);else{let e=n.key,t=u.focus,r=t.key,a=u.getNodes(),s=a.length,c=u.isBackward(),[d,f]=l?[n.offset,t.offset]:[i,o],p=c?f:d,m=c?d:f,h=c?r:e,g=c?e:r,_=Jhe,v=!1;for(let e=0;e<s;e++){let t=a[e],n=t.getTextContentSize();if(aE(t)&&n!==0&&!(e===0&&t.__key===h&&p===n||e===s-1&&t.__key===g&&m===0)&&(v=!0,_&=t.getFormat(),_===0))break}u.format=v?_:0}}(function(e,t,n=!1){(n||Ik(e,t))&&e.dispatchCommand(FC)})(t,u,u!==null&&(u.dirty&&!l||!Q(u)))})}function Zk(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function Qk(e,t){Zk(e,t.getFormat(),t.getStyle())}function $k(e,t){let n=t.anchor,r=n.getNode(),i=ID(e).event,a=i?i.timeStamp:performance.now(),{format:o,style:s,offset:c,key:l,timeStamp:u}=e._inputState.collapsedSelectionFormat;a<u+200&&n.offset===c&&n.key===l?Zk(t,o,s):n.type===`text`?(aE(r)||hC(141),Qk(t,r)):(e.isComposing()||oD().getTextContent()!==``)&&(Z(r)||hC(259),r.isEmpty()?tj(t,``):Zk(t,t.format,``))}function oye(e,t){Vk(t,()=>{let n=$(),r=qD(ID(t)),i=nj();if(r){if(Q(n)){let e=n.anchor,t=e.getNode();e.type===`element`&&e.offset===0&&n.isCollapsed()&&!WT(t)&&oD().getChildrenSize()===1&&t.getTopLevelElementOrThrow().isEmpty()&&i!==null&&n.is(i)&&(r.removeAllRanges(),n.dirty=!0)}else if(e.pointerType===`touch`||e.pointerType===`pen`||SC&&t._inputState.lastPointerType!==`mouse`){let n=tO(r,t._rootElement).anchorNode;(oO(n)||WE(n))&&cD(ej(i,r,t,e))}}if(bC&&r!==null&&r.rangeCount===0){let n=t._rootElement;if(n!==null&&e.target===n){let a=e.clientY,o=n.childNodes.length;for(let e=0;e<n.childNodes.length;e++){let t=n.childNodes[e];if(oO(t)){let n=t.getBoundingClientRect();if(a<=(n.top+n.bottom)/2){o=e;break}}}r.setBaseAndExtent(n,o,n,o);let s=ej(i,r,t,e);s===null?r.removeAllRanges():cD(s)}}ED(t,IC,e)})}var eA=10,sye=`input:not(:disabled),textarea:not(:disabled),select:not(:disabled),button:not(:disabled),a[href],area[href],label,summary,iframe,object,embed,audio[controls],video[controls],[tabindex],[contenteditable]:not([contenteditable="false"])`;function cye(e,t){let n=t.getRootElement();n!==null&&(tA(e,t,n)?(e.preventDefault(),rO(n.ownerDocument)!==n&&(t._inputState.savedInputMode===void 0&&(t._inputState.savedInputMode=n.getAttribute(`inputmode`)),n.setAttribute(`inputmode`,`none`),n.focus({preventScroll:!0}))):nA(t,n))}function tA(e,t,n){if(t._inputState.lastPointerType===`mouse`)return!1;let r=iO(e);if(!sO(r))return!1;let i=!1;for(let e=r;e!==null;e=OD(e)){if(e===n)return i;if(e.nodeType===1){let t=e;if(t.matches(sye))return!1;t.getAttribute(`data-lexical-decorator`)===`true`&&(i=!0)}}return!1}function nA(e,t){let n=e._inputState.savedInputMode;n!==void 0&&(e._inputState.savedInputMode=void 0,n===null?t.removeAttribute(`inputmode`):t.setAttribute(`inputmode`,n))}function lye(e,t){let n=iO(e),r=e.pointerType;sO(n)&&r!==`touch`&&r!==`pen`&&e.button===0&&Vk(t,()=>{wO(n,t)||(t._inputState.isSelectionChangeFromMouseDown=!0)})}var rA=new WeakSet;function iA(e,t,n=null){let r=$(),i=r&&r.clone();(function(e,t,n){let r=nj(),i=t.type===`mousedown`,a=i&&!t.shiftKey,o=n&&rD(n);VT(o)&&(i?a&&o.isInline()&&o.selectPrevious():Q(r)&&cD(r.clone()));let s=$(),c=s||(a?ZA():Q(r)?r.clone():null),l=e.getRootElement(),u=l&&l.getRootNode();if(!Q(c)||a&&!c.isCollapsed()||!GE(u)&&!JD(u))return;let{anchor:d,focus:f}=c;if(!i&&Q(r)){let{key:e,offset:t,type:n}=r.anchor;d.set(e,t,n,!0)}let{clientX:p,clientY:m}=t,h=u.elementFromPoint&&u.elementFromPoint(p,m),g=h&&rD(h),_=(e,t)=>Z(e)?t===`next`?e.getLastDescendant():e.getFirstDescendant():e,v=[null],y=Z(g)&&!g.isInline()&&(WT(g)?GO(f.getNode(),YA):g);for(let e of y?$j(y,`next`):[])v.push(Yj(e.origin,`previous`),e);let b=ID(e),x=b.document.createRange(),S=null;for(let t of v){let n=t?_(t.origin,t.direction):g;if(!VT(n)||!n.isInline()||n===S)continue;let r=e.getElementByKey(n.getKey());if(!r)continue;x.selectNodeContents(r);let i=x.getBoundingClientRect(),o=r.getBoundingClientRect(),{bottom:l,left:u,right:h,top:v}=i.height>o.height?i:o;if(t&&(m<v||m>l)){S=n;continue}let y=b.getComputedStyle(OD(r)||r).direction===`rtl`,C=2*p>u+h!==y,w=C?`next`:`previous`,T=t&&t.getNodeAtCaret(),ee=T&&e.getElementByKey(T.getKey()),E=ee?ee.getClientRects():[],te=E[C?0:E.length-1];if(!t||t.direction===w&&b.getComputedStyle(r).cssFloat===`none`&&(!T||tk(T)||te&&(C===y?2*te.right>u+h:2*te.left<u+h))){if(!n.is(_(wD(f,C),w))){let e=Yj(n,w);cE(f,e),a&&cE(d,e)}s||cD(c);return}}if(VT(o)&&!i){let t=b.document,n=t.caretPositionFromPoint&&t.caretPositionFromPoint(p,m,{shadowRoots:JD(u)?[u]:[]}),r=n&&VA(n.offsetNode,n.offset,null,e);if(r){let[{key:e,offset:t,type:n}]=r;f.set(e,t,n)}}})(e,t,n);let a=$(),o=e._inputState.mouseDrag;o&&a&&!a.is(i)&&rA.add(o),t.type===`mousedown`&&Q(a)&&tj(a,Q(i)?i.anchor.key:``)}function aA(e){if(!e.getTargetRanges)return null;let t=e.getTargetRanges();return t.length===0?null:t[0]}function oA(e){let{lastKeyCode:t}=Tk()._inputState;if(e==null||e.length<=1||t==null)return;let n=t.length===1?t:t===`Enter`?`
`:t===`Tab`?` `:null;if(!n)return;let r=$();if(!Q(r)||!r.isCollapsed())return;let i=r.anchor.getNode();if(!aE(i))return;let{offset:a}=r.anchor;if(i.getTextContentSize()===a){let e=i.getNextSibling();if(n===`
`){if(SC)return;if(tk(e))e.selectEnd();else if(!e){let e=GO(i,YA),t=e&&e.getNextSibling();Z(t)&&t.selectStart()}}else n===` `?AE(e)&&e.selectEnd():aE(e)&&e.getTextContent()[0]===n&&e.select(1,1)}else i.getTextContent()[a]===n&&i.select(a+1,a+1)}function sA(e){e.isInsertTextAfterHandledSelectionCommand=!1,e.handledSelectionCommandTimeoutId!==null&&(clearTimeout(e.handledSelectionCommandTimeoutId),e.handledSelectionCommandTimeoutId=null)}function cA(e){yC&&!SC&&wC&&(sA(e),e.isInsertTextAfterHandledSelectionCommand=!0,e.handledSelectionCommandTimeoutId=setTimeout(()=>sA(e),0))}function lA(e,t){let n=iO(e);if(oO(n)&&wO(n,t))return!0;let r=t.getRootElement();if(r===null)return!1;let i=rO(r.ownerDocument);return i!==null&&r.contains(i)&&(wO(i,t)||IE(r,i))}function uye(e,t){let n=e.inputType;n===`deleteCompositionText`||bC&&TD(t)||n!==`insertCompositionText`&&Vk(t,()=>{lA(e,t)||ED(t,sge,e)},{event:e})}function dye(e){let t=e.inputType,n=aA(e),r=Tk(),i=r._inputState,a=$();if(t===`insertText`&&e.data&&i.isInsertTextAfterHandledSelectionCommand){if(sA(i),e.preventDefault(),Q(a)&&!a.isCollapsed()){let e=a.isBackward()?a.anchor:a.focus;a.anchor.set(e.key,e.offset,e.type),a.focus.set(e.key,e.offset,e.type)}return!0}if(t===`deleteContentBackward`){if(a===null){let e=nj();if(!Q(e))return!0;cD(e.clone())}if(Q(a)){let t=a.anchor.key===a.focus.key;if(function(e,t){return e.lastKeyCode===`MediaLast`&&t<e.lastKeyDownTimeStamp+Gk}(i,e.timeStamp)&&r.isComposing()&&t){if(XE(null),i.lastKeyDownTimeStamp=0,setTimeout(()=>{Vk(r,()=>{XE(null)})},Gk),Q(a)){let e=a.anchor.getNode();e.markDirty(),aE(e)||hC(142),Qk(a,e)}}else{if(XE(null),SC&&n!==null&&!n.collapsed&&(a.applyDOMRange(n),!a.isCollapsed()))return e.preventDefault(),a.removeText(),!0;e.preventDefault();let o=a.anchor.getNode(),s=o.getTextContent(),c=o.canInsertTextAfter(),l=a.anchor.offset===0&&a.focus.offset===s.length,u=TC&&t&&!l&&c;if(u&&a.isCollapsed()&&(u=!VT(wD(a.anchor,!0))),!u){ED(r,LC,!0);let e=$();TC&&Q(e)&&e.isCollapsed()&&(i.postDeleteSelectionToRestore=e,setTimeout(()=>i.postDeleteSelectionToRestore=null))}}return!0}}if(!Q(a))return t!==`historyUndo`&&t!==`historyRedo`||(e.preventDefault(),ED(r,t===`historyUndo`?KC:qC)),!0;let o=e.data;i.unprocessedBeforeInputData!==null&&hD(!1,r,i.unprocessedBeforeInputData);let s=!1;if((!a.dirty||i.unprocessedBeforeInputData!==null)&&a.isCollapsed()&&!WT(a.anchor.getNode())&&n!==null){let{key:e,offset:i,type:o}=a.anchor,c=r._slotsUsed&&UA(a.anchor);a.applyDOMRange(n);let l=t.endsWith(`Forward`);if(!1!==c&&(l||t.endsWith(`Backward`))){let n=SA(e,i,o),{anchor:r,focus:u}=a,d=!GA(UA(r),c)||!GA(UA(u),c),f=!d&&c!==null&&(l?r.isBefore(n)||u.isBefore(n):n.isBefore(r)||n.isBefore(u));(d||f)&&(r.set(e,i,o),u.set(e,i,o),s=f&&t===`deleteContentForward`)}}i.unprocessedBeforeInputData=null;let c=a.anchor,l=a.focus,u=c.getNode(),d=l.getNode();if(t===`insertText`||t===`insertTranspose`){if(o===`
`)e.preventDefault(),ED(r,RC,!1);else if(o===OC)e.preventDefault(),ED(r,zC);else if(o==null&&e.dataTransfer){let t=e.dataTransfer.getData(`text/plain`);e.preventDefault(),a.insertRawText(t)}else o!=null&&Jk(a,n,o,e.timeStamp,!0)?(e.preventDefault(),ED(r,BC,o),oA(o)):i.unprocessedBeforeInputData=o;return i.lastBeforeInputInsertTextTimeStamp=e.timeStamp,!0}switch(e.preventDefault(),t){case`insertFromYank`:case`insertFromDrop`:case`insertReplacementText`:ED(r,BC,e),oA((e.dataTransfer?e.dataTransfer.getData(`text/plain`):null)??e.data);break;case`insertFromComposition`:{i.compositionPhase=`idle`;let t=i.hadOrphanedCompositionEvents;i.hadOrphanedCompositionEvents=!1;let n=r._compositionKey;XE(null),t||ED(r,BC,e),uA(n);break}case`insertLineBreak`:XE(null),i.isInsertLineBreak=!1,ED(r,RC,!1);break;case`insertParagraph`:XE(null),i.isInsertLineBreak?(i.isInsertLineBreak=!1,ED(r,RC,!1)):ED(r,zC);break;case`insertFromPaste`:case`insertFromPasteAsQuotation`:ED(r,VC,e);break;case`deleteByComposition`:(function(e,t){return e!==t||Z(e)||Z(t)||!HE(e)||!HE(t)})(u,d)&&ED(r,HC,e);break;case`deleteByDrag`:MD(`skip-selection-focus`),ED(r,HC,e);break;case`deleteByCut`:ED(r,HC,e);break;case`deleteContent`:ED(r,LC,!1);break;case`deleteWordBackward`:ED(r,UC,!0);break;case`deleteWordForward`:ED(r,UC,!1);break;case`deleteHardLineBackward`:case`deleteSoftLineBackward`:ED(r,WC,!0);break;case`deleteContentForward`:case`deleteHardLineForward`:case`deleteSoftLineForward`:ED(r,s?LC:WC,!1);break;case`formatStrikeThrough`:ED(r,GC,`strikethrough`);break;case`formatBold`:ED(r,GC,`bold`);break;case`formatItalic`:ED(r,GC,`italic`);break;case`formatUnderline`:ED(r,GC,`underline`);break;case`historyUndo`:ED(r,KC);break;case`historyRedo`:ED(r,qC)}return!0}function fye(e,t){e.stopPropagation();let n=t._inputState;sA(n),Vk(t,()=>{lA(e,t)||t.dispatchCommand(cge,e)},{event:e}),n.unprocessedBeforeInputData=null}function pye(e){let t=Tk(),n=t._inputState,r=$(),i=e.data,a=aA(e),o=!1,s=!1;if(i!=null&&Q(r)){let c=qD(ID(t)),l=c===null?null:tO(c,t._rootElement),u=e.inputType===`insertCompositionText`&&n.compositionPhase!==`ending-firefox`&&!t.isComposing();u&&(n.hadOrphanedCompositionEvents=!0);let d=r.anchor.getNode(),f=e.inputType===`insertCompositionText`&&n.compositionPhase!==`ending-firefox`&&t.isComposing()&&aE(d)&&UE(d);if(!u&&!f&&Jk(r,a,i,e.timeStamp,!1,l)){if(o=!0,n.compositionPhase===`ending-firefox`){let e=dA(t,i);if(n.compositionPhase=`idle`,e)return MD(`composition-end`),lD(),!0}let a=r.anchor.getNode();if(c===null||l===null)return!0;let u=r.isBackward(),d=u?r.anchor.offset:r.focus.offset,f=u?r.focus.offset:r.anchor.offset;xC&&!r.isCollapsed()&&aE(a)&&l.anchorNode!==null&&a.getTextContent().slice(0,d)+i+a.getTextContent().slice(d+f)===mD(l.anchorNode)||(ED(t,BC,i),s=e.inputType===`insertText`);let p=i.length;bC&&p>1&&e.inputType===`insertCompositionText`&&!t.isComposing()&&(r.anchor.offset-=p,r._cachedNodes=null,r._cachedIsBackward=null),TC&&t.isComposing()&&(n.lastKeyDownTimeStamp=0,XE(null))}}return o||(hD(!1,t,i===null?void 0:i),n.compositionPhase===`ending-firefox`&&(dA(t,i||void 0),MD(`composition-end`),n.compositionPhase=`idle`)),lD(s),!0}function mye(e,t){ED(t,lge,e)}function hye(e){let t=Tk(),n=t._inputState,r=$();if(Q(r)&&!t.isComposing()){n.compositionPhase=`composing`,n.hadOrphanedCompositionEvents=!1;let i=r.anchor,a=r.anchor.getNode();if(XE(i.key),MD(`composition-start`),e.timeStamp<n.lastKeyDownTimeStamp+Gk||i.type===`element`||!r.isCollapsed()||!TC&&(a.getFormat()!==r.format||aE(a)&&a.getStyle()!==r.style)||aE(a)&&(UE(a)||i.offset===0&&!a.canInsertTextBefore()||i.offset===a.getTextContentSize()&&!a.canInsertTextAfter())){SC||!CC&&!EC?ED(t,BC,kC):function(e){TA(e,``,!0)}(r);let e=$();Q(e)&&XE(e.anchor.key)}}return!0}function gye(e){let t=Tk();return t._inputState.compositionPhase=`idle`,dA(t,e.data),MD(`composition-end`),!0}function uA(e){let t=Tk()._inputState,n=t.composedSegmentedKey;if(t.composedSegmentedKey=null,e===null||e!==n)return;let r=$E(e);if(!aE(r)||r.getType()===`text`||UE(r)||!r.isAttached())return;let i=$(),a=Q(i)&&i.anchor.key===e?i.anchor.offset:null,o=iE(r.getTextContent());if(o.setFormat(r.getFormat()),o.setStyle(r.getStyle()),r.replace(o),a!==null){let e=Math.min(a,o.getTextContentSize());o.select(e,e)}}function dA(e,t){let n=e._compositionKey;if(XE(null),n!==null&&t!=null){if(t===``){let t=$E(n),r=e.getElementByKey(n),i=r!==null&&aE(t)?hO(t,r,e):null;if(i!==null&&i.nodeValue!==null&&aE(t)){let n=qD(ID(e)),r=n&&tO(n,e._rootElement),a=null,o=null;r!==null&&r.anchorNode===i&&(a=r.anchorOffset,o=r.focusOffset),gD(t,i.nodeValue,a,o,!0)}return uA(n),!1}if(t[t.length-1]===`
`){let t=$();if(Q(t)||AA(t)){if(Q(t)){let e=t.focus;t.anchor.set(e.key,e.offset,e.type)}return ED(e,tw,null),uA(n),!1}}let r=$E(n);if(r!==null&&aE(r)&&UE(r)){r.markDirty();let e=$(),i=r.getTextContentSize(),a=Q(e)&&e.anchor.key===n?e.anchor.offset:i;return r.select(a,a).insertText(t),!0}}return hD(!0,e,t),uA(n),!1}function _ye(e,t){let n=t._inputState;bC?n.compositionPhase=`ending-firefox`:(e.data===``||SC||!CC&&!EC)&&ED(t,uge,e)}function vye(e,t){let n=t._inputState;SC&&(n.isShiftKeyDown=e.key===`Shift`||n.isShiftKeyDown&&e.shiftKey&&e.key!==`CapsLock`),n.lastKeyDownTimeStamp=e.timeStamp,n.lastKeyCode=e.key,e.key!==`Backspace`&&sA(n),t.isComposing()||!SC&&(CC||EC)&&e.keyCode===229||ED(t,JC,e)}function yye(e,t){e.shiftKey&&e.key!==`CapsLock`||(t._inputState.isShiftKeyDown=!1)}var fA={altKey:`any`,ctrlKey:`any`,metaKey:`any`,shiftKey:`any`},pA={ctrlKey:!0},mA={metaKey:!0},hA={shiftKey:`any`},gA={altKey:`any`,shiftKey:`any`};function bye(e){let t=Tk();if(e.key==null)return!0;let n=t._keyDownShortcuts;n===null&&(n=Ege(function(){let e=(e,t,n)=>({key:e,modifiers:t,onMatch:(e,t)=>{ED(t,n,e)}}),t=(e,t,n,r)=>({key:e,modifiers:t,onMatch:(e,t)=>{e.preventDefault(),ED(t,n,r)}}),n=(e,t)=>({key:`Enter`,modifiers:e,onMatch:(e,n)=>{let r=n._inputState;r.isInsertLineBreak=t&&(!SC||r.isShiftKeyDown),ED(n,tw,e),e.defaultPrevented&&(r.isInsertLineBreak=!1)}}),r=(e,t)=>({key:e,modifiers:hw,onMatch:(e,n)=>{let r=n._editorState._selection;r===null||Q(r)||LE(e)||(e.preventDefault(),ED(n,t,e))}});return[e(`ArrowRight`,hA,YC),e(`ArrowLeft`,hA,ZC),e(`ArrowUp`,gA,$C),e(`ArrowDown`,gA,ew),n({...fA,shiftKey:!0},!0),n({...fA,shiftKey:!1},!1),e(` `,fA,fge),{key:`Backspace`,modifiers:hA,onMatch:(e,t)=>{ED(t,nw,e)&&cA(t._inputState)}},e(`Escape`,fA,rw),e(`Delete`,{},iw),t(`Backspace`,Cge,UC,!0),t(`Delete`,Cge,UC,!1),t(`b`,hw,GC,`bold`),t(`u`,hw,GC,`underline`),t(`i`,hw,GC,`italic`),e(`Tab`,hA,aw),t(`z`,hw,KC,void 0),t(`z`,{...hw,shiftKey:!0},qC,void 0),...yC?[{key:`o`,modifiers:pA,onMatch:(e,t)=>{e.preventDefault(),ED(t,RC,!0)}},e(`ArrowLeft`,{metaKey:!0,...hA},QC),e(`ArrowRight`,{metaKey:!0,...hA},XC),t(`h`,pA,LC,!0),t(`d`,pA,LC,!1),t(`Backspace`,mA,WC,!0),t(`Delete`,mA,WC,!1),t(`k`,pA,WC,!1)]:[e(`Home`,hA,QC),e(`End`,hA,XC),t(`y`,pA,qC,void 0)],{key:`a`,modifiers:hw,onMatch:(e,t)=>{e.preventDefault(),ED(t,fw,e)&&cA(t._inputState)}},r(`c`,uw),r(`x`,dw)]}()),t._keyDownShortcuts=n);let r=n.match(e);return r&&r.onMatch(e,t),function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey}(e)&&t.dispatchCommand(xge,e),!0}function _A(e){let t=e.__lexicalEventHandles;return t===void 0&&(t=[],e.__lexicalEventHandles=t),t}function vA(e,t,n,r){if(r!==void 0)for(let e of r.editors)e._inputState.isSelectionChangeFromMouseDown=!1;let i=tO(t,e._rootElement).anchorNode;(oO(i)||WE(i))&&cD(ej(nj(),t,e,n))}var yA=new Map;function bA(e){let t=e.target;if(oO(t)&&(t.nodeName===`INPUT`||t.nodeName===`TEXTAREA`))return;let n=Ove(t);if(n===null)return;let r=kD(t),i=null,a=r===null?void 0:qk.get(r);if(r!==null){if(a!==void 0){let e=a.editors,t=a.hasShadowEditor;if(t===void 0){t=!1;for(let n of e)if(n._rootElement!==null&&JD(n._rootElement.getRootNode())){t=!0;break}a.hasShadowEditor=t}if(t){let t=null;for(let r of e){let e=r._rootElement;if(e===null)continue;let a=tO(n,e).anchorNode;if(a!==null&&BE(a)===r){if(JD(e.getRootNode())){i=r;break}t===null&&(t=r)}}i===null&&t!==null&&(i=t)}else{let e=n.anchorNode;e===null||oO(e)&&e.shadowRoot!==null||(i=BE(e))}}if(i===null){let e=rO(r);i=e===null?null:BE(e)}}if(i===null)return;i._inputState.isSelectionChangeFromMouseDown&&Vk(i,()=>vA(i,n,e,a));let o=fD(i),s=o[o.length-1],c=s._key,l=yA.get(c),u=l||s;u!==i&&Xk(n,u,!1),Xk(n,i,!0),i===s?l&&yA.delete(c):yA.set(c,i)}function xye(e){e._lexicalHandled=!0}function Sye(e){return!0===e._lexicalHandled}var xA=age(),Cye=class{key;offset;type;_selection;constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){return this.key===e.key?this.offset<e.offset:cM(hE(sE(this,`next`)),hE(sE(e,`next`)))<0}getNode(){let e=$E(this.key);return e===null&&hC(20),e}set(e,t,n,r){let i=this._selection,a=this.key;r&&this.key===e&&this.offset===t&&this.type===n||(this.key=e,this.offset=t,this.type=n,xk()||(ZE()===a&&XE(e),i!==null&&(i.setCachedNodes(null),Q(i)&&(i._cachedIsBackward=null),i.dirty=!0)))}};function SA(e,t,n){return new Cye(e,t,n)}function CA(e,t){let n=t.__key,r=e.offset,i=`element`;if(aE(t)){i=`text`;let e=t.getTextContentSize();r>e&&(r=e)}else if(!Z(t)){let e=t.getNextSibling();if(aE(e))n=e.__key,r=0,i=`text`;else{let e=t.getParent();e&&(n=e.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,i)}function wye(e,t){if(Z(t)){let n=t.getLastDescendant();Z(n)||aE(n)?CA(e,n):CA(e,t)}else CA(e,t)}function wA(e,t,n,r){let i=e.getNode(),a=i.getChildAtIndex(e.offset),o=iE();if(o.setFormat(n),o.setStyle(r),DE(a))a.splice(0,0,[o]);else if(a!==null){let e=BD(i)?EE().append(o):o;a.insertBefore(e)}else if(BD(i)){let e=i.getLastChild();Z(e)&&!e.isInline()&&e.isEmpty()?e.append(o):i.append(EE().append(o))}else i.append(o);e.is(t)&&t.set(o.__key,0,`text`),e.set(o.__key,0,`text`)}function TA(e,t,n){let r=e.format,i=e.style;if(!e.isCollapsed()){let a=(e.focus.isBefore(e.anchor)?e.focus:e.anchor).getNode();if(aE(a)&&(r=a.getFormat(),i=a.getStyle()),e.removeText(),e.format=r,e.style=i,t===``&&!n)return;if(ZE()===null)return e.anchor.type===`element`&&wA(e.anchor,e.focus,r,i),void EA(e,t,r,i)}e.anchor.type===`element`&&wA(e.anchor,e.focus,r,i);let a=e.anchor.getNode();aE(a)||hC(398);let o=e.anchor.offset,s=a.getParentOrThrow(),c=a.getTextContentSize();if(UE(a)||o===0&&(!a.canInsertTextBefore()||!s.canInsertTextBefore()&&!a.__prev)||o===c&&(!a.canInsertTextAfter()||!s.canInsertTextAfter()&&!a.__next)){if(a.isSegmented()&&o!==0&&o!==c){if(ZE()!==null)a.setMode(`normal`).setFormat(r).setStyle(i),Tk()._inputState.composedSegmentedKey=a.getKey();else{let t=iE(a.getTextContent());t.setFormat(r),t.setStyle(i);let n=$()===e;a.replace(t),e.setTextNodeRange(t,o,t,o),n&&$()!==e&&cD(e)}(t!==``||n)&&TA(e,t,n);return}if(t===``&&!n)return;if(o===0||o===c){let c=o===0,l=c?`previous`:`next`,u=Yj(a,l).getNodeAtCaret(),d;aE(u)&&(c?u.canInsertTextAfter():u.canInsertTextBefore())&&!UE(u)?d=u:(d=iE().setFormat(r).setStyle(i),Yj((c?s.canInsertTextBefore():s.canInsertTextAfter())?a:s,l).insert(d));let f=c?void 0:0;d.select(f,f),TA(e,t,n);return}let l=iE(t);l.setFormat(r),l.setStyle(i),a.replace(l),l.select();return}if(t===``&&!n)return;let l=s.isInline()&&o===0&&!a.__prev,u=s.isInline()&&o===c&&!a.__next,d=a.getFormat()!==r||a.getStyle()!==i;if(l||u||d){if(a.getTextContent()!==``||l||u)return void EA(e,t,r,i);a.setFormat(r),a.setStyle(i)}a.spliceText(o,0,t,!0),a.isComposing()&&e.anchor.type===`text`&&e.anchor.set(e.anchor.key,e.anchor.offset-t.length,e.anchor.type)}function EA(e,t,n,r){let i=e.anchor.getNode();aE(i)||hC(398);let a=e.anchor.offset,o=iE(t).setFormat(n).setStyle(r),s=i.getParentOrThrow(),c=a===0,l=c||a===i.getTextContentSize();if(l&&s.isInline()&&!(c?i.__prev:i.__next))Yj(s,c?`previous`:`next`).insert(o);else{let e=l?i:i.splitText(a)[0];c?e.insertBefore(o,!1):e.insertAfter(o,!1)}i.getTextContent()===``&&i.isAttached()&&i.remove(),o.selectEnd(),o.isComposing()&&e.anchor.type===`text`&&e.anchor.set(e.anchor.key,e.anchor.offset-t.length,e.anchor.type)}var DA=class e{_nodes;_cachedNodes;dirty;constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!AA(e))return!1;let t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every(e=>n.has(e))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new e(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){let t=this.getNodes().filter(e=>Oj(e)===null),n=t.length;if(n===0)return;let r=t[n-1],i;if(aE(r))i=r.select();else{let e=r.getIndexWithinParent()+1;i=r.getParentOrThrow().select(e,e)}i.insertNodes(e);for(let e=0;e<n;e++)t[e].remove()}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=this._nodes,n=[];for(let e of t){let t=$E(e);t!==null&&n.push(t)}return xk()||(this._cachedNodes=n),n}getTextContent(){let e=this.getNodes(),t=``;for(let n=0;n<e.length;n++)t+=e[n].getTextContent();return t}deleteNodes(){let e=this.getNodes().filter(e=>Oj(e)===null);if(($()||nj())===this&&e[0]){let t=Yj(e[0],`next`);lE(oM(t,t))}for(let t of e)t.remove();OA()}};function OA(){let e=oD();if(e.getChildrenSize()===0&&jj($())===null){let t=EE();e.append(t),t.select()}}function Q(e){return e instanceof kA}var kA=class e{format;style;anchor;focus;_cachedNodes;_cachedIsBackward;dirty;constructor(e,t,n,r){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this._cachedIsBackward=null,this.format=n,this.style=r,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!Q(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=function(e){let t=[],[n,r]=e.getTextSlices();n&&t.push(n.caret.origin);let i=new Set,a=0;for(let n of e)if(Jj(n)){let{origin:e}=n;t.length===0?i.add(e):(a++,t.push(e))}else{let{origin:e}=n;Z(e)&&a!==0?a--:t.push(e)}if(r&&t.push(r.caret.origin),qj(e.focus)&&Z(e.focus.origin)&&e.focus.getNodeAtCaret()===null)for(let n=$j(e.focus.origin,`previous`);Jj(n)&&i.has(n.origin)&&!n.origin.isEmpty()&&n.origin.is(t[t.length-1]);n=tM(n))i.delete(n.origin),t.pop();for(;t.length>1;){let e=t[t.length-1];if(!Z(e)||a>0||e.isEmpty()||i.has(e))break;t.pop()}if(t.length===0&&e.isCollapsed()){let n=hE(e.anchor),r=hE(e.anchor.getFlipped()),i=e=>Kj(e)?e.origin:e.getNodeAtCaret(),a=i(n)||i(r)||(e.anchor.getNodeAtCaret()?n.origin:r.origin);t.push(a)}return t}(_E(dE(this),`next`));return xk()||(this._cachedNodes=t),t}setTextNodeRange(e,t,n,r){return this.anchor.set(e.__key,t,`text`),this.focus.set(n.__key,r,`text`),this}getTextContent(){if(this.isCollapsed())return``;let e=this.getNodes(),t=dE(this).getTextSlices(),n=``,r=!0;for(let i=0;i<e.length;i++){let a=e[i];if(Z(a)&&!a.isInline()){r||(n+=`
`);let e=``;for(let t of Nj(a)){let n=Pj(a,t);n!==null&&(e+=n.getTextContent())}e===``?r=!a.isEmpty():(n+=e,r=!1)}else if(r=!1,aE(a)){let e=bE(t,a);n+=e?e.getTextContent():a.getTextContent()}else(VT(a)||tk(a))&&(n+=a.getTextContent())}return n}applyDOMRange(e){let t=Tk(),n=t.getEditorState()._selection,r=JA(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,n);if(r===null)return;let[i,a,o]=r;this.anchor.set(i.key,i.offset,i.type,!0),this.focus.set(a.key,a.offset,a.type,!0),o&&(this.dirty=!0),IT(this)}clone(){let t=this.anchor,n=this.focus;return new e(SA(t.key,t.offset,t.type),SA(n.key,n.offset,n.type),this.format,this.style)}toggleFormat(e){this.format=qE(this.format,e,null),this.dirty=!0}setFormat(e){this.format=e,this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){let t=AC[e];return(this.format&t)!==0}insertRawText(e){this.insertNodes(dj(e))}insertText(e){TA(this,e,!1)}removeText(){let e=$()===this,t=this.anchor.key;uE(this,mve(dE(this))),this.isCollapsed()&&tj(this,t),e&&$()!==this&&cD(this)}formatText(e,t=null){NA(this,e,t)}insertNodes(e){if(e.length===0)return;this.isCollapsed()||this.removeText();let t=this.anchor.getNode();if(this.anchor.type===`element`&&Z(t)&&t.isShadowRoot()&&Oj(t)!==null){let n=t.getFirstChild()??t.append(EE()).getFirstChild();if(n!==null&&!Z(n)){let e=EE();n.insertBefore(e),n=e}if(n!==null){n.selectStart();let t=$();return Q(t)||hC(369),t.insertNodes(e)}}if(this.anchor.type===`element`&&BD(t)){let n=hj(e),r=n.getLastDescendant();t.splice(this.anchor.offset,0,n.getChildren()),r!==null&&r.selectEnd();return}let n=this.isBackward()?this.focus:this.anchor,r=n.getNode(),i=GO(r,dO),a=e[e.length-1];if(Z(i)&&`__language`in i){if(`__language`in e[0])this.insertText(e[0].getTextContent());else{let[,t]=pj(this);i.splice(t,0,e),a.selectEnd()}return}if(!e.some(e=>(Z(e)||VT(e))&&!e.isInline())){Z(i)||hC(211,r.constructor.name,r.getType());let[t,n]=pj(this,!0);(Z(t)?t:i).splice(n,0,e),a.selectEnd();return}if(i===null){let t=hj(e),n=t.getLastDescendant(),r=sE(this.anchor,`next`);for(let e of t.getChildren())r=CE(e,r);n!==null&&n.selectEnd();return}if(Z(i)&&(Oj(i)!==null||!i.isParentRequired()&&!BD(i.getParentOrThrow()))){let[,t]=pj(this),n=fj(e);i.splice(t,0,n);let r=n[n.length-1];r===void 0?i.select(t,t):r.selectEnd();return}let o=hj(e),s=o.getLastDescendant(),c=o.getChildren(),l=function(e){let t=function(e){let t=e.getNode();if(e.offset>0)return e.type===`element`&&Z(t)?t.getChildAtIndex(e.offset-1):null;for(let e=t;e!==null&&!dO(e)&&!BD(e);e=e.getParent()){let t=e.getPreviousSibling();if(t!==null)return t}return null}(e);return tk(t)&&tk(t.getPreviousSibling())}(n),u=Z(i)&&i.isEmpty()?null:this.insertParagraph();u&&!i.isAttached()&&(r=this.anchor.getNode(),i=GO(r,dO));let d=c[c.length-1],f=c[0];var p=f;l||!Z(p)||!dO(p)||p.isEmpty()||!Z(i)||i.isEmpty()&&!i.canMergeWhenEmpty()||(Z(i)||hC(211,r.constructor.name,r.getType()),i.append(...f.getChildren()),f=c[1]),f&&(i===null&&hC(212,r.constructor.name,r.getType()),function(e,t){let n=t.getParentOrThrow().getLastChild(),r=t,i=[t];for(;r!==n;)r.getNextSibling()||hC(140),r=r.getNextSibling(),i.push(r);let a=e;for(let e of i)a=a.insertAfter(e)}(i,f));let m=GO(s,dO),h=s.selectEnd();u&&(Z(m)&&(u.canMergeWhenEmpty()||dO(d))?(m.append(...u.getChildren()),u.remove()):u.isEmpty()&&u.remove()),Z(i)&&i.isEmpty()&&i.remove();let g=Z(i)?i.getLastChild():null;tk(g)&&m!==i&&g.remove();let _=hE(sE(h.anchor,`next`));cE(h.anchor,_),cE(h.focus,_)}insertParagraph(){this.isCollapsed()||this.removeText();let e=this.anchor.getNode();if(this.anchor.type===`element`&&BD(e)){let t=EE();return e.splice(this.anchor.offset,0,[t]),t.select(),t}let[,t]=pj(this),n=GO(this.anchor.getNode(),dO);if(n!==null&&Oj(n)!==null)return null;Z(n)||hC(213);let r=n.getChildAtIndex(t),i=r?[r,...r.getNextSiblings()]:[],a=n.insertNewAfter(this,!1);return a?(a.append(...i),a.selectStart(),a):null}insertLineBreak(e){let t=ek();if(this.insertNodes([t]),e){let e=t.getParentOrThrow(),n=t.getIndexWithinParent();e.select(n,n)}}extract(){let e=this.getNodes();if(this.isCollapsed())return[...e];let t=this.isBackward(),n=dE(this).getTextSlices(),r=[];for(let t of e){let e=bE(n,t),i=e?xE(e,this):t;i!==null&&r.push(i)}if(e.length===1&&r.length===1&&aE(r[0])){let e=r[0],[n,i]=t?[this.focus,this.anchor]:[this.anchor,this.focus];n.set(e.getKey(),0,`text`),i.set(e.getKey(),e.getTextContentSize(),`text`)}return r}modify(e,t,n){if(gj(this,e,t,n))return;let r=e===`move`,i=Tk(),a=qD(ID(i));if(!a)return;let o=i._blockCursorElement,s=i._rootElement,c=this.focus.getNode();s===null||o===null||!Z(c)||c.isInline()||c.canBeEmpty()||KD(o,i,s);let l=DD(i,this.focus.key),u=l;if(this.focus.type===`text`&&(u=aE(c)?hO(c,l,i):null),this.dirty){let e=DD(i,this.anchor.key),t=e;if(this.anchor.type===`text`){let n=this.anchor.getNode();t=aE(n)?hO(n,e,i):null}t&&u&&sj(a,t,this.anchor.offset,u,this.focus.offset)}if(n===`character`&&aE(c)&&c.isUnmergeable()&&(t?this.focus.offset===0:this.focus.offset===c.getTextContentSize())){let e=Yj(c,t?`previous`:`next`).getNodeAtCaret();if(aE(e)){if(!r){let n=e.getTextContentSize();t?this.focus.set(e.__key,n-1,`text`):this.focus.set(e.__key,1,`text`),this.dirty=!0;return}{let n=i.getElementByKey(e.getKey()),r=n?hO(e,n,i):null;if(r){let e=t?r.length:0;sj(a,r,e,r,e)}}}}if(IA(a,e,t?`backward`:`forward`,n,s),a.rangeCount>0){let e=$D(a,i._rootElement),n=e||a.getRangeAt(0),o=this.anchor.getNode(),s=WT(o)?o:RD(o);this.applyDOMRange(n),this.dirty=!0,r||(LA(this,t,s),(e?a.direction!==`backward`:a.anchorNode===n.startContainer&&a.anchorOffset===n.startOffset)||FA(this))}n===`lineboundary`&&gj(this,e,t,n,`decorators`)}forwardDeletion(e,t,n){if(!n&&(e.type===`element`&&Z(t)&&e.offset===t.getChildrenSize()||e.type===`text`&&e.offset===t.getTextContentSize())){let e=t.getParent(),n=t.getNextSibling()||(e===null?null:e.getNextSibling());if(Z(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(e){let t=this.isCollapsed();if(this.isCollapsed()){let t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e)){let e=Z(n)?n.getNextSibling():null;if(!(Z(n)&&n.isEmpty()&&Z(e)&&e.isShadowRoot()))return}let r=sE(t,e?`previous`:`next`),i=iM(r);if(i.getTextSlices().every(e=>e===null||e.distance===0)){if(t.type===`element`){let e=r.getNodeAtCaret();if(Z(e)&&GD(e)){let t=e.getParent();e.remove();let n=sD(t,e);n!==null&&n.selectStart();return}}let e={type:`initial`};for(let t of i.iterNodeCarets(`shadowRoot`))if(Jj(t)){if(!t.origin.isInline()){if(t.origin.isShadowRoot()){if(e.type===`merge-block`)break;if(Z(i.anchor.origin)&&i.anchor.origin.isEmpty()){let e=hE(t);uE(this,oM(e,e)),i.anchor.origin.remove()}return}e.type!==`merge-next-block`&&e.type!==`merge-block`||(e={block:e.block,caret:t,type:`merge-block`})}}else{if(e.type===`merge-block`)break;if(qj(t)){if(Z(t.origin)){if(t.origin.isInline()){if(!t.origin.isParentOf(i.anchor.origin))break}else e={block:t.origin,type:`merge-next-block`};continue}if(VT(t.origin)){if(!t.origin.isIsolated()){if(e.type===`merge-next-block`&&(t.origin.isKeyboardSelectable()||!t.origin.isInline())&&Z(i.anchor.origin)&&i.anchor.origin.isEmpty()){i.anchor.origin.remove();let e=QA();e.add(t.origin.getKey()),cD(e)}else{let e=t.origin,n=e.getParent();e.remove();let r=sD(n,e);r!==null&&r.selectStart()}}return}if(tk(t.origin))return void t.origin.remove();break}}if(e.type===`merge-block`){let{caret:t,block:n}=e;return Nj(n).length>0?void 0:t.origin.isEmpty()&&!n.isEmpty()&&t.origin.getParent()===n.getParent()?void t.origin.remove(!0):(uE(this,oM(!t.origin.isEmpty()&&n.isEmpty()?fE(Yj(n,t.direction)):i.anchor,t)),this.removeText())}for(let e=t.getNode();e!==null;){if(Oj(e)!==null)return;if(Z(e)&&e.isShadowRoot())break;e=e.getParent()}}let a=this.focus;if(RA(this,e,`character`),this.isCollapsed()){if(e&&t.offset===0&&function(e,t){for(let n=t;n;n=n.getParent()){if(Z(n)){if(n.collapseAtStart(e))return!0;if(BD(n))break}if(n.getPreviousSibling())break}return!1}(this,t.getNode()))return}else{let r=a.type===`text`?a.getNode():null;if(n=t.type===`text`?t.getNode():null,r!==null&&r.isSegmented()){let t=a.offset,i=r.getTextContentSize();if(r.is(n)||e&&t!==i||!e&&t!==0)return void BA(r,e,t)}else if(n!==null&&n.isSegmented()){let i=t.offset,a=n.getTextContentSize();if(n.is(r)||e&&i!==0||!e&&i!==a)return void BA(n,e,i)}(function(e,t){let n=e.anchor,r=e.focus,i=n.getNode();if(i===r.getNode()&&n.type===`text`&&r.type===`text`){let e=n.offset,o=r.offset,s=e<o,c=s?e:o,l=s?o:e,u=l-1;c!==u&&!dD(a=i.getTextContent().slice(c,l))&&!Dye(a)&&(t?r.set(r.key,u,r.type):n.set(n.key,u,n.type))}var a})(this,e)}}t||PA(this),this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type===`element`&&this.anchor.offset===0&&OA()}deleteLine(e){jA(this,e,`lineboundary`)}deleteWord(e){jA(this,e,`word`)}isBackward(){let e=this._cachedIsBackward;if(e!==null)return e;let t=this.focus.isBefore(this.anchor);return xk()||(this._cachedIsBackward=t),t}getStartEndPoints(){return[this.anchor,this.focus]}};function AA(e){return e instanceof DA}function jA(e,t,n){let r=e.isCollapsed(),{anchor:i,focus:a}=e,o=!1;if(r){if(n===`word`&&e.forwardDeletion(i,i.getNode(),t))return;o=RA(e,t,n),n===`lineboundary`&&function(e){for(let t of dE(e).iterNodeCarets(`shadowRoot`))if(qj(t)&&tk(t.origin))return void cE(e.focus,fE(t))}(e)}n!==`lineboundary`||e.isCollapsed()||GO(i.getNode(),dO)===GO(a.getNode(),dO)||a.set(i.key,i.offset,i.type),e.isCollapsed()?o||e.deleteCharacter(t):(r||PA(e),e.removeText())}function MA(e,t){if(AA(e)){for(let n of e.getNodes())$T(n)&&n.setFormat(t(n.getFormat()));return}let n=e.isCollapsed()?[]:e.getNodes(),r=n.length?dE(e).getTextSlices():[],i,a,o,s=!1,c=0;for(let l of n)if(aE(l)){i&&a&&(i.set(a.__key,0,`text`),i=void 0);let n=bE(r,l);if(!s&&n&&n.distance===0){let t=e.isBackward()?e.focus:e.anchor;t.type===`text`&&t.key===l.__key&&(i=t)}if(s=!0,n&&n.distance===0)continue;let u=t(l.getFormat()),d=i?l.getTextContentSize():0,f=n&&!UE(l)?xE(n,e):l;f!==null&&(f.setFormat(u),o===void 0&&(o=u,a=f,i&&f.getTextContentSize()!==d&&(i.set(f.__key,0,`text`),i=void 0)),c=u)}else Z(l)?l.setTextFormat(t(l.getTextFormat())):$T(l)&&l.setFormat(t(l.getFormat()));s?o!==void 0&&(e.format=o|c):(e.setFormat(t(e.format)),XE(null))}function Tye(e,t){let n=[];for(let[e,r]of Object.entries(t))typeof r==`boolean`&&n.push([e,r]);n.length!==0&&MA(e,e=>{for(let[t,r]of n)e=qE(e,t,r?AC[t]:0);return e})}function NA(e,t,n=null){let r=n===null&&Q(e)?qE(e.format,t,null):n;MA(e,e=>qE(e,t,r))}function PA(e){let t=oD();!t.isEmpty()&&wE(t,e)&&(e.anchor.set(t.getKey(),0,`element`),e.focus.set(t.getKey(),t.getChildrenSize(),`element`))}function FA(e){let t=e.focus,n=e.anchor,r=n.key,i=n.offset,a=n.type;n.set(t.key,t.offset,t.type,!0),t.set(r,i,a,!0)}function IA(e,t,n,r,i){let a=r===`character`?tO(e,i):null,o=a&&a.focusNode,s=a?a.focusOffset:0;if(e.modify(t,n,r),a===null||!function(e,t,n){return e!==null&&e.nodeType===3&&(n===`backward`?t>0:n===`forward`&&t<e.length)}(o,s,n))return;let c=tO(e,i);c.focusNode===o&&c.focusOffset===s&&e.modify(t,n,r)}function LA(e,t,n){let r=e.getNodes(),i=r.filter(e=>PD(e,n));if(i.length===0||i.length===r.length)return!1;let a=t?i[0]:i[i.length-1],o=Z(a)?a:a.getParentOrThrow();return t?o.selectStart():o.selectEnd(),!0}function RA(e,t,n){if(gj(e,`extend`,t,n))return!1;let r=Tk(),i=qD(ID(r));if(!i||typeof i.modify!=`function`)return!1;let a=r._blockCursorElement,o=r._rootElement,s=e.anchor,c=e.focus.getNode();o===null||a===null||!Z(c)||c.isInline()||c.canBeEmpty()||KD(a,r,o);let l=e=>{let t=e.getNode(),n=r.getElementByKey(e.key);return n!==null&&e.type===`text`&&aE(t)?hO(t,n,r):n},u=s.getNode(),d=l(s);if(d===null)return!1;let f=s.offset,p=e.isCollapsed(),m=e.focus,h=p?d:l(m);if(h===null)return!1;let g=m.offset;if(sj(i,h,g,h,g),IA(i,`move`,t?`backward`:`forward`,n,o),i.rangeCount===0)return!1;let _=$D(i,o)||i.getRangeAt(0),v=_.startContainer,y=_.startOffset;if(n===`lineboundary`&&WE(v)&&BE(v)===r){let e=uD(v);if(VT(e)&&e.isInline()&&!e.isIsolated()){let n=r.getElementByKey(e.getKey());n!==null&&n.contains(v)&&(v=n,y=t?0:n.childNodes.length)}}if(p&&n===`character`&&s.type===`text`&&aE(u)&&u.isUnmergeable()&&f===(t?0:u.getTextContentSize())){let n=Yj(u,t?`previous`:`next`).getNodeAtCaret();if(aE(n)){let r=t?n.getTextContentSize()-1:1;return e.focus.set(n.__key,r,`text`),e.dirty=!0,!1}}if(p&&n===`character`&&s.type===`text`){let n=t?0:u.getTextContentSize(),r=v===d?y:f===n?-1:n;if(r>=0)return r!==f&&(e.focus.set(s.key,r,`text`),e.dirty=!0),!1}let b=r._slotsUsed&&rD(v),x=b?Aj(u):null,S=b?Aj(b):null;if(b&&!GA(S,x)&&zA(e.focus,u,x,S,`deletion`,()=>!t))return!0;let[C,w,T,ee]=t?[v,y,d,f]:[d,f,v,y],E=WT(u)?u:RD(u);return e.applyDOMRange({collapsed:!1,endContainer:T,endOffset:ee,startContainer:C,startOffset:w}),e.dirty=!0,!LA(e,t,E)&&t&&FA(e),!1}function zA(e,t,n,r,i,a){let o=r&&function(e,t){for(let n=kj(e);n!==null;){let e=Aj(n);if(GA(e,t))return e!==null||n.isAttached()?n:null;n=e&&kj(e)}return null}(r,n);if(o===null&&n===null)return!1;let s=a(),c=o&&o.getParent(),l,u;if(o===null||c===null||t!==null&&(o.is(t)||o.isParentOf(t))){let t=o||n;if(!Z(t))return t!==null&&function(e,t,n){Z(t)?e.set(t.getKey(),n?t.getChildrenSize():0,`element`):e.set(t.getKey(),n?t.getTextContentSize():0,`text`)}(e,t,s),!0;l=t,u=s?t.getChildrenSize():0}else l=c,u=o.getIndexWithinParent()+ +(s===(i===`selection`));return i===`deletion`?function(e,t,n,r){for(;;){let i=t.getChildAtIndex(r?n:n-1);if(aE(i))return void e.set(i.getKey(),r?0:i.getTextContentSize(),`text`);if(!Z(i)||BD(i))break;t=i,n=r?0:i.getChildrenSize()}e.set(t.getKey(),n,`element`)}(e,l,u,!s):e.set(l.getKey(),u,`element`),!0}function Eye(){try{let e=RegExp(`\\p{Emoji}`,`u`),t=e.test.bind(e);if(t(`❤️`)&&t(`#️⃣`)&&t(`👍`))return t}catch{}return()=>!1}var Dye=Eye();function BA(e,t,n){let r=e,i=r.getTextContent().split(/(?=\s)/g),a=i.length,o=0,s=0;for(let e=0;e<a;e++){let r=e===a-1;if(s=o,o+=i[e].length,t&&o===n||o>n||r){i.splice(e,1),r&&(s=void 0);break}}let c=i.join(``).trim();c===``?r.remove():(r.setTextContent(c),r.select(s,s))}function VA(e,t,n,r){let i,a=t,o=!1;if(oO(e)){let s=!1,c=e.childNodes,l=c.length,u=r._blockCursorElement;a===l&&l>0&&(s=!0,a=l-1),nD(e,r)!==void 0||wO(e,r)||(o=!0);let d=c[a],f=!1;if(d===u)d=c[a+1],f=!0;else if(u!==null){let n=u.parentNode;e===n&&t>Array.prototype.indexOf.call(n.children,u)&&a--}if(i=uD(d),aE(i))a=Zj(i,s?`next`:`previous`);else{let c=uD(e);if(c===null)return null;if(Z(c)){let o=r.getElementByKey(c.getKey());o===null&&hC(214);let l=mO(c,o,r);[c,a]=l.resolveChildIndex(c,o,e,t),Z(c)||hC(215),s&&a>=c.getChildrenSize()&&(a=Math.max(0,c.getChildrenSize()-1));let u=c.getChildAtIndex(a);if(Z(u)&&function(e,t,n){let r=e.getParent();return n===null||r===null||!r.canBeEmpty()||r!==n.getNode()}(u,0,n)){let e=s?u.getLastDescendant():u.getFirstDescendant();e===null?c=u:(u=e,c=Z(u)?u:u.getParentOrThrow()),a=0}aE(u)?(i=u,c=null,a=Zj(u,s?`next`:`previous`)):u!==c&&s&&!f&&(Z(c)||hC(216),a=Math.min(c.getChildrenSize(),a+1))}else{let n=kj(c),i=n===null?c:n,o=i.getIndexWithinParent(),s=r.getElementByKey(c.getKey()),l=`after`;if(s!==null&&uD(e)===c){let n=mO(c,s,r);n.element===s?t===0&&VT(c)&&(l=`before`):l=n.resolveLeafPosition(s,e,t)}a=l===`before`?o:o+1,c=i.getParentOrThrow()}if(Z(c))return[SA(c.__key,a,`element`),o]}}else i=uD(e);return aE(i)?[SA(i.__key,Zj(i,a,`clamp`),`text`),o]:null}function HA(e,t,n){let r=e.getNode();if(QE(r))return;let i=e.offset===0;if(!i&&e.offset!==r.getTextContent().length)return;let a=i?`previous`:`next`,o=Yj(r,a).getNodeAtCaret();if(i===t||!Z(o)||!o.isInline()||i&&n){if(i&&!t)aE(o)&&!r.isUnmergeable()&&e.set(o.__key,o.getTextContent().length,`text`);else if(o===null&&(n||!i&&t)){let t=r.getParent();if(Z(t)&&t.isInline()&&(i||!t.canInsertTextAfter()&&t.getTextContentSize()>1)){let n=Yj(t,a).getNodeAtCaret();aE(n)&&e.set(n.__key,i?n.getTextContent().length:0,`text`)}}}else e.set(o.__key,i?o.getChildrenSize():0,`element`)}function UA(e){let t=$E(e.key);return t===null?null:Aj(t)}function WA(e,t,n){let r=UA(e),i=UA(t);return!GA(r,i)&&zA(t,$E(e.key),r,i,`selection`,n)}function GA(e,t){return e===null?t===null:e.is(t)}function KA(e){let t=WA(e.anchor,e.focus,()=>function(e,t){let n=function(e,t){let n=new Map;for(let t=null,r=e;r!==null;t=r,r=lM(r))n.set(r.getKey(),t);for(let e=null,r=t;r!==null;e=r,r=lM(r)){let t=n.get(r.getKey());if(t===void 0)continue;let i=r.getLatest();return t===null?e===null?{commonAncestor:i,type:`same`}:{b:e,commonAncestor:i,type:`ancestor`}:e===null?{a:t,commonAncestor:i,type:`descendant`}:{a:t,b:e,commonAncestor:i,type:`branch`}}return null}(e.origin,t.origin);if(n===null)return null;switch(n.type){case`same`:return uM(e,t);case`ancestor`:return e.type===`child`&&Oj(n.b)===null?-1:1;case`descendant`:return t.type===`child`&&Oj(n.a)===null?1:-1;case`branch`:{let e=Oj(n.a)&&n.a.getKey(),t=Oj(n.b)&&n.b.getKey();if(e&&t){for(let r of Mj(n.commonAncestor).values())if(r===e||r===t)return r===e?-1:1}return e?-1:t?1:n.a.isBefore(n.b)?-1:1}}}(sE(e.anchor,`next`),sE(e.focus,`next`))!==1);return t&&(e.dirty=!0),t}function qA(e,t){let n=t;for(;n!==null&&n.parentNode!==e;)n=n.parentNode;let r=0;for(let e=n&&n.previousSibling;e;e=e.previousSibling)r++;return r}function JA(e,t,n,r,i,a){if(e===null||n===null||!RE(i,e,n))return null;let o=VA(e,t,Q(a)?a.anchor:null,i);if(o===null)return null;let s=VA(n,r,Q(a)?a.focus:null,i);if(s===null)return null;let[c,l]=o,[u,d]=s;if(c.type===`element`&&u.type===`element`){let t=uD(e),r=uD(n);if(VT(t)&&VT(r))return null}let f=i._slotsUsed&&WA(c,u,()=>function(e,t,n,r){if(e===n)return r>=t;let i=e.compareDocumentPosition(n);return i&Node.DOCUMENT_POSITION_CONTAINED_BY?qA(e,n)>=t:i&Node.DOCUMENT_POSITION_CONTAINS?r>qA(n,e):(i&Node.DOCUMENT_POSITION_FOLLOWING)!==0}(e,t,n,r));return function(e,t){if(e.type===`text`&&t.type===`text`){let n=e.isBefore(t),r=e.is(t);HA(e,n,r),HA(t,!n,r),r&&t.set(e.key,e.offset,e.type)}}(c,u),[c,u,l||d||f]}function YA(e){return Z(e)&&!e.isInline()}function XA(e,t,n,r,i,a){let o=wk(),s=new kA(SA(e,t,i),SA(n,r,a),0,``);return s.dirty=!0,o._selection=s,s}function ZA(){return new kA(SA(`root`,0,`element`),SA(`root`,0,`element`),0,``)}function QA(){return new DA(new Set)}function $A(e,t){return ej(null,e,t,null)}var Oye=new Set([` `,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`Backspace`,`Delete`,`End`,`Enter`,`Home`,`Tab`]);function ej(e,t,n,r){let i=n._window;if(i===null)return null;let a=r||i.event,o=a?a.type:void 0,s=o===`selectionchange`,c=o===`keydown`&&a,l=c&&iO(c),u=c&&(c.ctrlKey||c.metaKey||Oye.has(c.key))&&sO(l)&&BE(l)===n,d=!ww&&(s||u||o===`beforeinput`||o===`compositionstart`||o===`compositionend`||o===`click`&&a&&a.detail===3||o===`drop`||o===void 0),f,p,m,h;if(Q(e)&&!d)return e.clone();{if(t===null)return null;let r=tO(t,n._rootElement);if(f=r.anchorNode,p=r.focusNode,m=r.anchorOffset,h=r.focusOffset,(s||u||o===void 0)&&Q(e)&&!RE(n,f,p))return e.clone()}let g=JA(f,m,p,h,n,e);if(g===null)return null;let[_,v,y]=g,b=Q(e)?e:null,x=new kA(_,v,b?b.format:0,b?b.style:``);return b&&tj(x,b.anchor.key),x.dirty=y,x}function tj(e,t){let n=e.anchor;if(n.key===t)return;let r=n.getNode(),i=0,a=``;aE(r)?(i=r.getFormat(),a=r.getStyle()):Z(r)&&(i=r.getTextFormat(),a=r.getTextStyle()),e.format===i&&e.style===a||(e.format=i,e.style=a,e.dirty=!0)}function $(){return wk()._selection}function nj(){return Tk()._editorState._selection}function rj(e,t){let n=t.__key;return e.anchor.key===n||e.focus.key===n}function ij(e,t,n,r=1){if(rj(e,t))for(let i of[e.anchor,e.focus]){i.key===t.__key&&(n<=i.offset&&r>0||n<i.offset&&r<0)&&i.set(t.__key,Math.max(0,i.offset+r),`element`);let e=i.getNode();if(Z(e)){let t=e.getChildrenSize(),n=i.offset>=t,r=e.getChildAtIndex(n?t-1:i.offset);aE(r)&&i.set(r.__key,n?r.getTextContentSize():0,`text`)}}}function aj(e,t,n,r,i){let a=r||i;if(aE(a)||Z(a)){let t=aE(a);e.set(a.__key,r===null?0:t?a.getTextContentSize():a.getChildrenSize(),t?`text`:`element`)}else{let r=t.getIndexWithinParent();e.set(n.__key,r===-1?n.getChildrenSize():r,`element`)}}function oj(e,t,n,r,i){e.type===`text`?e.set(n,e.offset+(t?0:i),`text`):e.offset>r.getIndexWithinParent()&&e.set(e.key,e.offset-1,`element`)}function sj(e,t,n,r,i){try{e.setBaseAndExtent(t,n,r,i)}catch{}}function cj(e,t,n){let r=DD(e,t.getKey());if(Z(t)){let i=mO(t,r,e);return[i.element,n+i.getFirstChildOffset()]}return[r,n]}function kye(e,t,n,r,i,a){let o=a.getRootNode(),s=GE(o)||JD(o)?rO(o):null;if(i.has(`collaboration`)&&s!==a||s!==null&&IE(s,s))return;let c=tO(r,a),l;if(!Q(t))return void(e!==null&&RE(n,c.anchorNode,c.focusNode)&&r.removeAllRanges());let u=t.anchor,d=t.focus,f=u.getNode(),p=d.getNode(),[m,h]=cj(n,f,u.offset),[g,_]=cj(n,p,d.offset),v=t.format,y=t.style,b=t.isCollapsed(),x=m,S=g,C=!1;if(u.type===`text`?(x=aE(f)?hO(f,m,n):null,C=f.getFormat()!==v||f.getStyle()!==y):Q(e)&&e.anchor.type===`text`&&(C=!0),d.type===`text`&&(S=aE(p)?hO(p,g,n):null),x===null||S===null)return;let w=b&&aE(p)&&QE(p)&&WE(S)&&S.nodeValue===DC?DC.length:_;if(b&&(e===null||C||Q(e)&&(e.format!==v||e.style!==y))&&function(e,t,n,r,i,a){e._inputState.collapsedSelectionFormat={format:t,key:i,offset:r,style:n,timeStamp:a}}(n,v,y,u.offset,u.key,performance.now()),(r.type!==`Range`||!b)&&c.anchorOffset===h&&c.focusOffset===w&&c.anchorNode===x&&c.focusNode===S){if(s===null||!a.contains(s)){let e=s===null?null:BE(s);e!==null&&e!==n||i.has(`skip-selection-focus`)||a.focus({preventScroll:!0})}if(u.type!==`element`)return}if(sj(r,x,h,S,w),bC&&t.isCollapsed()&&a!==null&&!i.has(`skip-selection-focus`)){let e=nO(a);if(e===null||!a.contains(e)){let e=rO(a.ownerDocument),t=e===null?null:BE(e);t!==null&&t!==n||a.focus({preventScroll:!0})}}if(!i.has(`skip-scroll-into-view`)&&t.isCollapsed()&&a!==null&&a===nO(a)){let e=Q(t)&&t.anchor.type===`element`?function(e,t,n){let r=t.childNodes[n];if(!oO(r))return r||null;let i=nD(r,e),a=i===void 0?null:$E(i);return a===null||Z(a)?r:mO(a,r,e).element}(n,x,h):(l===void 0&&(l=eO(r,a)),l);if(e!==null){let t;if(WE(e)){let n=e.ownerDocument.createRange();n.selectNode(e),t=n.getBoundingClientRect()}else t=oO(e)?e.getBoundingClientRect():function(e){let t=e.getBoundingClientRect(),{startContainer:n,startOffset:r}=e;if(!e.collapsed||t.width!==0||t.height!==0||!WE(n)||n.length===0)return t;let i=e.cloneRange();return r>0?i.setStart(n,r-1):i.setEnd(n,1),i.getBoundingClientRect()}(e);(function(e,t,n,r=null){let i=kD(n),a=FD(i);if(i===null||a===null)return;let o=n.getBoundingClientRect();if(t.bottom<o.top)return;if(r!==null&&t.height>0){let{left:e,right:i}=t,o=oO(r)?r:OD(r);for(;o!==null&&n.contains(o);){let t=Dve(a,o,e,i);e-=t,i-=t,o=o===n?null:OD(o)}}let{top:s,bottom:c}=t,l=0,u=0,d=n;for(;d!==null;){let t=d===i.body;if(t){let t=a.visualViewport;if(t){let e=t.offsetTop;l=e,u=e+t.height}else l=0,u=ID(e).innerHeight;let n=a.getComputedStyle(i.documentElement),r=parseFloat(n.scrollPaddingTop),o=parseFloat(n.scrollPaddingBottom);isFinite(r)&&(l+=r),isFinite(o)&&(u-=o)}else{let e=d===n?o:d.getBoundingClientRect();l=e.top,u=e.bottom}let r=0;if(s<l?r=-(l-s):c>u&&(r=c-u),r!==0){if(t)a.scrollBy(0,r);else{let e=d.scrollTop;d.scrollTop+=r;let t=d.scrollTop-e;s-=t,c-=t}}if(t)break;d=OD(d)}})(n,t,a,x)}}(function(e,t,n,r,i){let a=e._inputState;a.isSelectionChangeFromDOMUpdate=!0,a.selectionChangeFromDOMUpdatePoints=t!==void 0&&n!==void 0&&r!==void 0&&i!==void 0?{anchorNode:t,anchorOffset:n,focusNode:r,focusOffset:i}:null})(n,x,h,S,w)}function lj(e){let t=$()||nj();t===null&&(t=oD().selectEnd()),t.insertNodes(e)}function uj(e,t){for(let n of e.split(/(\r?\n|\t)/))n===`
`||n===`\r
`?t.linebreak():n===` `?t.tab():n!==``&&t.text(n)}function dj(e){let t=[];return uj(e,{linebreak:()=>t.push(ek()),tab:()=>t.push(kE()),text:e=>t.push(iE(e))}),t}function Aye(){let e=$();return e===null?``:e.getTextContent()}function fj(e){let t=[];for(let n of e)tk(n)||(!Z(n)&&!VT(n)||n.isInline()?t.push(n):Z(n)&&t.push(...fj(n.getChildren())));return t}function pj(e,t=!1){let n=e;e.isCollapsed()||n.removeText();let r=$();Q(r)&&(n=r),Q(n)||hC(161);let i=n.anchor,a=i.getNode(),o=i.offset;for(;!dO(a)&&Oj(a)===null;){let e=a;if([a,o]=jye(a,o,t),e.is(a))break}return[a,o]}function jye(e,t,n=!1){let r=e.getParent();if(!r){let e=EE();return oD().append(e),e.select(),[oD(),0]}if(aE(e)){let n=e.splitText(t);if(n.length===0)return[r,e.getIndexWithinParent()];let i=t===0?0:1;return[r,n[0].getIndexWithinParent()+i]}if(!Z(e)||t===0)return[r,e.getIndexWithinParent()];let i=e.getChildAtIndex(t);if(i){let r=new kA(SA(e.__key,t,`element`),SA(e.__key,t,`element`),0,``),a=e.insertNewAfter(r);if(a)a.append(i,...i.getNextSiblings());else if(n)return[e,t]}return[r,e.getIndexWithinParent()+1]}function mj(e){return tk(e)||LD(e)||aE(e)||e.isParentRequired()}function hj(e){let t=EE(),n=null;for(let r=0;r<e.length;r++){let i=e[r];if(mj(i)){if(n===null){n=i.createParentElementNode(),t.append(n);let a=e[r+1];if(tk(i)&&(a===void 0||!mj(a)))continue}n.append(i)}else t.append(i),n=null}return t}function gj(e,t,n,r,i=`decorators-and-blocks`){if(t===`move`&&r===`character`&&!e.isCollapsed()){let[t,r]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return r.set(t.key,t.offset,t.type),!0}let a=sE(e.focus,n?`previous`:`next`),o=r===`lineboundary`,s=t===`move`,c=a,l=i===`decorators-and-blocks`,u=!1;if(!gE(c)){for(let e of c){l=!1;let{origin:t}=e;if(VT(t)){if(t.isIsolated()){u=!0;break}if(c=e,o&&t.isInline())continue}break}if(u)return!0;if(l)for(let e of iM(a).iterNodeCarets(t===`extend`?`shadowRoot`:`root`)){if(Jj(e))e.origin.isInline()||(c=e);else{if(Z(e.origin))continue;VT(e.origin)&&!e.origin.isInline()&&(c=e)}break}}if(c===a)return!1;if(s&&!o&&VT(c.origin)&&c.origin.isKeyboardSelectable()){let e=QA();return e.add(c.origin.getKey()),cD(e),!0}return c=hE(c),s&&cE(e.anchor,c),cE(e.focus,c),l||!o}function _j(e,t,n){let r=t===null?null:t.__key,i=n===null?null:n.__key;t===null?e.__first=i:t.__next=i,n===null?e.__last=r:n.__prev=r}function vj(e){let t=Tk();if(!t._recordNodeMoves)return;let n=t._editorState._nodeMap;if(n.has(e.__key)){let t=wk(),r=t._movedNodes||=new WeakMap,i=r.get(n);i===void 0&&(i=new Set,r.set(n,i)),i.add(e.__key)}}function yj(e,t,n,r){let i=t.__key;n===null?e.__first=i:n.__next=i,r===null?e.__last=i:r.__prev=i,t.__prev=n===null?null:n.__key,t.__next=r===null?null:r.__key,t.__parent=e.__key}function bj(e){Oj(e)!==null&&hC(380,e.__key,String(Oj(e)));let t=e.getParent();if(t!==null){let n=t.getWritable();vj(e);let r=e.getPreviousSibling(),i=e.getNextSibling();_j(n,r&&r.getWritable(),i&&i.getWritable()),e.__prev=null,e.__next=null,e.__parent=null,n.__size--}}function xj(e,t){let n=t&&e.getParent(),r=t&&n&&rj(t,n)?e.getIndexWithinParent():-1,i=t&&n&&r!==-1?[t.anchor,t.focus].filter(e=>e.type===`element`&&e.key===n.__key&&e.offset===r+1):null;return t&&n&&r!==-1&&t.isBackward(),bj(e),t&&n&&r!==-1&&ij(t,n,r,-1),t&&(t._cachedIsBackward=null),i}function Sj(e,t,n,r){Sk();let i=t===`next`;UD(e,n);let a=e.getWritable(),o=n.getWritable();e.getParentOrThrow();let s=$(),c=r&&Q(s)?s:null,l=xj(o,c),u=e.getParentOrThrow().getWritable(),d=c&&(i&&l!==null&&l.length>0||rj(c,u))?e.getIndexWithinParent()+ +!!i:-1,f=i?e.getNextSibling():e.getPreviousSibling(),p=f&&f.getWritable();if(yj(u,o,i?a:p,i?p:a),u.__size++,c&&d!==-1&&(ij(c,u,d),i&&l!==null))for(let e of l)e.set(u.__key,d+1,`element`);return n}function Cj(e,t,n){Sk();let{origin:r,direction:i}=e,a=i===`next`,o=kj(r);if(o!==null)return a?o.selectNext(t,n):o.selectPrevious(t,n);let s=e.getNodeAtCaret(),c=r.getParentOrThrow();if(s===null)return a?c.select():c.select(0,0);if(Z(s))return a?s.select(0,0):s.select();if(aE(s))return s.select(t,n);let l=s.getIndexWithinParent()+ +!a;return c.select(l,l)}function wj(e,t){let n=[];for(let r=e;r!==null;r=t===`next`?r.getNextSibling():r.getPreviousSibling())n.push(r);return n}var Tj=new Map;function Ej(e){return Z(e)||VT(e)}function Dj(e){return Z(e)||VT(e)}function Oj(e){let t=e.getLatest();return Dj(t)?t.__slotHost:null}function kj(e){let t=Oj(e);if(t===null)return null;let n=$E(t);return Z(n)||VT(n)||hC(370),n}function Mye(e){let t=kj(e);if(t===null)return null;let n=e.getLatest().__key;for(let[e,r]of Mj(t))if(r===n)return e;return null}function Aj(e){let t=e.getLatest();for(;t!==null;){if(Oj(t)!==null)return t;t=t.getParent()}return null}function jj(e){if(e===null)return null;let t=Q(e)?e.anchor.getNode():e.getNodes()[0]??null;return t===null?null:Aj(t)}function Mj(e){let t=e.getLatest();return Ej(t)&&t.__slots!==null?t.__slots:Tj}function Nj(e){return Array.from(Mj(e).keys())}function Pj(e,t){let n=Mj(e).get(t);return n===void 0?null:$E(n)}var Nye=[`__proto__`,`constructor`,`prototype`],Fj=Symbol(`slotMapOwner`);function Ij(e){let t=e.__slots;return t!==null&&t[Fj]===e||(t=new Map(t),t[Fj]=e,e.__slots=t),t}var Lj=new WeakMap,Pye=[];function Fye(e){for(let{ownNodeConfig:t}of UO(e)){let e=t&&t.slots;if(e)return e}return Pye}function Rj(e){let t=``;for(let n of Mj(e).values()){let e=$E(n);e!==null&&(t+=e.getTextContent())}return t}function zj(e,t,n){let r=n.get(e),i=n.get(t);return r===void 0?i===void 0?e<t?-1:+(e>t):1:i===void 0?-1:r-i}function Iye(e,t,n){t!==`__proto__`&&t!==`constructor`&&t!==`prototype`||hC(373,t);let r=e.getLatest();if(r.__slots!==null&&r.__slots.get(t)===n.getLatest().__key)return r;(!Z(n)&&!VT(n)||n.isInline())&&hC(374,n.__key);let i=e.getWritable(),a=Ij(i),o=a.get(t);o!==void 0&&Lye(o);let s=n.getWritable(),c=kj(s);if(c!==null){let e=Mye(s);e!==null&&Ij(c.getWritable()).delete(e),s.__slotHost=null}return bj(s),s.__slotHost=i.__key,a.set(t,s.__key),function(e){let t=e.__slots;if(t===null||t.size<2)return;let n=function(e){let t=Lj.get(e);if(t===void 0){let n=Fye(e),r=new Map;for(let t of n)Nye.includes(t)&&hC(371,e.name,t),r.has(t)&&hC(372,e.name,t),r.set(t,r.size);t=r,Lj.set(e,t)}return t}(e.constructor),r=null,i=!0;for(let e of t.keys()){if(r!==null&&zj(r,e,n)>0){i=!1;break}r=e}if(i)return;let a=Array.from(t).sort(([e],[t])=>zj(e,t,n));t.clear();for(let[e,n]of a)t.set(e,n)}(i),Tk()._slotsUsed=!0,wk()._slotsUsed=!0,i}function Lye(e){let t=$E(e);if(t===null)return;let n=t.getWritable();Dj(n)||hC(377,e),n.__slotHost=null,n.remove()}var Rye={next:`previous`,previous:`next`},Bj=class{origin;constructor(e){this.origin=e}[Symbol.iterator](){return sM({hasNext:qj,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return Yj(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return Yj(this.origin,this.direction)}remove(){let e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,t){let n=this.getNodeAtCaret();return e.is(this.origin)||e.is(n)||(n===null?this.insert(e):n.replace(e,t)),this}splice(e,t,n=`next`){let r=n===this.direction?t:Array.from(t).reverse(),i=this,a=this.getParentAtCaret(),o=new Map;for(let t=i.getAdjacentCaret();t!==null&&o.size<e;t=t.getAdjacentCaret()){let e=t.origin.getWritable();o.set(e.getKey(),e)}for(let e of r){if(o.size>0){let t=i.getNodeAtCaret();if(t){if(o.delete(t.getKey()),o.delete(e.getKey()),!(t.is(e)||i.origin.is(e))){let n=e.getParent();n&&n.is(a)&&e.remove(),t.replace(e)}}else t===null&&hC(263,Array.from(o).join(` `))}else i.insert(e);i=Yj(e,this.direction)}for(let e of o.values())e.remove();return this}},Vj=class e extends Bj{type=`child`;getLatest(){let e=this.origin.getLatest();return e===this.origin?this:$j(e,this.direction)}getParentCaret(e=`root`){return Yj(Uj(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=Hj(this.direction);return Yj(this.getNodeAtCaret(),e)||$j(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}},zye={root:WT,shadowRoot:BD};function Hj(e){return Rye[e]}function Uj(e,t=`root`){return e===null||zye[t](e)?null:Oj(e)===null?e:null}var Wj=class e extends Bj{type=`sibling`;getLatest(){let e=this.origin.getLatest();return e===this.origin?this:Yj(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return Z(this.origin)?$j(this.origin,this.direction):null}getParentCaret(e=`root`){return Yj(Uj(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=Hj(this.direction);return Yj(this.getNodeAtCaret(),e)||$j(this.origin.getParentOrThrow(),e)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSameNodeCaret(t){return(t instanceof e||t instanceof Gj)&&this.direction===t.direction&&this.origin.is(t.origin)}},Gj=class e extends Bj{type=`text`;offset;constructor(e,t){super(e),this.offset=t}getLatest(){let e=this.origin.getLatest();return e===this.origin?this:Xj(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e=`root`){return Yj(Uj(this.getParentAtCaret(),e),this.direction)}getFlipped(){return Xj(this.origin,Hj(this.direction),this.offset)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)&&this.offset===t.offset}isSameNodeCaret(t){return(t instanceof Wj||t instanceof e)&&this.direction===t.direction&&this.origin.is(t.origin)}getSiblingCaret(){return Yj(this.origin,this.direction)}};function Kj(e){return e instanceof Gj}function qj(e){return e instanceof Wj}function Jj(e){return e instanceof Vj}var Bye={next:class extends Gj{direction=`next`;getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends Gj{direction=`previous`;getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},Vye={next:class extends Wj{direction=`next`;getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends Wj{direction=`previous`;getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},Hye={next:class extends Vj{direction=`next`;getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends Vj{direction=`previous`;getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function Yj(e,t){return e?new Vye[t](e):null}function Xj(e,t,n){return e?new Bye[t](e,Zj(e,n)):null}function Zj(e,t,n=`error`){let r=e.getTextContentSize(),i=t===`next`?r:t===`previous`?0:t;return(i<0||i>r)&&(n!==`clamp`&&gC(284,String(t),String(r),e.getKey()),i=i<0?0:r),i}function Qj(e,t){return new Wye(e,t)}function $j(e,t){return Z(e)?new Hye[t](e):null}function eM(e){return e&&e.getChildCaret()||e}function tM(e){return e&&eM(e.getAdjacentCaret())}var Uye=class e{type=`node-caret-range`;direction;anchor;focus;constructor(e,t,n){this.anchor=e,this.focus=t,this.direction=n}getLatest(){let t=this.anchor.getLatest(),n=this.focus.getLatest();return t===this.anchor&&n===this.focus?this:new e(t,n,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){let e=this.anchor.getLatest(),t=this.focus.getLatest();return Kj(e)&&Kj(t)&&e.isSameNodeCaret(t)?[Qj(e,t.offset-e.offset),null]:[Kj(e)?nM(e,`anchor`):null,Kj(t)?nM(t,`focus`):null]}iterNodeCarets(e=`root`){let t=Kj(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n=this.focus.getLatest(),r=Kj(n),i=t=>t.isSameNodeCaret(n)?null:tM(t)||t.getParentCaret(e);return sM({hasNext:e=>e!==null&&!(r&&n.isSameNodeCaret(e)),initial:t.isSameNodeCaret(n)?null:i(t),map:e=>e,step:i})}[Symbol.iterator](){return this.iterNodeCarets(`root`)}},Wye=class{type=`slice`;caret;distance;constructor(e,t){this.caret=e,this.distance=t}getSliceIndices(){let{distance:e,caret:{offset:t}}=this,n=t+e;return n<t?[n,t]:[t,n]}getTextContent(){let[e,t]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,t)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){let{caret:{origin:e,direction:t}}=this,[n,r]=this.getSliceIndices(),i=e.getTextContent();return Xj(e.setTextContent(i.slice(0,n)+i.slice(r)),t,n)}};function nM(e,t){let{direction:n,origin:r}=e;return Qj(e,Zj(r,t===`focus`?Hj(n):n)-e.offset)}function rM(e,t){return e.direction===t?e:e.getFlipped()}function iM(e){return oM(e,rM($j(oD(),Hj(e.direction)),e.direction))}function aM(e){return oM(e,e)}function oM(e,t){return e.direction!==t.direction&&hC(265),new Uye(e,t,e.direction)}function sM(e){let{initial:t,hasNext:n,step:r,map:i}=e,a=t;return{[Symbol.iterator](){return this},next(){if(!n(a))return{done:!0,value:void 0};let e={done:!1,value:i(a)};return a=r(a),e}}}function cM(e,t){let n=mM(e.origin,t.origin);switch(n===null&&hC(275,e.origin.getKey(),t.origin.getKey()),n.type){case`same`:return uM(e,t);case`ancestor`:return e.type===`child`?-1:1;case`descendant`:return t.type===`child`?1:-1;case`branch`:return dM(n)}}function lM(e){return e.getParent()||kj(e)}function uM(e,t){let n=e.type===`text`,r=t.type===`text`;return n&&r?function(e,t){return Math.sign(e-t)}(e.offset,t.offset):e.type===t.type?0:n?-1:r?1:e.type===`child`?-1:1}function dM(e){let{a:t,b:n}=e,r=t.__key,i=n.__key,a=t,o=n;for(;a&&o;a=a.getNextSibling(),o=o.getNextSibling()){if(a.__key===i)return-1;if(o.__key===r)return 1}return a===null?1:-1}function fM(e,t){return t.is(e)}function pM(e){return Z(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function mM(e,t){if(e.is(t))return{commonAncestor:e,type:`same`};let n=new Map;for(let[t,r]=pM(e);t;r=t,t=t.getParent())n.set(t,r);for(let[r,i]=pM(t);r;i=r,r=r.getParent()){let a=n.get(r);if(a!==void 0)return a===null?(fM(e,r)||hC(276),{commonAncestor:r,type:`ancestor`}):i===null?(fM(t,r)||hC(277),{commonAncestor:r,type:`descendant`}):((Z(a)||fM(e,a))&&(Z(i)||fM(t,i))&&r.is(a.getParent())&&r.is(i.getParent())||hC(278),{a,b:i,commonAncestor:r,type:`branch`})}return null}function Gye(e){return e}function Kye(...e){return e}function hM(e,t){if(!t||e===t)return e;for(let n in t)if(e[n]!==t[n])return{...e,...t};return e}function gM(...e){let t=[];for(let n of e)if(n&&typeof n==`string`)for(let[e]of n.matchAll(/\S+/g))t.push(e);return t}function _M(e,...t){let n=gM(...t);n.length>0&&e.classList.add(...n)}function vM(e,...t){let n=gM(...t);n.length>0&&e.classList.remove(...n)}function yM(e,t,n){let r=e.getElementByKey(t.getKey());if(r===null||aE(t))return[KE(r),n];let i=r.parentNode;return i&&r.nodeName===`BR`?[i,Array.from(i.childNodes).indexOf(r)]:e.read(`latest`,()=>cj(e,t,n))}function qye(e,t,n,r,i){let a=ZD(e.getRootElement()).createRange(),[o,s]=yM(e,t,n),[c,l]=yM(e,r,i),u=l;if(o===null||c===null)return null;let d=o.firstChild;o===c&&d!=null&&d.nodeName===`BR`&&s===0&&u===0&&(u=1);try{a.setStart(o,s),a.setEnd(c,u)}catch{return null}return!a.collapsed||s===u&&t.is(r)||(a.setStart(c,u),a.setEnd(o,s)),a}function bM(e){let t=fO().getElementByKey(e.getKey());if(t===null)return null;let n=t.ownerDocument.defaultView;return n===null?null:n.getComputedStyle(t)}function xM(e){let t=WT(e)?e:e.getParent();return t&&bM(t)}function SM(e){let t=xM(e);return t!==null&&t.direction===`rtl`}function CM(e,t,n=`self`){let r=e.getStartEndPoints();if(r!==null&&t.isSelected(e)&&!UE(t)){let[i,a]=e.isBackward()?[r[1],r[0]]:r,o=!Q(e)||i.type!==`element`&&a.type!==`element`?void 0:bE(dE(e).getTextSlices(),t),[s,c]=o?o.getSliceIndices():[t.__key===i.key?i.offset:0,t.__key===a.key?a.offset:void 0],l=t.__text.slice(s,c);l!==t.__text&&(n===`clone`&&(t=Rve(t)),t.__text=l)}return t}function Jye(e,t){let n=e.getFormatType(),r=e.getIndent();n!==t.getFormatType()&&t.setFormat(n),r!==t.getIndent()&&t.setIndent(r)}function wM(e,t,n){let r=sE(e,n);if(gE(r))return!1;for(;r;r=r.getParentCaret()){let e=r.getParentAtCaret();if(!e||r.getNodeAtCaret())return!1;if(t.is(e))return!0}return!1}function Yye(e,t,n=Jye){if(!e)return;let r=e.getStartEndPoints(),i=!1,a=null,o=new Map;if(r){let[t,n]=r,s=GO(t.getNode(),dO);a=GO(n.getNode(),dO);let c=e.isBackward()?`previous`:`next`;i=Z(a)&&!a.is(s)&&function(e,t,n){let r=e.getNode();return(!Z(r)||!r.isEmpty())&&wM(e,t,n)}(n,a,Hj(c)),Z(s)&&o.set(s.getKey(),s),Z(a)&&!i&&o.set(a.getKey(),a)}for(let t of e.getNodes())if(Z(t)&&dO(t)){if(i&&t.is(a))continue;o.set(t.getKey(),t)}else if(!r){let e=GO(t,dO);Z(e)&&o.set(e.getKey(),e)}for(let e of o.values()){if(kj(e)!==null)continue;let r=t();n(e,r),e.replace(r,!0)}}function TM(e){let t=EM(e);return t!==null&&t.writingMode===`vertical-rl`}function EM(e){let t=e.anchor.getNode();return Z(t)?bM(t):xM(t)}function DM(e,t){let n=TM(e)?!t:t;OM(e)&&(n=!n);let r=sE(e.focus,n?`previous`:`next`);if(gE(r))return!1;if(Kj(r)&&!AE(r.origin)&&r.origin.isUnmergeable()){let e=r.getNodeAtCaret();if(aE(e)&&!AE(e))return!0}for(let e of iM(r)){if(Jj(e))return!e.origin.isInline();if(!Z(e.origin)){if(VT(e.origin))return!0;break}}return!1}function Xye(e,t,n,r){e.modify(t?`extend`:`move`,n,r)}function OM(e){let t=EM(e);return t!==null&&t.direction===`rtl`}function kM(e,t,n){let r=OM(e),i;i=TM(e)||r?!n:n,Xye(e,t,i,`character`)}function Zye(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}function Qye(e,t){return Array.from($ye(e,t))}function $ye(e,t){return ebe(`next`,e,t)}function AM(e,t){let n=yE(Yj(e,t));return n&&n[0]}function ebe(e,t,n){let r=oD(),i=t||r,a=Z(i)?$j(i,e):Yj(i,e),o=tbe(i),s=n?tM(eM(Yj(n,e)))||AM(n,e):AM(i,e),c=o;return sM({hasNext:e=>e!==null,initial:a,map:e=>({depth:c,node:e.origin}),step:e=>{if(e.isSameNodeCaret(s))return null;Jj(e)&&c++;let t=yE(e);return!t||t[0].isSameNodeCaret(s)?null:(c+=t[1],t[0])}})}function tbe(e){let t=-1;for(let n=e;n!==null;n=n.getParent()??kj(n))t++;return t}function jM(e,t){let n=e;for(;n!=null;){if(n instanceof t)return n;n=n.getParent()}return null}function nbe(e){let t=GO(e,e=>Z(e)&&!e.isInline());return Z(t)||Zye(4,e.__key),t}function MM(e){let t=$()||nj(),n;if(Q(t))n=sE(t.focus,`next`);else{if(t!=null){let e=t.getNodes(),r=e[e.length-1];r&&(n=Yj(r,`next`))}n||=$j(oD(),`previous`).getFlipped().insert(EE())}let r=CE(e,n,gE(i=n)||yE(Kj(i)?i.getSiblingCaret():i,`shadowRoot`)!==null?{$shouldSplit:(e,t)=>t!==`last`}:void 0);var i;let a=tM(r);return lE(aM(Jj(a)?hE(a):r)),e.getLatest()}function NM(e,t){if(e==null)return!1;let n=Object.getPrototypeOf(e);return n!=null&&n.constructor!=null&&n.constructor.name===t.name}function PM(e){let t=null;if(NM(e,DragEvent)?t=e.dataTransfer:NM(e,ClipboardEvent)&&(t=e.clipboardData),t===null)return[!1,[],!1];let n=t.types,r=n.includes(`Files`),i=n.includes(`text/html`)||n.includes(`text/plain`);return[r,Array.from(t.files),i]}function FM(e){let t=$();if(!Q(t))return!1;let n=new Set,r=t.getNodes();for(let t=0;t<r.length;t++){let i=r[t],a=i.getKey();if(n.has(a))continue;let o=GO(i,e=>Z(e)&&!e.isInline());if(o===null)continue;let s=o.getKey();o.canIndent()&&!n.has(s)&&(n.add(s),e(o))}return n.size>0}function rbe(e,t){$j(e,`next`).insert(t)}function IM(e,t){return LM(e,t,null)}function LM(e,t,n){let r=!1;for(let i of zM(e))t(i)?n!==null&&n(i):(r=!0,Z(i)&&LM(i,t,n||(e=>i.insertAfter(e))),i.remove());return r}function RM(e,t){let n=[],r=Array.from(e).reverse();for(let e=r.pop();e!==void 0;e=r.pop())if(t(e))n.push(e);else if(Z(e))for(let t of zM(e))r.push(t);return n}function zM(e){return ibe($j(e,`previous`))}function ibe(e){return sM({hasNext:qj,initial:e.getAdjacentCaret(),map:e=>e.origin.getLatest(),step:e=>e.getAdjacentCaret()})}function abe(e){fE(Yj(e,`next`)).splice(1,e.getChildren())}function BM(e,t){let n=$();if(Q(n)&&n.isCollapsed()){let r=GO(n.anchor.getNode(),e);if(r){let e=r.getParent();if(e!==null&&e.getFirstChild()===r&&HM(n.anchor,r))return r.insertBefore(EE()).selectEnd(),t&&t.preventDefault(),!0}}return!1}function VM(e,t){let n=$();if(Q(n)&&n.isCollapsed()){let r=GO(n.anchor.getNode(),e);if(r){let e=r.getParent();if(e!==null&&e.getLastChild()===r&&UM(n.anchor,r))return r.insertAfter(EE()).selectEnd(),t&&t.preventDefault(),!0}}return!1}function HM(e,t){return wM(e,t,`previous`)}function UM(e,t){return wM(e,t,`next`)}function obe(e){return(typeof e.nodes==`function`?e.nodes():e.nodes)||[]}var WM={tag:`history-merge`};function sbe(){let e=oD();e.isEmpty()&&e.append(EE())}var cbe={config:{setOptions:WM,updateOptions:WM},init:({$initialEditorState:e=sbe})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:t,setOptions:n},r){let i=r.getInitResult();if(!i.initialized){i.initialized=!0;let{$initialEditorState:r}=i;if(Zve(r))e.setEditorState(r,n);else if(typeof r==`function`)e.update(()=>{r(e)},t);else if(r&&(typeof r==`string`||typeof r==`object`)){let t=e.parseEditorState(r);e.setEditorState(t,n)}}return()=>{}},name:`@lexical/extension/InitialState`,nodes:[UT,eE,$O,OE,TE]};function GM(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}function lbe(){let e;try{e=`0.53.0+prod.esm`}catch{}return e??`"<unknown>+source"`}var ube=lbe(),dbe=new Set([`__proto__`,`constructor`,`prototype`]);function KM(e,t){if(e&&t&&!Array.isArray(t)&&typeof e==`object`&&typeof t==`object`){let n=e,r=t;for(let e in r)!dbe.has(e)&&Object.prototype.hasOwnProperty.call(r,e)&&(n[e]=KM(n[e],r[e]));return e}return t}function qM(e){return e.id===0}function JM(e){return e.id===2}var fbe=new Set,pbe=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,t){this.builder=e,this.extension=t,this.configs=new Set,this.state={id:0}}mergeConfigs(){let e=this.extension.config||{},t=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):hM;for(let n of this.configs)e=t(e,n);return e}init(e){let t=this.state;JM(t)||GM(306,String(t.id));let n={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},r={...n,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},i=function(e,t,n){return Object.assign(e,{config:t,id:3,registerState:n})}(t,this.mergeConfigs(),n),a;this.state=i,this.extension.init&&(a=this.extension.init(e,i.config,n)),this.state=function(e,t,n){return Object.assign(e,{id:4,initResult:t,registerState:n})}(i,a,r)}build(e){let t=this.state,n;t.id!==4&&GM(307,String(t.id),`5`),this.extension.build&&(n=this.extension.build(e,t.config,t.registerState));let r={...t.registerState,getOutput:()=>n,getSignal:this.getSignal.bind(this)};this.state=function(e,t,n){return Object.assign(e,{id:5,output:t,registerState:n})}(t,n,r)}register(e,t){this._signal=t;let n=this.state;n.id!==5&&GM(308,String(n.id),`5`);let r=this.extension.register&&this.extension.register(e,n.config,n.registerState);return this.state=function(e){return Object.assign(e,{id:6})}(n),()=>{let e=this.state;e.id!==7&&GM(309,String(n.id),`7`),this.state=function(e){return Object.assign(e,{id:5})}(e),r&&r()}}afterRegistration(e){let t=this.state,n;return t.id!==6&&GM(310,String(t.id),`6`),this.extension.afterRegistration&&(n=this.extension.afterRegistration(e,t.config,t.registerState)),this.state=function(e){return Object.assign(e,{id:7})}(t),n}getSignal(){return this._signal===void 0&&GM(311),this._signal}getInitResult(){this.extension.init===void 0&&GM(312,this.extension.name);let e=this.state;return function(e){return e.id>=4}(e)||GM(313,String(e.id),`4`),e.initResult}getInitPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionInitDependency():void 0}getExtensionInitDependency(){let e=this.state;return function(e){return e.id>=3}(e)||GM(314,String(e.id),`3`),{config:e.config}}getPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}getInitDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&GM(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&GM(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){let e=this.state;return function(e){return e.id>=7}(e)||GM(316,String(e.id),`7`),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||fbe}getPeerNameSet(){let e=this._peerNameSet;return e||(e=new Set((this.extension.peerDependencies||[]).map(([e])=>e)),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){let e=this.state;(function(e){return e.id>=5})(e)||GM(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}},YM=Symbol.for(`@lexical/extension/LexicalBuilder`);function mbe(...e){return $M.fromExtensions(e).buildEditor()}function XM(){}function hbe(e){throw e}function ZM(e){return Array.isArray(e)?e:[e]}var QM=ube,$M=class e{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(e){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=QM,this.roots=e;for(let t of e)this.addExtension(t)}static fromExtensions(t){let n=[ZM(cbe)];for(let e of t)n.push(ZM(e));return new e(n)}static maybeFromEditor(t){let n=t[YM];return n&&(n.PACKAGE_VERSION!==QM&&GM(292,n.PACKAGE_VERSION,QM),n instanceof e||GM(293)),n}static fromEditor(t){let n=e.maybeFromEditor(t);return n===void 0&&GM(294),n}constructEditor(){let{$initialEditorState:e,onError:t,onWarn:n,...r}=this.buildCreateEditorArgs(),i=Object.assign(sk({...r,...t?{onError:e=>{t(e,i)}}:{},...n?{onWarn:e=>{n(e,i)}}:{}}),{[YM]:this});for(let e of this.sortedExtensionReps())e.build(i);return i}buildEditor(){let e=XM;function t(){try{e()}finally{e=XM}}let n=Object.assign(this.constructEditor(),{dispose:t,[Symbol.dispose]:t});return e=Hk(this.registerEditor(n),()=>n.setRootElement(null)),n}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){let t=this.extensionNameMap.get(e.name);if(t)return t.extension!==e&&GM(295,e.name),t}addEdge(e,t,n){let r=this.outgoingConfigEdges.get(e);if(r){let e=r.get(t);e?e.push(...n):r.set(t,n)}else this.outgoingConfigEdges.set(e,new Map([[t,n]]));let i=this.incomingEdges.get(t);i?i.add(e):this.incomingEdges.set(t,new Set([e]))}addExtension(e){this._sortedExtensionReps!==void 0&&GM(296);let[t]=ZM(e);typeof t.name!=`string`&&GM(297,typeof t.name);let n=this.extensionNameMap.get(t.name);if(n!==void 0&&n.extension!==t&&GM(298,t.name),!n){n=new pbe(this,t),this.extensionNameMap.set(t.name,n);let e=this.conflicts.get(t.name);typeof e==`string`&&GM(299,t.name,e);for(let e of t.conflictsWith||[])this.extensionNameMap.has(e)&&GM(299,t.name,e),this.conflicts.set(e,t.name);for(let e of t.dependencies||[]){let n=ZM(e);this.addEdge(t.name,n[0].name,n.slice(1)),this.addExtension(n)}for(let[e,n]of t.peerDependencies||[])this.addEdge(t.name,e,n?[n]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;let e=[],t=(n,r)=>{let i=n.state;if(JM(i))return;let a=n.extension.name;var o;qM(i)||GM(300,a,r||`[unknown]`),qM(o=i)||GM(304,String(o.id),`0`),i=Object.assign(o,{id:1}),n.state=i;let s=this.outgoingConfigEdges.get(a);if(s)for(let e of s.keys()){let n=this.extensionNameMap.get(e);n&&t(n,a)}i=function(e){return function(e){return e.id===1}(e)||GM(305,String(e.id),`1`),Object.assign(e,{id:2})}(i),n.state=i,e.push(n)};for(let e of this.extensionNameMap.values())qM(e.state)&&t(e);for(let t of e)for(let[e,n]of this.outgoingConfigEdges.get(t.extension.name)||[])if(n.length>0){let t=this.extensionNameMap.get(e);if(t)for(let e of n)t.configs.add(e)}for(let[e,...t]of this.roots)if(t.length>0){let n=this.extensionNameMap.get(e.name);n===void 0&&GM(301,e.name);for(let e of t)n.configs.add(e)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){let t=this.sortedExtensionReps(),n=new AbortController,r=[()=>n.abort()],i=n.signal;for(let n of t){let t=n.register(e,i);t&&r.push(t)}for(let n of t){let t=n.afterRegistration(e);t&&r.push(t)}return Hk(...r)}buildCreateEditorArgs(){let e={},t=new Set,n=new Map,r=new Map,i={},a={},o=this.sortedExtensionReps();for(let s of o){let{extension:o}=s;if(o.onError!==void 0&&(e.onError=o.onError),o.onWarn!==void 0&&(e.onWarn=o.onWarn),o.disableEvents!==void 0&&(e.disableEvents=o.disableEvents),o.parentEditor!==void 0&&(e.parentEditor=o.parentEditor),o.editable!==void 0&&(e.editable=o.editable),o.namespace!==void 0&&(e.namespace=o.namespace),o.$initialEditorState!==void 0&&(e.$initialEditorState=o.$initialEditorState),o.nodes)for(let e of obe(o)){if(typeof e!=`function`){let t=n.get(e.replace);t&&GM(302,o.name,e.replace.name,t.extension.name),n.set(e.replace,s)}t.add(e)}if(o.html){if(o.html.export)for(let[e,t]of o.html.export.entries())r.set(e,t);o.html.import&&Object.assign(i,o.html.import)}o.theme&&KM(a,o.theme)}Object.keys(a).length>0&&(e.theme=a),t.size&&(e.nodes=Array.from(t));let s=Object.keys(i).length>0,c=r.size>0;(s||c)&&(e.html={},s&&(e.html.import=i),c&&(e.html.export=r));for(let t of o)t.init(e);return e.onError||=hbe,e}};function eN(e,t){let n=$M.maybeFromEditor(e);if(!n)return;let r=n.extensionNameMap.get(t);return r?r.getExtensionDependency():void 0}var gbe=Symbol.for(`preact-signals`);function tN(){if(oN>1)oN--;else{var e,t=!1;for((function(){var e=lN;for(lN=void 0;e!==void 0;){var t=e.S;if(t.v===e.v)for(var n=t.t;n!==void 0;n=n.x)n.i===e.i&&(n.i=t.i);e=e.o}})();aN!==void 0;){var n=aN;for(aN=void 0,sN++;n!==void 0;){var r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&mN(n))try{n.c()}catch(n){t||=(e=n,!0)}n=r}}if(sN=0,oN--,t)throw e}}function _be(e){if(oN>0)return e();cN=++vbe,oN++;try{return e()}finally{tN()}}var nN,rN=void 0;function iN(e){var t=rN,n=nN;rN=void 0,nN=void 0;try{return e()}finally{rN=t,nN=n}}var aN=void 0,oN=0,sN=0,vbe=0,cN=0,lN=void 0,uN=0;function dN(e){if(rN!==void 0){var t=e.n;if(t===void 0||t.t!==rN)return t={i:0,S:e,p:rN.s,n:void 0,t:rN,e:void 0,x:void 0,r:t},rN.s!==void 0&&(rN.s.n=t),rN.s=t,e.n=t,32&rN.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=rN.s,t.n=void 0,rN.s.n=t,rN.s=t),t}}function fN(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}fN.prototype.brand=gbe,fN.prototype.h=function(){return!0},fN.prototype.S=function(e){var t=this,n=this.t;n!==e&&e.e===void 0&&(e.x=n,this.t=e,n===void 0?iN(function(){var e;(e=t.W)==null||e.call(t)}):n.e=e)},fN.prototype.U=function(e){var t=this;if(this.t!==void 0){var n=e.e,r=e.x;n!==void 0&&(n.x=r,e.e=void 0),r!==void 0&&(r.e=n,e.x=void 0),e===this.t&&(this.t=r,r===void 0&&iN(function(){var e;(e=t.Z)==null||e.call(t)}))}},fN.prototype.subscribe=function(e){var t=this;return xN(function(){var n=t.value;iN(function(){return e(n)})},{name:`sub`})},fN.prototype.valueOf=function(){return this.value},fN.prototype.toString=function(){return this.value+``},fN.prototype.toJSON=function(){return this.value},fN.prototype.peek=function(){var e=this;return iN(function(){return e.value})},Object.defineProperty(fN.prototype,"value",{get:function(){var e=dN(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(sN>100)throw Error(`Cycle detected`);(function(e){oN!==0&&sN===0&&e.l!==cN&&(e.l=cN,lN={S:e,v:e.v,i:e.i,o:lN})})(this),this.v=e,this.i++,uN++,oN++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{tN()}}}});function pN(e,t){return new fN(e,t)}function mN(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function hN(e){for(var t=e.s;t!==void 0;t=t.n){var n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function gN(e){for(var t=e.s,n=void 0;t!==void 0;){var r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}e.s=n}function _N(e,t){fN.call(this,void 0,t),this.x=e,this.s=void 0,this.g=uN-1,this.f=4}_N.prototype=new fN,_N.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===uN))return!0;if(this.g=uN,this.f|=1,this.i>0&&!mN(this))return this.f&=-2,!0;var e=rN;try{hN(this),rN=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return rN=e,gN(this),this.f&=-2,!0},_N.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}fN.prototype.S.call(this,e)},_N.prototype.U=function(e){if(this.t!==void 0&&(fN.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}},_N.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(_N.prototype,"value",{get:function(){if(1&this.f)throw Error(`Cycle detected`);var e=dN(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function ybe(e,t){return new _N(e,t)}function vN(e){var t=e.j;if(e.j=void 0,typeof t==`function`){oN++;var n=rN;rN=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,yN(e),t}finally{rN=n,tN()}}}function yN(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,vN(e)}function bbe(e){if(rN!==this)throw Error(`Out-of-order effect`);gN(this),rN=e,this.f&=-2;try{8&this.f&&yN(this)}finally{tN()}}function bN(e,t){this.x=e,this.j=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,nN&&nN.push(this)}bN.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t==`function`&&(this.j=t)}finally{e()}},bN.prototype.S=function(){if(1&this.f)throw Error(`Cycle detected`);this.f|=1,this.f&=-9,vN(this),hN(this),oN++;var e=rN;return rN=this,bbe.bind(this,e)},bN.prototype.N=function(){2&this.f||(this.f|=2,this.u=aN,aN=this)},bN.prototype.d=function(){this.f|=8,1&this.f||yN(this)},bN.prototype.dispose=function(){this.d()};function xN(e,t){var n=new bN(e,t);try{n.c()}catch(e){throw n.d(),e}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}function SN(e,t){let n;return pN(e(),{unwatched(){n&&=(n(),void 0)},watched(){this.value=e(),n=t(this)}})}var CN={build:e=>SN(()=>e.getEditorState(),t=>e.registerUpdateListener(e=>{t.value=e.editorState})),name:`@lexical/extension/EditorState`},xbe=new Set,wN={build(e,t,n){let r=n.getDependency(CN).output,i=pN({watchedNodeKeys:new Map}),a=SN(()=>{},()=>xN(()=>{let e=a.peek(),{watchedNodeKeys:t}=i.value,n,o=!1;r.value.read(()=>{if($())for(let[r,i]of t.entries()){if(i.size===0){t.delete(r);continue}let a=$E(r),s=a&&a.isSelected()||!1;o||=s!==(!!e&&e.has(r)),s&&(n||=new Set,n.add(r))}}),!o&&n&&e&&n.size===e.size||(a.value=n)}));return{watchNodeKey:function(e){let t=ybe(()=>(a.value||xbe).has(e)),{watchedNodeKeys:n}=i.peek(),r=n.get(e),o=r!==void 0;return r||=new Set,r.add(t),o||(n.set(e,r),i.value={watchedNodeKeys:n}),t}}},dependencies:[CN],name:`@lexical/extension/NodeSelection`},Sbe=PC(`INSERT_HORIZONTAL_RULE_COMMAND`),TN=class extends BT{$config(){return this.config(`horizontalrule`,{extends:BT,importDOM:{hr:()=>({conversion:Cbe,priority:0})}})}exportDOM(){return{element:QD().createElement(`hr`)}}createDOM(e){let t=QD().createElement(`hr`);return _M(t,e.theme.hr),t}getTextContent(){return`
`}isInline(){return!1}updateDOM(){return!1}};function Cbe(){return{node:EN()}}function EN(){return WO(TN)}function DN(e){return e instanceof TN}var wbe={dependencies:[CN,wN],name:`@lexical/extension/HorizontalRule`,nodes:()=>[TN],register(e,t,n){let{watchNodeKey:r}=n.getDependency(wN).output,i=pN({nodeSelections:new Map}),a=e._config.theme.hrSelected??`selected`;return Hk(e.registerCommand(Sbe,e=>{let t=$();return Q(t)?(t.focus.getNode()!==null&&MM(EN()),!0):!1},0),e.registerCommand(IC,e=>{if(sO(e.target)){let t=eD(e.target);if(DN(t))return function(e,t=!1){let n=$(),r=e.isSelected(),i=e.getKey(),a;t&&AA(n)?a=n:(a=QA(),cD(a)),r?a.delete(i):a.add(i)}(t,e.shiftKey),!0}return!1},1),e.registerMutationListener(TN,(t,n)=>{_be(()=>{let n=!1,{nodeSelections:a}=i.peek();for(let[i,o]of t.entries())if(o===`destroyed`)a.delete(i),n=!0;else{let t=a.get(i),o=e.getElementByKey(i);t?t.domNode.value=o:(n=!0,a.set(i,{domNode:pN(o),selectedSignal:r(i)}))}n&&(i.value={nodeSelections:a})})}),xN(()=>{let e=[];for(let{domNode:t,selectedSignal:n}of i.value.nodeSelections.values())e.push(xN(()=>{let e=t.value;e&&(n.value?_M(e,a):vM(e,a))}));return Hk(...e)}))}};function Tbe(e){return eN(fO(),e)}function ON(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}var Ebe=(e,t,n)=>{kN(e),n()};function kN(e){if(!GE(e))return;let t=e;if(t.querySelector(`style`)===null)return;let n=new Map;function r(e){let t=n.get(e);if(t===void 0){t=new Set;for(let n=0;n<e.style.length;n++)t.add(e.style[n]);n.set(e,t)}return t}try{for(let e of Array.from(t.styleSheets)){let n;try{n=e.cssRules}catch{continue}for(let e of Array.from(n)){if(!NM(e,CSSStyleRule))continue;let n;try{n=t.querySelectorAll(e.selectorText)}catch{continue}for(let t of Array.from(n)){if(!oO(t))continue;let n=r(t);for(let r=0;r<e.style.length;r++){let i=e.style[r];n.has(i)||t.style.setProperty(i,e.style.getPropertyValue(i),e.style.getPropertyPriority(i))}}}}}catch{}}var AN;function jN(e,t){let{key:n}=t;return e&&n in e?e[n]:t.defaultValue}function MN(e){return AN&&AN.editor===e?AN:void 0}function NN(e,t){let n=MN(t);return n&&n[e]}function Dbe(e,t){if(`cfg`in t){let{cfg:n,updater:r}=t;return[n,r(jN(e,n))]}return t}function PN(e,t){let n=t;for(let r of e){let[e,i]=Dbe(n,r),a=e.key;if(n===t&&jN(n,e)===i)continue;let o=n===t||n===void 0?Obe(t):n;o[a]=i,n=o}return n}function Obe(e){return Object.create(e||null)}function FN(e,t){return[e,t]}function IN(e,t,n,r=fO()){let i=AN,a=MN(r);try{return AN={...a,editor:r,[e]:t},n()}finally{AN=i}}function LN(e,t=()=>{}){return(n,r=fO())=>i=>{let a=MN(r),o=a&&a[e],s=PN(n,o||t(r));return s&&s!==o?IN(e,s,i,r):i()}}function RN(e,t,n,r){return Object.assign(Jw(Symbol(t),{isEqual:r,parse:n}),{[e]:!0})}var zN=`@lexical/html/DOM`,BN=Symbol.for(`@lexical/html/DOMExportContext`),VN=`@lexical/html/DOMImport`,HN=Symbol.for(`@lexical/html/DOMImportContext`);function kbe(e,t,n){return RN(BN,e,t,n)}var Abe=kbe(`isExport`,Boolean);function jbe(e){let t=eN(e,zN);return t?t.output.defaults:void 0}function Mbe(e){let t=eN(e,zN);return t?t.output.runtime:void 0}function Nbe(e=fO()){let t=Mbe(e);return t?t.getSessionConfig():pO(e)}var Pbe=LN(BN,jbe),UN=Symbol.for(`@lexical/html/SelectorImpl`);function WN(e,t){let n={kind:`element`,predicate:(r=t,r.length===0?oO:r.length===1?r[0]:(e,t)=>{for(let n of r)if(!n(e,t))return!1;return!0}),tags:e};var r;let i=n=>WN(e,[...t,n]);return{[UN]:n,attr:(e,t,n)=>i(qN(e,t,n)),classAll:(...e)=>i(KN(e)),classAny:(...e)=>i(function(e){let t=GN(e);return t.length===0?()=>!1:e=>{if(!oO(e))return!1;let n=e.classList;for(let e of t)if(n.contains(e))return!0;return!1}}(e)),styleAny:(e,t,n)=>i(function(e,t,n){if(typeof t==`string`)return n=>oO(n)&&n.style.getPropertyValue(e)===t;if(t instanceof RegExp){let r=n&&n.capture,i=t;return(t,n)=>{if(!oO(t))return!1;let a=t.style.getPropertyValue(e);if(!a)return!1;let o=a.match(i);return o!==null&&(r!==void 0&&(n[r]=o),!0)}}ON(362,JSON.stringify(e))}(e,t,n))}}function GN(e){let t=[];for(let n of e)n&&t.push(n);return t}function KN(e){let t=GN(e);return t.length===0?()=>!0:e=>{if(!oO(e))return!1;let n=e.classList;for(let e of t)if(!n.contains(e))return!1;return!0}}function qN(e,t,n){if(!0===t)return t=>oO(t)&&t.hasAttribute(e);if(typeof t==`string`)return n=>oO(n)&&n.getAttribute(e)===t;if(t instanceof RegExp){let r=n&&n.capture,i=t;return(t,n)=>{if(!oO(t))return!1;let a=t.getAttribute(e);if(a==null)return!1;let o=a.match(i);return o!==null&&(r!==void 0&&(n[r]=o),!0)}}ON(361,JSON.stringify(e))}function JN(e){return{[UN]:e}}var Fbe=JN({kind:`text`,predicate:WE,tags:new Set}),Ibe=JN({kind:`comment`,predicate:e=>e.nodeType===8,tags:new Set});function YN(){return WN(new Set,[])}function XN(){return Ibe}function ZN(...e){e.length>0||ON(363);let t=new Set;for(let n of e)t.add(n.toUpperCase());return WN(t,[])}function QN(){return Fbe}var $N={any:YN,comment:XN,tag:ZN,text:QN},eP=/[A-Za-z0-9_-]/,Lbe=class{constructor(e,t){this.source=e,this.pos=t}peek(e=0){return this.source[this.pos+e]||``}consume(){return this.source[this.pos++]||``}eof(){return this.pos>=this.source.length}skipWhitespace(){for(;!this.eof()&&/\s/.test(this.peek());)this.pos++}readIdent(){let e=this.pos;for(;!this.eof()&&eP.test(this.peek());)this.pos++;return this.source.slice(e,this.pos)}readQuoted(){let e=this.consume();this.assert(e===`"`||e===`'`,`expected quote`);let t=this.pos;for(;!this.eof()&&this.peek()!==e;)this.peek()===`\\`?this.pos+=2:this.pos++;this.assert(!this.eof(),`unterminated string`);let n=this.source.slice(t,this.pos);return this.pos++,n.replace(/\\(.)/g,`$1`)}assert(e,t){e||ON(364,String(this.pos+1),t,this.source)}};function Rbe(e){let t=new Set,n=[],r=[],i=!1;if(e.skipWhitespace(),e.peek()===`*`)e.consume(),i=!0;else if(eP.test(e.peek())){let n=e.readIdent();n&&t.add(n.toUpperCase())}for(;!e.eof();){let t=e.peek();if(t===`.`){e.consume();let t=e.readIdent();e.assert(t!==``,`expected class name after "."`),r.push(t)}else if(t===`#`){e.consume();let t=e.readIdent();e.assert(t!==``,`expected id after "#"`),n.push(qN(`id`,t))}else{if(t!==`[`)break;{e.consume(),e.skipWhitespace();let t=e.readIdent();e.assert(t!==``,`expected attribute name after "["`),e.skipWhitespace();let r=!0;if(e.peek()===`=`){e.consume(),e.skipWhitespace();let t=e.peek();t===`"`||t===`'`?r=e.readQuoted():(r=e.readIdent(),e.assert(r!==``,`expected attribute value`)),e.skipWhitespace()}e.assert(e.peek()===`]`,`expected "]"`),e.consume(),n.push(qN(t,r))}}}return r.length>0&&n.push(KN(r)),e.assert(i||t.size>0||n.length>0,`expected a selector`),{predicates:n,tags:t}}function zbe(e){let t=new Lbe(e,0),n=[];for(;n.push(Rbe(t)),t.skipWhitespace(),!t.eof();)t.assert(t.peek()===`,`,`expected "," (selector lists are the only supported combinator)`),t.consume(),t.skipWhitespace();if(n.length===1)return WN(n[0].tags,n[0].predicates);let r=new Set;if(n.every(e=>e.tags.size>0))for(let e of n)for(let t of e.tags)r.add(t);return WN(r,[(e,t)=>{for(let r of n){let n=e.nodeName;if(r.tags.size>0&&!r.tags.has(n))continue;let i=!0;for(let n of r.predicates)if(!n(e,t)){i=!1;break}if(i)return!0}return!1}])}function tP(e,t,n){return RN(HN,e,t,n)}var nP=tP(`textFormat`,()=>0),rP=tP(`textStyle`,()=>({}));function Bbe(e){if(!oO(e))return!1;if(e.nodeName===`PRE`)return!0;let t=e.style.whiteSpace;return typeof t==`string`&&t.startsWith(`pre`)}function Vbe(e){if(WE(e))return!0;if(!oO(e))return!1;let t=e.style.display;return t?t.startsWith(`inline`):!uO(e)&&lO(e)}var Hbe=tP(`whitespaceConfig`,()=>({isInline:Vbe,preservesWhitespace:Bbe})),iP=tP(`importOverlays`,()=>[]),Ube=class{constructor(e){this.record=e}get(e){return jN(this.record,e)}set(e,t){this.record[e.key]=t}update(e,t){this.record[e.key]=t(jN(this.record,e))}has(e){return Object.prototype.hasOwnProperty.call(this.record,e.key)}};function aP(e){let t=eN(e,VN);return t?t.output.defaults:void 0}function Wbe(e,t=fO()){return jN(function(e){return NN(HN,e)||aP(e)}(t),e)}var oP=LN(HN,aP);function sP(e){return YA(e)||VT(e)&&!e.isInline()}function cP(e,t){if(!oO(t))return e;let n=t.style.textAlign;if(!dP(n))return e;for(let t of e)YA(t)&&t.getFormatType()===``&&t.setFormat(n);return e}function lP(e,t,n){e.length===1&&tk(e[0])&&(e=[]);let r=EE();if(oO(n)){let e=n.style.textAlign;dP(e)&&r.setFormat(e)}return[r.splice(0,0,e)]}var Gbe={$accepts:sP,$packageRun:lP,name:`BlockSchema`},Kbe={$accepts:sP,$packageRun:lP,name:`RootSchema`},uP=$N,qbe=new Set([`center`,`end`,`justify`,`left`,`right`,`start`]);function dP(e){return qbe.has(e)}var Jbe={B:{fontWeight:`bold`},EM:{fontStyle:`italic`},I:{fontStyle:`italic`},S:{textDecoration:`line-through`},STRONG:{fontWeight:`bold`},SUB:{verticalAlign:`sub`},SUP:{verticalAlign:`super`},U:{textDecoration:`underline`}},Ybe={CODE:16,MARK:128},Xbe=new Set([`font-weight`,`font-style`,`text-decoration`,`text-transform`,`vertical-align`]),Zbe={$import:(e,t)=>{let n=e.get(nP),r=Jbe[t.nodeName],i=function(e){return{fontStyle:e.style.fontStyle,fontWeight:e.style.fontWeight,textDecoration:e.style.textDecoration,textTransform:e.style.textTransform,verticalAlign:e.style.verticalAlign}}(t);var a,o;let s=n&~(c=function(e){let t=0,n=0,{fontWeight:r,fontStyle:i,textDecoration:a,textTransform:o,verticalAlign:s}=e;if(r===`700`||r===`bold`?t|=1:r!==`normal`&&r!==`400`||(n|=1),i===`italic`?t|=2:i===`normal`&&(n|=2),a){let e=a.split(` `);e.includes(`underline`)&&(t|=8),e.includes(`line-through`)&&(t|=4),e.includes(`none`)&&(n|=12)}return o===`lowercase`?(t|=AC.lowercase,n|=AC.uppercase|AC.capitalize):o===`uppercase`?(t|=AC.uppercase,n|=AC.lowercase|AC.capitalize):o===`capitalize`?(t|=AC.capitalize,n|=AC.lowercase|AC.uppercase):o===`none`&&(n|=AC.lowercase|AC.uppercase|AC.capitalize),s===`sub`?(t|=32,n|=64):s===`super`?(t|=64,n|=32):s===`baseline`&&(n|=96),{clear:n,set:t}}(r?(a=r,{fontStyle:(o=i).fontStyle||a.fontStyle,fontWeight:o.fontWeight||a.fontWeight,textDecoration:o.textDecoration||a.textDecoration,textTransform:o.textTransform||a.textTransform,verticalAlign:o.verticalAlign||a.verticalAlign}):i)).clear|c.set;var c;let l=Ybe[t.nodeName];return l&&(s|=l),s===n?e.$importChildren(t):e.$importChildren(t,{context:[FN(nP,s)]})},match:uP.tag(`b`,`strong`,`em`,`i`,`code`,`mark`,`s`,`sub`,`sup`,`u`,`span`),name:`@lexical/html/inline-format`};function fP(e,t,n){let r=e;for(;;){let e=null;for(;(e=t?r.nextSibling:r.previousSibling)===null;){let e=r.parentNode;if(e===null)return null;r=e}if(r=e,!n.isInline(r))return null;let i=r;for(;(i=t?r.firstChild:r.lastChild)!==null;)r=i;if(WE(r))return r;if(r.nodeName===`BR`)return null}}function pP(e,t){return t!==0&&aE(e)?e.setFormat(t):e}function mP(e,t){if(aE(e)){let n=function(e){let t=``;for(let n in e)Xbe.has(n)||(t+=`${n}: ${e[n]}; `);return t.trimEnd()}(t);n!==``&&e.setStyle(n)}return e}var Qbe={$import:(e,t)=>{let n=e.get(nP),r=e.get(rP),i=e.get(Hbe);if(function(e,t){let n=e.parentNode;for(;n!==null;){if(t.preservesWhitespace(n))return!0;n=n.parentNode}return!1}(t,i)){let e=dj(t.textContent||``);for(let t of e)pP(t,n),mP(t,r);return e}let a=function(e,t){let n=(e.textContent||``).replace(/\r/g,``).replace(/[ \t\n]+/g,` `);if(n.length===0)return``;if(n[0]===` `){let r=e,i=!0;for(;r!==null&&(r=fP(r,!1,t))!==null;){let e=r.textContent||``;if(e.length>0){/[ \t\n]$/.test(e)&&(n=n.slice(1)),i=!1;break}}i&&(n=n.slice(1))}if(n.length>0&&n[n.length-1]===` `){let r=e,i=!0;for(;r!==null&&(r=fP(r,!0,t))!==null;)if((r.textContent||``).replace(/^( |\t|\r?\n)+/,``).length>0){i=!1;break}i&&(n=n.slice(0,-1))}return n}(t,i);if(a===``)return[];let o=iE(a);return pP(o,n),mP(o,r),[o]},match:uP.text(),name:`@lexical/html/#text`},$be={$import:()=>[],match:uP.tag(`script`,`style`),name:`@lexical/html/script-style-ignore`},exe={$import:(e,t)=>nk(t)||rk(t)?[]:[ek()],match:uP.tag(`br`),name:`@lexical/html/br`},txe=[$be,{$import:(e,t)=>{let n=EE();if(xO(n,t),yO(t,n),n.getFormatType()===``){let e=t.getAttribute(`align`);e&&dP(e)&&n.setFormat(e)}return bO(n,t),[n.splice(0,0,e.$importChildren(t))]},match:uP.tag(`p`),name:`@lexical/html/p`},{$import:(e,t,n)=>fO().hasNode(TN)?[EN()]:n(),match:uP.tag(`hr`),name:`@lexical/html/hr`},{$import:(e,t,n)=>uO(t)?cP(e.$importChildren(t,{schema:Gbe}),t):n(),match:uP.any(),name:`@lexical/html/transparent-block`},Qbe,exe,Zbe];function nxe(e,t){let n=[],r=0,i=0;for(;r<e.length&&i<t.length;)e[r]<=t[i]?n.push(e[r++]):n.push(t[i++]);for(;r<e.length;)n.push(e[r++]);for(;i<t.length;)n.push(t[i++]);return n}function hP(e){let t=[],n=new Map,r=[],i=[],a=[],o=new Set;e.forEach((e,s)=>{let c=function(e){let t=e[UN];return t===void 0&&ON(360),t}(e.match),l=e.name||function(e,t){return e.kind===`text`?`#text@${t}`:e.kind===`comment`?`#comment@${t}`:e.tags.size===0?`*@${t}`:`${Array.from(e.tags).join(`,`).toLowerCase()}@${t}`}(c,s);if(e.name&&o.add(e.name),t.push({$import:e.$import,name:l,predicate:c.predicate}),c.kind===`text`)i.push(s);else if(c.kind===`comment`)a.push(s);else if(c.tags.size===0)r.push(s);else for(let e of c.tags){let t=n.get(e);t||(t=[],n.set(e,t)),t.push(s)}});let s=new Map;if(r.length===0)for(let[e,t]of n)s.set(e,t);else for(let[e,t]of n)s.set(e,nxe(t,r));return{byTag:s,commentIndices:a,rules:t,textIndices:i,wildcardIndices:r}}function gP(e,t){return WE(t)?e.textIndices:t.nodeType===8?e.commentIndices:oO(t)?e.byTag.get(t.nodeName)||e.wildcardIndices:rxe}var rxe=Object.freeze([]);function _P(e){let t=[];for(let n of e)if(ixe(n))for(let e of n.rules)t.push(e);else t.push(n);return t}function ixe(e){return typeof e==`object`&&!!e&&`__type`in e&&e.__type===`CompiledOverlayRules`}function vP(e){let t=_P(e);return{__type:`CompiledOverlayRules`,dispatch:hP(t),rules:t}}var axe=Object.freeze({});function oxe(e,t){return{$importChildren:(t,n)=>function(e,t,n){let r=n&&n.rules?n.rules.dispatch:void 0;r&&e.overlays.push(r);try{let r=()=>yP(e,t,n);return n&&n.context?oP(n.context,e.editor)(r):r()}finally{r&&e.overlays.pop()}}(e,t,n),$importOne:(t,n)=>bP(e,t,n),captures:t,get:t=>Wbe(t,e.editor),session:e.session}}function yP(e,t,n){let r=n&&n.$onChild,i=[];for(let n of Array.from(t.childNodes)){let t=bP(e,n,void 0);for(let e of t){let t=r?r(e):e;t!=null&&i.push(t)}}let a=n&&n.$after?n.$after(i):i,o=n&&n.schema;return o?function(e,t,n,r){let i=[],a=null,o=()=>{if(a===null)return;let t=a;if(a=null,e.$packageRun){let a=e.$packageRun(t,n,r);if(a.length>0){for(let e of a)i.push(e);return}}if(e.onReject===`hoist`)for(let e of t)i.push(e)};for(let r of t)e.$accepts(r,n)?(o(),i.push(r)):(a===null&&(a=[]),a.push(r));return o(),e.$finalize?e.$finalize(i,n):i}(o,a,null,t):a}function bP(e,t,n){let r=()=>function(e,t){let n=function(e,t){let n=[];for(let r=e.overlays.length-1;r>=0;r--){let i=e.overlays[r],a=gP(i,t);a.length>0&&n.push({dispatch:i,indices:a})}let r=gP(e.dispatch,t);return r.length>0&&n.push({dispatch:e.dispatch,indices:r}),n}(e,t);if(n.length===0)return xP(e,t);let r=0,i=0,a=()=>{for(;r<n.length;){let{dispatch:o,indices:s}=n[r];for(;i<s.length;){let n=s[i++],r=o.rules[n],c={};if(r.predicate(t,c)){let n=oxe(e,Object.keys(c).length===0?axe:c);try{return r.$import(n,t,a)}catch(e){throw e}}}r++,i=0}return xP(e,t)};return a()}(e,t);return n&&n.context?oP(n.context,e.editor)(r):r()}function xP(e,t){if(t.childNodes.length===0)return[];let n=[];for(let r of Array.from(t.childNodes)){let t=bP(e,r,void 0);for(let e of t)n.push(e)}return n}var SP={build(e,t){let n=hP(_P(t.rules)),r=PN(t.contextDefaults,void 0),i=t.preprocess;return{$generateNodesFromDOM:(t,a)=>{let o=NN(HN,e)||r,s=a&&a.context?PN(a.context,o):o,c=s!==void 0&&s!==o?s:Object.create(o||null),l=new Ube(c),u={session:l};return function(e,t,n){let r=e.length-1,i=()=>{for(;r>=0;)return void(0,e[r--])(t,n,i)};i()}(a&&a.preprocess?[...i,...a.preprocess]:i,t,u),IN(HN,c,()=>function(e,t,n,r){return yP({dispatch:e,editor:t,overlays:r.get(iP).map(e=>e.dispatch),session:r},GE(n)?n.body:n,{schema:Kbe})}(n,e,t,l),e)},defaults:r}},config:{contextDefaults:[],preprocess:[Ebe],rules:[{$import:(e,t)=>e.$importChildren(t),match:$N.any(),name:`@lexical/html/default-hoist`}]},mergeConfig:(e,t)=>hM(e,{...t,...t.contextDefaults&&{contextDefaults:[...e.contextDefaults,...t.contextDefaults]},...t.preprocess&&{preprocess:[...e.preprocess,...t.preprocess]},...t.rules&&{rules:[...t.rules,...e.rules]}}),name:VN},CP={dependencies:[[SP,{rules:txe}]],name:`@lexical/html/CoreImport`},wP={any:YN,comment:XN,css:zbe,tag:ZN,text:QN},TP=new Set([`STYLE`,`SCRIPT`]);function EP(e,t){kN(t);let n=GE(t)?t.body.childNodes:t.childNodes,r=[],i=[];for(let t of n)if(!TP.has(t.nodeName)){let n=kP(t,e,i,!1);if(n!==null)for(let e of n)r.push(e)}return function(e){for(let t of e)t.getParent()&&t.getNextSibling()instanceof QO&&t.insertAfter(ek());for(let t of e){let e=t.getParent();e&&e.splice(t.getIndexWithinParent(),1,t.getChildren())}}(i),r}function sxe(e,t=null,n=fO()){return Pbe([FN(Abe,!0)],n)(()=>{let r=oD(),i=Nbe(n),a=jj(t),o=e.append.bind(e);for(let e of(Z(a)?a:r).getChildren())OP(n,e,o,t,i);return e})}function DP(e,t=null){return(typeof document>`u`||typeof window>`u`&&global.window===void 0)&&ON(338),nye(e),sxe(QD().createElement(`div`),t,e).innerHTML}function OP(e,t,n,r=null,i=pO(e)){let a=i.$shouldInclude(t,r,e),o=i.$shouldExclude(t,r,e),s=t;r!==null&&aE(t)&&(s=CM(r,t,`clone`));let{element:c,after:l,append:u,$getChildNodes:d}=i.$exportDOM(s,e);if(!c)return!1;let f=QD().createDocumentFragment(),p=d?d():Z(s)?s.getChildren():[],m=a&&AA(r)&&Z(t)?null:r,h=f.append.bind(f),g=null;for(let n of p){let o=OP(e,n,h,m,i);o&&(g=n),!a&&o&&i.$extractWithChild(t,n,r,`html`,e)&&(a=!0)}if(a&&!o){if((oO(c)||cO(c))&&(u?u(f):c.append(f),function(e,t){let n=e.lastChild;if(tk(t)&&oO(e)&&uO(e)&&n!==null&&n.nodeName===`BR`){let t=QD().createElement(`br`);t.setAttribute(`data-lexical-managed-linebreak`,`true`),e.append(t)}}(c,g)),cO(c)){if(l){let e=l.call(s,c);e&&c.replaceChildren(e)}n(c)}else if(n(c),l){let e=l.call(s,c);e&&c.replaceWith(e)}}else n(f);return a}function kP(e,t,n,r,i=new Map,a){let o=[];if(TP.has(e.nodeName))return o;let s=null,c=function(e,t){let{nodeName:n}=e,r=t._htmlConversions.get(n.toLowerCase()),i=null;if(r!==void 0)for(let t of r){let n=t(e);n!==null&&(i===null||(i.priority||0)<=(n.priority||0))&&(i=n)}return i===null?null:i.conversion}(e,t),l=c?c(e):null,u=null;if(l!==null){u=l.after;let t=l.node;if(s=Array.isArray(t)?t[t.length-1]:t,s!==null){for(let[,e]of i)if(s=e(s,a),!s)break;s&&o.push(...Array.isArray(t)?t:[s])}l.forChild!=null&&i.set(e.nodeName,l.forChild)}let d=e.childNodes,f=[],p=(s==null||!BD(s))&&(s!=null&&YA(s)||r);for(let e=0;e<d.length;e++)f.push(...kP(d[e],t,n,p,new Map(i),s));if(u!=null&&(f=u(f)),uO(e)&&(f=function(e,t,n){let r=e.style.textAlign,i=[],a=[];for(let e=0;e<t.length;e++){let o=t[e];if(YA(o))r&&!o.getFormat()&&o.setFormat(r),i.push(o);else if(a.push(o),e===t.length-1||e<t.length-1&&YA(t[e+1])){let e=n();e.setFormat(r),e.append(...a),i.push(e),a=[]}}return i}(e,f,p?()=>{let e=new QO;return n.push(e),e}:EE)),s==null){if(f.length>0)for(let e of f)o.push(e);else uO(e)&&function(e){return e.nextSibling!=null&&e.previousSibling!=null&&lO(e.nextSibling)&&lO(e.previousSibling)}(e)&&o.push(ek())}else Z(s)&&s.append(...f);return o}function cxe(e,t={}){let n={};for(let r in e){let i=t[r];n[r]=pN(i===void 0?e[r]:i)}return n}function lxe(e){return()=>{}}function AP(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}function jP(e,t){let n=e;for(let r=Yj(e,t);r&&(QP(r.origin)||AE(r.origin));r=r.getAdjacentCaret())n=r.origin;return n}function MP(e){return jP(e,`previous`)}function NP(e){return jP(e,`next`)}function uxe(e){let t=MP(e),n=NP(e),r=t;for(;r!==null;){if(QP(r)){let e=xve(r.getTextContent());if(e!==null)return e}if(r===n)break;r=r.getNextSibling()}let i=t.getParent();if(Z(i)){let e=i.getDirection();if(e===`ltr`||e===`rtl`)return e}return null}function dxe(e,t){let n=null,r=null,i=e,a=t,o=e.getTextContent();for(;;){if(a===0){let e=i.getPreviousSibling();if(e===null){i=null;break}if(QP(e)||AE(e)||tk(e)||AP(167),i=e,tk(i)){n={node:i,offset:1};break}a=Math.max(0,i.getTextContentSize()-1),o=i.getTextContent()}else a--;let e=o[a];QP(i)&&e!==` `&&(r={node:i,offset:a})}if(r!==null)return r;let s=null;if(t<e.getTextContentSize())QP(e)&&(s=e.getTextContent()[t]);else{let t=e.getNextSibling();QP(t)&&(s=t.getTextContent()[0])}if(s!==null&&s!==` `)return n;{let r=function(e,t){let n=e,r=t,i=e.getTextContent(),a=e.getTextContentSize();for(;;){if(!QP(n)||r===a){if(n=n.getNextSibling(),n===null||tk(n))return null;QP(n)&&(r=0,i=n.getTextContent(),a=n.getTextContentSize())}if(QP(n)){if(i[r]!==` `)return{node:n,offset:r};r++}}}(e,t);return r===null?n:r}}function fxe(e){let t=NP(e);return tk(t)&&AP(168),t}function PP(e){let t=[];return uj(e,{linebreak:()=>t.push(ek()),tab:()=>t.push(kE()),text:e=>t.push(ZP(e))}),t}function FP(e,t,n){if(!Number.isInteger(t)||t<=0)return!1;let r=e.getTextContent(),i=/^ +/.exec(r);if(!i)return!1;let a=Math.min(t,i[0].length),o=e.getKey(),s=n.anchor.key===o&&n.anchor.type===`text`?n.anchor.offset:null,c=n.focus.key===o&&n.focus.type===`text`?n.focus.offset:null;return e.spliceText(0,a,``),s!==null&&n.anchor.set(o,Math.max(0,s-a),`text`),c!==null&&n.focus.set(o,Math.max(0,c-a),`text`),!0}var pxe=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function IP(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e!=`string`||!pxe.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}var mxe=e=>{let t=kw(e,`format`),n=Aw(e,`format`),r=Mw(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],language:e.__language,theme:e.__theme,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__language;o!==void 0&&(a.language=o);let s=e.__theme;s!==void 0&&(a.theme=s);let c=e.__dir;c!=null&&(a.direction=c);let l=t[e.__format];l!==void 0&&l!==``&&(a.format=l);let u=e.__indent;return u!==void 0&&u!==0&&(a.indent=u),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=function(e){let t=IP(e,0);return t>=0&&t<=1/0&&Number.isInteger(t)?t:0}(t.indent),e.__textFormat=IP(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.language;e.setLanguage(s==null||typeof s==`string`?s:``);let c=t.theme;return e.setTheme(c===void 0?void 0:typeof c==`string`?c:``),e}}};function hxe(e,t){e.__highlightType=t.__highlightType}var gxe=e=>{let t=kw(e,`mode`),n=jw(e,`detail`,0),r=jw(e,`format`,0),i=Aw(e,`mode`),a=Mw(e,`mode`);return{exportJSON:function(e){return{highlightType:e.__highlightType,detail:e.__detail,format:e.__format,mode:t[e.__mode],style:e.__style,text:e.__text,type:e.__type,version:1}},exportCompactJSON:function(e){let n={type:e.__type},r=e.__highlightType;r!==void 0&&(n.highlightType=r);let i=e.__detail;i!==void 0&&i!==0&&(n.detail=i);let a=e.__format;a!==void 0&&a!==0&&(n.format=a);let o=t[e.__mode];o!==void 0&&o!==`normal`&&(n.mode=o);let s=e.__style;s!==void 0&&s!==``&&(n.style=s);let c=e.__text;return c!==void 0&&c!==``&&(n.text=c),n},updateFromJSON:function(e,t){let o=t.detail;e.__detail=typeof o==`string`&&o in n?n[o]:IP(o,0);let s=t.format;e.setFormat(typeof s==`string`&&s in r?r[s]:IP(s,0));let c=t.mode;e.__mode=typeof c==`string`&&c in i?i[c]:a;let l=t.style;e.__style=typeof l==`string`?l:``;let u=t.text;e.__text=typeof u==`string`?u:``;let d=t.highlightType;return e.setHighlightType(d==null||typeof d==`string`?d:``),e},afterCloneFrom:hxe}},_xe=Ww()({language:qw(Uw(Hw(Rw())),{getter:{field:`__language`}}),theme:qw(Uw(Rw()),{getter:{field:`__theme`}})});function LP(e,t){for(let n of e.childNodes)if(oO(n)&&n.tagName===t||LP(n,t))return!0;return!1}var RP=`data-language`,zP=`data-highlight-language`,BP=`data-theme`,vxe=lxe(),VP=class extends zT{__language;__theme;__isSyntaxHighlightSupported;$config(){return this.config(`code`,{children:`inline`,extends:zT,generated:mxe,importDOM:{code:e=>e.textContent!=null&&(/\r?\n/.test(e.textContent)||LP(e,`BR`))?{conversion:WP,priority:1}:null,div:()=>({conversion:yxe,priority:1}),pre:()=>({conversion:WP,priority:0}),table:e=>qP(e)?{conversion:bxe,priority:3}:null,td:e=>{let t=e,n=t.closest(`table`);return t.classList.contains(`js-file-line`)||n&&qP(n)?{conversion:GP,priority:3}:null},tr:e=>{let t=e.closest(`table`);return t&&qP(t)?{conversion:GP,priority:3}:null}},json:_xe})}constructor(e=void 0,t){super(t),this.__language=e||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(e){super.afterCloneFrom(e),function(e,t){e.__language=t.__language,e.__theme=t.__theme}(this,e),this.__isSyntaxHighlightSupported=e.__isSyntaxHighlightSupported}createDOM(e){let t=QD().createElement(`code`);_M(t,e.theme.code),t.setAttribute(`spellcheck`,`false`);let n=this.getLanguage();n&&(t.setAttribute(RP,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(zP,n));let r=this.getTheme();r&&t.setAttribute(BP,r);let i=this.getStyle();return i&&KT(t.style,i),t}updateDOM(e,t,n){let r=this.__language,i=e.__language;r?r!==i&&t.setAttribute(RP,r):i&&t.removeAttribute(RP);let a=this.__isSyntaxHighlightSupported;e.__isSyntaxHighlightSupported&&i?a&&r?r!==i&&t.setAttribute(zP,r):t.removeAttribute(zP):a&&r&&t.setAttribute(zP,r);let o=this.__theme,s=e.__theme;o?o!==s&&t.setAttribute(BP,o):s&&t.removeAttribute(BP);let c=this.__style,l=e.__style;return c!==l&&KT(t.style,c,l),!1}exportDOM(e){let t=QD().createElement(`pre`);_M(t,e._config.theme.code),t.setAttribute(`spellcheck`,`false`);let n=this.getLanguage();n&&(t.setAttribute(RP,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(zP,n));let r=this.getTheme();r&&t.setAttribute(BP,r);let i=this.getStyle();return i&&KT(t.style,i),{element:t}}insertNewAfter(e,t=!0){if(!eN(fO(),`@lexical/code`)){vxe();let t=JP(e);if(t)return t}let{anchor:n,focus:r}=e,i=(n.isBefore(r)?n:r).getNode();if(aE(i)){let e=MP(i),t=[];for(;;)if(AE(e))t.push(kE()),e=e.getNextSibling();else{if(!QP(e))break;{let n=0,r=e.getTextContent(),i=e.getTextContentSize();for(;n<i&&r[n]===` `;)n++;if(n!==0&&t.push(ZP(` `.repeat(n))),n!==i)break;e=e.getNextSibling()}}let r=i.splitText(n.offset)[0],a=n.offset===0?0:1,o=r.getIndexWithinParent()+a,s=i.getParentOrThrow(),c=[ek(),...t];s.splice(o,0,c);let l=t[t.length-1];l?l.select():n.offset===0?r.selectPrevious():r.getNextSibling().selectNext(0,0)}if(UP(i)){let{offset:t}=e.anchor;i.splice(t,0,[ek()]),i.select(t+1,t+1)}return null}canIndent(){return!1}collapseAtStart(){let e=EE();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}setLanguage(e){let t=this.getWritable();return t.__language=e||void 0,t}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(e){let t=this.getWritable();return t.__isSyntaxHighlightSupported=e,t}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(e){let t=this.getWritable();return t.__theme=e||void 0,t}getTheme(){return this.getLatest().__theme}};function HP(e,t){return WO(VP).setLanguage(e).setTheme(t)}function UP(e){return e instanceof VP}function WP(e){return{node:HP(e.getAttribute(RP),e.getAttribute(BP))}}function yxe(e){let t=e,n=KP(t);return n||function(e){let t=e.parentElement;for(;t!==null;){if(KP(t))return!0;t=t.parentElement}return!1}(t)?{node:n?HP():null}:{node:null}}function bxe(){return{node:HP()}}function GP(){return{node:null}}function KP(e){return e.style.fontFamily.match(`monospace`)!==null}function qP(e){return e.classList.contains(`js-file-line-container`)}function JP(e){let{anchor:t}=e;if(e.isCollapsed()&&t.type===`element`){let e=t.getNode();if(UP(e)){let n=e.getChildrenSize();if(n>=2&&t.offset===n){let t=e.getLastChild();if(tk(t)&&tk(t.getPreviousSibling())){let t=EE();return e.splice(n-2,2,[]).insertAfter(t,!1),t.select(),t}}}}return null}var xxe=Ww()({highlightType:qw(Uw(Hw(Rw())),{getter:{field:`__highlightType`}})}),YP=class extends eE{__highlightType;constructor(e=``,t,n){super(e,n),this.__highlightType=t}$config(){return this.config(`code-highlight`,{extends:eE,generated:gxe,json:xxe})}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(e){let t=this.getWritable();return t.__highlightType=e||void 0,t}canHaveFormat(){return!1}createDOM(e){let t=super.createDOM(e);return _M(t,XP(e.theme,this.__highlightType)),t}updateDOM(e,t,n){let r=super.updateDOM(e,t,n),i=XP(n.theme,e.__highlightType),a=XP(n.theme,this.__highlightType);return i!==a&&(i&&vM(t,i),a&&_M(t,a)),r}setFormat(e){return this}isParentRequired(){return!0}createParentElementNode(){return HP()}};function XP(e,t){return t&&e&&e.codeHighlight&&e.codeHighlight[t]}function ZP(e=``,t){return HD(new YP(e,t))}function QP(e){return e instanceof YP}var $P=`data-language`,eF=`data-theme`;function tF(e){let t=[],n=!1;for(let r=0;r<e.length;r++){let i=e[r],a=sP(i);r>0&&(a||n)&&t.push(`
`),t.push(i.getTextContent()),n=a}return PP(t.join(``))}function nF(e){return e.style.fontFamily.match(`monospace`)!==null}function rF(e){let t=e.parentElement;for(;t!==null;){if(nF(t))return!0;t=t.parentElement}return!1}var Sxe=vP([{$import:(e,t)=>e.$importChildren(t),match:wP.tag(`tr`,`td`),name:`@lexical/code/github-code-table/unwrap`}]),Cxe={$import:(e,t)=>[HP(t.getAttribute($P),t.getAttribute(eF)).splice(0,0,tF(e.$importChildren(t)))],match:wP.tag(`pre`),name:`@lexical/code/pre`},wxe={$import:(e,t,n)=>{let r=t.textContent||``;return/\r?\n/.test(r)||t.querySelector(`br`)!==null?[HP(t.getAttribute($P),t.getAttribute(eF)).splice(0,0,tF(e.$importChildren(t)))]:n()},match:wP.tag(`code`),name:`@lexical/code/code-multiline`};function iF(e){if(!oO(e))return!1;let t=e.style.fontFamily,n=e.style.whiteSpace;return typeof t==`string`&&/monospace/i.test(t)&&typeof n==`string`&&n.startsWith(`pre`)}function aF(e){let t=!1,n=[],r=``,i=!1,a=()=>{i&&=(n.push(r),r=``,!1)};for(let o of Array.from(e.childNodes))if(oO(o))o.tagName===`DIV`?(a(),n.push(o.textContent||``),t=!0):o.tagName===`BR`?(a(),n.push(``),t=!0):(r+=o.textContent||``,i=!0);else if(WE(o)){let e=o.textContent||``;e.length>0&&(r+=e,i=!0)}return a(),t?n:null}function oF(e){for(let t of Array.from(e.children))if(oO(t)&&iF(t)){if(aF(t)!==null)return!0;let e=t.nextElementSibling;if(e&&iF(e))return!0}else if(oF(t))return!0;return!1}var Txe=vP([{$import:(e,t,n)=>{if(!iF(t)||rF(t))return n();let r=aF(t);return r===null||r.length===0?n():[HP().splice(0,0,PP(r.join(`
`)))]},match:wP.tag(`div`),name:`@lexical/code/vscode-wrapper`},{$import:(e,t,n)=>{if(!iF(t)||rF(t))return n();let r=t.previousElementSibling;if(r&&iF(r))return[];let i=[],a=t;for(;a&&iF(a);)i.push(a.tagName===`BR`?``:a.textContent||``),a=a.nextElementSibling;return i.length<2?n():[HP().splice(0,0,PP(i.join(`
`)))]},match:wP.tag(`div`,`br`),name:`@lexical/code/vscode-line-run`}]),Exe={$import:(e,t,n)=>nF(t)?[HP().splice(0,0,tF(e.$importChildren(t)))]:n(),match:wP.tag(`div`),name:`@lexical/code/div`},Dxe={dependencies:[CP,[SP,{preprocess:[(e,t,n)=>{oF(GE(e)?e.body:e)&&t.session.update(iP,e=>[...e,Txe]),n()}],rules:[{$import:(e,t)=>[HP().splice(0,0,tF(e.$importChildren(t,{rules:Sxe})))],match:wP.tag(`table`).classAll(`js-file-line-container`),name:`@lexical/code/github-code-table`},{$import:(e,t)=>e.$importChildren(t),match:wP.tag(`td`).classAll(`js-file-line`),name:`@lexical/code/github-code-cell-by-class`},wxe,Cxe,Exe]}]],name:`@lexical/code`,nodes:()=>[VP,YP],register:e=>Hk(e.registerCommand(tw,e=>{let t=$();return!(!Q(t)||!JP(t)||(e!==null&&e.preventDefault(),0))},1),e.registerNodeTransform(OE,e=>{e.getFormat()!==0&&UP(e.getParent())&&e.setFormat(0)}))};function sF(e){if(!Q(e))return!1;let t=e.anchor.getNode(),n=UP(t)?t:t.getParent(),r=e.focus.getNode(),i=UP(r)?r:r.getParent();return UP(n)&&n.is(i)}function cF(e){let t=e.getNodes(),n=[];if(t.length===1&&UP(t[0]))return n;let r=[];for(let e=0;e<t.length;e++){let i=t[e];QP(i)||AE(i)||tk(i)||AP(169),tk(i)?r.length>0&&(n.push(r),r=[]):r.push(i)}if(r.length>0){let t=e.isBackward()?e.anchor:e.focus,i=SA(r[0].getKey(),0,`text`);t.is(i)||n.push(r)}return n}function lF(e,t){let n=$();if(!Q(n)||!sF(n))return!1;let r=cF(n),i=r.length;if(i===0&&n.isCollapsed())return e===sw?n.insertNodes([kE()]):function(e,t){let n=e.anchor.getNode();if(!QP(n)&&!AE(n))return;let r=MP(n);AE(r)?r.remove():t!==void 0&&QP(r)&&FP(r,t,e)}(n,t),!0;if(i===0&&e===sw&&n.getTextContent()===`
`){let e=kE(),t=ek(),r=n.isBackward()?`previous`:`next`;return n.insertNodes([e,t]),lE(_E(oM(Xj(e,`next`,0),hE(Yj(t,`next`))),r)),!0}for(let a=0;a<i;a++){let i=r[a];if(i.length>0){let r=i[0];if(a===0&&(r=MP(r)),e===sw){let e=kE();if(r.insertBefore(e),a===0){let t=n.isBackward()?`focus`:`anchor`,i=SA(r.getKey(),0,`text`);n[t].is(i)&&n[t].set(e.getKey(),0,`text`)}}else AE(r)?r.remove():t!==void 0&&QP(r)&&FP(r,t,n)}}return!0}function uF(e,t){let n=$();if(!Q(n))return!1;let{anchor:r,focus:i}=n,a=r.offset,o=i.offset,s=r.getNode(),c=i.getNode(),l=e===$C;if(!sF(n)||!QP(s)&&!AE(s)||!QP(c)&&!AE(c))return!1;if(!t.altKey){if(n.isCollapsed()){let e=s.getParentOrThrow();if(l&&a===0&&s.getPreviousSibling()===null){if(e.getPreviousSibling()===null)return e.selectPrevious(),t.preventDefault(),!1}else if(!l&&a===s.getTextContentSize()&&s.getNextSibling()===null&&e.getNextSibling()===null)return e.selectNext(),t.preventDefault(),!1}return!1}let u,d;if(s.isBefore(c)?(u=MP(s),d=NP(c)):(u=MP(c),d=NP(s)),u==null||d==null)return!1;let f=u.getNodesBetween(d);for(let e=0;e<f.length;e++){let t=f[e];if(!QP(t)&&!AE(t)&&!tk(t))return!1}t.preventDefault(),t.stopPropagation();let p=l?u.getPreviousSibling():d.getNextSibling();if(!tk(p))return!0;let m=l?p.getPreviousSibling():p.getNextSibling();if(m==null)return!0;let h=tk(m),g=(h||!QP(m)&&!AE(m)?null:l?MP(m):NP(m))??m;return p.remove(),f.forEach(e=>e.remove()),h?(f.forEach(e=>{g.insertAfter(e),g=e}),g.insertAfter(p)):e===$C?(f.forEach(e=>g.insertBefore(e)),g.insertBefore(p)):(g.insertAfter(p),g=p,f.forEach(e=>{g.insertAfter(e),g=e})),n.setTextNodeRange(s,a,c,o),!0}function dF(e,t){let n=$();if(!Q(n))return!1;let{anchor:r,focus:i}=n,a=r.getNode(),o=i.getNode(),s=e===QC;if(!sF(n)||!QP(a)&&!AE(a)||!QP(o)&&!AE(o))return!1;let c=o,l=uxe(c)===`rtl`?!s:s,u=r.key,d=r.offset,f=r.type;if(l){let e=dxe(c,i.offset);if(e!==null){let{node:t,offset:r}=e;tk(t)?t.selectNext(0,0):n.setTextNodeRange(t,r,t,r)}else c.getParentOrThrow().selectStart()}else fxe(c).select();return t.shiftKey&&n.anchor.set(u,d,f),t.preventDefault(),t.stopPropagation(),!0}function Oxe(e,t,n){return Hk(...n?[e.registerCommand(ew,e=>!e.altKey&&VM(UP,e),1),e.registerCommand(YC,e=>VM(UP,e),1),e.registerCommand($C,e=>!e.altKey&&BM(UP,e),1),e.registerCommand(ZC,e=>BM(UP,e),1)]:[],e.registerCommand(aw,t=>{let n=function(e){let t=$();if(!Q(t)||!sF(t))return null;let n=e?cw:sw,r=e?cw:ow,i=t.anchor,a=t.focus;if(i.is(a))return r;let o=cF(t);if(o.length!==1)return n;let s=o[0],c,l;s.length===0&&AP(285),t.isBackward()?(c=a,l=i):(c=i,l=a);let u=MP(s[0]),d=NP(s[0]),f=SA(u.getKey(),0,`text`),p=SA(d.getKey(),d.getTextContentSize(),`text`);return c.isBefore(f)||p.isBefore(l)?n:f.isBefore(c)||l.isBefore(p)?r:n}(t.shiftKey);return n!==null&&(t.preventDefault(),e.dispatchCommand(n),!0)},1),e.registerCommand(ow,()=>!!sF($())&&(lj([kE()]),!0),1),e.registerCommand(sw,()=>lF(sw),1),e.registerCommand(cw,()=>lF(cw,t),1),e.registerCommand($C,e=>{let t=$();if(!Q(t))return!1;let{anchor:n}=t,r=n.getNode();if(!sF(t))return!1;let i=r.getParent();return t.isCollapsed()&&n.offset===0&&r.getPreviousSibling()===null&&UP(i)&&i.getPreviousSibling()===null?(e.preventDefault(),!0):uF($C,e)},1),e.registerCommand(ew,e=>{let t=$();if(!Q(t))return!1;let{anchor:n}=t,r=n.getNode();return!!sF(t)&&(t.isCollapsed()&&n.offset===r.getTextContentSize()&&r.getNextSibling()===null&&UP(r.getParentOrThrow())&&r.getParentOrThrow().getNextSibling()===null?(e.preventDefault(),!0):uF(ew,e))},1),e.registerCommand(QC,e=>dF(QC,e),1),e.registerCommand(XC,e=>dF(XC,e),1))}var kxe=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function fF(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e!=`string`||!kxe.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}function pF(e,t,n,r,i){let a=fF(e,t);return a>=n&&a<=r&&Number.isInteger(a)?a:t}function Axe(e,t){e.__rel=t.__rel,e.__target=t.__target,e.__title=t.__title,e.__url=t.__url}var jxe=e=>{let t=kw(e,`format`),n=Aw(e,`format`),r=Mw(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],rel:e.__rel,target:e.__target,title:e.__title,url:e.__url,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__rel;o!=null&&(a.rel=o);let s=e.__target;s!=null&&(a.target=s);let c=e.__title;c!=null&&(a.title=c);let l=e.__url;l!==void 0&&l!==``&&(a.url=l);let u=e.__dir;u!=null&&(a.direction=u);let d=t[e.__format];d!==void 0&&d!==``&&(a.format=d);let f=e.__indent;return f!==void 0&&f!==0&&(a.indent=f),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=pF(t.indent,0,0,1/0),e.__textFormat=fF(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.rel;e.__rel=typeof s==`string`&&s!==``?s:null;let c=t.target;e.__target=typeof c==`string`&&c!==``?c:null;let l=t.title;e.__title=typeof l==`string`&&l!==``?l:null;let u=t.url;return e.__url=typeof u==`string`?u:``,e},afterCloneFrom:Axe}};function Mxe(e,t){e.__isUnlinked=t.__isUnlinked}var Nxe=e=>{let t=kw(e,`format`),n=Aw(e,`format`),r=Mw(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],isUnlinked:e.__isUnlinked,rel:e.__rel,target:e.__target,title:e.__title,url:e.__url,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__isUnlinked;o!==void 0&&!1!==o&&(a.isUnlinked=o);let s=e.__rel;s!=null&&(a.rel=s);let c=e.__target;c!=null&&(a.target=c);let l=e.__title;l!=null&&(a.title=l);let u=e.__url;u!==void 0&&u!==``&&(a.url=u);let d=e.__dir;d!=null&&(a.direction=d);let f=t[e.__format];f!==void 0&&f!==``&&(a.format=f);let p=e.__indent;return p!==void 0&&p!==0&&(a.indent=p),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=pF(t.indent,0,0,1/0),e.__textFormat=fF(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.rel;e.__rel=typeof s==`string`&&s!==``?s:null;let c=t.target;e.__target=typeof c==`string`&&c!==``?c:null;let l=t.title;e.__title=typeof l==`string`&&l!==``?l:null;let u=t.url;e.__url=typeof u==`string`?u:``;let d=t.isUnlinked;return e.__isUnlinked=typeof d==`boolean`&&d,e},afterCloneFrom:Mxe}},mF=new Set([`http:`,`https:`,`mailto:`,`sms:`,`tel:`]),Pxe=Ww()({rel:Kw(Hw(Rw(),{defaultAsNull:!0}),{field:`__rel`}),target:Kw(Hw(Rw(),{defaultAsNull:!0}),{field:`__target`}),title:Kw(Hw(Rw(),{defaultAsNull:!0}),{field:`__title`}),url:Kw(Rw(),{field:`__url`,getter:`getURL`,setter:`setURL`})}),hF=class extends zT{__url;__target;__rel;__title;$config(){return this.config(`link`,{children:`inline`,extends:zT,generated:jxe,importDOM:{a:()=>({conversion:Fxe,priority:1})},inline:!0,json:Pxe,mergeAdjacent:{by:[`url`,`target`,`rel`,`title`]}})}constructor(e=``,t={},n){super(n);let{target:r=null,rel:i=null,title:a=null}=t;this.__url=e,this.__target=r,this.__rel=i,this.__title=a}createDOM(e){let t=QD().createElement(`a`);return this.updateLinkDOM(null,t,e),_M(t,e.theme.link),t}updateLinkDOM(e,t,n){if(aO(t)){e&&e.__url===this.__url||(t.href=this.sanitizeUrl(this.__url));for(let n of[`target`,`rel`,`title`]){let r=`__${n}`,i=this[r];e&&e[r]===i||(i?t[n]=i:t.removeAttribute(n))}}}updateDOM(e,t,n){return this.updateLinkDOM(e,t,n),!1}sanitizeUrl(e){let t=e;e=xF(e);try{let t=new URL(xF(e));if(!mF.has(t.protocol))return`about:blank`}catch{let e=t.replace(/[\u0000-\u001F\u007F\s]/g,``).match(/^([a-z][a-z0-9+.-]*):/i);if(e!=null&&!mF.has(`${e[1].toLowerCase()}:`))return`about:blank`}return e}getURL(){return this.getLatest().__url}setURL(e){let t=this.getWritable();return t.__url=e,t}getTarget(){return this.getLatest().__target}setTarget(e){let t=this.getWritable();return t.__target=e,t}getRel(){return this.getLatest().__rel}setRel(e){let t=this.getWritable();return t.__rel=e,t}getTitle(){return this.getLatest().__title}setTitle(e){let t=this.getWritable();return t.__title=e,t}insertNewAfter(e,t=!0){let n=VD(this);return this.insertAfter(n,t),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,n){if(!Q(t))return!1;let r=t.anchor.getNode(),i=t.focus.getNode();return(this.is(r)||this.isParentOf(r))&&(this.is(i)||this.isParentOf(i))&&t.getTextContent().length>0}isEmailURI(){return this.getURL().startsWith(`mailto:`)}isWebSiteURI(){let e=this.getURL();return e.startsWith(`https://`)||e.startsWith(`http://`)}shouldMergeAdjacentLink(e){return this.getType()===e.getType()&&this.getURL()===e.getURL()&&this.getTarget()===e.getTarget()&&this.getRel()===e.getRel()&&this.getTitle()===e.getTitle()}};function Fxe(e){let t=null;if(aO(e)){let n=e.textContent;(n!==null&&n!==``||e.children.length>0)&&(t=gF(e.getAttribute(`href`)||``,{rel:e.getAttribute(`rel`),target:e.getAttribute(`target`),title:e.getAttribute(`title`)}))}return{node:t}}function gF(e=``,t){return HD(new hF(e,t))}function _F(e){return e instanceof hF}var Ixe=Ww()({isUnlinked:Kw(Bw(),{field:`__isUnlinked`})}),Lxe=class extends hF{__isUnlinked;constructor(e=``,t={},n){super(e,t,n),this.__isUnlinked=t.isUnlinked!==void 0&&t.isUnlinked!==null&&t.isUnlinked}$config(){return this.config(`autolink`,{extends:hF,generated:Nxe,json:Ixe,mergeAdjacent:!1})}shouldMergeAdjacentLink(e){return!1}getIsUnlinked(){return this.getLatest().__isUnlinked}setIsUnlinked(e){let t=this.getWritable();return t.__isUnlinked=e,t}createDOM(e){return this.__isUnlinked?QD().createElement(`span`):super.createDOM(e)}updateDOM(e,t,n){return super.updateDOM(e,t,n)||e.__isUnlinked!==this.__isUnlinked}};function vF(e){return e instanceof Lxe}var yF=PC(`TOGGLE_LINK_COMMAND`);function bF(e,t){if(e.type===`element`){let n=e.getNode();return Z(n)||function(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}(252),n.getChildren()[e.offset+t]||null}return null}function Rxe(e,t={}){let n;if(e&&typeof e==`object`){let{url:r,...i}=e;n=r,t={...i,...t}}else n=e;let{target:r,title:i}=t,a=t.rel===void 0?`noreferrer`:t.rel,o=$();if(o===null||!Q(o)&&!AA(o))return;if(AA(o)){let e=o.getNodes();if(e.length===0)return;e.forEach(e=>{if(n===null){let t=GO(e,e=>!vF(e)&&_F(e));t&&(t.insertBefore(e),t.getChildren().length===0&&t.remove())}else{let t=GO(e,e=>!vF(e)&&_F(e));if(t)t.setURL(n),r!==void 0&&t.setTarget(r),a!==void 0&&t.setRel(a),i!==void 0&&t.setTitle(i);else{let t=gF(n,{rel:a,target:r,title:i});e.insertBefore(t),t.append(e)}}});return}if(o.isCollapsed()&&n===null)for(let e of o.getNodes()){let t=GO(e,e=>!vF(e)&&_F(e));t!==null&&(t.getParentOrThrow().splice(t.getIndexWithinParent(),0,t.getChildren()),t.remove());return}let s=o.extract();if(n===null){let e=new Set;s.forEach(t=>{let n=GO(t,e=>!vF(e)&&_F(e));if(n!==null){let t=n.getKey();if(e.has(t))return;(function(e,t){let n=new Set(t.filter(t=>e.isParentOf(t)).map(e=>e.getKey())),r=e.getChildren(),i=r=>n.has(r.getKey())||Z(r)&&t.some(t=>e.isParentOf(t)&&r.isParentOf(t)),a=r.filter(i);if(a.length===0&&r.length>0)return;if(a.length===r.length)return r.forEach(t=>e.insertBefore(t)),void e.remove();let o=r.findIndex(i),s=r.findLastIndex(i),c=o===0,l=s===r.length-1;if(c)a.forEach(t=>e.insertBefore(t));else if(l)for(let t=a.length-1;t>=0;t--)e.insertAfter(a[t]);else{for(let t=a.length-1;t>=0;t--)e.insertAfter(a[t]);let t=r.slice(s+1);if(t.length>0){let n=VD(e);a[a.length-1].insertAfter(n),t.forEach(e=>n.append(e))}}})(n,s),e.add(t)}});return}let c=new Set,l=e=>{c.has(e.getKey())||(c.add(e.getKey()),e.setURL(n),r!==void 0&&e.setTarget(r),a!==void 0&&e.setRel(a),i!==void 0&&e.setTitle(i))};if(s.length===1){let e=s[0],t=GO(e,_F);if(t!==null)return l(t)}(function(e){let t=$();if(!Q(t))return e();let n=IT(t),r=n.isBackward(),i=bF(n.anchor,r?-1:0),a=bF(n.focus,r?0:-1);if(e(),i||a){let e=$();if(Q(e)){let t=e.clone();if(i){let e=i.getParent();e&&t.anchor.set(e.getKey(),i.getIndexWithinParent()+ +!!r,`element`)}if(a){let e=a.getParent();e&&t.focus.set(e.getKey(),a.getIndexWithinParent()+ +!r,`element`)}cD(IT(t))}}})(()=>{let e=null;for(let t of s){if(!t.isAttached())continue;let o=GO(t,_F);if(o){l(o);continue}if(Z(t)){if(!t.isInline())continue;if(_F(t)){if(!(vF(t)||e!==null&&e.getParentOrThrow().isParentOf(t))){l(t),e=t;continue}for(let e of t.getChildren())t.insertBefore(e);t.remove();continue}}let s=t.getPreviousSibling();_F(s)&&s.is(e)?s.append(t):(e=gF(n,{rel:a,target:r,title:i}),t.insertAfter(e),e.append(t))}})}var zxe=/^\+?[0-9\s()-]{5,}$/;function xF(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes(`@`)?`mailto:${e}`:zxe.test(e)?`tel:${e}`:`https://${e}`}function SF(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}function Bxe(e){let t=1,n=e.getParent();for(;n!=null;){if(UF(n)){let e=n.getParent();if(RF(e)){t++,n=e.getParent();continue}SF(40)}return t}return t}function Vxe(e){let t=e.getParent();RF(t)||SF(40);let n=t,r=t;for(;r!==null;)r=r.getParent(),RF(r)&&(n=r);return n}function CF(e){return UF(e)&&RF(e.getFirstChild())}function wF(e,t){return t.getValue()}function Hxe(e,t){return UF(e)&&(t.length===0||t.length===1&&e.is(t[0])&&e.getChildrenSize()===0)}function TF(e,t){return RF(e)?VD(e).setListType(t):LF(t)}function Uxe(e){let t=$();if(t!==null){let n=t.getNodes();if(Q(t)){let[r]=t.getStartEndPoints(),i=r.getNode(),a=i.getParent();if(BD(i)){let e=i.getFirstChild();if(e)n=e.selectStart().getNodes();else{let e=EE();i.append(e),n=e.select().getNodes()}}else if(Hxe(i,n)){if(BD(a)){let t=LF(e);i.replace(t);let n=HF();Z(i)&&(n.setFormat(i.getFormatType()),n.setIndent(i.getIndent())),t.append(n)}else if(UF(i)){let t=i.getParentOrThrow();if(kj(t)===null){let n=TF(t,e);EF(n,t.getChildren()),t.replace(n)}}return}}let r=new Set;for(let t=0;t<n.length;t++){let i=n[t];if(Z(i)&&i.isEmpty()&&!UF(i)&&kj(i)===null&&!r.has(i.getKey())){DF(i,e);continue}let a=Sve(i)?i.getParent():UF(i)&&i.isEmpty()?i:null;for(;a!=null;){let t=a.getKey();if(RF(a)){if(!r.has(t)&&kj(a)===null){let n=TF(a,e);EF(n,a.getChildren()),a.replace(n),r.add(t)}break}{let n=a.getParent();if(BD(n)&&!r.has(t)){r.add(t),DF(a,e);break}a=n}}}}}function EF(e,t){e.splice(e.getChildrenSize(),0,t)}function DF(e,t){if(RF(e))return e;let n=e.getPreviousSibling(),r=e.getNextSibling(),i=HF(),a;if(EF(i,e.getChildren()),RF(n)&&t===n.getListType())n.append(i),RF(r)&&t===r.getListType()&&(EF(n,r.getChildren()),r.remove()),a=n;else if(RF(r)&&t===r.getListType())r.getFirstChildOrThrow().insertBefore(i),a=r;else{let n=LF(t);n.append(i),e.replace(n),a=n}i.setFormat(e.getFormatType()),i.setIndent(e.getIndent());let o=$();return Q(o)&&(a.getKey()===o.anchor.key&&o.anchor.set(i.getKey(),o.anchor.offset,`element`),a.getKey()===o.focus.key&&o.focus.set(i.getKey(),o.focus.offset,`element`)),e.remove(),a}function OF(e,t){kF(e,t,!1)}function kF(e,t,n){AF(e.getLastChild(),t.getFirstChild(),n);let r=t.getChildren();r.length>0&&e.append(...r),t.remove()}function AF(e,t,n=!1){if(e&&t&&CF(e)&&CF(t)&&(!n||e.getChildrenSize()===1&&t.getChildrenSize()===1)&&e.getFirstChild().getListType()===t.getFirstChild().getListType()){if(kF(e.getFirstChild(),t.getFirstChild(),n),!n)return void t.remove();zT.prototype.remove.call(t)}}function Wxe(e){let t=e.getListType()!==`check`,n=e.getStart();for(let r of e.getChildren())UF(r)&&(r.getValue()!==n&&r.setValue(n),t&&r.getLatest().__checked!=null&&r.setChecked(void 0),RF(r.getFirstChild())||n++)}function Gxe(e){let t=new Set;if(CF(e)||t.has(e.getKey()))return;let n=e.getParent(),r=e.getNextSibling(),i=e.getPreviousSibling();if(CF(r)&&CF(i)){let n=i.getFirstChild();if(RF(n)){n.append(e);let i=r.getFirstChild();RF(i)&&n.getListType()===i.getListType()&&(EF(n,i.getChildren()),r.remove(),t.add(r.getKey()))}}else if(CF(r)){let t=r.getFirstChild();if(RF(t)){let n=t.getFirstChild();n!==null&&n.insertBefore(e)}}else if(CF(i)){let t=i.getFirstChild();RF(t)&&t.append(e)}else if(RF(n)){let t=VD(e),a=VD(n);t.append(a),a.append(e),i?i.insertAfter(t):r?r.insertBefore(t):n.append(t)}}function jF(e){if(CF(e))return;let t=e.getParent(),n=t?t.getParent():void 0;if(RF(n?n.getParent():void 0)&&UF(n)&&RF(t)){let r=t?t.getFirstChild():void 0,i=t?t.getLastChild():void 0;if(e.is(r))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(i))n.insertAfter(e),t.isEmpty()&&n.remove();else{let r=VD(e),i=VD(t);r.append(i),e.getPreviousSiblings().forEach(e=>i.append(e));let a=VD(e),o=VD(t);a.append(o),EF(o,e.getNextSiblings()),n.insertBefore(r),n.insertAfter(a),n.replace(e)}}}function Kxe(e=!1){let t=$();if(!Q(t)||!t.isCollapsed())return!1;let n=t.anchor.getNode(),r=null;if(UF(n)&&n.getChildrenSize()===0)r=n;else if(aE(n)){let e=n.getParent();UF(e)&&e.getChildren().every(e=>aE(e)&&e.getTextContent().trim()===``)&&(r=e)}if(r===null)return!1;let i=Vxe(r),a=r.getParent();RF(a)||SF(40);let o=a.getParent(),s;if(BD(o))s=EE(),i.insertAfter(s);else{if(!UF(o))return!1;s=VD(o),o.insertAfter(s)}s.setTextStyle(t.style).setTextFormat(t.format).select();let c=r.getNextSiblings();if(c.length>0){let t=e?wF(0,r):1,n=VD(a).setStart(t);if(UF(s)){let e=VD(s);e.append(n),s.insertAfter(e)}else s.insertAfter(n);n.append(...c)}return function(e){let t=e;for(;t.getNextSibling()==null&&t.getPreviousSibling()==null;){let e=t.getParent();if(e==null||!UF(e)&&!RF(e))break;t=e}t.remove()}(r),!0}var qxe=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function MF(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e!=`string`||!qxe.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}function Jxe(e,t){e.__listType=t.__listType,e.__start=t.__start,e.__tag=t.__tag}var Yxe=e=>{let t=kw(e,`format`),n=Aw(e,`format`),r=Mw(e,`format`),i=jw(e,`listType`,0);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],listType:e.__listType,start:e.__start,tag:e.__tag,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__listType;o!==void 0&&o!==`number`&&(a.listType=o);let s=e.__start;s!==void 0&&s!==1&&(a.start=s);let c=e.__dir;c!=null&&(a.direction=c);let l=t[e.__format];l!==void 0&&l!==``&&(a.format=l);let u=e.__indent;return u!==void 0&&u!==0&&(a.indent=u),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let a=t.direction;e.__dir=a===null||a===`ltr`||a===`rtl`?a:null;let o=t.format;e.__format=typeof o==`string`&&o in n?n[o]:r,e.__indent=function(e){let t=MF(e,0);return t>=0&&t<=1/0&&Number.isInteger(t)?t:0}(t.indent),e.__textFormat=MF(t.textFormat,0);let s=t.textStyle;e.__textStyle=typeof s==`string`?s:``;let c=t.listType;return e.setListType(typeof c==`string`&&c in i?i[c]:c===`number`||c===`bullet`||c===`check`?c:`number`),e.__start=MF(t.start,1),e},afterCloneFrom:Jxe}};function Xxe(e,t){e.__checked=t.__checked,e.__value=t.__value}var Zxe=e=>{let t=kw(e,`format`),n=Aw(e,`format`),r=Mw(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],checked:e.getChecked(),indent:e.getIndent(),value:e.__value,direction:e.__dir,format:t[e.__format],textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.getChecked();o!==void 0&&(a.checked=o);let s=e.getIndent();s!==void 0&&s!==0&&(a.indent=s);let c=e.__value;c!==void 0&&c!==1&&(a.value=c);let l=e.__dir;l!=null&&(a.direction=l);let u=t[e.__format];return u!==void 0&&u!==``&&(a.format=u),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.setIndent(function(e){let t=MF(e,NaN);return Number.isFinite(t)&&Number.isInteger(t)?t<0?0:t>128?128:t:0}(t.indent)),e.__textFormat=MF(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.checked;return e.__checked=s===void 0?void 0:typeof s==`boolean`&&s,e.__value=MF(t.value,1),e},afterCloneFrom:Xxe}},NF={ol:`number`,ul:`bullet`},Qxe=Ww()({listType:qw(Gw(Vw([`number`,`bullet`,`check`]),NF),{getter:{field:`__listType`}}),start:Kw(zw(1),{field:`__start`}),tag:qw(Vw([`ul`,`ol`]),{getter:{field:`__tag`},setter:null})}),PF=class extends zT{__tag;__start;__listType;$config(){return this.config(`list`,{$transform:e=>{(function(e){let t=e.constructor,n=e.getNextSibling();return n!==null&&n.constructor===t&&RT(fO())&&Q_e(t).declaredBy.mergeAdjacent===t})(e)||function(e){let t=e.getNextSibling();RF(t)&&e.getListType()===t.getListType()&&OF(e,t)}(e),Wxe(e)},children:[zF],extends:zT,generated:Yxe,importDOM:M_e({ol:()=>({conversion:IF,priority:0}),ul:()=>({conversion:IF,priority:0})}),json:Qxe,mergeAdjacent:{by:[`listType`]}})}constructor(e=`number`,t=1,n){super(n);let r=NF[e]||e;this.__listType=r,this.__tag=r===`number`?`ol`:`ul`,this.__start=t}getTag(){return this.getLatest().__tag}setListType(e){let t=this.getWritable();return t.__listType=e,t.__tag=e===`number`?`ol`:`ul`,t}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(e){let t=this.getWritable();return t.__start=e,t}createDOM(e,t){let n=this.__tag,r=QD().createElement(n);return this.__start!==1&&r.setAttribute(`start`,String(this.__start)),r.__lexicalListType=this.__listType,FF(r,e.theme,this),r}updateDOM(e,t,n){return e.__tag!==this.__tag||e.__listType!==this.__listType||(FF(t,n.theme,this),e.__start!==this.__start&&t.setAttribute(`start`,String(this.__start)),!1)}exportDOM(e){let t=this.createDOM(e._config,e);if(oO(t)){this.__start!==1&&t.setAttribute(`start`,String(this.__start)),this.__listType===`check`&&t.setAttribute(`__lexicalListType`,`check`);let e=this.getDirection();e&&(t.dir=e)}return{element:t}}canBeEmpty(){return!1}INTERNAL_$afterStructureMerge(e,t){AF(e,t,!0)}INTERNAL_$afterStructureSplit(e,t){if(this.getListType()===`number`){let n=e.getStart();for(let e of t)UF(e)&&!RF(e.getFirstChild())&&n++;this.setStart(n)}}canIndent(){return!1}splice(e,t,n){let r=n;for(let e=0;e<n.length;e++){let t=n[e];if(!UF(t)){r===n&&(r=[...n]);let i=this.createListItemNode();!Z(t)||RF(t)||t.isInline()?i.append(t):i.append(...t.getChildren()),r[e]=i}}return super.splice(e,t,r)}extractWithChild(e){return UF(e)}createListItemNode(){return HF()}};function FF(e,t,n){let r=[],i=[],a=t.list;if(a!==void 0){let e=a[`${n.__tag}Depth`]||[],t=Bxe(n)-1,o=t%e.length,s=e[o],c=a[n.__tag],l,u=a.nested,d=a.checklist;if(u!==void 0&&u.list&&(l=u.list),c!==void 0&&r.push(c),d!==void 0&&n.__listType===`check`&&r.push(d),s!==void 0){r.push(...gM(s));for(let t=0;t<e.length;t++)t!==o&&i.push(...gM(e[t]))}if(l!==void 0){let e=gM(l);t>1?r.push(...e):i.push(...e)}}i.length>0&&vM(e,...i),r.length>0&&_M(e,...r)}function IF(e){let t;if(function(e){return oO(e)&&e.nodeName.toLowerCase()===`ol`}(e)){let n=e.start;t=LF(`number`,n)}else t=function(e){if(e.getAttribute(`__lexicallisttype`)===`check`||e.classList.contains(`contains-task-list`)||e.getAttribute(`data-is-checklist`)===`1`)return!0;for(let t of e.childNodes)if(oO(t)&&t.hasAttribute(`aria-checked`))return!0;return!1}(e)?LF(`check`):LF(`bullet`);return bO(t,e),{after:e=>function(e,t){let n=t.createListItemNode.bind(t),r=[];for(let t=0;t<e.length;t++){let i=e[t];if(UF(i)){r.push(i);let e=i.getChildren();e.length>1&&e.forEach(e=>{RF(e)&&r.push(n().append(e))})}else r.push(n().append(i))}return r}(e,t),node:t}}function LF(e=`number`,t=1){return HD(new PF(e,t))}function RF(e){return e instanceof PF}var $xe=Ww()({checked:qw(Uw(Bw()),{setter:{field:`__checked`}}),indent:qw(zw(0,{clamp:!0,integer:!0,max:128,min:0}),{derived:!0}),value:Kw(zw(1),{derived:!0,field:`__value`})}),zF=class extends zT{__value;__checked;$config(){return this.config(`listitem`,{$transform:e=>{let t=e.getParent();if(RF(t))t.getListType()!==`check`&&e.getChecked()!=null&&e.setChecked(void 0);else if(t){let n=e.createParentElementNode();RF(n)||SF(340);let r=[e];for(let t of[`previous`,`next`]){r.reverse();for(let{origin:n}of Yj(e,t)){if(!UF(n))break;r.push(n)}}let i=RT(fO()),a=i?function(e,t){let n=$();if(!Q(n))return null;let r=e.getKey(),i=t[0].getIndexWithinParent(),a=[n.anchor,n.focus].filter(e=>e.type===`element`&&e.key===r).map(e=>({offset:e.offset,point:e}));return a.length===0?null:e=>{for(let{point:e,offset:n}of a)if(n<=i)e.set(r,n,`element`);else if(n<i+t.length){let r=t[n-i-1];e.set(r.getKey(),r.getChildrenSize(),`element`)}else e.set(r,n-t.length+1,`element`)}}(t,r):null;if(e.insertBefore(n),n.splice(0,0,r),a!==null&&a(n),i)for(let e=t;e!==null&&!BD(e);e=e.getParent())e.markDirty();BD(t)||i||(CE(n,fE(Yj(n,`next`)),{$shouldSplit:()=>!1,removeEmptyDestination:!0}),t.isEmpty()&&t.isAttached()&&t.remove())}},children:[`inline`,PF],extends:zT,generated:Zxe,importDOM:M_e({li:()=>({conversion:eSe,priority:0})}),json:$xe})}constructor(e=1,t=void 0,n){super(n),this.__value=e===void 0?1:e,this.__checked=t}createDOM(e){let t=QD().createElement(`li`);return this.updateListItemDOM(null,t,e),t}updateListItemDOM(e,t,n){(function(e,t){let n=t.getParent();!RF(n)||n.getListType()!==`check`||RF(t.getFirstChild())?(e.removeAttribute(`role`),e.removeAttribute(`tabIndex`),e.removeAttribute(`aria-checked`)):(e.setAttribute(`role`,`checkbox`),e.setAttribute(`tabIndex`,`-1`),e.setAttribute(`aria-checked`,t.getChecked()?`true`:`false`))})(t,this),t.value=this.__value,function(e,t,n){let r=t.list;if(!r)return;let i=r.listitem,a=r.nested&&r.nested.listitem,o=n.getParent(),s=RF(o)&&o.getListType()===`check`,c=n.getChecked(),l=n.getChildren().some(e=>RF(e)),u=[];r.listitemChecked!==void 0&&u.push(r.listitemChecked),r.listitemUnchecked!==void 0&&u.push(r.listitemUnchecked),a!==void 0&&u.push(...gM(a)),u.length>0&&vM(e,...u);let d=[];if(i!==void 0&&d.push(...gM(i)),s){let e=c?r.listitemChecked:r.listitemUnchecked;e!==void 0&&d.push(e)}a!==void 0&&l&&d.push(...gM(a)),d.length>0&&_M(e,...d)}(t,n.theme,this);let r=e?e.__style:``,i=this.__style;r!==i&&KT(t.style,i,r),function(e,t,n){let r=t.__textStyle,i=n?n.__textStyle:``;if(n!==null&&i===r)return;let a=GT(r);for(let t in a)e.style.setProperty(`--listitem-marker-${t}`,a[t]);if(i!==``)for(let t in GT(i))t in a||e.style.removeProperty(`--listitem-marker-${t}`)}(t,this,e)}updateDOM(e,t,n){let r=t;return this.updateListItemDOM(e,r,n),!1}exportDOM(e){let t=this.createDOM(e._config),n=this.getFormatType();n&&(t.style.textAlign=n);let r=this.getDirection();return r&&(t.dir=r),CF(this)?{after(e){if(oO(e)){let t=e.previousElementSibling;if(oO(t)&&t.nodeName===`LI`){for(;e.firstChild;)t.append(e.firstChild);e.remove()}}return e},element:t}:{element:t}}append(...e){for(let t=0;t<e.length;t++){let n=e[t];if(Z(n)&&this.canMergeWith(n)){let e=n.getChildren();this.append(...e),n.remove()}else super.append(n)}return this}replace(e,t){if(UF(e))return super.replace(e);this.setIndent(0);let n=this.getParentOrThrow();if(!RF(n))return e;if(n.__first===this.getKey())n.insertBefore(e);else if(n.__last===this.getKey())n.insertAfter(e);else{let t=VD(n),r=this.getNextSibling();for(;r;){let e=r;r=r.getNextSibling(),t.append(e)}n.insertAfter(e),e.insertAfter(t)}let r=this.__key,i=0;if(t&&(Z(e)||SF(139),i=e.getChildrenSize(),e.splice(i,0,this.getChildren())),t&&Z(e)){let t=$();if(Q(t))for(let n of t.getStartEndPoints())n.key===r&&n.type===`element`&&n.set(e.getKey(),i+n.offset,`element`)}return this.remove(),n.getChildrenSize()===0&&n.remove(),e}insertAfter(e,t=!0){let n=this.getParentOrThrow();if(RF(n)||SF(39),UF(e))return super.insertAfter(e,t);let r=this.getNextSiblings();if(n.insertAfter(e,t),r.length!==0){let i=VD(n),a=r[0];i.getListType()===`number`&&UF(a)&&i.setStart(wF(0,a)),r.forEach(e=>i.append(e)),e.insertAfter(i,t)}return e}remove(e){let t=this.getPreviousSibling(),n=this.getNextSibling();super.remove(e),t&&n&&CF(t)&&CF(n)&&t.getFirstChild().getListType()===n.getFirstChild().getListType()&&(OF(t.getFirstChild(),n.getFirstChild()),n.remove())}resetOnCopyNodeFrom(e){super.resetOnCopyNodeFrom(e),e.getChecked()&&this.setChecked(!1)}insertNewAfter(e,t=!0){let n=VD(this);return this.insertAfter(n,t),n}collapseAtStart(e){if(CF(this))return!1;let t=this.getParentOrThrow();if(UF(t.getParentOrThrow()))return jF(this),!0;let n=EE().append(...this.getChildren()),r=this.getNextSiblings();if(r.length>0){let e=VD(t);e.append(...r),t.insertAfter(e)}return t.insertAfter(n),this.remove(),t.getChildrenSize()===0&&t.remove(),n.selectStart(),!0}getValue(){return this.getLatest().__value}setValue(e){let t=this.getWritable();return t.__value=e,t}getChecked(){let e=this.getLatest(),t,n=this.getParent();return RF(n)&&(t=n.getListType()),t===`check`?!!e.__checked:void 0}setChecked(e){let t=this.getWritable();return t.__checked=e,t}toggleChecked(){let e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){let e=this.getParent();if(e===null||!this.isAttached())return this.getLatest().__indent;let t=e.getParentOrThrow(),n=0;for(;UF(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){typeof e!=`number`&&SF(117),(e=Math.floor(e))>=0||SF(199);let t=e,n=this.getIndent();for(;n!==t;)n<t?(Gxe(this),n++):(jF(this),n--);return this}canInsertAfter(e){return UF(e)}canReplaceWith(e){return UF(e)}canMergeWith(e){return UF(e)||DE(e)}extractWithChild(e,t){if(!Q(t))return!1;let n=t.anchor.getNode(),r=t.focus.getNode();return this.isParentOf(n)&&this.isParentOf(r)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return LF(`bullet`)}canMergeWhenEmpty(){return!0}};function eSe(e){if(e.classList.contains(`task-list-item`)){for(let t of e.children)if(t.tagName===`INPUT`)return BF(t)}if(e.classList.contains(`joplin-checkbox`)){for(let t of e.children)if(t.classList.contains(`checkbox-wrapper`)&&t.children.length>0&&t.children[0].tagName===`INPUT`)return BF(t.children[0])}let t=e.getAttribute(`aria-checked`),n=HF(t===`true`||t!==`false`&&void 0);return xO(n,e),{after:VF.bind(null,n),node:bO(n,e)}}function BF(e){if(e.getAttribute(`type`)!==`checkbox`)return{node:null};let t=HF(e.hasAttribute(`checked`));return{after:VF.bind(null,t),node:t}}function VF(e,t){let n=t[0];return t.length===1&&DE(n)&&!e.getFormatType()&&n.getFormatType()?(e.setFormat(n.getFormatType()),n.getChildren()):t}function HF(e){return HD(new zF(void 0,e))}function UF(e){return e instanceof zF}var WF=PC(`INSERT_UNORDERED_LIST_COMMAND`),GF=PC(`INSERT_ORDERED_LIST_COMMAND`);function KF(e,t,n=null){let r=ZD(n),i=n?YD(n):[],a=n!==null&&i.length>0;if(a&&typeof r.caretPositionFromPoint==`function`){let a=r.caretPositionFromPoint(e,t,{shadowRoots:i});if(a!==null&&function(e,t){for(let n=e;n!==null;){if(n===t)return!0;n=OD(n)}return!1}(a.offsetNode,n))return{node:a.offsetNode,offset:a.offset}}if(a){let i=n.getRootNode();if(JD(i)){let a=i.elementFromPoint(e,t);if(a!==null&&n.contains(a)){let n=function(e,t,n,r){let i=r.createRange(),a=e=>t<e.top?e.top-t:t>e.bottom?t-e.bottom:0,o=t=>e<t.left?t.left-e:e>t.right?e-t.right:0,s=r.createTreeWalker(n,NodeFilter.SHOW_TEXT),c=null,l=1/0,u=1/0;for(let e=s.nextNode();e;e=s.nextNode()){i.selectNodeContents(e);for(let t of i.getClientRects()){let n=a(t),r=o(t);(n<l||n===l&&r<u)&&(l=n,u=r,c=e)}}if(c===null)return null;let d=0,f=1/0,p=1/0;for(let t=0;t<=c.length;t++){i.setStart(c,t),i.collapse(!0);let n=i.getBoundingClientRect(),r=a(n),o=Math.abs(e-n.left);(r<f||r===f&&o<p)&&(f=r,p=o,d=t)}return{node:c,offset:d}}(e,t,a,r);if(n!==null)return n}}}if(typeof r.caretRangeFromPoint==`function`){let n=r.caretRangeFromPoint(e,t);return n===null?null:{node:n.startContainer,offset:n.startOffset}}if(typeof r.caretPositionFromPoint==`function`){let n=r.caretPositionFromPoint(e,t);return n===null?null:{node:n.offsetNode,offset:n.offset}}return null}function qF(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}var JF={"application/x-lexical-editor":0,"text/html":10,"text/plain":20,"text/uri-list":30};function tSe(e){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy(`lexical`,{createHTML:e=>e}).createHTML(e):e}var YF=(e,t)=>{if(!Q(t))return t.insertRawText(e),!0;t!==$()&&cD(t);let n=e=>{let t=$();Q(t)&&e(t)};return uj(e,{linebreak:()=>n(e=>e.insertParagraph()),tab:()=>n(e=>e.insertNodes([kE()])),text:e=>n(t=>t.insertText(e))}),!0},XF={"application/x-lexical-editor":[(e,t,n)=>{try{let n=fO(),r=JSON.parse(e);if(r&&r.namespace===n._config.namespace&&Array.isArray(r.nodes))return rI(n,lSe(r.nodes),t),!0}catch(e){console.error(e)}return n()}],"text/html":[(e,t,n)=>{try{let n=fO();return rI(n,EP(n,new DOMParser().parseFromString(tSe(e),`text/html`)),t),!0}catch(e){return console.error(e),n()}}],"text/plain":[YF],"text/uri-list":[YF]};function nSe(e,t,n,r){if(!e)return!1;let i=(t,n,a)=>!!e[t]&&e[t](n,a,(e=n,r=a)=>i(t-1,e,r),r);return i(e.length-1,t,n)}function ZF(e,t,n){let r=t.getData(`text/plain`);for(let i of function(e){return Object.keys(e.$importMimeType).filter(t=>e.$importMimeType[t]!==void 0).sort((t,n)=>{let r=e.priority[t],i=e.priority[n];return r===void 0&&i===void 0?t<n?-1:+(t>n):r===void 0?1:i===void 0?-1:r-i})}(e)){let a=t.getData(i);if(a&&(i!==`text/html`||a!==r)&&nSe(e.$importMimeType[i],a,n,t))return!0}return!1}var rSe={$importMimeType:XF,$insertDataTransfer:(e,t)=>ZF({$importMimeType:XF,priority:JF},e,t),priority:JF},iSe={build:(e,t)=>({$importMimeType:t.$importMimeType,$insertDataTransfer:(e,n)=>ZF(t,e,n),priority:t.priority}),config:{$importMimeType:XF,priority:JF},mergeConfig(e,t){let n=hM(e,t);if(t.$importMimeType){let r={...e.$importMimeType};for(let[e,n]of Object.entries(t.$importMimeType))if(n){let t=r[e];r[e]=t?[...t,...n]:n}n.$importMimeType=r}return t.priority&&(n.priority={...e.priority,...t.priority}),n},name:`@lexical/clipboard/Import`};function QF(e,t=$()){return t??qF(166),Q(t)&&t.isCollapsed()||t.getNodes().length===0?``:DP(e,t)}function $F(e,t=$()){return t??qF(166),Q(t)&&t.isCollapsed()||t.getNodes().length===0?null:JSON.stringify(cSe(e,t))}function eI(e,t,n){(function(){let e=Tbe(iSe.name);return e?e.output:rSe})().$insertDataTransfer(e,t)}var tI=`application/x-lexical-drag`;function aSe(e,t){let n={editorKey:t.getKey()};e.setData(tI,JSON.stringify(n))}function nI(e){let t=e;if(Kj(t)){if(t.offset===0)t=fE(t.getSiblingCaret());else{if(t.offset!==t.origin.getTextContentSize())return t;t=t.getSiblingCaret()}}for(;;){let e=t.getParentAtCaret();if(e===null||!e.isInline()||e.isShadowRoot())return t;if(Jj(t))t=fE(Yj(e,`next`));else{if(t.getNodeAtCaret()!==null)return t;t=Yj(e,`next`)}}}function oSe(e,t,n){let r=e.dataTransfer;if(r===null)return!1;let i=function(e){let t=e.getData(tI);if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}return(r=n)!==null&&typeof r==`object`&&`editorKey`in r&&typeof r.editorKey==`string`?n:null;var r}(r);if(i===null)return!1;let a=function(e,t){let n=KF(e.clientX,e.clientY,t.getRootElement());if(n===null)return null;let r=rD(n.node);if(r===null)return null;if(aE(r))return Xj(r,`next`,n.offset);let i=r.getParent();if(Z(r)){let e=t.getElementByKey(r.getKey());if(e===null)return null;let a=mO(r,e,t);return n.node===a.element||i?vE(...a.resolveChildIndex(r,e,n.node,n.offset),`next`):null}return i&&vE(i,r.getIndexWithinParent()+1,`next`)}(e,t);if(a===null)return!1;let o=i.editorKey===t.getKey(),s=$();if(o){if(!Q(s)||s.isCollapsed())return!1;if(function(e,t){let{anchor:n,focus:r}=_E(dE(t),`next`),i=nI(e);return cM(nI(n),i)<=0&&cM(i,nI(r))<=0}(a,s))return e.preventDefault(),!0}let c=hE(a),l=Kj(c)?SE(c):c;if(l===null)return!1;let u=l.getFlipped();o&&Q(s)&&s.removeText();let d=l.origin.isAttached()?l:u;if(d.origin.isAttached()||qF(438),n(r,lE(aM(d)),t),!o){let e=t.getRootElement(),n=e?e.ownerDocument:null,r=n?function(e,t){for(let n of XD(t)){let t=VE(n);if(zE(t)&&t.getKey()===e&&oO(n))return n}return null}(i.editorKey,n):null;r!==null&&r.dispatchEvent(new InputEvent(`beforeinput`,{bubbles:!0,cancelable:!0,inputType:`deleteByDrag`}))}return e.preventDefault(),!0}function sSe(e,t){return oSe(e,t,eI)}function rI(e,t,n){e.dispatchCommand(oge,{nodes:t,selection:n})||(n.insertNodes(t),function(e){if(Q(e)&&e.isCollapsed()){let t=e.anchor,n=null,r=sE(t,`previous`);if(r){if(Kj(r))n=r.origin;else{let e=oM(r,$j(oD(),`next`).getFlipped());for(let t of e){if(aE(t.origin)){n=t.origin;break}if(Z(t.origin)&&!t.origin.isInline())break}}}if(n&&aE(n)){let t=n.getFormat(),r=n.getStyle();e.format===t&&e.style===r||(e.format=t,e.style=r,e.dirty=!0)}}}(n))}function iI(e,t,n,r=[]){let i=t===null||n.isSelected(t),a=Z(n)&&n.excludeFromCopy(`clone`),o=n;t!==null&&aE(o)&&(o=CM(t,o,`clone`));let s=Nge(o),c=Z(o)?o.getChildren():[],l=s.children||[];aE(o)&&o.getTextContentSize()===0&&(i=!1);let u=i&&AA(t)&&Z(n)?null:t;for(let r=0;r<c.length;r++){let a=c[r],o=iI(e,u,a,l);!i&&Z(n)&&o&&n.extractWithChild(a,t,`clone`)&&(i=!0)}if(i&&!a){let t=Nj(o);if(t.length>0){let n={};for(let r of t){let t=Pj(o,r);t===null&&qF(366,o.constructor.name,r);let i=[];iI(e,null,t,i),(i.length!==1||Z(t)&&t.excludeFromCopy(`clone`))&&qF(435,r,o.constructor.name,String(i.length)),n[r]=i[0]}s.$slots=n}}if(i&&!a)r.push(s);else for(let e=0;e<l.length;e++)r.push(l[e]);return i}function cSe(e,t){let n=[],r=oD(),i=jj(t),a=(Z(i)?i:r).getChildren();for(let r=0;r<a.length;r++)iI(e,t,a[r],n);return{namespace:e._config.namespace,nodes:n}}function lSe(e){let t=[];for(let n of e)t.push(rye(n));return t}var aI=null;async function oI(e,t,n){if(aI!==null)return!1;if(t!==null)return new Promise((r,i)=>{e.update(()=>{r(sI(e,t,n))})});let r=e.getRootElement(),i=e._window||window,a=i.document,o=qD(i);if(r===null||o===null)return!1;let s=a.createElement(`span`);s.style.position=`fixed`,s.style.top=`-1000px`,s.append(a.createTextNode(`#`)),r.append(s);let c=a.createRange();return c.setStart(s,0),c.setEnd(s,1),o.removeAllRanges(),o.addRange(c),new Promise((t,r)=>{let o=e.registerCommand(uw,r=>(NM(r,ClipboardEvent)&&(o(),aI!==null&&(i.clearTimeout(aI),aI=null),t(sI(e,r,n))),!0),4);aI=i.setTimeout(()=>{o(),aI=null,t(!1)},50),a.execCommand(`copy`),s.remove()})}function sI(e,t,n){if(n===void 0){let t=qD(e._window),r=$();if(!r||r.isCollapsed()||!t)return!1;let i=tO(t,e.getRootElement()),a=i.anchorNode,o=i.focusNode;if(a!==null&&o!==null&&!RE(e,a,o))return!1;n=cI(r)}t.preventDefault();let r=t.clipboardData;return r!==null&&(lI(r,n),!0)}var uSe=[[`text/html`,QF],[`application/x-lexical-editor`,$F]];function cI(e=$()){return function(e,t){let n={"text/plain":``};for(let[r,i]of Object.entries(e))if(i){let e=fSe(i,t);e!==null&&(n[r]=e)}return n}(dSe(),e)}function lI(e,t){for(let[n]of uSe)t[n]===void 0&&e.setData(n,``);for(let n in t){let r=t[n];r!==void 0&&e.setData(n,r)}}function dSe(e=fO()){let t=eN(e,pSe.name);return t?t.output:uI}var uI={"application/x-lexical-editor":[(e,t)=>e?$F(fO(),e):t()],"text/html":[(e,t)=>e?QF(fO(),e):t()],"text/plain":[(e,t)=>e?e.getTextContent():t()]};function fSe(e,t){let n=r=>e[r]?e[r](t,n.bind(null,r-1)):null;return n(e.length-1)}var pSe={build:(e,t,n)=>t.$exportMimeType,config:{$exportMimeType:uI},mergeConfig(e,t){let n=hM(e,t);if(t.$exportMimeType){let r={...e.$exportMimeType};for(let[e,n]of Object.entries(t.$exportMimeType))if(n){let t=r[e];r[e]=t?[...t,...n]:n}n.$exportMimeType=r}return n},name:`@lexical/clipboard/GetClipboardData`},mSe={bold:`bold`,italic:`italic`,strikeThrough:`strikethrough`,subscript:`subscript`,superscript:`superscript`,underline:`underline`},dI=Symbol.for(`@lexical/dragon/WindowState`);function hSe(e,t,n){let r=function(e){let t=e[dI];return t===void 0&&(t={dispose:()=>{},editors:new Map,installs:new Set},e[dI]=t),t}(e);if(r.installs.size===0){let t=vSe.bind(e);e.addEventListener(`message`,t,!0),r.dispose=()=>{e.removeEventListener(`message`,t,!0)}}if(r.installs.add(t),n){let e=r.editors.get(n)||new Set;e.add(t),r.editors.set(n,e)}return gSe.bind(null,e,r,t,n)}function gSe(e,t,n,r){if(r){let e=t.editors.get(r);e&&e.delete(n)&&e.size===0&&t.editors.delete(r)}t.installs.delete(n)&&t.installs.size===0&&(t.dispose(),delete e[dI])}function fI(e){return e&&e.ownerDocument.defaultView}function _Se(e){let t=SN(()=>fI(e.getRootElement()),t=>e.registerRootListener(e=>{t.value=fI(e)}));return xN(()=>{let n=t.value;if(n)return hSe(n,Symbol(`@lexical/dragon/editorInstall`),e)})}function vSe(e){if(e.origin!==this.location.origin)return;let t=function(e){let t=e[dI];if(t===void 0)return null;let n=VE(rO(e.document));return zE(n)&&t.editors.has(n)?n:null}(this);if(t===null)return;let n=e.data;if(typeof n==`string`){let r;try{r=JSON.parse(n)}catch{return}if(r&&r.protocol===`nuanria_messaging`&&r.type===`request`){let n=r.payload;if(n&&n.functionId===`makeChanges`){let r=n.args;if(Array.isArray(r)){let[n,i,a,o,s,c]=r;if(![n,i,o,s].every(Number.isFinite)||typeof a!=`string`&&a!==-1)return;t.update(()=>{let t=$();if(Q(t)){let r=t.anchor,l=r.getNode(),u=0,d=0;if(aE(l)&&n>=0&&i>=0&&(u=n,d=n+i,t.setTextNodeRange(l,u,l,d)),typeof a!=`string`||u===d&&a===``||(t.insertRawText(a),l=r.getNode()),aE(l)){let e=l.getTextContentSize();u=Math.min(Math.max(o,0),e),d=o<0||s<0?u:Math.min(o+s,e),t.setTextNodeRange(l,u,l,d)}if(typeof c==`string`&&s>0&&!t.isCollapsed()){let e=mSe[c];e!==void 0&&t.formatText(e)}e.stopImmediatePropagation()}})}}}}}var ySe=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function pI(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e!=`string`||!ySe.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}function mI(e,t,n,r,i){let a=pI(e,t);return a>=n&&a<=r&&Number.isInteger(a)?a:t}function bSe(e,t){e.__tag=t.__tag}var xSe=e=>{let t=kw(e,`format`),n=Aw(e,`format`),r=Mw(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],tag:e.__tag,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__tag;o!==void 0&&o!==`h1`&&(a.tag=o);let s=e.__dir;s!=null&&(a.direction=s);let c=t[e.__format];c!==void 0&&c!==``&&(a.format=c);let l=e.__indent;return l!==void 0&&l!==0&&(a.indent=l),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=mI(t.indent,0,0,1/0),e.__textFormat=pI(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.tag;return e.__tag=s===`h1`||s===`h2`||s===`h3`||s===`h4`||s===`h5`||s===`h6`?s:`h1`,e},afterCloneFrom:bSe}},SSe=e=>{let t=kw(e,`format`),n=Aw(e,`format`),r=Mw(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__dir;o!=null&&(a.direction=o);let s=t[e.__format];s!==void 0&&s!==``&&(a.format=s);let c=e.__indent;return c!==void 0&&c!==0&&(a.indent=c),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=mI(t.indent,0,0,1/0),e.__textFormat=pI(t.textFormat,0);let o=t.textStyle;return e.__textStyle=typeof o==`string`?o:``,e}}},hI=PC(`DRAG_DROP_PASTE_FILE`),gI=Jw(`shadowRoot`,{parse:Bw()}),_I=class extends zT{$config(){return this.config(`quote`,{children:`inline`,extends:zT,generated:SSe,importDOM:{blockquote:()=>({conversion:wSe,priority:0})},stateConfigs:[{flat:!0,stateConfig:gI}]})}isShadowRoot(){return Yw(this,gI)}setIsShadowRoot(e){return Xw(this,gI,e)}createDOM(e){let t=QD().createElement(`blockquote`);return _M(t,e.theme.quote),t}updateDOM(e,t,n){return!1}exportDOM(e){let{element:t}=super.exportDOM(e);if(oO(t)){this.isEmpty()&&t.append(QD().createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e);let n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){return vI().updateFromJSON(e)}insertNewAfter(e,t){let n=EE();n.setTextFormat(e.format),n.setTextStyle(e.style);let r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,t),n}collapseAtStart(){if(this.isShadowRoot()){for(let e of this.getChildren())this.insertBefore(e);return this.remove(),!0}let e=EE();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}canMergeWhenEmpty(){return!0}};function vI(e){let t=HD(new _I);return e&&e.shadowRoot?t.setIsShadowRoot(!0):t}function yI(e){return e instanceof _I}var CSe=Ww()({tag:Kw(Vw([`h1`,`h2`,`h3`,`h4`,`h5`,`h6`]),{field:`__tag`})}),bI=class extends zT{__tag;$config(){return this.config(`heading`,{children:`inline`,extends:zT,generated:xSe,importDOM:{h1:()=>({conversion:SI,priority:0}),h2:()=>({conversion:SI,priority:0}),h3:()=>({conversion:SI,priority:0}),h4:()=>({conversion:SI,priority:0}),h5:()=>({conversion:SI,priority:0}),h6:()=>({conversion:SI,priority:0}),p:e=>{let t=e.firstChild;return t!==null&&xI(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>xI(e)?{conversion:()=>({node:CI(`h1`)}),priority:3}:null},json:CSe})}constructor(e=`h1`,t){super(t),this.__tag=e}getTag(){return this.getLatest().__tag}setTag(e){let t=this.getWritable();return t.__tag=e,t}createDOM(e){let t=this.__tag,n=QD().createElement(t),r=e.theme.heading;if(r!==void 0){let e=r[t];_M(n,e)}return n}updateDOM(e,t,n){return e.__tag!==this.__tag}exportDOM(e){let{element:t}=super.exportDOM(e);if(oO(t)){this.isEmpty()&&t.append(QD().createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e);let n=this.getDirection();n&&(t.dir=n)}return{element:t}}insertNewAfter(e,t=!0){let n=!this.getLastDescendant()||e&&UM(e.anchor,this),r=e&&HM(e.anchor,this),i=n||!e?EE():CI(this.getTag()).setFormat(this.getFormatType()).setStyle(this.getStyle()),a=this.getDirection();if(i.setDirection(a),this.insertAfter(i,t),r&&!this.isEmpty()){let e=EE();e.select(),this.replace(e,!0)}return i}collapseAtStart(){if(this.isEmpty()){let e=EE();this.getChildren().forEach(t=>e.append(t)),this.replace(e)}return!0}extractWithChild(){return!0}};function xI(e){return e.nodeName.toLowerCase()===`span`&&e.style.fontSize===`26pt`}function SI(e){let t=e.nodeName.toLowerCase(),n=null;return t!==`h1`&&t!==`h2`&&t!==`h3`&&t!==`h4`&&t!==`h5`&&t!==`h6`||(n=CI(t),yO(e,n),xO(n,e),bO(n,e)),{node:n}}function wSe(e){let t=vI();return xO(t,e),yO(e,t),bO(t,e),{node:t}}function CI(e=`h1`){return HD(new bI(e))}function wI(e){return e instanceof bI}function TI(e){return VT(rD(e))&&!(oO(e)&&e.hasAttribute(`data-lexical-slot`))}function EI(e){let t=e.focus;return t.key===`root`&&t.offset===oD().getChildrenSize()}function DI(e){let t=e.focus;return t.key===`root`&&t.offset===0}function OI(e,t){if(!e.isCollapsed())return!1;let n=t===`next`;if(!(n?EI(e):DI(e)))return!1;let r=e.focus.offset;return GD(oD().getChildAtIndex(n?r-1:r))}function kI(e,t,n,r){let i=!1,a=null;if(e.isCollapsed()&&e.anchor.type===`text`){let t=e.anchor.getNode();if(aE(t)){a=t;let r=e.anchor.offset,o=r===t.getTextContentSize()&&t.getNextSibling()===null,s=r===0&&t.getPreviousSibling()===null;i=n===`end`&&o||n===`start`&&s||n===`both`&&(o||s)}}let o=!1;for(let[n,s]of Object.entries(r)){if(s==null||!s[t])continue;let r=n;if(s.onlyAtBoundary){if(!(i&&a&&aE(a)&&a.hasFormat(r)))continue;o=!0}e.hasFormat(r)&&e.toggleFormat(r)}o&&e.setStyle(``)}var TSe={capitalize:{enter:!0,space:!0,tab:!0},lowercase:{enter:!0,space:!0,tab:!0},uppercase:{enter:!0,space:!0,tab:!0}};function AI(e,t){return function(e,t){if(!e.isCollapsed())return!1;let n=sE(e.focus,t),r=GO(n.origin,zD);if(!r)return!1;let i=e.focus.getNode();if(!r.is(i)&&!PD(i,r))return!1;let a=oM(n,Yj(r,t));if(a.getTextSlices().some(e=>e&&e.getTextContentSize()>0))return!1;let o=oM(a.anchor.getSiblingCaret(),a.focus),s=o.anchor.origin;for(let e of o){if(!qj(e)||!e.origin.is(s.getParent()))return!1;s=e.origin}let c=r;for(let e of iM(Yj(r,t))){if(!e.origin.is(c.getParent())){if(GD(e.origin)){let e=Yj(c,t);return lE(oM(e,e)),!0}break}if(!zD(e.origin))break;c=e.origin}return!1}(e,t)||function(e,t){if(!e.isCollapsed()||e.anchor.type!==`element`)return!1;let n=sE(e.anchor,t).getNodeAtCaret();return!(!zD(n)||n.isInline()||(lE(aM(hE($j(n,t)))),0))}(e,t)}function jI(e){return VT(e)&&!e.isInline()&&!e.isIsolated()&&e.isKeyboardSelectable()}function MI(e){let t=QA();t.add(e),cD(t)}function NI(e,t){if(!e.isCollapsed())return!1;let n=e.focus,r=n.getNode(),i=t?`previous`:`next`,a=sE(n,i);if(n.type===`element`&&Z(r)&&BD(r)){let e=a.getNodeAtCaret();return!(e===null||!jI(e)||(MI(e.__key),0))}let o=GO(Z(r)?r:r.getParentOrThrow(),e=>Z(e)&&!e.isInline()&&BD(e.getParent()));if(o===null)return!1;let s=Yj(o,i).getNodeAtCaret();if(s===null||!jI(s))return!1;if(o.getTextContentSize()===0)return MI(s.__key),!0;let c=fO().getRootElement();if(c===null)return!1;let l=qD(c.ownerDocument.defaultView);if(l===null||l.rangeCount===0)return!1;let u=l.anchorNode,d=l.anchorOffset,f=l.focusNode,p=l.focusOffset;l.modify(`move`,t?`backward`:`forward`,`line`);let m=l.anchorNode,h=l.anchorOffset;if(m===null)return PI(l,u,d,f,p),!1;let g=rD(m);return PI(l,u,d,f,p),g!==null&&(m===u&&h===d||!g.is(o)&&!PD(g,o))&&(MI(s.__key),!0)}function PI(e,t,n,r,i){t!==null&&r!==null&&e.setBaseAndExtent(t,n,r,i)}function FI(e,t){if(!e.isCollapsed())return!1;let n=e.focus.getNode(),r=GO(Z(n)?n:n.getParentOrThrow(),e=>Z(e)&&!e.isInline());if(r===null)return!1;let i=fO(),a=i.getRootElement();if(a===null)return!1;let o=a.ownerDocument.defaultView;if(o===null)return!1;let s=!1;for(let e of r.getChildren())if(Z(e)&&e.isInline()){let t=i.getElementByKey(e.getKey());if(t!==null){let e=o.getComputedStyle(t).display;if(e===`inline-grid`||e===`inline-flex`){s=!0;break}}}if(!s)return!1;let c=Yj(r,t?`previous`:`next`).getNodeAtCaret();if(c===null||!Z(c)){if(t){let e=r.getFirstDescendant();aE(e)?e.select(0,0):r.select(0,0)}else{let e=r.getLastDescendant();if(aE(e)){let t=e.getTextContentSize();e.select(t,t)}else{let e=r.getChildrenSize();r.select(e,e)}}return!0}let l=i.getElementByKey(c.getKey());if(l===null)return!1;let u=qD(o);if(u===null||u.rangeCount===0)return!1;let d=u.getRangeAt(0).cloneRange();d.collapse(!0);let f=d.getBoundingClientRect(),p=l.getBoundingClientRect(),m=p.top+p.height/2;if(f.height>0){let t=KF(f.left,m,a);if(t!==null&&l.contains(t.node)){let n=a.ownerDocument.createRange();return n.setStart(t.node,t.offset),n.collapse(!0),e.applyDOMRange(n),e.dirty=!0,!0}}let h=t?c.getLastDescendant():c.getFirstDescendant();if(aE(h)){let e=t?h.getTextContentSize():0;h.select(e,e)}else{let e=c.getChildrenSize();c.select(t?e:0,t?e:0)}return!0}function II(e,t){let n=Yj(e,t),r=n.getAdjacentCaret();r!==null&&Z(r.origin)&&!r.origin.isInline()&&r.origin.isShadowRoot()?lE(aM(n)):t===`next`?e.selectNext(0,0):e.selectPrevious()}function LI(e,t){let n=e.getNodes().map(e=>Yj(e,`next`)).sort(cM),r=n[0],i=n[n.length-1];if(!r||!i)return!1;for(let e=0;e<n.length-1;e++)if(!n[e+1].origin.is(n[e].getNodeAtCaret()))return!1;return lE(_E(oM(fE(r),i),t)),iye(),!0}function RI(e,t,n){n.preventDefault(),n.stopPropagation();let r=e.getNodes();if(r.length===0)return!0;let i=r.map(e=>Yj(e,`next`)).sort(cM),a=(t?i[0]:i[i.length-1]).origin,o=GO(a,e=>e!==a&&Z(e)&&!e.isInline())??oD(),s=t?0:o.getChildrenSize();return o.select(s,s),!0}function ESe(e,t){return e.length>0&&!t}function DSe(e,t=pN(TSe),n=pN(ESe)){return Hk(e.registerCommand(IC,n=>{let r=$();if(AA(r)){let t=n.target;if(oO(t))for(let n of r.getNodes()){let r=e.getElementByKey(n.getKey());if(r!==null&&r.contains(t))return!1}return r.clear(),!0}return Q(r)&&kI(r,`click`,`both`,t.peek()),!1},0),e.registerCommand(LC,e=>{let t=$();return Q(t)?(t.deleteCharacter(e),!0):!!AA(t)&&(t.deleteNodes(),!0)},0),e.registerCommand(UC,e=>{let t=$();return!!Q(t)&&(t.deleteWord(e),!0)},0),e.registerCommand(WC,e=>{let t=$();return!!Q(t)&&(t.deleteLine(e),!0)},0),e.registerCommand(BC,t=>{let n=$();if(typeof t==`string`)n!==null&&n.insertText(t);else{if(n===null)return!1;let r=t.dataTransfer;if(r!=null)eI(r,n,e);else if(Q(n)){let e=t.data;return e&&n.insertText(e),!0}}return!0},0),e.registerCommand(HC,()=>{let e=$();return!!Q(e)&&(e.removeText(),!0)},0),e.registerCommand(GC,e=>{let t=$();return!(!Q(t)&&!AA(t)||(NA(t,e),0))},0),e.registerCommand(dge,e=>{let t=$();return!(!Q(t)&&!AA(t)||(Tye(t,e),0))},0),e.registerCommand(lw,e=>{let t=$();if(!Q(t)&&!AA(t))return!1;let n=t.getNodes();for(let t of n){let n=GO(t,e=>Z(e)&&!e.isInline());n!==null&&n.setFormat(e)}return!0},0),e.registerCommand(RC,e=>{let t=$();return!!Q(t)&&(t.insertLineBreak(e),!0)},0),e.registerCommand(zC,()=>{let e=$();return!!Q(e)&&(e.insertParagraph(),!0)},0),e.registerCommand(ow,()=>{let e=kE(),t=$();return Q(t)&&(e.setFormat(t.format),e.setStyle(t.style)),lj([e]),!0},0),e.registerCommand(sw,()=>FM(e=>{let t=e.getIndent();e.setIndent(t+1)}),0),e.registerCommand(cw,()=>FM(e=>{let t=e.getIndent();t>0&&e.setIndent(Math.max(0,t-1))}),0),e.registerCommand($C,e=>{let t=$();if(AA(t)){let n=t.getNodes();if(n.length>0){if(!e.shiftKey||!LI(t,`previous`))return e.preventDefault(),II(n[0],`previous`),!0;t=$()}}return Q(t)&&(DI(t)||!e.shiftKey&&AI(t,`previous`)||!e.shiftKey&&NI(t,!0)||!e.shiftKey&&FI(t,!0))?(e.preventDefault(),!0):!1},0),e.registerCommand(ew,e=>{let t=$();if(AA(t)){let n=t.getNodes();if(n.length>0){if(!e.shiftKey||!LI(t,`next`))return e.preventDefault(),II(n[0],`next`),!0;t=$()}}return Q(t)&&(EI(t)||!e.shiftKey&&AI(t,`next`)||!e.shiftKey&&NI(t,!1)||!e.shiftKey&&FI(t,!1))?(e.preventDefault(),!0):!1},0),e.registerCommand(ZC,e=>{let n=$();if(AA(n)){let t=n.getNodes();if(t.length>0){let r=SM(t[0])?`next`:`previous`;if(!e.shiftKey||!LI(n,r))return e.preventDefault(),II(t[0],r),!0;n=$()}}if(!Q(n))return!1;let r=SM(n.anchor.getNode())?`next`:`previous`;if(OI(n,r)||!e.shiftKey&&AI(n,r))return e.preventDefault(),!0;if(e.shiftKey||kI(n,`arrow`,`start`,t.peek()),DM(n,!0)){let t=e.shiftKey;return e.preventDefault(),kM(n,t,!0),!0}return!1},0),e.registerCommand(YC,e=>{let n=$();if(AA(n)){let t=n.getNodes();if(t.length>0){let r=SM(t[0])?`previous`:`next`;if(!e.shiftKey||!LI(n,r))return e.preventDefault(),II(t[0],r),!0;n=$()}}if(!Q(n))return!1;let r=SM(n.anchor.getNode())?`previous`:`next`;if(OI(n,r)||!e.shiftKey&&AI(n,r))return e.preventDefault(),!0;if(e.shiftKey||kI(n,`arrow`,`end`,t.peek()),DM(n,!1)){let t=e.shiftKey;return e.preventDefault(),kM(n,t,!1),!0}return!1},0),e.registerCommand(nw,t=>{let n=$();if(!AA(n)&&TI(t.target))return!1;if(Q(n)){if(function(e){if(!e.isCollapsed())return!1;let{anchor:t}=e;if(t.offset!==0)return!1;let n=t.getNode();if(WT(n))return!1;let r=nbe(n);return r.getIndent()>0&&(r.is(n)||n.is(r.getFirstDescendant()))}(n))return t.preventDefault(),e.dispatchCommand(cw);if(SC&&xC)return!1}else if(!AA(n))return!1;return t.preventDefault(),e.dispatchCommand(LC,!0)},0),e.registerCommand(iw,t=>{let n=$();return!(!AA(n)&&TI(t.target))&&!(!Q(n)&&!AA(n))&&(t.preventDefault(),e.dispatchCommand(LC,!1))},0),e.registerCommand(tw,n=>{let r=$();if(AA(r)){let e=r.getNodes();e.length===1&&VT(e[0])&&!e[0].isInline()&&(r=e[0].selectNext())}if(!Q(r))return!1;if(kI(r,`enter`,`both`,t.peek()),n!==null){if((SC||CC||EC)&&xC)return!1;if(n.preventDefault(),n.shiftKey)return e.dispatchCommand(RC,!1)}return e.dispatchCommand(zC)},0),e.registerCommand(rw,()=>!!Q($())&&(e.blur(),!0),0),e.registerCommand(pge,t=>{let[,n]=PM(t);if(n.length>0){let r=t.clientX,i=t.clientY,a=KF(r,i,e.getRootElement());if(a!==null){let{offset:e,node:t}=a,n=rD(t);if(n!==null){let t=ZA();if(aE(n))t.anchor.set(n.getKey(),e,`text`),t.focus.set(n.getKey(),e,`text`);else{let e=n.getParentOrThrow().getKey(),r=n.getIndexWithinParent()+1;t.anchor.set(e,r,`element`),t.focus.set(e,r,`element`)}cD(IT(t))}}return!(!e.dispatchCommand(hI,n)&&SC&&n.every(e=>e.type===`text/plain`)||(t.preventDefault(),0))}return sSe(t,e)},0),e.registerCommand(mge,t=>{let[n]=PM(t),r=$();return!(n&&!Q(r)||(Q(r)&&!r.isCollapsed()&&t.dataTransfer!==null&&(lI(t.dataTransfer,cI(r)),aSe(t.dataTransfer,e)),0))},0),e.registerCommand(hge,t=>{let[n]=PM(t),r=$();if(n&&!Q(r))return!1;let i=t.clientX,a=t.clientY,o=KF(i,a,e.getRootElement());return o!==null&&VT(rD(o.node))&&t.preventDefault(),!0},0),e.registerCommand(fw,()=>{let e=$();return Eve(Q(e)&&Aj(e.anchor.getNode())!==null?e:null),!0},0),e.registerCommand(uw,t=>!LE(t)&&(oI(e,NM(t,ClipboardEvent)?t:null),!0),0),e.registerCommand(dw,t=>!LE(t)&&(async function(e,t){t.update(()=>{let e=$();Q(e)&&!e.isCollapsed()&&PA(e)},{discrete:!0,tag:`cut`}),await oI(t,NM(e,ClipboardEvent)?e:null),t.update(()=>{let e=$();Q(e)?e.removeText():AA(e)&&e.getNodes().forEach(e=>e.remove())},{tag:`cut`})}(t,e),!0),0),e.registerCommand(VC,t=>{let[,r,i]=PM(t);return!(!n.peek()(r,i)||!e.dispatchCommand(hI,r))||!LE(t)&&$()!==null&&(function(e,t){e.preventDefault(),t.update(()=>{let n=$(),r=NM(e,InputEvent)||NM(e,KeyboardEvent)?null:e.clipboardData;r!=null&&n!==null&&eI(r,n,t)},{tag:`paste`})}(t,e),!0)},0),e.registerCommand(fge,()=>{let e=$();return Q(e)&&kI(e,`space`,`both`,t.peek()),!1},0),e.registerCommand(aw,()=>{let e=$();return Q(e)&&kI(e,`tab`,`both`,t.peek()),!1},0),e.registerCommand(XC,e=>{let t=$();if(AA(t))return RI(t,!1,e);if(!Q(t))return!1;let{anchor:n}=t;if(n.type!==`element`||n.offset!==0)return!1;let r=n.getNode();if(!Z(r))return!1;let i=r.getFirstChild();if(!VT(i)||!i.isInline())return!1;let a=r.getKey(),o=r.selectEnd();return e.shiftKey&&o.anchor.set(a,0,`element`),e.preventDefault(),e.stopPropagation(),!0},0),e.registerCommand(QC,e=>{let t=$();if(AA(t))return RI(t,!0,e);if(!Q(t))return!1;let{anchor:n,focus:r}=t,i=GO(r.getNode(),e=>Z(e)&&!e.isInline());if(i===null)return!1;let a=i.getFirstChild();if(!VT(a)||!a.isInline()||GO(n.getNode(),e=>Z(e)&&!e.isInline())!==i)return!1;let o=i.getKey();return(r.type!==`element`||r.key!==o||r.offset!==0)&&(t.focus.set(o,0,`element`),e.shiftKey||t.anchor.set(o,0,`element`),e.preventDefault(),e.stopPropagation(),!0)},0))}function zI(e,t){let n={};for(let r of e){let e=t(r);e&&(n[e]?n[e].push(r):n[e]=[r])}return n}function BI(e){let t=zI(e,e=>e.type);return{element:t.element||[],multilineElement:t[`multiline-element`]||[],textFormat:t[`text-format`]||[],textMatch:t[`text-match`]||[]}}var VI=/[!-/:-@[-`{-~\s]/,HI=/\s/,UI=/[!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~]/,OSe=/^\s{0,3}$/;function WI(e){if(!DE(e))return!1;let t=e.getFirstChild();return t==null||e.getChildrenSize()===1&&aE(t)&&OSe.test(t.getTextContent())}function GI(e){return e.replace(/\\([!-/:-@[-`{-~])|&#(?:(\d{1,7})|[xX]([\da-fA-F]{1,6}));/g,(e,t,n,r)=>t??function(e,t){let n=e===void 0?parseInt(t,16):Number(e);return n===0||n>=55296&&n<=57343||n>1114111?`�`:String.fromCodePoint(n)}(n,r))}function KI(e,t){let n=0;for(let r=t-1;r>=0&&e[r]===`\\`;r--)n++;return n%2==1}function qI(e){let t=t=>{let n=0;for(let r=t-1;r>=0&&e[r]===`\\`;r--)n++;return n%2==1},n=[],r=0;for(;r<e.length;)if(e[r]==="`"){let t=1;for(;r+t<e.length&&e[r+t]==="`";)t++;n.push({index:r,length:t}),r+=t}else r++;let i=[],a=0;for(;a<n.length;){let r=n[a];if(t(r.index)){a++;continue}let o=-1;for(let e=a+1;e<n.length;e++)if(n[e].length===r.length){o=e;break}if(o===-1){a++;continue}let s=n[o],c=e.slice(r.index+r.length,s.index);c.length>=2&&c.startsWith(` `)&&c.endsWith(` `)&&/[^ ]/.test(c)&&(c=c.slice(1,-1)),i.push({content:c,endIndex:s.index+s.length,startIndex:r.index}),a=o+1}return i}function JI(e,t,n,r,i){if(!YI(t,n,r,i))return!1;if(e===`*`)return!0;if(e===`_`){if(!YI(t,n,r,!i))return!0;let e=i?t[n-1]:t[n+r];return e!==void 0&&UI.test(e)}return!0}function YI(e,t,n,r){let i=e[t-1],a=e[t+n],[o,s]=r?[a,i]:[i,a];return o!==void 0&&!HI.test(o)&&(!UI.test(o)||s===void 0||HI.test(s)||UI.test(s))}var XI=/^(\s*)(\d{1,})\.\s/,ZI=/^(\s*)[-*+]\s/,kSe=/^(\s*)(?:[-*+]\s)?\s?(\[(\s|x)?\])\s/i,QI=/^(#{1,6})\s/,$I=/^>\s/,eL=/^([ \t]*`{3,})([\w-]+)?[ \t]?/,tL=/^[ \t]*`{3,}$/,ASe=/^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/,jSe=/^(?:\|)(.+)(?:\|)\s?$/;function MSe(e){if(e[0]!==`|`)return!1;let{length:t}=e,n=1,r=0;for(;n<t;){let t=n;for(e[t]===` `&&t++,e[t]===`:`&&t++;e[t]===`-`;)t++;if(e[t]===`:`&&t++,e[t]===` `&&t++,e[t]!==`|`)break;r++,n=t+1}return r>0&&(n===t||n===t-1&&/\s/.test(e[n]))}var nL=/^<[a-z_][\w-]*(?:\s[^<>]*)?\/?>/i,rL=/^<\/[a-z_][\w-]*\s*>/i,iL=e=>RegExp(`(?:${e.source})$`,e.flags),aL=Jw(`mdListMarker`,{parse:e=>typeof e==`string`&&/^[-*+]$/.test(e)?e:`-`,resetOnCopyNode:!0}),oL=Jw(`mdCodeFence`,{parse:e=>typeof e==`string`&&/^`{3,}$/.test(e)?e:"```",resetOnCopyNode:!0}),sL=Jw(`mdCodeMeta`,{parse:e=>typeof e==`string`?e:``,resetOnCopyNode:!0}),cL=Jw(`mdHardLineBreak`,{parse:e=>typeof e==`string`&&/^(\\| {2,})$/.test(e)?e:``,resetOnCopyNode:!0});function lL(e){if(e.endsWith(`\\`)){let t=0;for(let n=e.length-1;n>=0&&e[n]===`\\`;n--)t++;return t%2==1?[e.slice(0,-1),`\\`]:null}let t=e.match(/^(.*?\S)( {2,})$/);return t?[t[1],t[2]]:null}function uL(e){let t=ek(),n=function(e){let t=e.getChildren(),n=t.length-1,r=t[n];if(!aE(r))return null;let i=r.getTextContent(),a=lL(i);if(a!==null){let[e,t]=a;return r.setTextContent(e),t}return/^ {2,}$/.test(i)&&function(e,t){for(let n=t-1;n>=0;n--){if(tk(e[n]))return!1;if(/\S/.test(e[n].getTextContent()))return!0}return!1}(t,n)?(r.setTextContent(``),i):null}(e);return n!==null&&Xw(t,cL,n),t}function dL(e){return yI(e)}function fL(e,t){let n=0;for(;n<t&&(e[n]===` `||e[n]===` `);)n++;return e.slice(n)}function NSe(e,t){let n=e.getLastChild();t&&UP(n)&&Xw(n,sL,t)}var pL=e=>(t,n,r,i)=>{let a=e(r);a.append(...n),t.replace(a),i||a.select(0,0)};function mL(e){let t=0;for(let n of e)t+=n===` `?4-t%4:1;return t}var hL=null,gL=!1,_L=e=>(t,n,r,i)=>{if(wI(t)||!i&&dL(t))return!1;let a=t.getPreviousSibling(),o=t.getNextSibling(),s=HF(e===`check`?/^x$/i.test(r[3]||``):void 0),c=r[0].trim()[0],l=e!==`bullet`&&e!==`check`||c!==aL.parse(c)?void 0:c,u=hL,d=a;if(u!==null){if(gL)for(;d!==null&&WI(d);)d=d.getPreviousSibling();RF(d)||(u.length=0)}let f=u===null||u.length===0?function(e){let t=e.match(/\t/g),n=e.match(/ /g),r=0;return t&&(r+=t.length),n&&(r+=Math.floor(n.length/4)),r}(r[1]):function(e,t){let n=mL(t);for(let t=e.length-1;t>=0;t--)if(n>=e[t])return t+1;return 0}(u,r[1]);if(RF(o)&&o.getListType()===e){let n=o.getFirstChild();n===null?o.append(s):n.insertBefore(s),e===`number`&&f===0&&o.setStart(Number(r[2])),t.remove()}else if(RF(d)&&(d.getListType()===e||f>0))d.append(s),t.remove();else{let n=LF(e,e===`number`?Number(r[2]):void 0);n.append(s),t.replace(n)}s.append(...n),i||s.select(0,0),f&&(s.setIndent(f),function(e,t,n){let r=e.getParent();if(!RF(r)||r.getListType()===t)return;let i=r.getParent();if(!UF(i))return;let a=LF(t,t===`number`?Number(n[2]):void 0),o=e.getPreviousSibling()===null;a.append(e);let s=HF();s.append(a),o?i.insertBefore(s):i.insertAfter(s),r.getChildrenSize()===0&&i.remove()}(s,e,r));let p=s.getParent();l&&RF(p)&&Xw(p,aL,l),u!==null&&function(e,t,n,r){for(let n=e.length;n<t;n++)e[n]=4*(n+1);e.length=t,e[t]=function(e,t){let n=e[0];if(t===`check`){let t=n.slice(e[1].length).match(/^[-*+]\s/);t&&(n=e[1]+t[0])}return Math.min(mL(n),mL(e[1])+4)}(n,r)}(u,f,r,e)},vL=(e,t,n,r)=>{let i=[],a=e.getChildren(),o=0;for(let s of a)if(UF(s)){if(s.getChildrenSize()===1){let e=s.getFirstChild();if(RF(e)){let a=vL(e,t,n+1,r);a&&i.push(a);continue}}if(r&&!s.getChildren().some(e=>e.isSelected(r)))continue;let a=` `.repeat(4*n),c=e.getListType(),l=Yw(e,aL),u=c===`number`?`${e.getStart()+o}. `:c===`check`?`${l} [${s.getChecked()?`x`:` `}] `:l+` `,d=t(s);c!==`number`&&(d=d.replace(/^(\s{0,3}\d+)(\.\s)/,`$1\\$2`)),i.push(a+u+d),o++}return i.join(`
`)},PSe=pL(e=>CI(`h`+e[1].length)),yL={dependencies:[bI],export:(e,t)=>{if(!wI(e))return null;let n=Number(e.getTag().slice(1));return`#`.repeat(n)+` `+t(e)},regExp:QI,replace:(e,t,n,r)=>!(!r&&dL(e))&&PSe(e,t,n,r),triggerOnEnter:!0,type:`element`},bL={dependencies:[_I],export:(e,t)=>{if(!yI(e))return null;let n=t(e).split(`
`),r=[];for(let e of n)r.push(`> `+e);return r.join(`
`)},regExp:$I,replace:(e,t,n,r)=>{if(r){let n=e.getPreviousSibling();if(yI(n))return n.splice(n.getChildrenSize(),0,[uL(n),...t]),void e.remove()}let i=vI();i.append(...t),e.replace(i),r||i.select(0,0)},triggerOnEnter:!0,type:`element`},xL={dependencies:[VP],export:e=>{if(!UP(e))return null;let t=e.getTextContent(),n=Yw(e,oL);if(t.indexOf(n)>-1){let e=t.match(/`{3,}/g);if(e){let t=Math.max(...e.map(e=>e.length));n="`".repeat(t+1)}}let r=e.getLanguage()||``,i=r?Yw(e,sL):``;return n+r+(i?` `+i:``)+(t?`
`+t:``)+`
`+n},handleImportAfterStartMatch:({lines:e,rootNode:t,startLineIndex:n,startMatch:r})=>{let i=r[1],a=i.trim().length,o=e[n],s=r.index+i.length,c=o.slice(s),l=RegExp(`\`{${a},}$`);if(l.test(c)){let e=c.match(l),i=c.slice(0,c.lastIndexOf(e[0])),a=[...r];return a[2]=``,xL.replace(t,null,a,e,[i],!0),[!0,n]}let u=RegExp(`^[ \\t]*\`{${a},}$`);for(let i=n+1;i<e.length;i++){let a=e[i];if(u.test(a)){let s=a.match(u),c=e.slice(n+1,i),l=r[2]?o.slice(r[0].length).trim():``;return c.unshift(l?``:o.slice(r[0].length)),xL.replace(t,null,r,s,c,!0),NSe(t,l),[!0,i]}}let d=e.slice(n+1);return d.unshift(o.slice(r[0].length)),xL.replace(t,null,r,null,d,!0),[!0,e.length-1]},regExpEnd:{optional:!0,regExp:tL},regExpStart:eL,replace:(e,t,n,r,i,a)=>{let o,s,c=n[1]?n[1].trim():"```",l=n[2]||void 0,u=n[1]?n[1].length-n[1].trimStart().length:0;if(!t&&i){if(i.length===1)r?(o=HP(l),s=fL(i[0],u)):(o=HP(l),s=i[0].startsWith(` `)?i[0].slice(1):i[0]);else{for(o=HP(l),i.length>0&&(i[0].trim().length===0?i.shift():i[0].startsWith(` `)&&(i[0]=i[0].slice(1)));i.length>0&&!i[i.length-1].length;)i.pop();s=i.map(e=>fL(e,u)).join(`
`)}Xw(o,oL,c);let t=iE(s);o.append(t),e.append(o)}else if(t){if(!a&&dL(e))return!1;pL(e=>HP(e?e[2]:void 0))(e,t,n,a)}},type:`multiline-element`},SL={dependencies:[PF,zF],export:(e,t,n)=>RF(e)?vL(e,t,0,n):null,regExp:ZI,replace:_L(`bullet`),triggerOnEnter:!0,type:`element`},CL={dependencies:[PF,zF],export:(e,t,n)=>RF(e)?vL(e,t,0,n):null,regExp:XI,replace:_L(`number`),triggerOnEnter:!0,type:`element`},wL={format:[`code`],tag:"`",type:`text-format`},FSe={format:[`highlight`],tag:`==`,type:`text-format`},TL={format:[`bold`,`italic`],tag:`***`,type:`text-format`},EL={format:[`bold`,`italic`],intraword:!1,tag:`___`,type:`text-format`},DL={format:[`bold`],tag:`**`,type:`text-format`},OL={format:[`bold`],intraword:!1,tag:`__`,type:`text-format`},kL={format:[`strikethrough`],tag:`~~`,type:`text-format`},AL={format:[`italic`],tag:`*`,type:`text-format`},jL={format:[`italic`],intraword:!1,tag:`_`,type:`text-format`};function ML(e){return e.replace(/&(?=#\d+;|#[Xx][\dA-Fa-f]+;|[A-Za-z][\dA-Za-z]*;)/g,`&#38;`)}var NL={dependencies:[hF],export:(e,t,n)=>{if(!_F(e)||vF(e))return null;let r=t(e),i=e.getTitle();i!=null&&(i=ML(i).replace(/([\\"])/g,`\\$1`));let a=e.getURL(),o=ML(a),s=a===``||/\s/.test(a)?`<${o.replace(/([\\<>])/g,`\\$1`).replace(/\r/g,`&#13;`).replace(/\n/g,`&#10;`)}>`:o.replace(/([\\()])/g,`\\$1`).replace(/^</,`\\<`);return i?`[${r}](${s} "${i}")`:`[${r}](${s})`},importRegExp:/(?:\[(.+?)\])(?:\(\s*(?:(?:<((?:\\.|[^<>\n\\])*)>|((?!<)(?:\\[^\s]|\\(?=\s)|\((?:\\[^\s]|[^\s()\\]|\((?:\\[^\s]|[^\s()\\]|\((?:\\[^\s]|[^\s()\\])*\))*\))*\)|[^\s()\\])+))(?:\s+(?:"((?:[^"]*\\")*[^"]*)"|'((?:[^']*\\')*[^']*)'|\(((?:\\.|[^()\\])*)\)))?\s*)?\))/,regExp:/(?:\[([^[\]]*(?:\[[^[\]]*\][^[\]]*)*)\])(?:\(\s*(?:(?:<((?:\\.|[^<>\n\\])*)>|((?!<)(?:\\[^\s]|\\(?=\s)|\((?:\\[^\s]|[^\s()\\]|\((?:\\[^\s]|[^\s()\\]|\((?:\\[^\s]|[^\s()\\])*\))*\))*\)|[^\s()\\])+))(?:\s+(?:"((?:[^"]*\\")*[^"]*)"|'((?:[^']*\\')*[^']*)'|\(((?:\\.|[^()\\])*)\)))?\s*)?\))$/,replace:(e,t)=>{let n=t.input||``,r=t.index||0;if(GO(e,_F)||KI(n,r)||KI(n,r+t[1].length+1))return;let[,i,a,o,s,c,l]=t,u=GI(a??o??``),d=s??c??l,f=gF(u,{title:d==null?void 0:GI(d)}),p=function(e){let t=qI(e),n=0,r=e.replace(/\\.|[[\]]/g,(e,r)=>{for(;n<t.length&&r>=t[n].endIndex;)n++;return n<t.length&&r>=t[n].startIndex||e[0]===`\\`?` `.repeat(e.length):e}),i=[],a=!1;for(let e=0;e<r.length;e++){let t=r[e];t===`[`?i.push(e):t===`]`&&i.pop()===void 0&&(a=!0)}return i.pop()??(a?null:-1)}(i);if(p===null)return;let m=i,h=``;p!==-1&&(h=`[`+function(e){let t=``,n=0;for(let{startIndex:r,endIndex:i}of qI(e))t+=GI(e.slice(n,r))+e.slice(r,i),n=i;return t+GI(e.slice(n))}(i.slice(0,p)),m=i.slice(p+1));let g=e.getFormat(),_=iE(m);return _.setFormat(g),f.append(_),e.replace(f),h&&f.insertBefore(iE(h).setFormat(g)),_},trigger:`)`,type:`text-match`},ISe=[yL,bL,SL,CL],LSe=[xL],RSe=[wL,TL,EL,DL,OL,FSe,AL,jL,kL],zSe=[NL];function BSe(...e){return e.flat()}var PL=BSe(ISe,LSe,RSe,zSe);function FL(e,t=!1){let n=e.split(`
`),r=0,i=[];for(let e=0;e<n.length;e++){let a=n[e],o=a.trimEnd(),s=i[i.length-1],c=e<n.length-1?lL(a):null,l=s!==void 0&&lL(s)!==null;if(ASe.test(o))i.push(o);else if(r===0){{let e=o.match(eL);if(e){r=e[1].trim().length,i.push(o);continue}}o===``||s===``||!s||QI.test(s)||QI.test(o)||$I.test(o)||XI.test(o)||ZI.test(o)||kSe.test(o)||jSe.test(o)||MSe(o)||l||!t||nL.test(o)||rL.test(o)||iL(rL).test(s)||iL(nL).test(s)||tL.test(s)?i.push(!t&&o!==``||c!==null?a:o):i[i.length-1]=s+` `+(c===null?o:a).trimStart()}else{if(tL.test(o)&&o.trim().length>=r){r=0,i.push(o);continue}i.push(a)}}return i.join(`
`)}function VSe(e,t,n,r,i){for(let a of t){if(!a.export)continue;let t=a.export(e,e=>IL(e,n,r,void 0,void 0,i));if(t!=null)return t}return Z(e)?IL(e,n,r,void 0,void 0,i):VT(e)?e.getTextContent():null}function IL(e,t,n,r,i,a=!1){let o=[],s=e.getChildren();r||=[],i||=[];t:for(let e of s){for(let s of n){if(!s.export)continue;let c=s.export(e,e=>IL(e,t,n,r,[...i,...r],a),(e,n)=>LL(e,n,t,r,i,a));if(c!=null){o.push(c);continue t}}tk(e)?o.push(HSe(e)):aE(e)?o.push(LL(e,e.getTextContent(),t,r,i,a)):Z(e)?o.push(IL(e,t,n,r,i,a)):VT(e)&&o.push(e.getTextContent())}return o.join(``)}function HSe(e){return Yw(e,cL)+`
`}function LL(e,t,n,r,i,a=!1){let o=e.hasFormat(`code`),s,c,l,u,d=t;if(o||(d=a?d.replace(/([*_`~])/g,`\\$1`):d.replace(/([[\]*_`~\\]|<(?=\S|$)|&(?=#|$))/g,e=>/[*_`~\\]/.test(e)?`\\${e}`:`&#${e.charCodeAt(0)};`)),o){let{fence:e,padded:n}=function(e){let t=e.match(/`+/g),n=t?Math.max(...t.map(e=>e.length)):0;return{fence:"`".repeat(n+1),padded:e.length===0||e.includes("`")||/^\s/.test(e)&&/\s$/.test(e)?` ${e} `:e}}(t);s=``,l=``,c=e+n+e,u=!1}else{let e=d.match(/^(\s*)(.*?)(\s*)$/s)||[``,``,d,``];s=e[1],c=e[2],l=e[3],u=c===``}let f=``,p=``,m=``,h=RL(e,!0),g=RL(e,!1),_=new Set;for(let t of n){let n=t.format[0],i=t.tag;n!==`code`&&(u||!BL(e,n)||_.has(n)||(_.add(n),BL(h,n)&&r.find(e=>e.tag===i)||(r.push({format:n,tag:i}),f+=i)))}for(let t=0;t<r.length;t++){let n=zL(e,r[t].format),a=zL(g,r[t].format);if(n&&a)continue;let o=[...r];for(;o.length>t;){let e=o.pop();i&&e&&i.find(t=>t.tag===e.tag)||(e&&typeof e.tag==`string`&&(n?a||(m+=e.tag):p+=e.tag),r.pop())}break}return u&&!e.hasFormat(`code`)?p+d:p+s+f+c+m+l}function RL(e,t){let n=t?e.getPreviousSibling():e.getNextSibling();return aE(n)?n:null}function zL(e,t){return aE(e)&&e.hasFormat(t)}function BL(e,t){return!(!zL(e,t)||t!==`code`&&e&&/^\s*$/.test(e.getTextContent()))}function USe(e,t){let n=new RegExp(t.source,t.flags.replace(/[gy]/g,``)+`g`),r;for(;(r=n.exec(e))!==null;){if(!KI(e,r.index))return r;n.lastIndex=r.index+1}return null}function VL(e){return aE(e)&&!e.hasFormat(`code`)}function HL(e,t,n){let r=function(e,t){let n=e.getTextContent(),r=t.transformersByTag["`"],i=[],a=null;if(r){let e=qI(n);for(let t of e)a||={content:t.content,endIndex:t.endIndex,startIndex:t.startIndex,tag:"`"},i.push({end:t.endIndex,start:t.startIndex})}let o=function(e,t,n=[]){let r=[],i=new Set(Object.keys(t.transformersByTag).filter(e=>e[0]!=="`").map(e=>e[0])),a=t=>{let n=0;for(let r=t-1;r>=0&&e[r]===`\\`;r--)n++;return n%2==1},o=e=>n.some(t=>e>=t.start&&e<t.end),s=0;for(;s<e.length;){let t=e[s];if(!i.has(t)||a(s)||o(s)){s++;continue}let n=1;for(;s+n<e.length&&e[s+n]===t;)n++;let c=JI(t,e,s,n,!0),l=JI(t,e,s,n,!1);(c||l)&&r.push({active:!0,canClose:l,canOpen:c,char:t,index:s,length:n}),s+=n}return r}(n,t,i),s=o.length>0?function(e,t,n){let r={},i=0,a=null;for(;i<t.length;){let o=t[i];if(!o.active||!o.canClose||o.length===0){i++;continue}let s=`${o.char}${o.canOpen}${o.length%3}`,c=r[s]??-1,l=!1;for(let r=i-1;r>c;r--){let s=t[r];if(!s.active||!s.canOpen||s.length===0||s.char!==o.char||(s.canClose||o.canOpen)&&(s.length+o.length)%3==0&&s.length%3!=0&&o.length%3!=0)continue;let c=Math.min(s.length,o.length),u=Object.keys(n.transformersByTag).filter(e=>e[0]===s.char&&e.length<=c).sort((e,t)=>t.length-e.length)[0];if(!u)continue;l=!0;let d=u.length,f={content:e.slice(s.index+s.length,o.index),endIndex:o.index+d,startIndex:s.index+(s.length-d),tag:u};(!a||f.startIndex<a.startIndex||f.startIndex===a.startIndex&&f.endIndex>a.endIndex)&&(a=f);for(let e=r+1;e<i;e++)t[e].active=!1;s.length-=d,o.length-=d,s.active=s.length>0,o.length>0?o.index+=d:(o.active=!1,i++);break}l||(r[s]=i-1,o.canOpen||(o.active=!1),i++)}return a}(n,o,t):null,c=null,l=null;if(a&&s?s.startIndex<=a.startIndex&&s.endIndex>=a.endIndex?(c=s,l=t.transformersByTag[s.tag]):(c=a,l=r):a?(c=a,l=r):s&&(c=s,l=t.transformersByTag[s.tag]),!c||!l)return null;let u=[n.slice(c.startIndex,c.endIndex),c.tag,c.content];return u.index=c.startIndex,u.input=n,{endIndex:c.endIndex,isCodeSpan:l===r,match:u,startIndex:c.startIndex,transformer:l}}(e,t),i=function(e,t){let n=e,r,i,a,o;for(let e of t){if(!e.replace||!e.importRegExp)continue;let t=n.getTextContent(),s=NL.importRegExp!==void 0&&e.importRegExp.source===NL.importRegExp.source?USe(t,e.importRegExp):t.match(e.importRegExp);if(!s)continue;let c=s.index||0,l=e.getEndIndex?e.getEndIndex(n,s):c+s[0].length;!1!==l&&(r===void 0||i===void 0||c<r&&(l>i||l<=r))&&(r=c,i=l,a=e,o=s)}return r===void 0||i===void 0||a===void 0||o===void 0?null:{endIndex:i,match:o,startIndex:r,transformer:a}}(e,n);if(r&&i&&(r.isCodeSpan?i.startIndex<=r.startIndex&&i.endIndex>=r.endIndex?r=null:i=null:r.startIndex<=i.startIndex&&r.endIndex>=i.endIndex||i.startIndex>r.endIndex?i=null:r=null),r){let i=function(e,t,n,r,i){let a=e.getTextContent(),o,s,c;if(i[0]===a?o=e:t===0?[o,s]=e.splitText(n):[c,o,s]=e.splitText(t,n),o.setTextContent(i[2]),r)for(let e of r.format)o.hasFormat(e)||o.toggleFormat(e);return{nodeAfter:s,nodeBefore:c,transformedNode:o}}(e,r.startIndex,r.endIndex,r.transformer,r.match);VL(i.nodeAfter)&&HL(i.nodeAfter,t,n),VL(i.nodeBefore)&&HL(i.nodeBefore,t,n),VL(i.transformedNode)&&HL(i.transformedNode,t,n)}else if(i){let r=function(e,t,n,r,i){let a,o,s;return t===0?[a,o]=e.splitText(n):[s,a,o]=e.splitText(t,n),r.replace?{matchedNode:a,nodeAfter:o,nodeBefore:s,transformedNode:r.replace(a,i)||void 0}:null}(e,i.startIndex,i.endIndex,i.transformer,i.match);if(!r)return;VL(r.nodeAfter)&&HL(r.nodeAfter,t,n),VL(r.nodeBefore)&&HL(r.nodeBefore,t,n),VL(r.transformedNode)?HL(r.transformedNode,t,n):r.transformedNode===void 0&&VL(r.matchedNode)&&r.matchedNode.getParent()!==null&&r.matchedNode.setTextContent(GI(r.matchedNode.getTextContent()))}if(!r&&!i){let t=GI(e.getTextContent());e.setTextContent(t)}}function UL(e,t,n,r=!1){let i=BI(n),a=function(e){let t={},n={},r=[];for(let i of e){let{tag:e}=i;t[e]=i;let a=e.replace(/(\*|\^|\+)/g,`\\$1`);r.push(a),n[e]=e.length===1?RegExp(e==="`"?"(^|[^\\\\`])(`)((?:\\\\`|[^`])+?)(`)(?!`)":`(^|[^\\\\${a}])(${a})((\\\\${a})?.*?[^${a}\\s](\\\\${a})?)(${a})(?![\\\\${a}])`):RegExp(`(^|[^\\\\])(${a})((\\\\${a})?.*?[^\\s](\\\\${a})?)(${a})(?!\\\\)`)}return{fullMatchRegExpByTag:n,openTagsRegExp:RegExp(`(${r.join(`|`)})`,`g`),transformersByTag:t}}(i.textFormat),o=e.split(`
`),s=o.length;(function(e){let n=hL,c=gL;hL=[],gL=e;try{return(()=>{for(let e=0;e<s;e++){let n=o[e],[s,c]=WSe(o,e,i.multilineElement,t);s?e=c:GSe(n,t,i.element,a,i.textMatch,r)}})()}finally{hL=n,gL=c}})(!r);let c=t.getChildren();for(let e of c)if(!r&&WI(e)&&t.getChildrenSize()>1)e.remove();else if(Z(e))for(let t of e.getAllTextNodes())KSe(t)}function WSe(e,t,n,r){for(let i of n){let{handleImportAfterStartMatch:n,regExpEnd:a,regExpStart:o,replace:s}=i,c=e[t].match(o);if(!c)continue;if(n){let a=n({lines:e,rootNode:r,startLineIndex:t,startMatch:c,transformer:i});if(a===null)continue;if(a)return a}let l=typeof a==`object`&&`regExp`in a?a.regExp:a,u=a&&typeof a==`object`&&`optional`in a?a.optional:!a,d=t,f=e.length;for(;d<f;){let n=l?e[d].match(l):null;if(!n&&(!u||u&&d<f-1)||n&&t===d&&n.index===c.index){d++;continue}let i=[];if(n&&t===d)i.push(e[t].slice(c[0].length,-n[0].length));else for(let r=t;r<=d;r++)if(r===t){let t=e[r].slice(c[0].length);i.push(t)}else if(r===d&&n){let t=e[r].slice(0,-n[0].length);i.push(t)}else i.push(e[r]);if(!1!==s(r,null,c,n,i,!0))return[!0,d];break}}return[!1,t]}function GSe(e,t,n,r,i,a){let o=iE(e),s=EE();s.append(o),t.append(s);for(let{regExp:t,replace:r}of n){let n=e.match(t);if(n&&(o.setTextContent(e.slice(n[0].length)),!1!==r(s,[o],n,!0)))break}if(HL(o,r,i),s.getParent()!==null&&e.length>0){let e=s.getPreviousSibling();if(!a&&(DE(e)||yI(e)||RF(e))){let t=e;if(RF(e)){let n=e.getLastDescendant();t=n==null?null:GO(n,UF)}t!=null&&t.getTextContentSize()>0&&(t.splice(t.getChildrenSize(),0,[uL(t),...s.getChildren()]),s.remove())}}}function KSe(e){if(AE(e))return;let t=e.getTextContent();if(!t.includes(` `))return;let n=e.getFormat(),r=e.getStyle(),i=[],a=0;for(let e=t.indexOf(` `);e!==-1;e=t.indexOf(` `,e+1))e>a&&i.push(iE(t.slice(a,e)).setFormat(n).setStyle(r)),i.push(kE()),a=e+1;a<t.length&&i.push(iE(t.slice(a)).setFormat(n).setStyle(r)),e.getParentOrThrow().splice(e.getIndexWithinParent(),1,i)}function qSe(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}function WL(e,t,n,r,i){if(!BD(e.getParent())||e.getFirstChild()!==t)return!1;let a=t.getTextContent();if(!i&&a[n-1]!==` `)return!1;for(let{regExp:o,replace:s}of r){let r=a.match(o),c=i||r&&r[0].endsWith(` `)?n:n-1;if(r&&r[0].length===c){let i=t.getNextSiblings(),[a,o]=t.splitText(n);if(!1!==s(e,o?[o,...i]:i,r,!1))return a.remove(),!0}}return!1}function GL(e,t,n,r,i){if(!BD(e.getParent())||e.getFirstChild()!==t)return!1;let a=t.getTextContent();if(!i&&a[n-1]!==` `)return!1;for(let{regExpStart:o,replace:s,regExpEnd:c}of r){if(c&&!(`optional`in c)||c&&`optional`in c&&!c.optional)continue;let r=a.match(o);if(r){let a=i||r[0].endsWith(` `)?n:n-1;if(r[0].length!==a)continue;let o=t.getNextSiblings(),[c,l]=t.splitText(n);if(!1!==s(e,l?[l,...o]:o,r,null,null,!1))return c.remove(),!0}}return!1}function JSe(e,t){let n=0,r=e.getTextContent();for(let e=0;e<t;e++)r[e]==="`"&&n++;return n%2!=0}function KL(e,t,n){let r=n.length;for(let i=t;i>=r;i--){let t=i-r;if(JL(e,t,n,0,r)&&e[t+r]!==` `)return t}return-1}function qL(e){let t=e.getNode(),n=0;if(aE(t))n=e.offset;else if(Z(t))for(let r of t.getChildren().slice(0,e.offset))n+=r.getTextContentSize();for(let e=t.getPreviousSibling();e!==null;e=e.getPreviousSibling())n+=e.getTextContentSize();return n}function JL(e,t,n,r,i){for(let a=0;a<i;a++)if(e[t+a]!==n[r+a])return!1;return!0}function YSe(e,t=PL){let n=BI(t),r=n.element.filter(e=>e.triggerOnEnter),i=zI(n.textFormat,({tag:e})=>e[e.length-1]),a=zI(n.textMatch,({trigger:e})=>e),o=new Set([` `]);for(let e of n.textFormat)o.add(e.tag.slice(-1));for(let e of n.textMatch)e.trigger!==void 0&&o.add(e.trigger);for(let n of t){let t=n.type;if(t===`element`||t===`text-match`||t===`multiline-element`){let t=n.dependencies;for(let n of t)e.hasNode(n)||qSe(173,n.getType())}}return Hk(e.registerUpdateListener(({tags:t,dirtyLeaves:r,editorState:s,prevEditorState:c})=>{if(t.has(`collaboration`)||t.has(`historic`)||e.isComposing())return;let l=t.has(`composition-end`),u=s.read($),d=c.read($);if(!Q(d)||!Q(u)||!u.isCollapsed()||u.is(d)&&!l)return;let f=u.anchor.key,p=u.anchor.offset,m=s._nodeMap.get(f);if(aE(m)&&r.has(f)&&(l||p===1||!(s.read(()=>qL(u.anchor))>c.read(()=>qL(d.anchor))+1))){if(l){let e=s.read(()=>m.getTextContent())[p-1];if(!o.has(e))return}e.update(()=>{if(!VL(m))return;let e=m.getParent();e===null||UP(e)||((e,t,r)=>!!(WL(e,t,r,n.element)||GL(e,t,r,n.multilineElement)||function(e,t,n){let r=e.getTextContent(),i=n[r[t-1]];if(i==null)return!1;t<r.length&&(r=r.slice(0,t));for(let t of i){if(!t.replace||!t.regExp)continue;let n=r.match(t.regExp);if(n===null)continue;let i=n.index||0,a=i+n[0].length,o;return i===0?[o]=e.splitText(a):[,o]=e.splitText(i,a),o.selectNext(0,0),t.replace(o,n),!0}return!1}(t,r,a)||function(e,t,n){let r=e.getTextContent(),i=t-1,a=r[i],o=n[a];if(!o)return!1;for(let t of o){let{tag:n}=t,o=n.length,s=i-o+1;if(o>1&&!JL(r,s,n,0,o)||r[s-1]===` `)continue;let c=r[i+1];if(!1===t.intraword&&c&&!VI.test(c))continue;let l=e,u=l,d=KL(r,s,n),f=u;for(;d<0&&(f=f.getPreviousSibling())&&!tk(f);)if(aE(f)){if(f.hasFormat(`code`))continue;let e=f.getTextContent();u=f,d=KL(e,e.length,n)}if(d<0||u===l&&d+o===s)continue;let p=u.getTextContent();if(d>0&&p[d-1]===a)continue;let m=p[d-1];if(!1===t.intraword&&m&&!VI.test(m)||!t.format.includes(`code`)&&JSe(u,d))continue;let h=l.getTextContent(),g=h.slice(0,s)+h.slice(i+1);l.setTextContent(g);let _=u===l?g:p;u.setTextContent(_.slice(0,d)+_.slice(d+o));let v=$(),y=ZA();cD(y);let b=i-o*(u===l?2:1)+1;y.anchor.set(u.__key,d,`text`),y.focus.set(l.__key,b,`text`);for(let e of t.format)y.formatText(e,AC[e]);y.anchor.set(y.focus.key,y.focus.offset,y.focus.type);for(let e of t.format)y.hasFormat(e)&&y.toggleFormat(e);return Q(v)&&(y.format=v.format),!0}return!1}(t,r,i)))(e,m,u.anchor.offset)&&MD(`history-push`)})}}),e.registerCommand(tw,e=>{if(e!==null&&e.shiftKey)return!1;let t=$();if(!Q(t)||!t.isCollapsed())return!1;let i=t.anchor.offset,a=t.anchor.getNode();if(!aE(a)||!VL(a))return!1;let o=a.getParent();return o!==null&&!UP(o)&&!(i!==a.getTextContent().length||!GL(o,a,i,n.multilineElement,!0)&&!WL(o,a,i,r,!0)||(e!==null&&e.preventDefault(),0))},1))}function YL(e,t=PL,n,r=!1,i=!1){let a=r?e:FL(e,i),o=n||oD();o.clear(),UL(a,o,t,r),$()!==null&&o.selectStart()}function XSe(e,t=PL,n=!1,r=!1){let i=n?e:FL(e,r),a=new QO;return UL(i,a,t,n),a.getChildren()}function XL(e=PL,t,n=!1){return function(e,t=!1){let n=BI(e),r=[...n.multilineElement,...n.element],i=!t,a=n.textFormat.filter(e=>e.format.length===1).sort((e,t)=>Number(e.format.includes(`code`))-Number(t.format.includes(`code`)));return e=>{let o=[],s=(e||oD()).getChildren();for(let e=0;e<s.length;e++){let c=s[e],l=VSe(c,r,a,n.textMatch,t);l!=null&&o.push(i&&e>0&&!WI(c)&&!WI(s[e-1])?`
${l}`:l)}return o.join(`
`)}}(e,n)(t)}var ZSe=/^([ \t]*`{3,})[ \t]*([\w-]+)?[ \t]*/,ZL={...xL,export:(e,t)=>{let n=xL.export?.(e,t)??null,[r]=n?.split(`
`,1)??[];if(!n||!r.includes(``))return n;let i=n.slice(r.length,n.lastIndexOf(`
`)),a=Math.max(2,...(i.match(/^[ \t]*~+/gm)??[]).map(e=>e.trim().length)),o=`~`.repeat(a+1);return`${r.replace(/^`+/,o).replaceAll(``,"`")}${i}\n${o}`},handleImportAfterStartMatch:({lines:e,startLineIndex:t,...n})=>{let r=e[t].match(ZSe),i=r[1].trim(),a=RegExp(`^[ \\t]*\`{${i.length},}$`),o=e.slice(t+1).some(e=>a.test(e)),s=xL.handleImportAfterStartMatch?.({...n,lines:o?e:[...e,i],startLineIndex:t,startMatch:r});return s&&[s[0],Math.min(s[1],e.length-1)]},regExpStart:RegExp(`${xL.regExpStart.source}(?=[^\`]*$)`)},QL=e=>aE(e)&&e.hasFormat(`code`)&&/^\s+$/.test(e.getTextContent()),$L=e=>{let t=e.getPreviousSibling(),n=e.getNextSibling();if(![e,t,n].some(QL))return e;let r=e=>QL(e)?Object.create(e,{getTextContent:{value:()=>``}}):e;return Object.create(r(e),{getPreviousSibling:{value:()=>r(t)},getNextSibling:{value:()=>r(n)}})},eR=e=>{if(!DE(e))return!1;let t=e.getFirstChild();return!t||e.getChildrenSize()===1&&aE(t)&&/^\s{0,3}$/.test(t.getTextContent())},QSe=e=>{let t=e.getParent();if(!eR(t)||!WT(t?.getParent()))return[``,``];let n=t?.getPreviousSibling()??null,r=t?.getNextSibling()??null;return[n&&!eR(n)?`
`:``,r&&!(e=>{let t=e?.getFirstChild();return eR(e)&&!(aE(t)&&t.hasFormat(`code`))})(r)?`
`:``]},tR={dependencies:[],export:(e,t,n)=>{if(!aE(e)||!e.hasFormat(`code`))return null;let r=e.getTextContent(),i=$L(e),[a,o]=QL(e)?QSe(e):[``,``],s=!r.includes("`")&&/^\s/.test(r)&&/\s$/.test(r)&&!(r.startsWith(` `)&&r.endsWith(` `)&&/[^ ]/.test(r));if(!s&&i===e&&!a&&!o)return null;let c=n(i,r);return`${a}${s?c.replace(`\` ${r} \``,()=>`\`${r}\``):c}${o}`},importRegExp:/^(`+)(?!`)([^]*?[^`])\1(?!`)/,regExp:/(?!)/,replace:(e,[,,t])=>{let n=iE(/^ .*[^ ].* $/s.test(t)?t.slice(1,-1):t).setFormat(e.getFormat()).setStyle(e.getStyle()).toggleFormat(`code`);return e.replace(n),n},type:`text-match`},nR={bold:[`**`,`__`],italic:[`_`,`*`],strikethrough:[`~~`]},$Se=/^(?:\*\*|__|~~|\*|_)/,rR=e=>aE(e)&&e.hasFormat(`code`)?"`":e?.getTextContent()??``,eCe=e=>{let t=e.getChildren();if(!t.length||!t.every(e=>aE(e)&&/\S/.test(rR(e)))||/^\s/.test(rR(t[0]))||/\s$/.test(rR(t.at(-1))))return[];let n=Object.keys(nR).filter(e=>t.every(t=>t.hasFormat(e))),r=(e,t)=>{if(!e||tk(e))return!0;if(!aE(e))return!1;let r=t(rR(e))??``;return n.some(t=>e.hasFormat(t))?/\s/.test(r):/[\s\p{P}\p{S}]/u.test(r)};return n.length&&r(e.getPreviousSibling(),e=>e.at(-1))&&r(e.getNextSibling(),e=>e[0])?n:[]},tCe=(e,t)=>{let n=[...t],r=``;for(;n.length;){let[t]=e.slice(r.length).match($Se)??[],i=n.findIndex(e=>nR[e]?.includes(t??``));if(!t||i===-1)return;n.splice(i,1),r+=t}let i=[...r].reverse().join(``);if(!(e.length<r.length*2||!e.endsWith(i)))return{text:e.slice(r.length,-i.length),delimiters:r}},iR={...NL,export:(e,t,n)=>{let r=_F(e)?eCe(e):[],i,a=NL.export?.(e,e=>{let n=t(e),a=r.length?tCe(n,r):void 0;return i=a?.delimiters,a?.text??n},n);return a&&i?`${i}${a}${[...i].reverse().join(``)}`:a??null}},nCe={text:{italic:`italic`,strikethrough:`strikethrough`},list:{nested:{listitem:`nested`}},code:`code-block`,tableScrollableWrapper:`table-wrapper`,tableCellSelected:`selected`,tableSelection:`table-selection`},aR={bold:{labelKey:`bold`,icon:`format_bold`,inline:!0},italic:{labelKey:`italic`,icon:`format_italic`,inline:!0},strikethrough:{labelKey:`strikethrough`,icon:`strikethrough_s`,inline:!0},code:{labelKey:`code`,icon:`code`,inline:!0},link:{labelKey:`link`,icon:`link`,inline:!0},paragraph:{labelKey:`paragraph`,icon:`format_paragraph`,inline:!1},"heading-1":{labelKey:`heading_1`,icon:`format_h1`,inline:!1},"heading-2":{labelKey:`heading_2`,icon:`format_h2`,inline:!1},"heading-3":{labelKey:`heading_3`,icon:`format_h3`,inline:!1},"heading-4":{labelKey:`heading_4`,icon:`format_h4`,inline:!1},"heading-5":{labelKey:`heading_5`,icon:`format_h5`,inline:!1},"heading-6":{labelKey:`heading_6`,icon:`format_h6`,inline:!1},"bulleted-list":{labelKey:`bulleted_list`,icon:`format_list_bulleted`,inline:!1},"numbered-list":{labelKey:`numbered_list`,icon:`format_list_numbered`,inline:!1},blockquote:{labelKey:`blockquote`,icon:`format_quote`,inline:!1},"code-block":{labelKey:`code_block`,icon:`code_blocks`,inline:!1},table:{labelKey:`insert_table`,icon:`table`,inline:!1},"horizontal-rule":{labelKey:`insert_horizontal_rule`,icon:`horizontal_rule`,inline:!1}},oR=[`bold`,`italic`,`strikethrough`,`code`],sR=[...oR,`link`],cR=[`paragraph`,`heading-1`,`heading-2`,`heading-3`,`heading-4`,`heading-5`,`heading-6`,`bulleted-list`,`numbered-list`,`blockquote`,`code-block`],rCe={"heading-1":[bI],"heading-2":[bI],"heading-3":[bI],"heading-4":[bI],"heading-5":[bI],"heading-6":[bI],"bulleted-list":[PF,zF],"numbered-list":[PF,zF],blockquote:[_I],"code-block":[VP,YP],link:[hF]},iCe={"heading-1":[yL],"heading-2":[yL],"heading-3":[yL],"heading-4":[yL],"heading-5":[yL],"heading-6":[yL],"bulleted-list":[SL],"numbered-list":[CL],blockquote:[bL],"code-block":[ZL],code:[wL,tR],bold:[DL,OL,TL,EL],italic:[jL,AL,TL,EL],strikethrough:[kL],link:[iR]},aCe=[`*`,`__`,`***`,`___`],lR=PC(`OPEN_LINK_EDITOR_COMMAND`),uR=[{type:`left`,labelKey:`align_left`,icon:`format_align_left`},{type:`center`,labelKey:`align_center`,icon:`format_align_center`},{type:`right`,labelKey:`align_right`,icon:`format_align_right`},{type:`justify`,labelKey:`align_justify`,icon:`format_align_justify`}],oCe=`input, textarea, select, button, a[href], label, summary, video[controls], audio[controls], [tabindex], [draggable="true"], [contenteditable]:not([contenteditable="false"])`,dR=e=>{if(!(e instanceof Element))return!1;let t=e.closest(`[data-lexical-decorator]`);if(!t)return!1;let n=e.closest(oCe);return!n||!t.contains(n)},sCe=()=>{let e=$();if(!Q(e)||!e.isCollapsed()||e.anchor.type!==`element`)return!1;let t=oD();if(!e.anchor.getNode().is(t))return!1;let{offset:n}=e.anchor,r=t.getChildAtIndex(n-1),i=t.getChildAtIndex(n);if(Z(i))i.selectStart();else if(Z(r))r.selectEnd();else{let e=EE();r?r.insertAfter(e):i?i.insertBefore(e):t.append(e),e.select()}return!0},fR=(e,t,n)=>{e.getRootElement()?.focus({preventScroll:!0}),e.update(()=>{n(rD(t))})},pR=(e,t)=>{fR(e,t,e=>{VT(e)&&(e.selectNext(),sCe())})},cCe=(e,t)=>{fR(e,t,e=>{Z(e)&&e.selectEnd()})},lCe=(e,t)=>{let{target:n,button:r,shiftKey:i,clientY:a}=t,o=e.getRootElement();if(!o||!e.isEditable()||t.defaultPrevented||r!==0||i||!(n instanceof Element))return!1;if(dR(n)){let r=n.closest(`[data-lexical-decorator]`);return r.parentElement?.closest(`[data-lexical-editor]`)===o&&(t.preventDefault(),pR(e,r),!0)}if(n!==o)return!1;let s=[...o.children].filter(e=>!e.hasAttribute(`data-lexical-decorator-boundary`)).findLast(e=>e.getBoundingClientRect().top<=a);return s?s.hasAttribute(`data-lexical-decorator`)?(t.preventDefault(),pR(e,s),!0):a<=s.getBoundingClientRect().bottom?!1:(t.preventDefault(),cCe(e,s),!0):!1},mR=async e=>new Promise(t=>{e.focus(()=>{t(void 0)})});function hR(e){return JSON.stringify([e.exportJSON(),Z(e)?e.getChildrenKeys():null])}function uCe(e,t,n){let r=n(),i=0,a=r,o=0,s=null,c=new Set;return(l,u,d,f,p,m)=>{let h=n();if(m.has(`composition-start`)&&(a=r,o=i,s=l,c.clear()),s!==null){for(let e of f)c.add(e);for(let e of p.keys())c.add(e)}if(m.has(`historic`))return i=0,r=h,s=null,c.clear(),2;let g=m.has(`composition-end`);g&&s&&(r=a,i=o,l=s);let _=m.has(`paste`)||m.has(`cut`)?0:function(e,t,n,r,i){if(e===null||n.size===0&&r.size===0&&!i)return 0;let a=t._selection,o=e._selection;if(i)return 1;if(!(Q(a)&&Q(o)&&o.isCollapsed()&&a.isCollapsed()))return 0;let s=function(e,t,n){let r=e._nodeMap,i=[];for(let e of t){let t=r.get(e);t!==void 0&&i.push(t)}for(let[e,t]of n){if(!t)continue;let n=r.get(e);n===void 0||WT(n)||i.push(n)}return i}(t,n,r);if(s.length===0)return 0;if(s.length>1){let n=t._nodeMap,r=n.get(a.anchor.key),i=n.get(o.anchor.key);return r&&i&&!e._nodeMap.has(r.__key)&&aE(r)&&r.__text.length===1&&a.anchor.offset===1?2:0}let c=s[0],l=e._nodeMap.get(c.__key);if(!aE(l)||!aE(c)||l.__mode!==c.__mode)return 0;let u=l.__text,d=c.__text;if(u===d)return 0;let f=a.anchor,p=o.anchor;if(f.key!==p.key||f.type!==`text`)return 0;let m=f.offset,h=p.offset,g=d.length-u.length;return g===1&&h===m-1?2:g===-1&&h===m+1?3:g===-1&&h===m?4:0}(l,u,f,p,e.isComposing()),v=!1,y=(()=>{let n=d===null||d.editor===e,a=m.has(`history-push`),o=!a&&n&&m.has(`history-merge`);if(g&&s!==null&&n&&!a&&function(e,t,n){for(let r of e){let e=t._nodeMap.get(r),i=n._nodeMap.get(r);if(!(e===i||e&&i&&t.read(()=>hR(e))===n.read(()=>hR(i))))return!1}return!0}(c,s,u))return v=!0,0;if(o)return 0;if(_===1)return 2;if(l===null)return 1;let y=u._selection;if(!(f.size>0||p.size>0))return y===null?2:0;let b=typeof t==`number`?t:t.peek();return!1===a&&_!==0&&_===i&&h<r+b&&n||!a&&f.size===1&&function(e,t,n){let r=t._nodeMap.get(e),i=n._nodeMap.get(e),a=t._selection,o=n._selection;return!(Q(a)&&Q(o)&&a.anchor.type===`element`&&a.focus.type===`element`&&o.anchor.type===`text`&&o.focus.type===`text`||!aE(r)||!aE(i)||r.__parent!==i.__parent)&&JSON.stringify(t.read(()=>r.exportJSON()))===JSON.stringify(n.read(()=>i.exportJSON()))}(Array.from(f)[0],l,u)?0:1})();return g&&(s=null,c.clear()),v||(r=h,i=_),y}}function gR(e,t){if(t!==null&&t.editor===e.editor)return t;let{editor:n}=e,r=n.getEditorState();return r.isEmpty()?null:{editor:n,editorState:r}}function _R(e,t){e.undoStack=[],e.redoStack=[],e.current=null,t&&t(e)}function dCe(e,t,n,r=Date.now,i,a=null){let o=uCe(e,n,r),s=()=>{i&&i(t)};return s(),Hk(e.registerCommand(KC,()=>(function(e,t,n){let r=t.redoStack,i=t.undoStack;if(i.length!==0){let a=t.current,o=i.pop();if(o){let t=gR(o,a);t!==null&&(r.push(t),e.dispatchCommand(pw,!0))}i.length===0&&e.dispatchCommand(mw,!1),t.current=o||null,n&&n(t),o&&o.editor.setEditorState(o.editorState,{tag:`historic`})}}(e,t,i),!0),0),e.registerCommand(qC,()=>(function(e,t,n){let r=t.redoStack,i=t.undoStack;if(r.length!==0){let a=t.current,o=r.pop();if(o){let t=gR(o,a);t!==null&&(i.push(t),e.dispatchCommand(mw,!0))}r.length===0&&e.dispatchCommand(pw,!1),t.current=o||null,n&&n(t),o&&o.editor.setEditorState(o.editorState,{tag:`historic`})}}(e,t,i),!0),0),e.registerCommand(_ge,()=>(_R(t,i),!1),0),e.registerCommand(vge,()=>(_R(t,i),e.dispatchCommand(pw,!1),e.dispatchCommand(mw,!1),!0),0),e.registerUpdateListener(({editorState:n,prevEditorState:r,dirtyLeaves:i,dirtyElements:c,tags:l})=>{let u=t.current,d=t.redoStack,f=t.undoStack,p=u===null?null:u.editorState;if(u!==null&&n===p)return;let m=o(r,n,u,i,c,l);if(m===1){d.length!==0&&(t.redoStack=[],e.dispatchCommand(pw,!1));let n=function(e,t,n){return n===null?null:n.editor===e?{...n}:t.isEmpty()?null:{editor:e,editorState:t}}(e,r,u);if(n!==null){f.push(n);let t=typeof a==`number`||a===null?a:a.peek();t!==null&&f.length>t&&f.splice(0,f.length-t),e.dispatchCommand(mw,!0)}}else if(m===2)return;t.current={editor:e,editorState:n},s()}))}function fCe(){return{current:null,redoStack:[],undoStack:[]}}var vR=/^(\d+(?:\.\d+)?)px$/,pCe=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function yR(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e!=`string`||!pCe.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}function bR(e,t,n,r,i){let a=yR(e,t);return a>=n&&a<=r&&Number.isInteger(a)?a:t}function mCe(e,t){e.__colWidths=t.__colWidths,e.__frozenColumnCount=t.__frozenColumnCount,e.__frozenRowCount=t.__frozenRowCount,e.__rowStriping=t.__rowStriping}var hCe=e=>{let t=kw(e,`format`),n=Aw(e,`format`),r=Mw(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],colWidths:e.__colWidths,frozenColumnCount:e.getSerializedFrozenColumnCount(),frozenRowCount:e.getSerializedFrozenRowCount(),rowStriping:e.getSerializedRowStriping(),direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__colWidths;o!==void 0&&(a.colWidths=o);let s=e.getSerializedFrozenColumnCount();s!==void 0&&s!==0&&(a.frozenColumnCount=s);let c=e.getSerializedFrozenRowCount();c!==void 0&&c!==0&&(a.frozenRowCount=c);let l=e.getSerializedRowStriping();l!==void 0&&!1!==l&&(a.rowStriping=l);let u=e.__dir;u!=null&&(a.direction=u);let d=t[e.__format];d!==void 0&&d!==``&&(a.format=d);let f=e.__indent;return f!==void 0&&f!==0&&(a.indent=f),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=bR(t.indent,0,0,1/0),e.__textFormat=yR(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.colWidths;e.setColWidths(s===void 0?void 0:Array.isArray(s)?Array.from(s,e=>yR(e,0)):[]),e.__frozenColumnCount=yR(t.frozenColumnCount,0),e.__frozenRowCount=yR(t.frozenRowCount,0);let c=t.rowStriping;return e.__rowStriping=typeof c==`boolean`&&c,e},afterCloneFrom:mCe}};function gCe(e,t){e.__height=t.__height}var _Ce=e=>{let t=kw(e,`format`),n=Aw(e,`format`),r=Mw(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],height:e.__height,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__height;o!==void 0&&(a.height=o);let s=e.__dir;s!=null&&(a.direction=s);let c=t[e.__format];c!==void 0&&c!==``&&(a.format=c);let l=e.__indent;return l!==void 0&&l!==0&&(a.indent=l),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=bR(t.indent,0,0,1/0),e.__textFormat=yR(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.height;return e.__height=s===void 0?void 0:yR(s,0),e},afterCloneFrom:gCe}};function vCe(e,t){e.__backgroundColor=t.__backgroundColor,e.__colSpan=t.__colSpan,e.__headerState=t.__headerState,e.__rowSpan=t.__rowSpan,e.__verticalAlign=t.__verticalAlign,e.__width=t.__width}var yCe=e=>{let t=kw(e,`format`),n=Aw(e,`format`),r=Mw(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],backgroundColor:e.__backgroundColor,colSpan:e.__colSpan,headerState:e.__headerState,rowSpan:e.__rowSpan,verticalAlign:e.getSerializedVerticalAlign(),width:e.__width,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__backgroundColor;o!=null&&(a.backgroundColor=o);let s=e.__colSpan;s!==void 0&&s!==1&&(a.colSpan=s);let c=e.__headerState;c!==void 0&&c!==0&&(a.headerState=c);let l=e.__rowSpan;l!==void 0&&l!==1&&(a.rowSpan=l);let u=e.getSerializedVerticalAlign();u!==void 0&&(a.verticalAlign=u);let d=e.__width;d!==void 0&&(a.width=d);let f=e.__dir;f!=null&&(a.direction=f);let p=t[e.__format];p!==void 0&&p!==``&&(a.format=p);let m=e.__indent;return m!==void 0&&m!==0&&(a.indent=m),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=bR(t.indent,0,0,1/0),e.__textFormat=yR(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.backgroundColor;e.__backgroundColor=typeof s==`string`&&s!==``?s:null,e.__colSpan=bR(t.colSpan,1,1,1/0),e.setHeaderStyles(yR(t.headerState,0)),e.__rowSpan=bR(t.rowSpan,1,1,1/0);let c=t.verticalAlign;e.__verticalAlign=c===`middle`||c===`bottom`?c:void 0;let l=t.width;return e.__width=l===void 0||yR(l,0)===0?void 0:yR(l,0),e},afterCloneFrom:vCe}},xR={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1},bCe=Ww()({backgroundColor:Kw(Hw(Rw(),{defaultAsNull:!0}),{field:`__backgroundColor`}),colSpan:Kw(zw(1,{integer:!0,min:1}),{field:`__colSpan`}),headerState:qw(zw(0),{getter:{field:`__headerState`,method:`getHeaderStyles`},setter:`setHeaderStyles`}),rowSpan:Kw(zw(1,{integer:!0,min:1}),{field:`__rowSpan`}),verticalAlign:qw(Vw([void 0,`middle`,`bottom`]),{getter:`getSerializedVerticalAlign`,setter:{field:`__verticalAlign`}}),width:Kw(Uw(zw(),{omitDefault:!0}),{field:`__width`})}),SR=class extends zT{__colSpan;__rowSpan;__headerState;__width;__backgroundColor;__verticalAlign;$config(){return this.config(`tablecell`,{children:`block`,extends:zT,generated:yCe,importDOM:{td:()=>({conversion:wR,priority:0}),th:()=>({conversion:wR,priority:0})},json:bCe})}constructor(e=xR.NO_STATUS,t=1,n,r){super(r),this.__colSpan=t,this.__rowSpan=1,this.__headerState=e,this.__width=n,this.__backgroundColor=null,this.__verticalAlign=void 0}createDOM(e){let t=QD().createElement(this.getTag());return this.__width&&(t.style.width=`${this.__width}px`),this.__colSpan>1&&(t.colSpan=this.__colSpan),this.__rowSpan>1&&(t.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(t.style.backgroundColor=this.__backgroundColor),CR(this.__verticalAlign)&&(t.style.verticalAlign=this.__verticalAlign),_M(t,e.theme.tableCell,this.hasHeader()&&e.theme.tableCellHeader),t}exportDOM(e){let t=super.exportDOM(e);if(oO(t.element)){let e=t.element;e.setAttribute(`data-temporary-table-cell-lexical-key`,this.getKey()),e.style.border=`1px solid black`,this.__colSpan>1&&(e.colSpan=this.__colSpan),this.__rowSpan>1&&(e.rowSpan=this.__rowSpan),e.style.width=`${this.getWidth()||75}px`,e.style.verticalAlign=this.getVerticalAlign()||`top`,e.style.textAlign=`start`,this.__backgroundColor===null&&this.hasHeader()&&(e.style.backgroundColor=`#f2f3f5`)}return t}getColSpan(){return this.getLatest().__colSpan}setColSpan(e){let t=this.getWritable();return t.__colSpan=e,t}getRowSpan(){return this.getLatest().__rowSpan}setRowSpan(e){let t=this.getWritable();return t.__rowSpan=e,t}getTag(){return this.hasHeader()?`th`:`td`}setHeaderStyles(e,t=xR.BOTH){let n=this.getWritable();return n.__headerState=e&t|n.__headerState&~t,n}getHeaderStyles(){return this.getLatest().__headerState}setWidth(e){let t=this.getWritable();return t.__width=e,t}getWidth(){return this.getLatest().__width}getSerializedVerticalAlign(){let e=this.getLatest().__verticalAlign;return CR(e)?e:void 0}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(e){let t=this.getWritable();return t.__backgroundColor=e,t}getVerticalAlign(){return this.getLatest().__verticalAlign}setVerticalAlign(e){let t=this.getWritable();return t.__verticalAlign=e||void 0,t}toggleHeaderStyle(e){let t=this.getWritable();return(t.__headerState&e)===e?t.__headerState&=~e:t.__headerState|=e,t}hasHeaderState(e){return(this.getHeaderStyles()&e)===e}hasHeader(){return this.getLatest().__headerState!==xR.NO_STATUS}updateDOM(e){return e.__headerState!==this.__headerState||e.__width!==this.__width||e.__colSpan!==this.__colSpan||e.__rowSpan!==this.__rowSpan||e.__backgroundColor!==this.__backgroundColor||e.__verticalAlign!==this.__verticalAlign}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}};function CR(e){return e===`middle`||e===`bottom`}function wR(e){let t=e,n=e.nodeName.toLowerCase(),r;vR.test(t.style.width)&&(r=parseFloat(t.style.width));let i=xR.NO_STATUS;if(n===`th`){let e=t.getAttribute(`scope`);if(e===`col`)i=xR.COLUMN;else if(e===`row`)i=xR.ROW;else{let e=t.parentElement,n=oO(e)&&e.nodeName.toLowerCase()===`tr`&&oO(e.parentElement)&&(e.parentElement.nodeName.toLowerCase()===`thead`||e.rowIndex===0),r=t.cellIndex===0;n&&(i|=xR.ROW),r&&(i|=xR.COLUMN),i===xR.NO_STATUS&&(i=xR.ROW)}}let a=TR(i,t.colSpan,r);a.__rowSpan=t.rowSpan;let o=t.style.backgroundColor;o!==``&&(a.__backgroundColor=o);let s=t.style.verticalAlign;CR(s)&&(a.__verticalAlign=s),bO(a,t);let c=t.style,l=(c&&c.textDecoration||``).split(` `),u=c.fontWeight===`700`||c.fontWeight===`bold`,d=l.includes(`line-through`),f=c.fontStyle===`italic`,p=l.includes(`underline`),m=c.color;return{after:e=>{let t=[],n=null,r=()=>{if(n){let e=n.getFirstChild();tk(e)&&n.getChildrenSize()===1&&e.remove()}};for(let i of e)if(LD(i)||aE(i)||tk(i)){if(aE(i)&&(u&&i.toggleFormat(`bold`),d&&i.toggleFormat(`strikethrough`),f&&i.toggleFormat(`italic`),p&&i.toggleFormat(`underline`),m)){let e=i.getStyle();e.includes(`color:`)||i.setStyle(e+`color: ${m};`)}n?n.append(i):(n=EE().append(i),t.push(n))}else t.push(i),r(),n=null;return r(),t.length===0&&t.push(EE()),t},node:a}}function TR(e=xR.NO_STATUS,t=1,n){return HD(new SR(e,t,n))}function ER(e){return e instanceof SR}var xCe=PC(`INSERT_TABLE_COMMAND`);function DR(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}var SCe=Ww()({height:Kw(Uw(zw()),{field:`__height`})}),OR=class extends zT{__height;$config(){return this.config(`tablerow`,{extends:zT,generated:_Ce,importDOM:{tr:()=>({conversion:CCe,priority:0})},json:SCe})}constructor(e=void 0,t){super(t),this.__height=e}createDOM(e){let t=QD().createElement(`tr`);return this.__height&&(t.style.height=`${this.__height}px`),_M(t,e.theme.tableRow),t}extractWithChild(e,t,n){return n===`html`}isShadowRoot(){return!0}setHeight(e){let t=this.getWritable();return t.__height=e,t}getHeight(){return this.getLatest().__height}updateDOM(e){return e.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}};function CCe(e){let t=e,n;return vR.test(t.style.height)&&(n=parseFloat(t.style.height)),{after:e=>RM(e,ER),node:bO(kR(n),t)}}function kR(e){return HD(new OR(e))}function AR(e){return e instanceof OR}function jR(e,t,n=!0){let r=Fz();for(let i=0;i<e;i++){let e=kR();for(let r=0;r<t;r++){let t=xR.NO_STATUS;typeof n==`object`?(i===0&&n.rows&&(t|=xR.ROW),r===0&&n.columns&&(t|=xR.COLUMN)):n&&(i===0&&(t|=xR.ROW),r===0&&(t|=xR.COLUMN));let a=TR(t),o=EE();o.append(iE()),a.append(o),e.append(a)}r.append(e)}return r}function wCe(e){let t=GO(e,e=>Iz(e));if(Iz(t))return t;throw Error(`Expected table cell to be inside of table.`)}var MR=(e,t)=>e===xR.BOTH||e===t?t:xR.NO_STATUS;function TCe(e=!0){let t=$();Q(t)||qR(t)||DR(188);let n=t.anchor.getNode(),r=t.focus.getNode(),[i]=VR(n),[a,,o]=VR(r),[,s,c]=RR(o,a,i),{startRow:l}=c,{startRow:u}=s;return e?NR(l+i.__rowSpan>u+a.__rowSpan?i:a,!0):NR(u<l?a:i,!1)}function NR(e,t=!0){let[,,n]=VR(e);BR(n);let[r,i]=RR(n,e,e),a=r[0].length,{startRow:o}=i,s=null;if(t){let t=o+e.__rowSpan-1,i=r[t],c=kR();for(let e=0;e<a;e++){let{cell:n,startRow:r}=i[e];if(r+n.__rowSpan-1<=t){let t=i[e].cell.__headerState,n=MR(t,xR.COLUMN);c.append(TR(n).append(EE()))}else n.setRowSpan(n.__rowSpan+1)}let l=n.getChildAtIndex(t);AR(l)||DR(256),l.insertAfter(c),s=c}else{let e=o,t=r[e],i=kR();for(let n=0;n<a;n++){let{cell:r,startRow:a}=t[n];if(a===e){let e=t[n].cell.__headerState,r=MR(e,xR.COLUMN);i.append(TR(r).append(EE()))}else r.setRowSpan(r.__rowSpan+1)}let c=n.getChildAtIndex(e);AR(c)||DR(257),c.insertBefore(i),s=i}return s}function ECe(e=!0){let t=$();Q(t)||qR(t)||DR(188);let n=t.anchor.getNode(),r=t.focus.getNode(),[i]=VR(n),[a,,o]=VR(r),[,s,c]=RR(o,a,i),{startColumn:l}=c,{startColumn:u}=s;return e?PR(l+i.__colSpan>u+a.__colSpan?i:a,!0):PR(u<l?a:i,!1)}function PR(e,t=!0,n=!0){let[,,r]=VR(e);BR(r);let[i,a]=RR(r,e,e),o=i.length,{startColumn:s}=a,c=t?s+e.__colSpan-1:s-1,l=r.getFirstChild();AR(l)||DR(120);let u=null;function d(e=xR.NO_STATUS){let t=TR(e).append(EE());return u===null&&(u=t),t}let f=l;for(let e=0;e<o;e++){if(e!==0){let e=f.getNextSibling();AR(e)||DR(121),f=e}let t=i[e],n=t[c<0?0:c].cell.__headerState,r=MR(n,xR.ROW);if(c<0){IR(f,d(r));continue}let{cell:a,startColumn:o}=t[c];if(o+a.__colSpan-1<=c){let n=null;for(let r=0;r<=c;r++){let i=t[r];i.startRow===e&&(n=i.cell),i.cell.__colSpan>1&&(r+=i.cell.__colSpan-1)}n===null?IR(f,d(r)):n.insertAfter(d(r))}else a.setColSpan(a.__colSpan+1)}u!==null&&n&&FR(u);let p=r.getColWidths();if(p){let e=[...p],t=c<0?0:c,n=e[t];e.splice(t,0,n),r.setColWidths(e)}return u}function DCe(){let e=$();Q(e)||qR(e)||DR(188);let[t,n]=e.isBackward()?[e.focus.getNode(),e.anchor.getNode()]:[e.anchor.getNode(),e.focus.getNode()],[r,,i]=VR(t),[a]=VR(n);BR(i);let[o,s,c]=RR(i,r,a),{startRow:l}=s,{startRow:u}=c,d=u+a.__rowSpan-1;if(o.length===d-l+1)return i.selectPrevious(),void i.remove();let f=o[0].length,p=o[d+1],m=i.getChildAtIndex(d+1);for(let e=d;e>=l;e--){for(let t=f-1;t>=0;t--){let{cell:n,startRow:r,startColumn:i}=o[e][t];if(i===t){if(r<l||r+n.__rowSpan-1>d){let e=Math.max(r,l),t=Math.min(n.__rowSpan+r-1,d),i=e<=t?t-e+1:0;n.setRowSpan(n.__rowSpan-i)}if(r>=l&&r+n.__rowSpan-1>d&&e===d){AR(m)||DR(387);let r=null;for(let n=0;n<t;n++){let t=p[n],i=t.cell;t.startRow===e+1&&(r=i),i.__colSpan>1&&(n+=i.__colSpan-1)}r===null?IR(m,n):r.insertAfter(n)}}}let t=i.getChildAtIndex(e);AR(t)||DR(206,String(e)),t.remove()}if(p!==void 0){let{cell:e}=p[0];FR(e)}else{let{cell:e}=o[l-1][0];FR(e)}}function OCe(){let e=$();Q(e)||qR(e)||DR(188);let t=e.anchor.getNode(),n=e.focus.getNode(),[r,,i]=VR(t),[a]=VR(n);BR(i);let[o,s,c]=RR(i,r,a),{startColumn:l}=s,{startRow:u,startColumn:d}=c,f=Math.min(l,d),p=Math.max(l+r.__colSpan-1,d+a.__colSpan-1),m=p-f+1;if(o[0].length===p-f+1)return i.selectPrevious(),void i.remove();let h=o.length;for(let e=0;e<h;e++)for(let t=f;t<=p;t++){let{cell:n,startColumn:r}=o[e][t];if(r<f){if(t===f){let e=f-r;n.setColSpan(n.__colSpan-Math.min(m,n.__colSpan-e))}}else if(r+n.__colSpan-1>p){if(t===p){let e=p-r+1;n.setColSpan(n.__colSpan-e)}}else n.remove()}let g=o[u],_=l>d?g[l+r.__colSpan]:g[d+a.__colSpan];if(_!==void 0){let{cell:e}=_;FR(e)}else{let{cell:e}=d<l?g[d-1]:g[l-1];FR(e)}let v=i.getColWidths();if(v){let e=[...v];e.splice(f,m),i.setColWidths(e)}}function FR(e){let t=e.getFirstDescendant();t==null?e.selectStart():t.getParentOrThrow().selectStart()}function IR(e,t){let n=e.getFirstChild();n===null?e.append(t):n.insertBefore(t)}function kCe(e){if(e.length===0)return null;let t=wCe(e[0]);BR(t);let[n]=zR(t,null,null),r=1/0,i=-1/0,a=1/0,o=-1/0,s=new Set;for(let t of n)for(let n of t){if(!n||!n.cell)continue;let t=n.cell.getKey();if(!s.has(t)&&e.some(e=>e.is(n.cell))){s.add(t);let e=n.startRow,c=n.startColumn,l=n.cell.__rowSpan||1,u=n.cell.__colSpan||1;r=Math.min(r,e),i=Math.max(i,e+l-1),a=Math.min(a,c),o=Math.max(o,c+u-1)}}if(r===1/0||a===1/0)return null;let c=i-r+1,l=o-a+1,u=n[r][a];if(!u.cell)return null;let d=u.cell;d.setColSpan(l),d.setRowSpan(c);let f=new Set([d.getKey()]);for(let e=r;e<=i;e++)for(let t=a;t<=o;t++){let r=n[e][t];if(!r.cell)continue;let i=r.cell,a=i.getKey();f.has(a)||(f.add(a),LR(i)||(LR(d)&&d.clear(),d.append(...i.getChildren())),i.remove())}return d.getChildrenSize()===0&&d.append(EE()),d}function LR(e){if(e.getChildrenSize()!==1)return!1;let t=e.getFirstChildOrThrow();return!(!DE(t)||!t.isEmpty())}function ACe(e){let[t,n,r]=VR(e),i=t.__colSpan,a=t.__rowSpan;if(i===1&&a===1)return;BR(r);let[o,s]=RR(r,t,t),{startColumn:c,startRow:l}=s,u=t.__headerState&xR.COLUMN,d=Array.from({length:i},(e,t)=>{let n=u;for(let e=0;n!==0&&e<o.length;e++)n&=o[e][t+c].cell.__headerState;return n}),f=t.__headerState&xR.ROW,p=Array.from({length:a},(e,t)=>{let n=f;for(let e=0;n!==0&&e<o[0].length;e++)n&=o[t+l][e].cell.__headerState;return n}),m=e=>VD(t).setColSpan(1).setRowSpan(1).setHeaderStyles(e).setWidth(void 0).append(EE());if(i>1){for(let e=1;e<i;e++)t.insertAfter(m(d[e]|p[0]));t.setColSpan(1)}if(a>1){let e;for(let t=1;t<a;t++){let r=l+t,a=o[r];e=(e||n).getNextSibling(),AR(e)||DR(125);let s=null;for(let e=0;e<c;e++){let t=a[e],n=t.cell;t.startRow===r&&(s=n),n.__colSpan>1&&(e+=n.__colSpan-1)}if(s===null)for(let n=i-1;n>=0;n--)IR(e,m(d[n]|p[t]));else for(let e=i-1;e>=0;e--)s.insertAfter(m(d[e]|p[t]))}t.setRowSpan(1)}}function RR(e,t,n){let[r,i,a]=zR(e,t,n);return i===null&&DR(207),a===null&&DR(208),[r,i,a]}function zR(e,t,n){let r=[],i=null,a=null;function o(e){let t=r[e];return t===void 0&&(r[e]=t=[]),t}let s=e.getChildren();for(let e=0;e<s.length;e++){let r=s[e];AR(r)||DR(209);let c=o(e);for(let l=r.getFirstChild(),u=0;l!=null;l=l.getNextSibling()){for(ER(l)||DR(147);c[u]!==void 0;)u++;let r={cell:l,startColumn:u,startRow:e},{__rowSpan:d,__colSpan:f}=l;for(let t=0;t<d&&!(e+t>=s.length);t++){let n=o(e+t);for(let e=0;e<f;e++)n[u+e]=r}t!==null&&i===null&&t.is(l)&&(i=r),n!==null&&a===null&&n.is(l)&&(a=r)}}return[r,i,a]}function BR(e){let[t]=zR(e,null,null),n=t.reduce((e,t)=>Math.max(e,t.length),0),r=e.getChildren(),i=!1;for(let e=0;e<t.length;++e){let a=r[e];if(!AR(a))continue;let o=t[e].reduce((e,t)=>t?1+e:e,0);if(o>=n)continue;let s=a.getLastChild(),c=ER(s)?s.getHeaderStyles()&xR.ROW:xR.NO_STATUS;for(let e=o;e<n;++e)a.append(TR(c).append(EE()));i=!0}return i}function VR(e){let t;if(e instanceof SR)t=e;else if(`__type`in e){let n=GO(e,ER);ER(n)||DR(148),t=n}else{let n=GO(e.getNode(),ER);ER(n)||DR(148),t=n}let n=t.getParent();AR(n)||DR(149);let r=n.getParent();return Iz(r)||DR(210),[t,n,r]}function HR(e,t,n){let r,i=Math.min(t.startColumn,n.startColumn),a=Math.min(t.startRow,n.startRow),o=Math.max(t.startColumn+t.cell.__colSpan-1,n.startColumn+n.cell.__colSpan-1),s=Math.max(t.startRow+t.cell.__rowSpan-1,n.startRow+n.cell.__rowSpan-1);do{r=!1;for(let t=0;t<e.length;t++)for(let n=0;n<e[0].length;n++){let c=e[t][n];if(!c)continue;let l=c.startColumn+c.cell.__colSpan-1,u=c.startRow+c.cell.__rowSpan-1,d=c.startColumn<=o&&l>=i,f=c.startRow<=s&&u>=a;if(d&&f){let e=Math.min(i,c.startColumn),t=Math.max(o,l),n=Math.min(a,c.startRow),d=Math.max(s,u);e===i&&t===o&&n===a&&d===s||(i=e,o=t,a=n,s=d,r=!0)}}}while(r);return{maxColumn:o,maxRow:s,minColumn:i,minRow:a}}function UR(e){let[t,,n]=VR(e),r=n.getChildren().filter(AR),i=r.length,a=r[0].getChildren().length,o=Array(i);for(let e=0;e<i;e++)o[e]=Array(a);for(let e=0;e<i;e++){let n=r[e].getChildren().filter(ER),i=0;for(let r=0;r<n.length;r++){for(;o[e][i];)i++;let a=n[r],s=a.__rowSpan||1,c=a.__colSpan||1;for(let t=0;t<s;t++)for(let n=0;n<c;n++)o[e+t][i+n]=a;if(t===a)return{colSpan:c,columnIndex:i,rowIndex:e,rowSpan:s};i+=c}}return null}function WR(e,t){let n=t.getStartEndPoints(),r=qR(t);if(n===null)return!1;let[i,a]=n,[o,s,c]=VR(i),l=GO(a.getNode(),e=>ER(e));if(!(ER(o)&&ER(l)&&AR(s)&&Iz(c)))return!1;BR(c);let[u,d,f]=RR(c,o,l),[p]=zR(e,null,null),m=u.length,h=m>0?u[0].length:0,g=d.startRow,_=d.startColumn,v=p.length,y=v>0?p[0].length:0;if(r){let e=HR(u,d,f),t=e.maxRow-e.minRow+1,n=e.maxColumn-e.minColumn+1;g=e.minRow,_=e.minColumn,v=Math.min(v,t),y=Math.min(y,n)}let b=!1,x=Math.min(m,g+v)-1,S=Math.min(h,_+y)-1,C=new Set;for(let e=g;e<=x;e++)for(let t=_;t<=S;t++){let n=u[e][t];C.has(n.cell.getKey())||n.cell.__rowSpan===1&&n.cell.__colSpan===1||(ACe(n.cell),C.add(n.cell.getKey()),b=!0)}let[w]=zR(c.getWritable(),null,null),T=v-m+g;for(let e=0;e<T;e++)NR(w[m-1][0].cell);let ee=y-h+_;for(let e=0;e<ee;e++)PR(w[0][h-1].cell,!0,!1);[w]=zR(c.getWritable(),null,null);for(let e=g;e<g+v;e++)for(let t=_;t<_+y;t++){let n=e-g,r=t-_,i=p[n][r];if(i.startRow!==n||i.startColumn!==r)continue;let a=i.cell;if(a.__rowSpan!==1||a.__colSpan!==1){let n=[],r=Math.min(e+a.__rowSpan,g+v)-1,i=Math.min(t+a.__colSpan,_+y)-1;for(let a=e;a<=r;a++)for(let e=t;e<=i;e++){let t=w[a][e];n.push(t.cell)}kCe(n),b=!0}let{cell:o}=w[e][t],s=a.getBackgroundColor();s!=null&&o.setBackgroundColor(s);let c=a.getVerticalAlign();c!==void 0&&o.setVerticalAlign(c);let l=o.getChildren();a.getChildren().forEach(e=>{aE(e)&&EE().append(e),o.append(e)}),l.forEach(e=>e.remove())}if(r&&b){let[e]=zR(c.getWritable(),null,null);e[d.startRow][d.startColumn].cell.selectEnd()}return!0}function GR(e){let[[t,n,r,i],[a,o,s,c]]=[`anchor`,`focus`].map(t=>{let n=e[t].getNode(),r=GO(n,ER);ER(r)||DR(238,t,n.getKey(),n.getType());let i=r.getParent();AR(i)||DR(239,t);let a=i.getParent();return Iz(a)||DR(240,t),[n,r,i,a]});return i.is(c)||DR(241),{anchorCell:n,anchorNode:t,anchorRow:r,anchorTable:i,focusCell:o,focusNode:a,focusRow:s,focusTable:c}}var KR=class e{tableKey;anchor;focus;_cachedNodes;dirty;constructor(e,t,n){this.anchor=t,this.focus=n,t._selection=this,n._selection=this,this._cachedNodes=null,this.dirty=!1,this.tableKey=e}getStartEndPoints(){return[this.anchor,this.focus]}isValid(){if(this.tableKey===`root`||this.anchor.key===`root`||this.anchor.type!==`element`||this.focus.key===`root`||this.focus.type!==`element`)return!1;let e=$E(this.tableKey),t=$E(this.anchor.key),n=$E(this.focus.key);return e!==null&&t!==null&&n!==null}isBackward(){return this.focus.isBefore(this.anchor)}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return qR(e)&&this.tableKey===e.tableKey&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)}set(e,t,n){this.dirty=this.dirty||e!==this.tableKey||t!==this.anchor.key||n!==this.focus.key,this.tableKey=e,this.anchor.key=t,this.focus.key=n,this._cachedNodes=null}clone(){return new e(this.tableKey,SA(this.anchor.key,this.anchor.offset,this.anchor.type),SA(this.focus.key,this.focus.offset,this.focus.type))}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(e){if(e===``)return;let t=(e.endsWith(`
`)?e.slice(0,-1):e).split(`
`).map(e=>e.split(` `)),n=Fz();for(let e of t){let t=kR();for(let n of e){let e=TR(xR.NO_STATUS),r=EE();n&&r.append(iE(n)),e.append(r),t.append(e)}n.append(t)}let{anchorCell:r}=GR(this);WR(n,r.select(0,r.getChildrenSize()))}insertText(){}hasFormat(e){let t=0;this.getNodes().filter(ER).forEach(e=>{let n=e.getFirstChild();DE(n)&&(t|=n.getTextFormat())});let n=AC[e];return(t&n)!==0}insertNodes(e){let t=this.focus.getNode();Z(t)||DR(151),IT(t.select(0,t.getChildrenSize())).insertNodes(e)}getShape(){let{anchorCell:e,focusCell:t}=GR(this),n=UR(e);n===null&&DR(153);let r=UR(t);r===null&&DR(155);let i=Math.min(n.columnIndex,r.columnIndex),a=Math.max(n.columnIndex+n.colSpan-1,r.columnIndex+r.colSpan-1),o=Math.min(n.rowIndex,r.rowIndex),s=Math.max(n.rowIndex+n.rowSpan-1,r.rowIndex+r.rowSpan-1);return{fromX:Math.min(i,a),fromY:Math.min(o,s),toX:Math.max(i,a),toY:Math.max(o,s)}}getNodes(){if(!this.isValid())return[];let e=this._cachedNodes;if(e!==null)return e;let{anchorTable:t,anchorCell:n,focusCell:r}=GR(this),i=r.getParents()[1];if(i!==t){if(t.isParentOf(r)){let e=i.getParent();e??DR(159),this.set(this.tableKey,r.getKey(),e.getKey())}else{let e=t.getParent();e??DR(158),this.set(this.tableKey,e.getKey(),r.getKey())}return this.getNodes()}let[a,o,s]=RR(t,n,r),{minColumn:c,maxColumn:l,minRow:u,maxRow:d}=HR(a,o,s),f=new Map([[t.getKey(),t]]),p=null;for(let e=u;e<=d;e++)for(let t=c;t<=l;t++){let{cell:n}=a[e][t],r=n.getParent();AR(r)||DR(160),r!==p&&(f.set(r.getKey(),r),p=r),f.has(n.getKey())||jCe(n,e=>{f.set(e.getKey(),e)})}let m=Array.from(f.values());return xk()||(this._cachedNodes=m),m}getTextContent(){let e=this.getNodes().filter(e=>ER(e)),t=``;for(let n=0;n<e.length;n++){let r=e[n],i=r.__parent,a=(e[n+1]||{}).__parent;t+=r.getTextContent()+(a===i?` `:`
`)}return t}};function qR(e){return e instanceof KR}function JR(e,t,n){e.getKey(),t.getKey(),n.getKey();let r=$(),i=qR(r)?r.clone():new KR(`root`,SA(`root`,0,`element`),SA(`root`,0,`element`));return i.set(e.getKey(),t.getKey(),n.getKey()),i}function jCe(e,t){let n=[[e]];for(let e=n.at(-1);e!==void 0&&n.length>0;e=n.at(-1)){let r=e.pop();r===void 0?n.pop():!1!==t(r)&&Z(r)&&n.push(r.getChildren())}}function YR(e,t=fO()){let n=$E(e);Iz(n)||DR(231,e);let r=tz(n,t.getElementByKey(e));return r===null&&DR(232,e),{tableElement:r,tableNode:n}}var MCe=class{observers;nextFocus;shouldCheckSelectionForTable;touchTapCellKey;constructor(){this.observers=new Map,this.nextFocus=null,this.shouldCheckSelectionForTable=null,this.touchTapCellKey=null}setNextFocus(e){this.nextFocus=e}getAndClearNextFocus(){let{nextFocus:e}=this;return e!==null&&(this.nextFocus=null),e}setShouldCheckSelectionForTable(e){this.shouldCheckSelectionForTable=e}getAndClearShouldCheckSelectionForTable(){let{shouldCheckSelectionForTable:e}=this;return e?(this.shouldCheckSelectionForTable=null,e):null}removeObserver(e){let t=this.observers.get(e);return t!==void 0&&(t[0].removeListeners(),this.observers.delete(e),!0)}removeAllObservers(){for(let e of Array.from(this.observers.keys()))this.removeObserver(e)}$getTableNodesAndObservers(){let e=[];for(let[t,[n]]of Array.from(this.observers.entries())){let r=$E(t);Iz(r)?e.push([r,n]):this.removeObserver(t)}return e}},NCe=class{focusX;focusY;listenersToRemove;table;isHighlightingCells;anchorX;anchorY;tableNodeKey;anchorCell;focusCell;anchorCellNodeKey;focusCellNodeKey;editor;tableSelection;hasHijackedSelectionStyles;isSelecting;isPointerDrag;pointerStartCell;pointerType;abortController;listenerOptions;constructor(e,t){this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=t,this.editor=e,this.table={columns:0,domRows:[],rows:0},this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.isSelecting=!1,this.isPointerDrag=!1,this.pointerStartCell=null,this.pointerType=null,this.abortController=new AbortController,this.listenerOptions={signal:this.abortController.signal},this.trackTable()}getTable(){return this.table}removeListeners(){this.abortController.abort(`removeListeners`),Array.from(this.listenersToRemove).forEach(e=>e()),this.listenersToRemove.clear()}$lookup(){return YR(this.tableNodeKey,this.editor)}trackTable(){let e=new MutationObserver(e=>{this.editor.read(`latest`,()=>{let t=!1;for(let n=0;n<e.length;n++){let r=e[n].target.nodeName;if(r===`TABLE`||r===`TBODY`||r===`THEAD`||r===`TR`){t=!0;break}}if(!t)return;let{tableNode:n,tableElement:r}=this.$lookup();this.table=sz(n,r)})});this.listenersToRemove.add(()=>e.disconnect()),this.editor.read(`latest`,()=>{let{tableNode:t,tableElement:n}=this.$lookup();this.table=sz(t,n),e.observe(n,{attributes:!0,childList:!0,subtree:!0})})}$clearHighlight(e=!0){let t=this.editor;this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.$enableHighlightStyle();let{tableNode:n,tableElement:r}=this.$lookup();cz(t,sz(n,r),null),e&&$()!==null&&(cD(null),t.dispatchCommand(FC))}$enableHighlightStyle(){let e=this.editor,{tableElement:t}=this.$lookup();vM(t,e._config.theme.tableSelection),t.classList.remove(`disable-selection`),this.hasHijackedSelectionStyles=!1}$disableHighlightStyle(){let{tableElement:e}=this.$lookup();_M(e,this.editor._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0}$updateTableTableSelection(e){if(e!==null){e.tableKey!==this.tableNodeKey&&DR(233,e.tableKey,this.tableNodeKey);let t=this.editor;this.tableSelection=e,this.isHighlightingCells=!0,this.$disableHighlightStyle(),this.updateDOMSelection(),cz(t,this.table,this.tableSelection)}else this.$clearHighlight()}updateDOMSelection(){if(this.anchorCell!==null&&this.focusCell!==null){let e=qD(this.editor._window);e&&e.rangeCount>0&&e.removeAllRanges()}}$setFocusCellForSelection(e,t=!1){let n=this.editor,{tableNode:r}=this.$lookup(),i=e.x,a=e.y;if(this.focusCell=e,this.isHighlightingCells||(t||this.anchorX!==i||this.anchorY!==a||this.tableSelection!=null&&this.anchorCellNodeKey!=null)&&(this.isHighlightingCells=!0,this.$disableHighlightStyle()),this.focusX!==-1&&this.focusY!==-1&&i===this.focusX&&a===this.focusY)return!1;if(this.focusX=i,this.focusY=a,this.isHighlightingCells){let o=Tz(r,e.elem);if(this.tableSelection!=null&&this.anchorCellNodeKey!=null){let e=o;if(e===null&&t&&(e=r.getCellNodeFromCords(i,a,this.table)),e!==null){let t=this.$getAnchorTableCellOrThrow();return this.focusCellNodeKey=e.getKey(),this.tableSelection=JR(r,t,e),cD(this.tableSelection),n.dispatchCommand(FC),cz(n,this.table,this.tableSelection),!0}}}return!1}$getAnchorTableCell(){let e=this.anchorCellNodeKey?$E(this.anchorCellNodeKey):null;return ER(e)?e:null}$getAnchorTableCellOrThrow(){let e=this.$getAnchorTableCell();return e===null&&DR(234),e}$getFocusTableCell(){let e=this.focusCellNodeKey?$E(this.focusCellNodeKey):null;return ER(e)?e:null}$getFocusTableCellOrThrow(){let e=this.$getFocusTableCell();return e===null&&DR(235),e}$setAnchorCellForSelection(e){this.isHighlightingCells=!1,this.anchorCell=e,this.anchorX=e.x,this.anchorY=e.y,this.focusX=-1,this.focusY=-1,this.focusCell=null,this.focusCellNodeKey=null;let{tableNode:t}=this.$lookup(),n=Tz(t,e.elem);if(n!==null){let e=n.getKey();this.tableSelection==null?this.tableSelection=JR(t,n,n):(this.tableSelection=this.tableSelection.clone(),this.tableSelection.set(t.getKey(),e,e)),this.anchorCellNodeKey=e}}$formatCells(e){let t=$();qR(t)||DR(236);let n=ZA(),r=n.anchor,i=n.focus,a=t.getNodes().filter(ER);a.length>0||DR(237);let o=a[0].getFirstChild(),s=DE(o)?o.getFormatFlags(e,null):null;a.forEach(t=>{r.set(t.getKey(),0,`element`),i.set(t.getKey(),t.getChildrenSize(),`element`),n.formatText(e,s)}),cD(t),this.editor.dispatchCommand(FC)}$clearText(){let{editor:e}=this,t=$E(this.tableNodeKey);if(!Iz(t))throw Error(`Expected TableNode.`);let n=$();qR(n)||DR(253);let r=n.getNodes().filter(ER),i=t.getFirstChild(),a=t.getLastChild();if(r.length>0&&i!==null&&a!==null&&AR(i)&&AR(a)&&r[0]===i.getFirstChild()&&r[r.length-1]===a.getLastChild()){t.selectPrevious();let n=t.getParent();t.remove(),WT(n)&&n.isEmpty()&&e.dispatchCommand(zC)}else r.forEach(e=>{if(Z(e)){let t=e.getFirstChild(),n=DE(t)?VD(t):EE(),r=iE();n.append(r),e.append(n),e.getChildren().forEach(e=>{e!==n&&e.remove()})}}),cz(e,this.table,null),cD(null),e.dispatchCommand(FC)}},XR=`__lexicalTableSelection`;function ZR(e){let t=WD(e);return Iz(t)||DR(386,e),t}var QR=40;function $R(e,t,n,r=1e3/60){let i=e=>Math.max(1,Math.round(Math.max(1,Math.ceil(Math.min(QR,e)/QR*18))*r*60/1e3));return e<=t+QR?-i(t+QR-e):e>=n-QR?i(e-(n-QR)):0}function ez(e){return oO(e)&&e.nodeName===`TABLE`}function tz(e,t){if(!t)return t;let n=ez(t)?t:t.querySelector(`table`);return ez(n)||DR(341,e.constructor.name,e.getType(),e.getKey(),t.nodeName),n}function nz(e){return e._window}function rz(e,t){for(let n=t,r=null;n!==null;n=n.getParent()){if(e.is(n))return r;ER(n)&&(r=n)}return null}var PCe=[[ew,`down`],[$C,`up`],[ZC,`backward`],[YC,`forward`]],FCe=[UC,WC,LC],ICe=[nw,iw];function LCe(e,t){return e.registerRootListener(n=>{if(n===null)return;let r=e._window;if(r===null)return;let i=()=>{t.touchTapCellKey=null};return Hk(Uk(r,`pointerdown`,r=>{t.touchTapCellKey=null;let i=iO(r);if(r.button!==0||!sO(i)||!n.contains(i))return;let a=function(e){let t=az(e);if(t===null)return null;let n=t.elem;for(;n!=null;){if(n.nodeName===`TABLE`&&XR in n&&n[XR])return{cellElement:t,tableElement:n,tableObserver:n[XR]};n=n.parentNode}return null}(i),o=a!==null&&a.tableObserver.editor===e?a:null;e.update(()=>{if(qR($())){for(let[e]of t.observers.values())e.$clearHighlight(!1);cD(null),e.dispatchCommand(FC)}if(!o)return;let{tableObserver:n,tableElement:i,cellElement:a}=o;(function(e,t,n,r,i,a){let o=e._window;if(!o)return;if(i.pointerType=t.pointerType,t.pointerType===`touch`&&!t.shiftKey&&!i.isSelecting){let e=rD(n.elem);a.touchTapCellKey=e?e.getKey():null}let s=ZR(i.tableNodeKey),c=nj(),l=Q(c)||qR(c)?vz(c.anchor.getNode()):null,u=l!==null&&l.isParentOf(s);if(bC&&t.shiftKey&&(Q(c)||qR(c))&&(mz(c,s)||u)){let e=c.anchor.getNode(),r=rz(s,c.anchor.getNode());if(r){let e=wz(i,r);e.elem===n.elem?t.pointerType!==`touch`&&i.$setAnchorCellForSelection(n):(i.$setAnchorCellForSelection(e),i.$setFocusCellForSelection(n),xz(t))}else(s.isBefore(e)?s.selectStart():s.selectEnd()).anchor.set(c.anchor.key,c.anchor.offset,c.anchor.type),xz(t)}else t.pointerType!==`touch`&&i.$setAnchorCellForSelection(n);(n=>{if(i.isSelecting)return;i.isSelecting=!0,i.isPointerDrag=!1,i.pointerStartCell=n;let s=t.pointerType===`touch`,c=t.pointerId,l=t.clientX,u=t.clientY,d=!s;s||i.anchorCell!==null||e.update(()=>{i.$setAnchorCellForSelection(n)});let f,p=t.clientX,m=t.clientY,h=null,g=null,_=e=>e.pointerId===c,v=(e,t)=>!(Math.abs(e-l)<=10&&Math.abs(t-u)<=10),y=()=>{i.isSelecting=!1,i.isPointerDrag=!1,i.pointerStartCell=null,h!==null&&(o.cancelAnimationFrame(h),h=null),g!==null&&(g(),g=null)},b=(e,t)=>{let n=r.getRootNode();if(!GE(n)&&!JD(n))return null;for(let i of n.elementsFromPoint(e,t)){let e=oz(r,i);if(e)return e}return null},x=(t,r)=>{if(d||i.isPointerDrag&&t.elem!==n.elem){if(i.anchorCell===null||!d){let r=d?t:n;e.update(()=>{i.$setAnchorCellForSelection(r)})}d=!0,i.focusCell!==null&&t.elem===i.focusCell.elem||(a.setNextFocus({focusCell:t,override:r,tableKey:i.tableNodeKey}),e.dispatchCommand(FC))}},S=e=>{for(let t=r.parentElement;t;t=t.parentElement)if(e===`x`?t.scrollWidth>t.clientWidth:t.scrollHeight>t.clientHeight){let n=o.getComputedStyle(t),r=e===`x`?n.overflowX:n.overflowY;if(r===`auto`||r===`scroll`)return t}return null},C=(e,t,n,r)=>{let i,a;if(e===null)i=0,a=n===`x`?o.innerWidth:o.innerHeight;else{let t=e.getBoundingClientRect();i=n===`x`?t.left:t.top,a=n===`x`?t.right:t.bottom}let s=$R(t,i,a,r);if(s===0)return!1;if(e===null){let e=n===`x`?o.scrollX:o.scrollY;return o.scrollBy(n===`x`?s:0,n===`x`?0:s),(n===`x`?o.scrollX:o.scrollY)!==e}if(n===`x`){let t=e.scrollLeft;return e.scrollLeft+=s,e.scrollLeft!==t}let c=e.scrollTop;return e.scrollTop+=s,e.scrollTop!==c},w=e=>{if(h=null,!i.isSelecting)return;let t=e>f?Math.min(e-f,100):1e3/60;f=e;let n=S(`x`),r=S(`y`),a=n!==null&&C(n,p,`x`,t),s=C(r,m,`y`,t);if(a||s){let[e,t]=((e,t)=>{let n=p,r=m;if(e===null)n=Math.min(Math.max(n,1),o.innerWidth-1);else{let t=e.getBoundingClientRect();n=Math.min(Math.max(n,t.left+1),t.right-1)}if(t===null)r=Math.min(Math.max(r,1),o.innerHeight-1);else{let e=t.getBoundingClientRect();r=Math.min(Math.max(r,e.top+1),e.bottom-1)}return[n,r]})(n,r),i=b(e,t);i&&x(i,!1),h=o.requestAnimationFrame(w)}},T=()=>{h!==null||s&&!i.isPointerDrag||!(()=>{let e=S(`x`);if(e!==null){let t=e.getBoundingClientRect();if($R(p,t.left,t.right)!==0)return!0}let t=S(`y`),n=t===null?0:t.getBoundingClientRect().top,r=t===null?o.innerHeight:t.getBoundingClientRect().bottom;return $R(m,n,r)!==0})()||(f=1/0,h=o.requestAnimationFrame(w))},ee=e=>{_(e)&&(a.touchTapCellKey=null,y())};g=Wk(o,{lostpointercapture:ee,pointercancel:ee,pointermove:e=>{if(!_(e))return;if(!(e=>!(1&~e.buttons))(e)&&i.isSelecting)return a.touchTapCellKey=null,void y();let t=iO(e);if(!sO(t))return;p=e.clientX,m=e.clientY,!i.isPointerDrag&&v(p,m)&&(i.isPointerDrag=!0,a.touchTapCellKey=null);let n=null,o=!(bC||r.contains(t));n=o?oz(r,t):b(e.clientX,e.clientY),n&&x(n,o),T()},pointerup:e=>{_(e)&&(v(e.clientX,e.clientY)&&(a.touchTapCellKey=null),y())}},i.listenerOptions)})(n)})(e,r,a,i,n,t)})}),Wk(r,{blur:i,keydown:i},{capture:!0}),i)})}function RCe(e,t,n,r,i){let a=n.getRootElement(),o=nz(n);a!==null&&o!==null||DR(246);let s=new NCe(n,e.getKey()),c=tz(e,t);(function(e,t){iz(e)!==null&&DR(205),e[XR]=t})(c,s),s.listenersToRemove.add(()=>function(e,t){iz(e)===t&&delete e[XR]}(c,s)),s.listenersToRemove.add(Uk(c,`mousedown`,e=>{let t=iO(e);e.detail>=3&&sO(t)&&az(t)!==null&&e.preventDefault()},s.listenerOptions));for(let[t,r]of PCe)s.listenersToRemove.add(n.registerCommand(t,t=>bz(n,t,r,e,s,i),3));s.listenersToRemove.add(n.registerCommand(rw,t=>{let n=$();if(qR(n)){let r=rz(e,n.focus.getNode());if(r!==null)return xz(t),r.selectEnd(),!0}return!1},3));let l=()=>{let t=$();return!!mz(t,e)&&!!qR(t)&&(s.$clearText(),!0)};for(let e of FCe)s.listenersToRemove.add(n.registerCommand(e,l,3));let u=t=>{let n=$();if(!qR(n)&&!Q(n))return!1;let r=e.isParentOf(n.anchor.getNode());if(r!==e.isParentOf(n.focus.getNode())){let t=r?`anchor`:`focus`,i=r?`focus`:`anchor`,{key:a,offset:o,type:s}=n[i];return e[n[t].isBefore(n[i])?`selectPrevious`:`selectNext`]()[i].set(a,o,s),!1}return!!mz(n,e)&&!!qR(n)&&(t&&(t.preventDefault(),t.stopPropagation()),s.$clearText(),!0)};for(let e of ICe)s.listenersToRemove.add(n.registerCommand(e,u,3));s.listenersToRemove.add(n.registerCommand(dw,e=>{let t=$();if(t){if(!qR(t)&&!Q(t))return!1;oI(n,NM(e,ClipboardEvent)?e:null,cI(t));let r=u(e);return Q(t)?(t.removeText(),!0):r}return!1},3));let d=a.ownerDocument;return s.listenersToRemove.add(Uk(d,`paste`,t=>{t.defaultPrevented||n.read(`latest`,()=>{let t=$();return a.contains(d.activeElement)&&qR(t)&&mz(t,e)})&&(t.preventDefault(),n.dispatchCommand(VC,t))})),s.listenersToRemove.add(Uk(d,`copy`,t=>{if(t.defaultPrevented)return;let r=iO(t);r===a||sO(r)&&a.contains(r)||n.read(`latest`,()=>{let t=$();return a.contains(nO(a))&&qR(t)&&mz(t,e)})&&(t.preventDefault(),n.dispatchCommand(uw,t))})),s.listenersToRemove.add(n.registerCommand(GC,t=>{let n=$();return!!mz(n,e)&&!!qR(n)&&(s.$formatCells(t),!0)},3)),s.listenersToRemove.add(n.registerCommand(lw,t=>{let n=$();if(!qR(n)||!mz(n,e))return!1;let r=n.anchor.getNode(),i=n.focus.getNode();if(!ER(r)||!ER(i))return!1;let[a,o,s]=RR(e,r,i),{minColumn:c,maxColumn:l,minRow:u,maxRow:d}=HR(a,o,s);if(u===0&&c===0&&d===a.length-1&&l===a[0].length-1)return e.setFormat(t),!0;let f=new Set;for(let e=u;e<=d;e++)for(let n=c;n<=l;n++){let r=a[e][n].cell;if(f.has(r))continue;f.add(r),r.setFormat(t);let i=r.getChildren();for(let e=0;e<i.length;e++){let n=i[e];Z(n)&&!n.isInline()&&n.setFormat(t)}}return!0},3)),s.listenersToRemove.add(n.registerCommand(BC,t=>{let r=$();if(!mz(r,e))return!1;if(qR(r))return s.$clearHighlight(),!1;if(Q(r)){if(!ER(GO(r.anchor.getNode(),e=>ER(e))))return!1;if(typeof t==`string`){let i=Cz(n,r,e);if(i)return Sz(i,e,[iE(t)]),!0}}return!1},3)),r&&s.listenersToRemove.add(n.registerCommand(aw,t=>{let n=$();if(!Q(n)||!n.isCollapsed()||!mz(n,e))return!1;let r=vz(n.anchor.getNode());return!(r===null||!e.is(yz(r))||(xz(t),function(e,t){let n=t===`next`?`getNextSibling`:`getPreviousSibling`,r=t===`next`?`getFirstChild`:`getLastChild`,i=e[n]();if(Z(i))return i.selectEnd();let a=GO(e,AR);a===null&&DR(247);for(let e=a[n]();AR(e);e=e[n]()){let t=e[r]();if(Z(t))return t.selectEnd()}let o=GO(a,Iz);o===null&&DR(248),t===`next`?o.selectNext():o.selectPrevious()}(r,t.shiftKey?`previous`:`next`),0))},3)),s.listenersToRemove.add(n.registerCommand(yge,t=>e.isSelected(),3)),s.listenersToRemove.add(n.registerCommand(zC,()=>{let t=$();if(!Q(t)||!t.isCollapsed()||!mz(t,e))return!1;let r=Cz(n,t,e);return!!r&&(Sz(r,e),!0)},3)),s}function zCe(e,t,n){let r=$(),i=t.isSelected();if(!(qR(r)&&r.tableKey===t.getKey()||n.isHighlightingCells||n.hasHijackedSelectionStyles||i))return;let{tableElement:a}=n.$lookup();if(n.table=sz(t,a),qR(r)&&r.tableKey===t.getKey()){let e=$E(r.anchor.key),t=$E(r.focus.key);if(ER(e)&&ER(t)){let r=wz(n,e),i=wz(n,t);n.anchorCell=r,n.anchorCellNodeKey=e.getKey(),n.anchorX=r.x,n.anchorY=r.y,n.focusCell=i,n.focusCellNodeKey=t.getKey(),n.focusX=i.x,n.focusY=i.y}n.$updateTableTableSelection(r)}else n.isHighlightingCells&&n.$clearHighlight(!1);n.hasHijackedSelectionStyles&&!i?function(e,t){t.$enableHighlightStyle(),lz(t.table,t=>{let n=t.elem;t.highlighted=!1,_z(e,t),n.getAttribute(`style`)||n.removeAttribute(`style`)})}(e,n):!n.hasHijackedSelectionStyles&&i&&function(e,t){t.$disableHighlightStyle(),lz(t.table,t=>{t.highlighted=!0,gz(e,t)})}(e,n)}function iz(e){return e[XR]||null}function az(e){let t=e;for(;t!=null;){let e=t.nodeName;if(e===`TD`||e===`TH`){let e=t._cell;return e===void 0?null:e}t=t.parentNode}return null}function oz(e,t){if(!e.contains(t))return null;let n=null;for(let r=t;r!=null;r=r.parentNode){if(r===e)return n;let t=r.nodeName;t!==`TD`&&t!==`TH`||(n=r._cell||null)}return null}function sz(e,t){let n=[],r={columns:0,domRows:n,rows:0},i=tz(e,t).querySelector(`tr`),a=0,o=0;for(n.length=0;i!=null;){let e=i.nodeName;if(e===`TD`||e===`TH`){let e={elem:i,hasBackgroundColor:i.style.backgroundColor!==``,highlighted:!1,x:a,y:o};i._cell=e;let t=n[o];t===void 0&&(t=n[o]=[]),t[a]=e}else{let e=i.firstChild;if(e!=null){i=e;continue}}let t=i.nextSibling;if(t!=null){a++,i=t;continue}let r=i.parentNode;if(r!=null){let e=r.nextSibling;if(e==null)break;o++,a=0,i=e}}return r.columns=a+1,r.rows=o+1,r}function cz(e,t,n){let r=new Set(n?n.getNodes():[]);lz(t,(t,n)=>{let i=t.elem;r.has(n)?(t.highlighted=!0,gz(e,t)):(t.highlighted=!1,_z(e,t),i.getAttribute(`style`)||i.removeAttribute(`style`))})}function lz(e,t){let{domRows:n}=e;for(let e=0;e<n.length;e++){let r=n[e];if(r)for(let n=0;n<r.length;n++){let i=r[n];if(!i)continue;let a=rD(i.elem);a!==null&&t(i,a,{x:n,y:e})}}}var BCe=(e,t,n,r,i)=>{let a=i===`forward`;switch(i){case`backward`:case`forward`:return n===(a?e.table.columns-1:0)?r===(a?e.table.rows-1:0)?a?t.selectNext():t.selectPrevious():hz(t.getCellNodeFromCordsOrThrow(a?0:e.table.columns-1,r+(a?1:-1),e.table),a):hz(t.getCellNodeFromCordsOrThrow(n+(a?1:-1),r,e.table),a),!0;case`up`:return r===0?t.selectPrevious():hz(t.getCellNodeFromCordsOrThrow(n,r-1,e.table),!1),!0;case`down`:return r===e.table.rows-1?t.selectNext():hz(t.getCellNodeFromCordsOrThrow(n,r+1,e.table),!0),!0;default:return!1}};function uz(e,t){let n,r;if(t.startColumn===e.minColumn)n=`minColumn`;else{if(t.startColumn+t.cell.__colSpan-1!==e.maxColumn)return null;n=`maxColumn`}if(t.startRow===e.minRow)r=`minRow`;else{if(t.startRow+t.cell.__rowSpan-1!==e.maxRow)return null;r=`maxRow`}return[n,r]}function dz(e,t,n){let r=uz(e,t);if(r)return r;let i=uz(e,n);return i?fz(i):[`minColumn`,`minRow`]}function fz([e,t]){return[e===`minColumn`?`maxColumn`:`minColumn`,t===`minRow`?`maxRow`:`minRow`]}function pz(e,t,[n,r]){let i=t[r],a=e[i];a===void 0&&DR(250,r,String(i));let o=t[n],s=a[o];return s===void 0&&DR(250,n,String(o)),s}function mz(e,t){if(Q(e)||qR(e)){let n=t.isParentOf(e.anchor.getNode()),r=t.isParentOf(e.focus.getNode());return n&&r}return!1}function hz(e,t){t?e.selectStart():e.selectEnd()}function gz(e,t){let n=t.elem,r=e._config.theme;ER(rD(n))||DR(131),_M(n,r.tableCellSelected)}function _z(e,t){let n=t.elem;ER(rD(n))||DR(131);let r=e._config.theme;vM(n,r.tableCellSelected)}function vz(e){let t=GO(e,ER);return ER(t)?t:null}function yz(e){let t=GO(e,Iz);return Iz(t)?t:null}function bz(e,t,n,r,i,a){if((n===`up`||n===`down`)&&function(e){let t=e.getRootElement();return!!t&&t.hasAttribute(`aria-controls`)&&t.getAttribute(`aria-controls`)===`typeahead-menu`}(e))return!1;let o=$();if(!mz(o,r)){if(Q(o)){if(n===`backward`){if(o.focus.offset>0)return!1;let e=function(e){for(let t=e,n=e;n!==null;t=n,n=n.getParent())if(Z(n)){if(n!==t&&n.getFirstChild()!==t)return null;if(!n.isInline())return n}return null}(o.focus.getNode());if(!e)return!1;let n=e.getPreviousSibling();return!!Iz(n)&&(xz(t),t.shiftKey?o.focus.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent(),`element`):n.selectEnd(),!0)}if(t.shiftKey&&(n===`up`||n===`down`)){let e=o.focus.getNode();if(!o.isCollapsed()&&(n===`up`&&!o.isBackward()||n===`down`&&o.isBackward())){let i=GO(e,e=>Iz(e));if(ER(i)&&(i=GO(i,Iz)),i!==r||!i)return!1;let a=n===`down`?i.getNextSibling():i.getPreviousSibling();if(!a)return!1;let s=0;n===`up`&&Z(a)&&(s=a.getChildrenSize());let c=a;n===`up`&&Z(a)&&(c=a.getLastChild()||a,s=aE(c)?c.getTextContentSize():0);let l=o.clone();return l.focus.set(c.getKey(),s,aE(c)?`text`:`element`),cD(l),xz(t),!0}if(BD(e)){let e=n===`up`?o.getNodes()[o.getNodes().length-1]:o.getNodes()[0];if(e&&rz(r,e)!==null){let e=r.getFirstDescendant(),t=r.getLastDescendant();if(!e||!t)return!1;let[n]=VR(e),[a]=VR(t),o=r.getCordsFromCellNode(n,i.table),s=r.getCordsFromCellNode(a,i.table),c=r.getDOMCellFromCordsOrThrow(o.x,o.y,i.table),l=r.getDOMCellFromCordsOrThrow(s.x,s.y,i.table);return i.$setAnchorCellForSelection(c),i.$setFocusCellForSelection(l,!0),!0}return!1}{let r=GO(e,e=>Z(e)&&!e.isInline());if(ER(r)&&(r=GO(r,Iz)),!r)return!1;let a=n===`down`?r.getNextSibling():r.getPreviousSibling();if(Iz(a)&&i.tableNodeKey===a.getKey()){let e=a.getFirstDescendant(),r=a.getLastDescendant();if(!e||!r)return!1;let[i]=VR(e),[s]=VR(r),c=o.clone();return c.focus.set((n===`up`?i:s).getKey(),n===`up`?0:s.getChildrenSize(),`element`),xz(t),cD(c),!0}}}}return n===`down`&&Mz(e)&&function(e,t){if(!Q(e))return!1;let n=sE(e.focus,`next`),r=$j(t,`next`);return mM(n.origin,r.origin)!==null&&cM(n,r)<0}(o,r)&&a.setShouldCheckSelectionForTable(r.getKey()),!1}if(Q(o)){if(n===`backward`||n===`forward`)return function(e,t,n,r,i,a,o){let s=sE(n.focus,i?`previous`:`next`);if(gE(s))return!1;let c=s;for(let e of iM(s).iterNodeCarets(`shadowRoot`)){if(!qj(e)||!Z(e.origin))return!1;c=e}let l=c.getParentAtCaret();if(!ER(l))return!1;let u=l,d=function(e){for(let t of iM(e).iterNodeCarets(`root`)){let{origin:n}=t;if(ER(n)){if(Jj(t))return $j(n,e.direction)}else if(!AR(n))break}return null}(Yj(u,c.direction)),f=GO(u,Iz);if(!f||!f.is(a))return!1;let p=e.getElementByKey(u.getKey()),m=az(p);if(!p||!m)return!1;if(o.table=GCe(e,f),d){if(r===`extend`){let t=az(e.getElementByKey(d.origin.getKey()));if(!t)return!1;o.$setAnchorCellForSelection(m),o.$setFocusCellForSelection(t,!0)}else{let e=hE(d);cE(n.anchor,e),cE(n.focus,e)}}else if(r===`extend`)o.$setAnchorCellForSelection(m),o.$setFocusCellForSelection(m,!0);else{let e=function(e){let t=tM(e);return Jj(t)?hE(t):e}(Yj(f,s.direction));cE(n.anchor,e),cE(n.focus,e)}return xz(t),!0}(e,t,o,t.shiftKey?`extend`:`move`,n===`backward`,r,i);if(o.isCollapsed()){let{anchor:s,focus:c}=o,l=GO(s.getNode(),ER),u=GO(c.getNode(),ER);if(!ER(l)||!l.is(u))return!1;let d=yz(l);if(d!==r&&d!=null){let r=tz(d,e.getElementByKey(d.getKey()));if(r!=null)return i.table=sz(d,r),bz(e,t,n,d,i,a)}let f=e.getElementByKey(l.__key),p=e.getElementByKey(s.key);if(p==null||f==null)return!1;let m;if(s.type===`element`)m=p.getBoundingClientRect();else{let t=qD(nz(e));if(t===null||t.rangeCount===0)return!1;let n=eO(t,e.getRootElement());if(n===null)return!1;m=n.getBoundingClientRect()}let h=n===`up`?l.getFirstChild():l.getLastChild();if(h==null)return!1;let g=e.getElementByKey(h.__key);if(g==null)return!1;let _=g.getBoundingClientRect();if(n===`up`?_.top>m.top-m.height:m.bottom+m.height>_.bottom){xz(t);let e=r.getCordsFromCellNode(l,i.table);if(!t.shiftKey)return BCe(i,r,e.x,e.y,n);{let t=r.getDOMCellFromCordsOrThrow(e.x,e.y,i.table);i.$setAnchorCellForSelection(t),i.$setFocusCellForSelection(t,!0)}return!0}}}else if(qR(o)){let{anchor:a,focus:s,tableKey:c}=o;if(c!==r.getKey())return!1;let l=GO(a.getNode(),ER),u=GO(s.getNode(),ER),[d]=o.getNodes();Iz(d)||DR(251);let f=tz(d,e.getElementByKey(d.getKey()));if(!ER(l)||!ER(u)||!Iz(d)||f==null)return!1;i.$updateTableTableSelection(o);let p=sz(d,f),m=r.getCordsFromCellNode(l,p),h=r.getDOMCellFromCordsOrThrow(m.x,m.y,p);if(i.$setAnchorCellForSelection(h),xz(t),t.shiftKey){let[e,t,a]=RR(r,l,u);return function(e,t,n,r,i){let a=HR(t,n,r),{topSpan:o,leftSpan:s,bottomSpan:c,rightSpan:l}=function(e,t){let{minColumn:n,maxColumn:r,minRow:i,maxRow:a}=t,o=1,s=1,c=1,l=1,u=e[i],d=e[a];for(let e=n;e<=r;e++)o=Math.max(o,u[e].cell.__rowSpan),l=Math.max(l,d[e].cell.__rowSpan);for(let t=i;t<=a;t++)s=Math.max(s,e[t][n].cell.__colSpan),c=Math.max(c,e[t][r].cell.__colSpan);return{bottomSpan:l,leftSpan:s,rightSpan:c,topSpan:o}}(t,a),[u,d]=fz(dz(a,n,r)),f=a[u],p=a[d];i===`forward`?f+=u===`maxColumn`?1:s:i===`backward`?f-=u===`minColumn`?1:l:i===`down`?p+=d===`maxRow`?1:o:i===`up`&&(p-=d===`minRow`?1:c);let m=t[p];if(m===void 0)return!1;let h=m[f];if(h===void 0)return!1;let[g,_]=function(e,t,n){let r=HR(e,t,n),i=dz(r,t,n);return[pz(e,r,i),pz(e,r,fz(i))]}(t,n,h),v=wz(e,g.cell),y=wz(e,_.cell);return e.$setAnchorCellForSelection(v),e.$setFocusCellForSelection(y,!0),!0}(i,e,t,a,n)}return u.selectEnd(),!0}return!1}function xz(e){e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation()}function Sz(e,t,n){let r=EE();e===`first`?t.insertBefore(r):t.insertAfter(r),r.append(...n||[]),r.selectEnd()}function Cz(e,t,n){let r=n.getParent();if(!r)return;let i=qD(nz(e));if(!i)return;let a=tO(i,e.getRootElement()).anchorNode,o=e.getElementByKey(r.getKey()),s=tz(n,e.getElementByKey(n.getKey()));if(!a||!o||!s||!o.contains(a)||s.contains(a))return;let c=GO(t.anchor.getNode(),e=>ER(e));if(!c)return;let l=GO(c,e=>Iz(e));if(!Iz(l)||!l.is(n))return;let[u,d]=RR(n,c,c),f=u[0][0],p=u[u.length-1][u[0].length-1],{startRow:m,startColumn:h}=d,g=m===f.startRow&&h===f.startColumn,_=m===p.startRow&&h===p.startColumn;return g?`first`:_?`last`:void 0}function wz(e,t){let{tableNode:n}=e.$lookup(),r=n.getCordsFromCellNode(t,e.table);return n.getDOMCellFromCordsOrThrow(r.x,r.y,e.table)}function Tz(e,t,n){return rz(e,rD(t,n))}function Ez(e){return oO(e)&&e.nodeName===`DIV`}var VCe=Ww()({colWidths:qw(Uw(t_e(zw())),{getter:{field:`__colWidths`}}),frozenColumnCount:qw(zw(),{getter:`getSerializedFrozenColumnCount`,setter:{field:`__frozenColumnCount`,method:`setFrozenColumns`}}),frozenRowCount:qw(zw(),{getter:`getSerializedFrozenRowCount`,setter:{field:`__frozenRowCount`,method:`setFrozenRows`}}),rowStriping:qw(Bw(),{getter:`getSerializedRowStriping`,setter:{field:`__rowStriping`}})});function Dz(e,t,n){let r=e.querySelector(`:scope > colgroup`);if(!n)return void(r&&r.remove());r||(r=QD().createElement(`colgroup`),SO(r),e.insertBefore(r,e.firstChild));let i=[];for(let e=0;e<t;e++){let t=QD().createElement(`col`),r=n[e];r&&(t.style.width=`${r}px`),i.push(t)}r.replaceChildren(...i)}function Oz(e,t,n){if(!t.theme.tableAlignment)return;let r=[],i=[];for(let e of[`center`,`right`]){let a=t.theme.tableAlignment[e];a&&(e===n?i:r).push(a)}vM(e,...r),_M(e,...i)}var kz=new WeakSet;function HCe(e){let{scrollable:t,scrollbar:n,tableElement:r}=e;if(n.classList.length===0&&function(e){let t=e.style.display;e.style.display=``;let n=e.offsetHeight-e.clientHeight;return e.style.display=t,n}(n)===0)return kz.add(n),n.style.display=`none`,t.style.scrollbarWidth=`auto`,()=>{};let i=t.scrollLeft,a=n.scrollLeft,o=()=>{t.scrollLeft!==i&&(n.scrollLeft=i=t.scrollLeft,a=n.scrollLeft)},s=()=>{n.scrollLeft!==a&&(t.scrollLeft=a=n.scrollLeft,i=t.scrollLeft)};t.addEventListener(`scroll`,o,{passive:!0}),n.addEventListener(`scroll`,s,{passive:!0});let c=null;return typeof ResizeObserver<`u`&&(c=new ResizeObserver(()=>{Az(t,n)}),c.observe(t),c.observe(r)),Az(t,n),()=>{t.removeEventListener(`scroll`,o),n.removeEventListener(`scroll`,s),c&&c.disconnect()}}function Az(e,t){if(kz.has(t))return;let n=t.firstElementChild;if(!n||!oO(n)||!e.isConnected)return;let r=e.ownerDocument.defaultView;if(!r)return void(t.style.display=`none`);let i=r.getComputedStyle(e).overflowX,a=i===`auto`||i===`scroll`,o=e.scrollWidth,s=e.clientWidth,c=o+`px`;n.style.width!==c&&(n.style.width=c);let l=a&&o>s;t.style.display=l?``:`none`}function UCe(e){if(!e.hasAttribute(`data-lexical-sticky-scrollbar`))return null;let t=e.firstElementChild;if(!Ez(t))return null;let n=t.querySelector(`:scope > table`);if(!ez(n))return null;let r=t.nextElementSibling;return Ez(r)?{scrollable:t,scrollbar:r,tableElement:n}:null}var jz=new WeakSet;function Mz(e=fO()){return jz.has(e)}function Nz(e=fO()){let t=eN(e,`@lexical/table/Table`);return!!t&&t.output.hasStickyScrollbar.peek()&&t.output.hasHorizontalScroll.peek()}function WCe(e,t){t?jz.add(e):jz.delete(e)}var Pz=class extends zT{__rowStriping=!1;__frozenColumnCount=0;__frozenRowCount=0;__colWidths=void 0;$config(){return this.config(`table`,{extends:zT,generated:hCe,importDOM:{table:()=>({conversion:KCe,priority:1})},json:VCe})}getSerializedFrozenColumnCount(){return this.getLatest().__frozenColumnCount||void 0}getSerializedFrozenRowCount(){return this.getLatest().__frozenRowCount||void 0}getSerializedRowStriping(){return this.getLatest().__rowStriping||void 0}getColWidths(){return this.getLatest().__colWidths}setColWidths(e){let t=this.getWritable();return t.__colWidths=e,t}extractWithChild(e,t,n){return n===`html`}getDOMSlot(e){let t=ez(e)?e:e.querySelector(`table`);return ez(t)||DR(229),super.getDOMSlot(e).withElement(t).withAfter(t.querySelector(`:scope > colgroup`))}createDOM(e,t){let n=QD().createElement(`table`);if(this.__style&&KT(n.style,this.__style),this.getColWidths()){let e=QD().createElement(`colgroup`);n.appendChild(e),SO(e)}if(_M(n,e.theme.table),this.updateTableElement(null,n,e),Mz(t)){let r=Nz(t),i=function(e,t,n){let r=QD().createElement(`div`),i=t.theme.tableScrollableWrapper;return i?_M(r,i):r.style.overflowX=`auto`,n&&(r.style.scrollbarWidth=`none`),r.appendChild(e),r}(n,e,r);if(this.updateTableWrapper(null,i,n,e),r){let t=function(e){let t=QD(),n=t.createElement(`div`),r=e.theme.tableStickyScrollbar;r?_M(n,r):(n.style.position=`sticky`,n.style.bottom=`0`,n.style.overflowX=`scroll`,n.style.overflowY=`hidden`),n.style.display=`none`,n.setAttribute(`aria-hidden`,`true`),n.tabIndex=-1;let i=t.createElement(`div`);return i.style.height=`1px`,i.style.width=`0px`,n.appendChild(i),n}(e),n=QD().createElement(`div`);return n.setAttribute(`data-lexical-sticky-scrollbar`,`true`),n.appendChild(i),n.appendChild(t),SO(t),n}return i}return n}updateTableWrapper(e,t,n,r){this.__frozenColumnCount!==(e?e.__frozenColumnCount:0)&&function(e,t,n,r){r>0?(_M(e,n.theme.tableFrozenColumn),t.setAttribute(`data-lexical-frozen-column`,`true`)):(vM(e,n.theme.tableFrozenColumn),t.removeAttribute(`data-lexical-frozen-column`))}(t,n,r,this.__frozenColumnCount),this.__frozenRowCount!==(e?e.__frozenRowCount:0)&&function(e,t,n,r){r>0?(_M(e,n.theme.tableFrozenRow),t.setAttribute(`data-lexical-frozen-row`,`true`)):(vM(e,n.theme.tableFrozenRow),t.removeAttribute(`data-lexical-frozen-row`))}(t,n,r,this.__frozenRowCount)}updateTableElement(e,t,n){this.__style!==(e?e.__style:``)&&KT(t.style,this.__style,e?e.__style:``),this.__rowStriping!==(!!e&&e.__rowStriping)&&function(e,t,n){n?(_M(e,t.theme.tableRowStriping),e.setAttribute(`data-lexical-row-striping`,`true`)):(vM(e,t.theme.tableRowStriping),e.removeAttribute(`data-lexical-row-striping`))}(t,n,this.__rowStriping);let r=e?e.getColumnCount():0,i=e?e.__colWidths:void 0;this.getColumnCount()===r&&this.getColWidths()===i||Dz(t,this.getColumnCount(),this.getColWidths()),Oz(t,n,this.getFormatType())}updateDOM(e,t,n){let r=tz(this,t);if(t===r===Mz())return!0;if(Ez(t)){if(t.hasAttribute(`data-lexical-sticky-scrollbar`)!==Nz())return!0;let i=r.parentElement;Ez(i)&&this.updateTableWrapper(e,i,r,n)}return this.updateTableElement(e,r,n),!1}scaleDOMColWidths(e,t){let n=this.getColWidths();n&&Dz(tz(this,e),this.getColumnCount(),n.map(e=>e*t))}exportDOM(e){let t=super.exportDOM(e),{element:n}=t,r=!ez(n)&&oO(n)?n.querySelector(`table`):n;if(oO(n)&&ez(r)&&r!==n){n.dir&&(r.dir=n.dir);let{paddingInlineStart:e}=n.style;e&&(r.style.paddingInlineStart=e);let t=n.getAttribute(`data-lexical-indent`);t!==null&&r.setAttribute(`data-lexical-indent`,t)}return{after:n=>{if(t.after&&(n=t.after(n)),!ez(n)&&oO(n)&&(n=n.querySelector(`table`)),!ez(n))return null;Oz(n,e._config,this.getFormatType());let[r]=zR(this,null,null),i=new Map;for(let e of r)for(let t of e){let e=t.cell.getKey();i.has(e)||i.set(e,{colSpan:t.cell.getColSpan(),startColumn:t.startColumn})}let a=new Set;for(let e of n.querySelectorAll(`:scope > tr > [data-temporary-table-cell-lexical-key]`)){let t=e.getAttribute(`data-temporary-table-cell-lexical-key`);if(t){let n=i.get(t);if(e.removeAttribute(`data-temporary-table-cell-lexical-key`),n){i.delete(t);for(let e=0;e<n.colSpan;e++)a.add(e+n.startColumn)}}}let o=n.querySelector(`:scope > colgroup`);if(o){let e=Array.from(n.querySelectorAll(`:scope > colgroup > col`)).filter((e,t)=>a.has(t));o.replaceChildren(...e)}let s=n.querySelectorAll(`:scope > tr`);if(s.length>0){let e=QD().createElement(`tbody`);for(let t of s)e.appendChild(t);n.append(e)}return n},element:r}}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(e,t){let{rows:n,domRows:r}=t;for(let t=0;t<n;t++){let n=r[t];if(n!=null)for(let r=0;r<n.length;r++){let i=n[r];if(i==null)continue;let{elem:a}=i,o=Tz(this,a);if(o!==null&&e.is(o))return{x:r,y:t}}}throw Error(`Cell not found in table.`)}getDOMCellFromCords(e,t,n){let{domRows:r}=n,i=r[t];return i==null?null:i[e<i.length?e:i.length-1]??null}getDOMCellFromCordsOrThrow(e,t,n){let r=this.getDOMCellFromCords(e,t,n);if(!r)throw Error(`Cell not found at cords.`);return r}getCellNodeFromCords(e,t,n){let r=this.getDOMCellFromCords(e,t,n);if(r==null)return null;let i=rD(r.elem);return ER(i)?i:null}getCellNodeFromCordsOrThrow(e,t,n){let r=this.getCellNodeFromCords(e,t,n);if(!r)throw Error(`Node at cords not TableCellNode.`);return r}getRowStriping(){return!!this.getLatest().__rowStriping}setRowStriping(e){let t=this.getWritable();return t.__rowStriping=e,t}setFrozenColumns(e){let t=this.getWritable();return t.__frozenColumnCount=e,t}getFrozenColumns(){return this.getLatest().__frozenColumnCount}setFrozenRows(e){let t=this.getWritable();return t.__frozenRowCount=e,t}getFrozenRows(){return this.getLatest().__frozenRowCount}canSelectBefore(){return!0}canIndent(){return!1}getColumnCount(){let e=this.getFirstChild();if(!AR(e))return 0;let t=0;return e.getChildren().forEach(e=>{ER(e)&&(t+=e.getColSpan())}),t}};function GCe(e,t){let n=e.getElementByKey(t.getKey());return n===null&&DR(230),sz(t,n)}function KCe(e){let t=Fz();e.hasAttribute(`data-lexical-row-striping`)&&t.setRowStriping(!0),e.hasAttribute(`data-lexical-frozen-column`)&&t.setFrozenColumns(1),e.hasAttribute(`data-lexical-frozen-row`)&&t.setFrozenRows(1);let n=e.querySelector(`:scope > colgroup`);if(n){let e=[];for(let t of n.querySelectorAll(`:scope > col`)){let n=t.style.width||``;if(!vR.test(n)&&(n=t.getAttribute(`width`)||``,!/^\d+$/.test(n))){e=void 0;break}e.push(parseFloat(n))}e&&t.setColWidths(e)}return bO(t,e),{after:e=>RM(e,AR),node:t}}function Fz(){return HD(new Pz)}function Iz(e){return e instanceof Pz}function qCe(e){AR(e.getParent())?e.isEmpty()&&e.append(EE()):e.remove()}function JCe(e){Iz(e.getParent())?IM(e,ER):e.remove()}function YCe(e){IM(e,AR),BR(e);let t=e.getColWidths(),n=e.getColumnCount();if(t&&t.length!==n){let r;if(n<t.length)r=t.slice(0,n);else if(t.length>0){let e=t[t.length-1];r=[...t,...Array(n-t.length).fill(e)]}e.setColWidths(r)}}function XCe(e){if(e.detail<3||!sO(e.target))return!1;let t=rD(e.target);if(t===null)return!1;let n=GO(t,e=>Z(e)&&!e.isInline());return n!==null&&!!ER(n.getParent())&&(IT(n.select(0)),!0)}function ZCe(){let e=$();if(!Q(e))return!1;let t=yz(e.anchor.getNode());if(t===null)return!1;let n=oD();if(!n.is(t.getParent())||n.getChildrenSize()!==1)return!1;let[r]=zR(t,null,null);if(r.length===0||r[0].length===0)return!1;let i=r[0][0];if(!i||!i.cell)return!1;let a=r[r.length-1],o=a[a.length-1];return!o||!o.cell?!1:(cD(JR(t,i.cell,o.cell)),!0)}function QCe(e){return e.registerNodeTransform(SR,e=>{if(e.getColSpan()>1||e.getRowSpan()>1){let[,,t]=VR(e),[n]=RR(t,e,e),r=n.length,i=n[0].length,a=t.getFirstChild();AR(a)||DR(175);let o=[];for(let e=0;e<r;e++){e!==0&&(a=a.getNextSibling(),AR(a)||DR(175));let t=null;for(let r=0;r<i;r++){let i=n[e][r],s=i.cell;if(i.startRow===e&&i.startColumn===r)t=s,o.push(s);else if(s.getColSpan()>1||s.getRowSpan()>1){ER(s)||DR(176);let e=TR(s.__headerState);t===null?rbe(a,e):t.insertAfter(e)}}}for(let e of o)e.setColSpan(1),e.setRowSpan(1)}})}function $Ce(e,t=!0){let n=new MCe,r=!1,i=(r,i,a)=>{let o=tz(r,a),s=RCe(r,o,e,t,n);n.observers.set(i,[s,o])};return Hk(LCe(e,n),e.registerCommand(FC,()=>e.getRootElement()!==null&&(r=!0,function(e,t){let n=$(),r=nj(),i=e.getAndClearNextFocus();if(i!==null&&Iz($E(i.tableKey))){let{tableKey:t,focusCell:r}=i,a=e.observers.get(t);a||DR(335,t);let[o]=a;if(qR(n)&&n.tableKey===o.tableNodeKey)return(r.x!==o.focusX||r.y!==o.focusY)&&(o.$setFocusCellForSelection(r),!0);if(o.anchorCell!==null&&o.anchorCellNodeKey!==null&&r.elem!==o.anchorCell.elem&&o.tableSelection!==null)return o.$setFocusCellForSelection(r,!0),!0}let a=e.getAndClearShouldCheckSelectionForTable();if(a&&Q(r)&&Q(n)&&n.isCollapsed()){let e=$E(a);if(Iz(e)){let t=n.anchor.getNode(),r=e.getFirstChild(),i=vz(t);if(i!==null&&AR(r)){let t=r.getFirstChild();if(ER(t)&&e.is(GO(i,n=>n.is(e)||n.is(t))))return t.selectStart(),!0}}}return qR(n)&&function(e,t){let n=nz(e),r=nj();if(!t.is(r))return;let i=ZR(t.tableKey),a=qD(n),o=a&&tO(a,e.getRootElement());if(a&&o&&o.anchorNode&&o.focusNode){let n=rD(o.focusNode),r=n&&!i.isParentOf(n),s=rD(o.anchorNode),c=s&&i.isParentOf(s);if(r&&c&&a.rangeCount>0){let n=$A(a,e);n&&(n.anchor.set(i.getKey(),t.isBackward()?i.getChildrenSize():0,`element`),a.removeAllRanges(),cD(n))}}}(t,n),Q(n)&&function(e,t){let n=nj(),{anchor:r,focus:i}=e,a=r.getNode(),o=i.getNode(),s=vz(a),c=vz(o),l=s?yz(s):null,u=c?yz(c):null;if(t.touchTapCellKey!==null&&!e.dirty&&!e.isCollapsed()&&Q(n)&&n.isCollapsed()&&(!s||!s.is(c))){let e=$E(n.anchor.key),a=e&&e.getParent();if(Z(e)&&e.isEmpty()&&ER(a)&&a.getKey()===t.touchTapCellKey&&a.getChildren().every(e=>Z(e)&&e.isEmpty())&&(r.is(n.anchor)||i.is(n.anchor)))return void cD(n.clone())}let d=e.isBackward(),f=s&&c&&l&&u&&l.is(u),p=u&&(!l||l.isParentOf(u)),m=l&&(!u||u.isParentOf(l));if(p){let t=e.clone(),[n]=RR(u,c,c),r=n[0][0].cell,i=n[n.length-1].at(-1).cell;t.focus.set(d?r.getKey():i.getKey(),d?0:i.getChildrenSize(),`element`),cD(t)}else if(m){let t=e.clone(),[n]=RR(l,s,s),r=n[0][0].cell,i=n[n.length-1].at(-1).cell;t.anchor.set(d?i.getKey():r.getKey(),d?i.getChildrenSize():0,`element`),cD(t)}else if(f){if(!s.is(c))return void cD(JR(l,s,c));let r=t.observers.get(l.getKey());if(r===void 0)return;let[i]=r;if(i.pointerType===`touch`&&i.isSelecting&&i.isPointerDrag&&e.isCollapsed()&&Q(n)&&n.isCollapsed()){let e=$E(n.anchor.key),t=e&&vz(e),{pointerStartCell:r}=i,a=r&&rD(r.elem);a!==null&&!a.is(c)&&t&&l.is(yz(t))&&!t.is(c)&&(cD(JR(l,t,c)),i.pointerType=null)}}}(n,e),!1}(n,e)),3),e.registerUpdateListener(({dirtyElements:t})=>{if(!r){for(let e of t.keys())if(n.observers.has(e)){r=!0;break}}r&&(r=!1,e.getRootElement()!==null&&e.read(`latest`,()=>{(function(e,t){for(let[n,r]of e.$getTableNodesAndObservers())zCe(t,n,r)})(n,e)}))}),e.registerMutationListener(Pz,t=>{r=!0,e.read(`latest`,()=>{for(let[e,r]of t){let t=n.observers.get(e);if(r===`created`||r===`updated`){let{tableNode:r,tableElement:a}=YR(e);t===void 0?i(r,e,a):a!==t[1]&&(n.removeObserver(e),i(r,e,a))}else r===`destroyed`&&n.removeObserver(e)}})},{skipInitialization:!1}),()=>{n.removeAllObservers()})}function ewe(e,t){e.hasNodes([Pz])||DR(255);let{hasNestedTables:n=pN(!1)}=t??{};return Hk(e.registerCommand(xCe,e=>function({rows:e,columns:t,includeHeaders:n},r){let i=$()||nj();if(!i||!Q(i)||!r&&yz(i.anchor.getNode()))return!1;let a=jR(Number(e),Number(t),n);MM(a);let o=a.getFirstDescendant();return aE(o)&&o.select(),!0}(e,n.peek()),0),e.registerCommand(oge,(t,r)=>e===r&&function(e,t){let{nodes:n,selection:r}=e;if(!n.some(e=>Iz(e)||Qye(e).some(e=>Iz(e.node)))){if(qR(r)){let e=``,t=!1;for(let r of n){let n=Z(r)&&!r.isInline();e.length>0&&(n||t)&&(e+=`
`),e+=r.getTextContent(),t=n}return r.insertRawText(e),!0}return!1}let i=qR(r),a=Q(r);return!!(a&&GO(r.anchor.getNode(),e=>ER(e))!==null&&GO(r.focus.getNode(),e=>ER(e))!==null||i)&&(n.length===1&&Iz(n[0])?WR(n[0],r):!(a&&t.peek()&&!function(e){return!(!qR(e)||e.focus.getNode().is(e.anchor.getNode()))||!(!Q(e)||!ER(e.anchor.getNode())||e.anchor.getNode().is(e.focus.getNode()))}(r)))}(t,n),0),e.registerCommand(fw,ZCe,1),e.registerCommand(IC,XCe,0),e.registerNodeTransform(Pz,YCe),e.registerNodeTransform(OR,JCe),e.registerNodeTransform(SR,qCe))}var twe={build:(e,t,n)=>cxe(t),config:{hasCellBackgroundColor:!0,hasCellMerge:!0,hasHorizontalScroll:!0,hasNestedTables:!1,hasStickyScrollbar:!1,hasTabHandler:!0},dependencies:[CP,[SP,{rules:[{$import:(e,t)=>{let n=Fz();t.hasAttribute(`data-lexical-row-striping`)&&n.setRowStriping(!0),t.hasAttribute(`data-lexical-frozen-column`)&&n.setFrozenColumns(1),t.hasAttribute(`data-lexical-frozen-row`)&&n.setFrozenRows(1);let r=t.querySelector(`:scope > colgroup`);if(r){let e=[];for(let t of r.querySelectorAll(`:scope > col`)){let n=t.style.width||``;if(!vR.test(n)&&(n=t.getAttribute(`width`)||``,!/^\d+$/.test(n))){e=void 0;break}e.push(parseFloat(n))}e&&n.setColWidths(e)}return[n.splice(0,0,RM(e.$importChildren(t),AR))]},match:wP.tag(`table`),name:`@lexical/table/table`},{$import:(e,t)=>[kR(vR.test(t.style.height)?parseFloat(t.style.height):void 0).splice(0,0,RM(e.$importChildren(t),ER))],match:wP.tag(`tr`),name:`@lexical/table/tr`},{$import:(e,t)=>{let n=t.nodeName===`TH`,r=vR.test(t.style.width)?parseFloat(t.style.width):void 0,i=xR.NO_STATUS;if(n){let e=t.getAttribute(`scope`);if(e===`col`)i=xR.COLUMN;else if(e===`row`)i=xR.ROW;else{let e=t.parentElement,n=Nve(e)&&(e.parentElement&&e.parentElement.nodeName===`THEAD`||e.rowIndex===0),r=t.cellIndex===0;n&&(i|=xR.ROW),r&&(i|=xR.COLUMN),i===xR.NO_STATUS&&(i=xR.ROW)}}let a=TR(i,t.colSpan,r);a.__rowSpan=t.rowSpan;let o=t.style.backgroundColor;o!==``&&(a.__backgroundColor=o);let s=t.style.verticalAlign;(function(e){return e===`middle`||e===`bottom`})(s)&&(a.__verticalAlign=s);let c=e.get(nP),l=c|function(e){let t=0,n=e.fontWeight;n!==`700`&&n!==`bold`||(t|=1),e.fontStyle===`italic`&&(t|=2);let r=(e.textDecoration||``).split(` `);return r.includes(`underline`)&&(t|=8),r.includes(`line-through`)&&(t|=4),t}(t.style),u=e.get(rP),d=t.style.color,f=d?{...u,color:d}:u,p=[];l!==c&&p.push(FN(nP,l)),f!==u&&p.push(FN(rP,f));let m=function(e){let t=[],n=null,r=()=>{if(n!==null){let e=n.getFirstChild();tk(e)&&n.getChildrenSize()===1&&e.remove()}};for(let i of e)LD(i)||aE(i)||tk(i)?n===null?(n=EE().append(i),t.push(n)):n.append(i):(r(),n=null,t.push(i));return r(),t.length===0&&t.push(EE()),t}(e.$importChildren(t,{context:p})),h=n?m:cP(m,t);return[a.splice(0,0,h)]},match:wP.tag(`td`,`th`),name:`@lexical/table/cell`}]}]],name:`@lexical/table/Table`,nodes:()=>[Pz,OR,SR],register(e,t,n){let r=n.getOutput(),i=!1;return Hk(xN(()=>{let t=r.hasHorizontalScroll.value,n=r.hasStickyScrollbar.value&&t,a=Mz(e);a!==t&&WCe(e,t),a===t&&i===n||e.update(Ek),i=n}),ewe(e,r),xN(()=>$Ce(e,r.hasTabHandler.value)),xN(()=>{if(r.hasStickyScrollbar.value&&r.hasHorizontalScroll.value)return e.registerRootListener(t=>{if(t)return function(e){let t=new Map;return Hk(()=>{for(let{cleanup:e}of t.values())e();t.clear()},e.registerMutationListener(Pz,n=>{for(let[r,i]of n){let n=t.get(r);if(i===`destroyed`){n&&(n.cleanup(),t.delete(r));continue}let a=e.getElementByKey(r),o=a&&oO(a)?UCe(a):null;n&&o&&n.parts.scrollable===o.scrollable&&n.parts.scrollbar===o.scrollbar&&n.parts.tableElement===o.tableElement?Az(o.scrollable,o.scrollbar):(n&&(n.cleanup(),t.delete(r)),o&&t.set(r,{cleanup:HCe(o),parts:o}))}},{skipInitialization:!1}))}(e)})}),xN(()=>r.hasCellMerge.value?void 0:QCe(e)),xN(()=>r.hasCellBackgroundColor.value?void 0:e.registerNodeTransform(SR,e=>{e.getBackgroundColor()!==null&&e.setBackgroundColor(null)})))}},Lz=(e,t=[])=>e.getRootElement()?.contains(document.activeElement)?t:[...t,`skip-dom-selection`],Rz=[{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`]},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`]},{id:`abap`,name:`ABAP`},{id:`actionscript-3`,name:`ActionScript`,aliases:[`actionscript`,`as3`]},{id:`ada`,name:`Ada`},{id:`angular-html`,name:`Angular HTML`},{id:`angular-ts`,name:`Angular TypeScript`},{id:`apache`,name:`Apache Conf`},{id:`apex`,name:`Apex`},{id:`apl`,name:`APL`},{id:`applescript`,name:`AppleScript`},{id:`ara`,name:`Ara`},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`]},{id:`razor`,name:`ASP.NET Razor`},{id:`asm`,name:`Assembly`},{id:`astro`,name:`Astro`},{id:`ahk`,name:`AutoHotkey`,aliases:[`ahk1`]},{id:`ahk2`,name:`AutoHotkey2`},{id:`awk`,name:`AWK`},{id:`ballerina`,name:`Ballerina`},{id:`bat`,name:`Batch File`,aliases:[`batch`,`cmd`]},{id:`beancount`,name:`Beancount`},{id:`berry`,name:`Berry`,aliases:[`be`]},{id:`bibtex`,name:`BibTeX`},{id:`bicep`,name:`Bicep`},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`]},{id:`blade`,name:`Blade`},{id:`c`,name:`C`},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`]},{id:`cpp`,name:`C++`,aliases:[`c++`]},{id:`c3`,name:`C3`},{id:`cadence`,name:`Cadence`,aliases:[`cdc`]},{id:`cairo`,name:`Cairo`},{id:`chapel`,name:`Chapel`,aliases:[`chpl`]},{id:`clarity`,name:`Clarity`},{id:`clojure`,name:`Clojure`,aliases:[`clj`]},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`]},{id:`cmake`,name:`CMake`},{id:`cobol`,name:`COBOL`},{id:`codeowners`,name:`CODEOWNERS`},{id:`codeql`,name:`CodeQL`,aliases:[`ql`]},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`]},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`]},{id:`crystal`,name:`Crystal`},{id:`css`,name:`CSS`},{id:`csv`,name:`CSV`},{id:`cue`,name:`CUE`},{id:`cypher`,name:`Cypher`,aliases:[`cql`]},{id:`d`,name:`D`},{id:`dart`,name:`Dart`},{id:`dax`,name:`DAX`},{id:`desktop`,name:`Desktop`},{id:`diff`,name:`Diff`},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`]},{id:`dotenv`,name:`dotEnv`},{id:`dream-maker`,name:`Dream Maker`},{id:`edge`,name:`Edge`},{id:`elixir`,name:`Elixir`},{id:`elm`,name:`Elm`},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`]},{id:`erb`,name:`ERB`},{id:`erlang`,name:`Erlang`,aliases:[`erl`]},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`]},{id:`fennel`,name:`Fennel`},{id:`fish`,name:`Fish`},{id:`fluent`,name:`Fluent`,aliases:[`ftl`]},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`]},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`]},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`]},{id:`gdscript`,name:`GDScript`,aliases:[`gd`]},{id:`gdshader`,name:`GDShader`},{id:`genie`,name:`Genie`},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`]},{id:`gherkin`,name:`Gherkin`},{id:`git-commit`,name:`Git Commit Message`},{id:`git-rebase`,name:`Git Rebase Message`},{id:`gleam`,name:`Gleam`},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`]},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`]},{id:`glsl`,name:`GLSL`},{id:`gn`,name:`GN`},{id:`smalltalk`,name:`GNU Smalltalk`},{id:`gnuplot`,name:`Gnuplot`},{id:`go`,name:`Go`},{id:`graphql`,name:`GraphQL`,aliases:[`gql`]},{id:`groovy`,name:`Groovy`},{id:`hack`,name:`Hack`},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`]},{id:`hcl`,name:`HashiCorp HCL`},{id:`haskell`,name:`Haskell`,aliases:[`hs`]},{id:`haxe`,name:`Haxe`},{id:`hjson`,name:`Hjson`},{id:`hlsl`,name:`HLSL`},{id:`html`,name:`HTML`},{id:`html-derivative`,name:`HTML (Derivative)`},{id:`http`,name:`HTTP`},{id:`hurl`,name:`Hurl`},{id:`hxml`,name:`HXML`},{id:`hy`,name:`Hy`},{id:`imba`,name:`Imba`},{id:`ini`,name:`INI`,aliases:[`properties`]},{id:`java`,name:`Java`},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`]},{id:`jinja`,name:`Jinja`},{id:`jison`,name:`Jison`},{id:`json`,name:`JSON`},{id:`jsonl`,name:`JSON Lines`},{id:`jsonc`,name:`JSON with Comments`},{id:`json5`,name:`JSON5`},{id:`jsonnet`,name:`Jsonnet`},{id:`jssm`,name:`JSSM`,aliases:[`fsl`]},{id:`jsx`,name:`JSX`},{id:`julia`,name:`Julia`,aliases:[`jl`]},{id:`just`,name:`Just`,aliases:[`justfile`]},{id:`kdl`,name:`KDL`},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`]},{id:`kusto`,name:`Kusto`,aliases:[`kql`]},{id:`latex`,name:`LaTeX`},{id:`lean`,name:`Lean 4`,aliases:[`lean4`]},{id:`less`,name:`Less`},{id:`liquid`,name:`Liquid`},{id:`llvm`,name:`LLVM IR`},{id:`log`,name:`Log file`},{id:`logo`,name:`Logo`},{id:`lua`,name:`Lua`},{id:`luau`,name:`Luau`},{id:`make`,name:`Makefile`,aliases:[`makefile`]},{id:`markdown`,name:`Markdown`,aliases:[`md`]},{id:`marko`,name:`Marko`},{id:`matlab`,name:`MATLAB`},{id:`mdc`,name:`MDC`},{id:`mdx`,name:`MDX`},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`]},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`]},{id:`mojo`,name:`Mojo`},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`]},{id:`move`,name:`Move`},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`]},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`]},{id:`nextflow-groovy`,name:`Nextflow Groovy`},{id:`nginx`,name:`Nginx`},{id:`nim`,name:`Nim`},{id:`nix`,name:`Nix`},{id:`nsis`,name:`NSIS`},{id:`nushell`,name:`nushell`,aliases:[`nu`]},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`]},{id:`objective-cpp`,name:`Objective-C++`},{id:`ocaml`,name:`OCaml`},{id:`odin`,name:`Odin`},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`]},{id:`org`,name:`Org Markup`},{id:`pascal`,name:`Pascal`},{id:`perl`,name:`Perl`},{id:`php`,name:`PHP`},{id:`pkl`,name:`Pkl`},{id:`plsql`,name:`PL/SQL`},{id:`polar`,name:`Polar`},{id:`postcss`,name:`PostCSS`},{id:`powerquery`,name:`PowerQuery`},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`,`pwsh`]},{id:`prisma`,name:`Prisma`},{id:`prolog`,name:`Prolog`},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`]},{id:`pug`,name:`Pug`,aliases:[`jade`]},{id:`puppet`,name:`Puppet`},{id:`purescript`,name:`PureScript`},{id:`python`,name:`Python`,aliases:[`py`]},{id:`qml`,name:`QML`},{id:`qmldir`,name:`QML Directory`},{id:`qss`,name:`Qt Style Sheets`},{id:`r`,name:`R`},{id:`racket`,name:`Racket`},{id:`raku`,name:`Raku`,aliases:[`perl6`]},{id:`rbs`,name:`RBS`,aliases:[`ruby-signature`]},{id:`regexp`,name:`RegExp`,aliases:[`regex`]},{id:`rel`,name:`Rel`},{id:`rst`,name:`reStructuredText`},{id:`riscv`,name:`RISC-V`},{id:`coq`,name:`Rocq`},{id:`ron`,name:`RON`},{id:`rosmsg`,name:`ROS Interface`},{id:`ruby`,name:`Ruby`,aliases:[`rb`]},{id:`haml`,name:`Ruby Haml`},{id:`rust`,name:`Rust`,aliases:[`rs`]},{id:`sas`,name:`SAS`},{id:`sass`,name:`Sass`},{id:`scala`,name:`Scala`},{id:`scheme`,name:`Scheme`},{id:`scss`,name:`SCSS`},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`]},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`]},{id:`shellsession`,name:`Shell Session`,aliases:[`console`]},{id:`smithy`,name:`Smithy`},{id:`solidity`,name:`Solidity`},{id:`sparql`,name:`SPARQL`},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`]},{id:`sql`,name:`SQL`},{id:`ssh-config`,name:`SSH Config`},{id:`stata`,name:`Stata`},{id:`stylus`,name:`Stylus`,aliases:[`styl`]},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`]},{id:`svelte`,name:`Svelte`},{id:`swift`,name:`Swift`},{id:`systemd`,name:`Systemd Units`},{id:`system-verilog`,name:`SystemVerilog`},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`]},{id:`tasl`,name:`Tasl`},{id:`tcl`,name:`Tcl`},{id:`templ`,name:`Templ`},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`]},{id:`tex`,name:`TeX`},{id:`toml`,name:`TOML`},{id:`tsv`,name:`TSV`},{id:`tsx`,name:`TSX`},{id:`turtle`,name:`Turtle`},{id:`twig`,name:`Twig`},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`]},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`]},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`]},{id:`typst`,name:`Typst`,aliases:[`typ`]},{id:`v`,name:`V`},{id:`vala`,name:`Vala`},{id:`verilog`,name:`Verilog`},{id:`vhdl`,name:`VHDL`},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`]},{id:`vb`,name:`Visual Basic`},{id:`vue`,name:`Vue`},{id:`vue-html`,name:`Vue HTML`},{id:`vue-vine`,name:`Vue Vine`},{id:`vyper`,name:`Vyper`,aliases:[`vy`]},{id:`wasm`,name:`WebAssembly`},{id:`wit`,name:`WebAssembly Interface Types`},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`]},{id:`wgsl`,name:`WGSL`},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`]},{id:`reg`,name:`Windows Registry Script`},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`]},{id:`xml`,name:`XML`},{id:`xsl`,name:`XSL`},{id:`yaml`,name:`YAML`,aliases:[`yml`]},{id:`zenscript`,name:`ZenScript`},{id:`zig`,name:`Zig`}],nwe=[{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`},{id:`github-light`,displayName:`GitHub Light`,type:`light`},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`},{id:`horizon`,displayName:`Horizon`,type:`dark`},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`light`},{id:`houston`,displayName:`Houston`,type:`dark`},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`},{id:`laserwave`,displayName:`LaserWave`,type:`dark`},{id:`light-plus`,displayName:`Light Plus`,type:`light`},{id:`material-theme`,displayName:`Material Theme`,type:`dark`},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`},{id:`min-dark`,displayName:`Min Dark`,type:`dark`},{id:`min-light`,displayName:`Min Light`,type:`light`},{id:`monokai`,displayName:`Monokai`,type:`dark`},{id:`night-owl`,displayName:`Night Owl`,type:`dark`},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`},{id:`nord`,displayName:`Nord`,type:`dark`},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`},{id:`one-light`,displayName:`One Light`,type:`light`},{id:`plastic`,displayName:`Plastic`,type:`dark`},{id:`poimandres`,displayName:`Poimandres`,type:`dark`},{id:`red`,displayName:`Red`,type:`dark`},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`},{id:`vesper`,displayName:`Vesper`,type:`dark`},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`}],rwe=`sveltia-ui`,iwe=`shiki`,zz,Bz,Vz=!0,Hz=(e,t)=>`4.6.0/${e}/${t}`,Uz=()=>(zz===void 0&&(zz=typeof indexedDB>`u`?null:new hu(rwe,iwe)),zz),awe=async e=>(Bz??=(async()=>{let t=(await e.keys()).filter(e=>typeof e==`string`&&!e.startsWith(`4.6.0/`));t.length&&await e.deleteEntries(t)})(),Bz),owe=async(e,t)=>{let n=Vz?Uz():null;if(n)try{return await awe(n),await n.get(Hz(e,t))}catch{return}},swe=async(e,t,n)=>{let r=Vz?Uz():null;if(r)try{await r.set(Hz(e,t),n)}catch{}},Wz=`https://unpkg.com/@shikijs`,cwe=`https://unpkg.com/@sveltia/ui`,lwe=()=>`${cwe}@0.90.0/dist/shiki-engine.js`,uwe=e=>`${Wz}/langs@4.6.0/dist/${e}.mjs`,dwe=e=>`${Wz}/themes@4.6.0/dist/${e}.mjs`,fwe={loadEngine:async()=>import(lwe()),loadLanguage:async e=>import(uwe(e)),loadTheme:async e=>import(dwe(e))},Gz=()=>fwe,Kz=()=>{if(typeof document>`u`)return`github-light`;let{theme:e}=document.documentElement.dataset;return e?e===`dark`?`github-dark`:`github-light`:window.matchMedia(`(prefers-color-scheme: dark)`).matches?`github-dark`:`github-light`},qz=e=>{if(typeof document>`u`)return()=>void 0;let t=new MutationObserver(e);t.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`]});let n=window.matchMedia(`(prefers-color-scheme: dark)`);return n.addEventListener(`change`,e),()=>{t.disconnect(),n.removeEventListener(`change`,e)}},pwe=e=>qz(()=>{let t=Kz();e.update(()=>{oD().getChildren().forEach(e=>{UP(e)&&e.getTheme()!==t&&(e.setTheme(t),e.markDirty())})},{tag:Lz(e,[`history-merge`])})}),mwe=[``,`plain`,`plaintext`,`text`,`txt`],hwe=/^diff-([\w-]+)/i,Jz=null,Yz=null,Xz=!1,Zz=e=>hwe.exec(e)?.[1]??null,Qz=e=>mwe.includes(e??``),$z=()=>!!Yz,gwe=()=>Xz,eB=e=>{if(!Yz)return!1;let t=Zz(e)??e;return Jz.isSpecialLang(t)?!0:Yz.getLoadedLanguages().includes(t)},_we=(e,t)=>{e.update(()=>{let e=$E(t);if(!UP(e))return;let n=e.getLanguage();n&&eB(n)&&!e.getIsSyntaxHighlightSupported()&&e.setIsSyntaxHighlightSupported(!0),e.markDirty()},{tag:Lz(e,[`history-merge`])})},tB=new Map,nB=(e,t,n,r)=>{let i=tB.get(e);if(!i){let n=new Map;i={promise:(async()=>{try{await t()}catch{}tB.delete(e),n.forEach((e,t)=>_we(e,t))})(),targets:n},tB.set(e,i)}return n&&r&&i.targets.set(r,n),i.promise},rB=(e,t)=>{if(!(Yz||Xz))return nB(`engine`,async()=>{try{Jz=await Gz().loadEngine(),Yz=Jz.createHighlighterCoreSync({engine:Jz.createJavaScriptRegexEngine(),langs:[],themes:[]})}catch{Xz=!0}},e,t)},vwe=async(e,t,n)=>{let r=await owe(e,t);if(r)return r;let i=await n();if(!i)return;let a=i.default??i;return await swe(e,t,a),a},iB=(e,t,n,r)=>{let i=e===`lang`?`loadLanguage`:`loadTheme`;return nB(`${e}/${t}`,async()=>{let n=await vwe(e,t,()=>Gz()[i](t));n&&await Yz[i](n)},n,r)},aB=e=>Rz.find(({id:t,aliases:n})=>t===e||n?.includes(e)),oB=e=>aB(e)?.id??e,sB=(e,t,n)=>{let r=Zz(e)??e;if(!Yz||eB(r))return;let i=aB(r);if(i)return iB(`lang`,i.id,t,n)},cB=e=>Yz?Jz.isSpecialTheme(e)||Yz.getLoadedThemes().includes(e):!1,lB=(e,t,n)=>{if(Yz&&!cB(e)&&nwe.some(({id:t})=>t===e))return iB(`theme`,e,t,n)},ywe=(e,t)=>{let n=[];return e.forEach((e,r)=>{r&&n.push(ek()),e.forEach((e,r)=>{let{content:i}=e;if(t&&r===0&&i.length>0){let e=[`+`,`-`,`>`,`<`,` `],t=[`inserted`,`deleted`,`inserted`,`deleted`,`unchanged`],r=e.indexOf(i[0]);r!==-1&&(n.push(ZP(e[r],t[r])),i=i.slice(1))}let a=Jz.stringifyTokenStyle(e.htmlStyle||Jz.getTokenStyleObject(e));uj(i,{linebreak:()=>n.push(ek()),tab:()=>n.push(kE()),text:e=>{let t=ZP(e);t.setStyle(a),n.push(t)}})})}),n},bwe=(e,t)=>{let n=Zz(t),{tokens:r}=Yz.codeToTokens(e.getTextContent(),{lang:n??t,theme:e.getTheme()});return ywe(r,!!n)},uB=(e,t)=>{if(!Yz||Qz(e)||!eB(e))return;let n=t??Kz();return cB(n)?n:void 0},xwe=(e,t,{theme:n}={})=>{let r=oB(Zz(t)??t),i=uB(r,n);if(i!==void 0)return Yz.codeToHtml(e,{lang:r,theme:i})},Swe=(e,t,{theme:n}={})=>{let r=oB(t),i=uB(r,n);if(i===void 0)return;let{tokens:a,fg:o=``}=Yz.codeToTokens(e,{lang:r,theme:i});return a.map(e=>e.map(({content:e,color:t,fontStyle:n=0})=>{let r={content:e};return t&&t.toLowerCase()!==o.toLowerCase()&&(r.color=t),n&2&&(r.bold=!0),n&4&&(r.underline=!0),n&8&&(r.strikethrough=!0),r}))},Cwe={a:[`href`,`rel`,`target`,`title`],ol:[`start`],td:[`colspan`,`rowspan`],th:[`colspan`,`rowspan`]},dB=[[`code`,`code`],[`subscript`,`sub`],[`superscript`,`sup`],[`highlight`,`mark`],[`underline`,`u`],[`strikethrough`,`s`],[`italic`,`em`],[`bold`,`strong`]],wwe=[`tbody`,`thead`,`tfoot`,`colgroup`,`col`],Twe=[`html`,`head`,`body`],fB=e=>e.className.match(/(?:^|\s)(?:lang|language)-(\S+)/)?.[1],Ewe=[`p`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`blockquote`,`li`],pB=e=>{let t=Cwe[e.localName]??[],n=Ewe.includes(e.localName)?e.style.textAlign:``;[...e.attributes].forEach(({name:n})=>{t.includes(n)||e.removeAttribute(n)}),n&&(e.style.textAlign=n)},mB=(e,t)=>{let{after:n,...r}=t.exportDOM(e);return oO(r.element)&&pB(r.element),{...r,after:e=>{let r=n?n.call(t,e):void 0,i=r??e;return oO(i)&&(pB(i),i.querySelectorAll(`:scope > br`).forEach(pB)),r===e?void 0:r}}},Dwe=`address.article.aside.blockquote.center.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.hr.li.listing.main.menu.nav.ol.p.plaintext.pre.search.section.summary.table.ul.xmp`.split(`.`),hB=e=>oO(e)&&Dwe.includes(e.localName),gB=e=>{for(let t=e.parentElement;t;t=t.parentElement)if(t.localName===`pre`||t.style.whiteSpace.startsWith(`pre`))return!0;return!1},_B=(e,t)=>{let n=e??null;for(;n&&!WE(n);)n=t?n.firstChild:n.lastChild;return n??void 0},Owe=dB.map(([,e])=>e),vB=e=>WE(e)?!e.data.trim():oO(e)&&Owe.includes(e.localName)&&[...e.childNodes].every(vB),kwe=e=>{let t=[...e.childNodes];if(!t.some(hB))return;let n=document.createDocumentFragment(),r=[],i=()=>{let t=_B(r[0],!0),i=_B(r.at(-1),!1);if(t&&!gB(t)&&(t.data=t.data.trimStart()),i&&!gB(i)&&(i.data=i.data.trimEnd()),!r.every(vB)){let t=e.cloneNode(!1);t.append(...r),n.append(t)}r=[]};return t.forEach(e=>{hB(e)?(i(),n.append(e)):r.push(e)}),i(),n},Awe=(e,t)=>{let n=t.getParent();if(n instanceof SR&&n.getChildrenSize()===1&&!t.getFormatType())return{element:document.createDocumentFragment()};if(t.isEmpty()&&t.getNextSiblings().every(e=>DE(e)&&e.isEmpty()))return{element:null};let{after:r,...i}=mB(e,t);return{...i,after:e=>{let n=r.call(t,e),i=n??e;return oO(i)&&kwe(i)||n}}},yB=(e,t)=>{let n=document.createTextNode(t.getTextContent());return dB.forEach(([e,r])=>{if(t.hasFormat(e)){let e=document.createElement(r);e.append(n),n=e}}),{element:n}},jwe=(e,t)=>({element:document.createElement(`pre`),after:e=>{if(!oO(e))return;let n=document.createElement(`code`),r=t.getLanguage();r&&!Qz(r)&&(n.className=`language-${r}`),n.textContent=[...e.childNodes].map(e=>e.nodeName===`BR`?oO(e)&&e.hasAttribute(`data-lexical-managed-linebreak`)?``:`
`:e.textContent).join(``),e.replaceChildren(n)}}),Mwe=`:scope > :is(thead, tbody, tfoot), :scope > :is(thead, tbody, tfoot) > tr, :scope > :is(thead, tbody, tfoot) > tr > :is(th, td), :scope > tr, :scope > tr > :is(th, td)`,Nwe=new Map([[eE,yB],[OE,yB],[YP,yB],[TE,Awe],[bI,mB],[_I,mB],[PF,mB],[zF,mB],[hF,mB],[TN,mB],[VP,jwe],[Pz,(e,t)=>{let{after:n,...r}=t.exportDOM(e);return{...r,after:e=>{let r=n?n.call(t,e):void 0,i=r??e;return oO(i)&&(i.querySelectorAll(`:scope > colgroup`).forEach(e=>e.remove()),[i,...i.querySelectorAll(Mwe)].forEach(pB)),r===e?void 0:r}}}]]),Pwe=e=>{let t=document.createTreeWalker(e,NodeFilter.SHOW_ALL),n=``;for(let e=t.nextNode();e;e=t.nextNode())e.nodeType===Node.TEXT_NODE?n+=e.data:e.nodeName===`BR`&&(n+=`
`);return n},Fwe=e=>{let t=e.querySelector(`:scope > code`),n=HP((t?fB(t):void 0)??e.getAttribute(`data-language`)),r=Pwe(e).replace(/\n$/,``);return r&&n.append(iE(r)),{node:n,after:()=>[]}},bB=new WeakMap,xB=new WeakMap,SB=e=>{let t=xB.get(e);return t||(t=e.importDOM?.()??{},xB.set(e,t)),t},CB=new WeakMap,wB=(e,t)=>{let n=CB.get(t);return n===void 0&&(n=bB.get(e)?.find(({node:e})=>!!SB(e)[t.localName]?.(t))??null,CB.set(t,n)),n??void 0},TB=e=>{let t=wB(fO(),e);return!!t&&!!t.node.prototype.isInline?.()},EB=(e,t)=>{let n=e;for(;;){let e=t?n.nextSibling:n.previousSibling;for(;!e;){let{parentElement:r}=n;if(!r)return null;n=r,e=t?n.nextSibling:n.previousSibling}if(n=e,oO(n)){if(TB(n))return n;let{display:e}=n.style;if(e?!e.startsWith(`inline`):!lO(n))return null}let r=t?n.firstChild:n.lastChild;for(;r;){if(n=r,oO(n)&&TB(n))return n;r=t?n.firstChild:n.lastChild}if(WE(n))return n;if(n.nodeName===`BR`)return null}},Iwe=e=>{let t=e.data.replace(/\r/g,``).replace(/[ \t\n]+/g,` `);if(t.startsWith(` `)){let n=EB(e,!1),r=!0;for(;n;n=EB(n,!1)){if(!WE(n)){r=!1;break}let e=n.data;if(e){r=/[ \t\n]$/.test(e);break}}r&&(t=t.slice(1))}if(t.endsWith(` `)){let n=EB(e,!0),r=!0;for(;n;n=EB(n,!0))if(!WE(n)||n.data.replace(/^[ \t\n]+/,``)){r=!1;break}r&&(t=t.slice(0,-1))}return{node:t?iE(t):null}},Lwe={"#text":e=>gB(e)?null:{conversion:e=>Iwe(e),priority:1}},Rwe={pre:()=>({conversion:Fwe,priority:2})},zwe=e=>{let t=bB.get(e)??[],n=new Set(t.map(({node:e})=>e)),r=new Set([...e._nodes.values()].filter(({klass:e})=>!n.has(e)).flatMap(({klass:e})=>Object.keys(e.importDOM?.()??{})));return new Set(t.flatMap(({node:e})=>Object.keys(SB(e))).filter(e=>!r.has(e)))},Bwe=(e,t)=>{let n=zwe(e),r=i=>{let a;return[...i.childNodes].some(i=>{if(i.nodeType===Node.COMMENT_NODE)return a=i,!0;if(i.nodeType!==Node.ELEMENT_NODE)return!1;let o=i,s=o.localName;return wB(e,o)?!1:!Twe.includes(s)&&!wwe.includes(s)&&(!e._htmlConversions.has(s)||n.has(s))?(a=o,!0):(a=s===`pre`?t.createTreeWalker(o,NodeFilter.SHOW_COMMENT).nextNode()??void 0:r(o),!!a)}),a};return r(t)},DB=e=>DP(e),OB={defaultLanguage:`javascript`,defaultTheme:`github-light`,tokenize(e,t){let n=t||this.defaultLanguage;return n===null||Qz(n)||!$z()?PP(e.getTextContent()):bwe(e,n)}},Vwe=(e,t)=>{let n=t.getElementByKey(e.getKey());if(n===null)return;let r=e.getChildren(),i=r.length;if(i===n.__cachedChildrenLength)return;n.__cachedChildrenLength=i;let a=`1`,o=1;for(let e=0;e<i;e+=1)tk(r[e])&&(o+=1,a+=`\n${o}`);n.setAttribute(`data-gutter`,a)},kB=(e,t)=>QP(e)&&QP(t)&&e.__text===t.__text&&e.__highlightType===t.__highlightType&&e.__style===t.__style||AE(e)&&AE(t)||tk(e)&&tk(t),Hwe=(e,t)=>{let n=0;for(;n<e.length&&kB(e[n],t[n]);)n+=1;let r=e.length,i=t.length,a=Math.min(r,i)-n,o=0;for(;o<a;)if(o+=1,!kB(e[r-o],t[i-o])){--o;break}return{from:n,to:r-o,nodesForReplacement:t.slice(n,i-o)}},Uwe=(e,t)=>{let n=$E(e);if(!UP(n)||!n.isAttached())return;let r=$();if(!Q(r)){t();return}let{anchor:i}=r,a=i.getNode();if(a!==n&&!n.isParentOf(a)){t();return}let o=i.offset,s=i.type===`element`&&tk(n.getChildAtIndex(i.offset-1)),c=0;if(s||(c=o+a.getPreviousSiblings().reduce((e,t)=>e+t.getTextContentSize(),0)),!t())return;if(s){i.getNode().select(o,o);return}let l=n.getChildren();for(let e=0;e<l.length;e+=1){let t=l[e];if(aE(t)){let e=t.getTextContentSize();if(e>=c){t.select(c,c);return}c-=e}else if(tk(t)){if(c===0){n.select(e,e);return}--c}}n.select(l.length,l.length)},AB=(e,t,n,r)=>{let i=r.getKey(),{nodesCurrentlyHighlighting:a}=n,o=r.getLanguage();!o&&t.defaultLanguage!==null&&(o=t.defaultLanguage,r.setLanguage(o));let s=r.getTheme();s||(s=t.defaultTheme,r.setTheme(s));let c=!o||Qz(o),l=!1;c||!o||gwe()?r.getIsSyntaxHighlightSupported()&&r.setIsSyntaxHighlightSupported(!1):$z()?(cB(s)||(lB(s,e,i),l=!0),eB(o)?r.getIsSyntaxHighlightSupported()||r.setIsSyntaxHighlightSupported(!0):(!sB(o,e,i)&&r.getIsSyntaxHighlightSupported()&&r.setIsSyntaxHighlightSupported(!1),l=!0)):(rB(e,i),l=!0),l||(a.has(i)?n.pendingRefresh.has(i)||(n.pendingRefresh.add(i),ND(()=>{n.pendingRefresh.delete(i),e.update(()=>{let e=$E(i);UP(e)&&e.markDirty()},{tag:Lz(e,[`history-merge`])})})):(a.add(i),n.didTransform||(n.didTransform=!0,ND(()=>{n.didTransform=!1,a.clear()})),Uwe(i,()=>{let e=$E(i);if(!UP(e)||!e.isAttached())return!1;let n=e.getLanguage()||t.defaultLanguage,a=t.tokenize(e,n??void 0),{from:o,to:s,nodesForReplacement:c}=Hwe(e.getChildren(),a);return o!==s||c.length?(r.splice(o,s-o,c),!0):!1})))},jB=(e,t,n,r)=>{let i=r.getParent();UP(i)?AB(e,t,n,i):QP(r)&&r.replace(iE(r.__text))},Wwe=(e,t=OB)=>{if(!e.hasNodes([VP,YP]))throw Error(`CodeNode or CodeHighlightNode not registered on editor`);let n=[];e._headless!==!0&&n.push(e.registerMutationListener(VP,t=>{e.read(`latest`,()=>{t.forEach((t,n)=>{if(t!==`destroyed`){let t=$E(n);t!==null&&Vwe(t,e)}})})},{skipInitialization:!1}));let r={didTransform:!1,nodesCurrentlyHighlighting:new Set,pendingRefresh:new Set};return n.push(e.registerNodeTransform(VP,AB.bind(null,e,t,r)),e.registerNodeTransform(eE,jB.bind(null,e,t,r)),e.registerNodeTransform(YP,jB.bind(null,e,t,r)),Oxe(e)),Hk(...n)},Gwe={dependencies:[TN],export:e=>DN(e)?`***`:null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,t,n,r)=>{let i=EN();r||e.getNextSibling()!==null?e.replace(i):e.insertBefore(i),i.isAttached()&&i.selectNext()},type:`element`},MB=`[ \\t\\uE005]`;`${MB}${MB}${MB}${MB}${MB}`;var NB=String.raw`(?=<)(?<!(?:^|[^\\])(?:\\\\)*\\)`,PB=new RegExp([NB,`(?:`,[`<[A-Za-z][A-Za-z0-9-]*(?:[ \\t\\uE005]+[A-Za-z_:][\\w.:-]*(?:[ \\t\\uE005]*=[ \\t\\uE005]*(?:[^\\s"'=<>\`\\uE005]+|'[^'\\n]*'|"[^"\\n]*"))?)*[ \\t\\uE005]*/?>|</[A-Za-z][A-Za-z0-9-]*[ \\t\\uE005]*>`,String.raw`<!-->|<!--->|<!--.*?-->`,String.raw`<\?.*?\?>`,String.raw`<![A-Za-z][^>]*>`,String.raw`<!\[CDATA\[.*?\]\]>`].join(`|`),`)`].join(``)),Kwe=`(?:${[`javascript`,`vbscript`,`data`].map(e=>e.replace(/[a-z]/g,e=>`[${e}${e.toUpperCase()}]`)).join(`|`)})`,qwe=new RegExp([NB,`(?:`,[String.raw`<(?!${Kwe}:)[A-Za-z][A-Za-z0-9+.-]{1,31}:[^\s<>]*>`,String.raw`<[\w.!#$%&'*+/=?^\x60{|}~-]+@[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?`+String.raw`(?:\.[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*>`].join(`|`),`)`].join(``)),Jwe=/(?<!(?:^|[^\\])(?:\\\\)*\\)\[\^[^\s[\]]+\]/,Ywe=[/([-*_])(?:[ \t]*\1){2,}[ \t]*$/,/(?:=+|-{2,})[ \t]*$/,/(?:#{1,6}|[-+*]|\d{1,9}[.)])(?=[ \t]|$)/,/>|`{3,}|~{3,}/].map(({source:e})=>e).join(`|`),Xwe=String.raw`\[(?:[^\\[\]]|\\.)+\]:`,Zwe=RegExp(`^ {0,3}(?:${Ywe}|${Xwe})`),FB=Jw(`suiRawSyntax`,{parse:e=>typeof e==`string`?e:``}),Qwe=e=>Yw(e,FB)||void 0,$we=e=>{if(Yw(e,FB))return e.getTextContent()},IB={dependencies:[],export:()=>null,importRegExp:Zwe,regExp:/(?!)/,replace:e=>{Xw(e,FB,e.getTextContent())},type:`text-match`},LB={dependencies:[],export:()=>null,importRegExp:new RegExp([`^(?=[*_~=]).+`,`(?<=^).+`,PB.source,qwe.source,Jwe.source].join(`|`)),regExp:/(?!)/,replace:IB.replace,type:`text-match`},RB=e=>{let t=$()??nj();t&&!$()&&cD(t.clone());let n=Q(t)?t.anchor.getNode():null;return DE(n)&&n.isEmpty()&&WT(n.getParent())?n.replace(e):MM(e)},eTe=()=>{let e=RB(EN()),t=e.getNextSibling();return Z(t)?t.selectStart():e.insertAfter(EE()).selectStart(),e},zB=e=>{let t=Number(e);return Number.isInteger(t)&&t>=1&&t<=50?t:void 0},tTe=(e,t)=>{let n=`| ${Array(t).fill(``).join(` | `)} |`;return[n,`| ${Array(t).fill(`---`).join(` | `)} |`,...Array(e-1).fill(n)].join(`
`)},BB=e=>{let t=e.closest(`table`);return!!t&&getComputedStyle(t).direction===`rtl`},VB=e=>e?GO(e,ER):null,HB=()=>{let e=$();return!Q(e)&&!qR(e)?null:VB(e.focus.getNode())?.getKey()??null},nTe=(e,t)=>{let n=$()??nj();return(Q(n)||qR(n))&&yz(n.anchor.getNode())?!1:(RB(jR(e,t,{rows:!0,columns:!1})).getFirstChildOrThrow().getFirstChildOrThrow().selectStart(),!0)},rTe=e=>{!e.getNextSibling()&&WT(e.getParent())&&e.insertAfter(EE())},iTe=e=>{e.getChildren().forEach((e,t)=>{if(!AR(e))return;let n=t===0?xR.ROW:xR.NO_STATUS;e.getChildren().forEach(e=>{ER(e)&&e.getHeaderStyles()!==n&&e.setHeaderStyles(n)})})},aTe=e=>{let t=e.getPreviousSibling(),n=e.getNextSibling();Z(t)?t.selectEnd():Z(n)?n.selectStart():e.insertAfter(EE()).selectStart()},oTe=e=>e===`delete-row`||e===`delete-column`,sTe=(e,t)=>{let n=$(),[r,i]=[n.anchor,n.focus].map(e=>VB(e.getNode())).map(e=>t===`delete-row`?e.getParentOrThrow().getIndexWithinParent():e.getIndexWithinParent()).sort((e,t)=>e-t);return i-r+1===(t===`delete-row`?e.getChildrenSize():e.getColumnCount())},cTe=(e,t,{rtl:n=!1}={})=>{let r=$E(t);if(!ER(r))return!1;let i=yz(r),a=$()??nj();return(Q(a)||qR(a))&&yz(a.anchor.getNode())?.is(i)&&yz(a.focus.getNode())?.is(i)?$()||cD(a.clone()):r.selectStart(),e===`delete-table`||oTe(e)&&sTe(i,e)?(aTe(i),i.remove()):e===`delete-row`?DCe():e===`delete-column`?OCe():e===`insert-row-above`||e===`insert-row-below`?TCe(e===`insert-row-below`):ECe(e===`insert-column-right`!==n),!0},lTe=e=>e.replace(/^( {0,3})(#{1,6}(?=[ \t]|$)|[-+](?=[ \t]|$)|>|=+[ \t]*$|-{2,}[ \t]*$)/,`$1\\$2`).replace(/^( {0,3}\d{1,9})([.)])(?=[ \t]|$)/,`$1\\$2`),UB=e=>!!e&&/[^\s\p{P}\p{S}]/u.test(e),uTe=e=>e.replace(/((?:\\_)+)|\\(.)/gs,(e,t,n,r,i)=>{if(t)return UB(i[r-1])&&UB(i[r+e.length])?t.replaceAll(`\\`,``):e;if(n===`\\`){let t=i[r+2];return t&&!/[\n\r!-/:-@[-`{-~]/.test(t)?n:e}return e}),dTe={38:`&`,60:`<`,91:`[`,93:`]`},fTe=/^[\w.!#$%&'*+/=?^`{|}~-]{1,64}@[A-Za-z\d]/,pTe=(e,{isInLink:t,isAtLineEnd:n})=>e.replace(/&#(38|60|91|93);/g,(e,r,i,a)=>{let o=dTe[r],s=a.slice(i+e.length,i+e.length+70);return!s&&!n||o===`<`&&(/^[A-Za-z/!?]/.test(s)||fTe.test(s))||o===`&`&&/^#(?:\d{1,7}|[xX][\dA-Fa-f]{1,6});/.test(s)||o===`[`&&(t||s.startsWith(`^`))||o===`]`&&(t||/^[(:[]/.test(s))?`\\${o}`:o}),mTe=e=>{if(!e.hasFormat(`italic`))return!1;let t=e=>aE(e)&&e.hasFormat(`italic`),n=e,r=e;for(;t(n.getPreviousSibling());)n=n.getPreviousSibling();for(;t(r.getNextSibling());)r=r.getNextSibling();let i=n.getTextContent(),a=r.getTextContent(),o=/^\s/.test(i)?` `:n.getPreviousSibling()?.getTextContent().at(-1),s=/\s$/.test(a)?` `:r.getNextSibling()?.getTextContent()[0];return UB(o)||UB(s)},WB=``,GB={dependencies:[],export:(e,t,n)=>{if(!aE(e)||e.hasFormat(`code`))return null;let r=e.getTextContent();if(e.getFormat()&&/^\s+$/.test(r))return`${n($L(e),WB).replace(WB,``)}${r}`;let i=$we(e),a=n($L(e),i===void 0?r:WB);if(mTe(e)&&(a=a.replace(/\\.|_/gs,e=>e===`_`?`*`:e)),i!==void 0)return a.replace(WB,()=>i);let o=e.getParent(),s=e.getPreviousSibling(),c=e.getNextSibling();return a=pTe(uTe(a),{isInLink:!!o?.isInline(),isAtLineEnd:!c||tk(c)}),!o||o.isInline()||[`code`,`heading`].includes(o.getType())||s&&!tk(s)?a:lTe(a)},regExp:/(?!)/,type:`text-match`},KB=/^(?:\|)(.+)(?:\|)\s?$/,hTe=/^(?:\|[ \t]*:?-+:?[ \t]*)+\|\s?$/,gTe={left:`:---`,center:`:---:`,right:`---:`},_Te=e=>{let t=e.trim(),n=t.startsWith(`:`),r=t.endsWith(`:`);return n&&r?`center`:n?`left`:r?`right`:``},qB=e=>{let t=e.getFirstChild();return AR(t)?t.getChildrenSize():0},JB=(e,t)=>{e=e.trim().replace(/\\n/g,`
`).replace(/\\\|/g,`|`);let n=TR(xR.NO_STATUS);return YL(e,t,n),n},YB=(e,t)=>{let[,n]=e.match(KB)??[];return n?n.split(/(?<=(?<!\\)(?:\\\\)*)\|/).map(e=>JB(e,t)):null},vTe=(e,t)=>{let n=[],r=[],i=!1;e.getChildren().forEach(e=>{ER(e)&&(n.push(XL(t,e).replace(/\|/g,`\\|`).replace(/\n/g,`\\n`).trim()),r.push(e),e.__headerState===xR.ROW&&(i=!0))});let a=[`| ${n.join(` | `)} |`];return i&&a.push(`| ${r.map(e=>gTe[e.getFormatType()]??`---`).join(` | `)} |`),a},yTe=(e,t)=>{let n=e.getPreviousSibling();if(!n||!Iz(n))return;let r=n.getChildren(),i=r[r.length-1];if(!i||!AR(i))return;let a=t.trim().slice(1,-1).split(`|`).map(_Te);i.getChildren().forEach((e,t)=>{ER(e)&&(e.setHeaderStyles(xR.ROW,xR.ROW),e.setFormat(a[t]??``))}),e.remove()},bTe=(e,t)=>{let n=[],r=e.getPreviousSibling();for(;r&&DE(r)&&r.getChildrenSize()===1;){let e=r.getFirstChild();if(!aE(e))break;let i=YB(e.getTextContent(),t);if(!i)break;n.unshift(i);let a=r.getPreviousSibling();r.remove(),r=a}return n},xTe=(e,t)=>{let n=Math.max(...e.map(e=>e.length)),r=Fz();return e.forEach(e=>{let i=kR();r.append(i);for(let r=0;r<n;r+=1)i.append(r<e.length?e[r]:JB(``,t))}),r},STe=(e,t)=>{let n=e.getPreviousSibling();if(Iz(n)&&qB(n)===qB(t)){let r=n.getFirstChild().getChildren();t.getChildren().forEach(e=>{e.getChildren().forEach((e,t)=>{e.setFormat(r[t].getFormatType())})}),n.append(...t.getChildren()),e.remove()}else e.replace(t);t.selectEnd()},CTe=(e=[])=>{let t=[...e,...PL.map(e=>e===NL?iR:e),tR,LB,IB],n=[...t,GB];return{dependencies:[Pz,OR,SR],export:e=>Iz(e)?e.getChildren().flatMap(e=>AR(e)?vTe(e,n):[]).join(`
`):null,regExp:KB,replace:(e,n,[r])=>{if(hTe.test(r)){yTe(e,r);return}let i=YB(r,t);i&&STe(e,xTe([...bTe(e,t),i],t))},type:`element`}},XB=e=>{let t=[],n;return e.forEach((e,r)=>{let i=e.match(/^[ \t]*(`{3,}(?=[^`]*$)|~{3,})/)?.[1];n?i?.[0]===n.fence[0]&&i.length>=n.fence.length&&!e.trim().slice(i.length)&&(t.push({...n,end:r,closed:!0}),n=void 0):i&&(n={start:r,fence:i})}),n&&t.push({...n,end:e.length-1,closed:!1}),t},ZB=(e,t)=>{let n=e.split(`
`),r=[],i=0,a=e=>{if(e>i){let a=i>0?`
`:``,o=e<n.length?`
`:``,s=t(`${a}${n.slice(i,e).join(`
`)}${o}`);r.push(s.slice(a.length,s.length-o.length))}};return XB(n).forEach(({start:e,end:t})=>{a(e),r.push(n.slice(e,t+1).join(`
`)),i=t+1}),a(n.length),r.join(`
`)},QB=(e,t)=>{let n=e.split(`
`),r=new Set(XB(n).flatMap(({start:e,end:t})=>Array.from({length:t-e+1},(t,n)=>e+n)));return n.map((e,n)=>r.has(n)?e:t(e)).join(`
`)},$B=/^ {0,3}(=+|-+)[ \t]*$/,eV=/^ {0,3}#{1,6}(?:[ \t]|$)/,tV=/^ {0,3}([-*_])(?:[ \t]*\1){2,}[ \t]*$/,nV=[[`(?:script|pre|style|textarea)(?:[ \\t>]|$)`,/<\/(?:pre|script|style|textarea)>/i],[`!--`,/-->/],[`\\?`,/\?>/],[`![A-Za-z]`,/>/],[`!\\[CDATA\\[`,/\]\]>/],[`/?(?:${`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h[1-6].head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`).join(`|`)})(?:[ \\t>]|/>|$)`,null]],wTe=RegExp(`<(?:${nV.map(([e])=>e).join(`|`)})`,`i`),TTe=nV.map(([e,t])=>[RegExp(`^ {0,3}<(?:${e})`,`i`),t]),ETe=new RegExp(PB,`g`),DTe=RegExp(`^ {0,3}(?!</?(?:pre|script|style|textarea)\\b)(?:<[A-Za-z][A-Za-z0-9-]*(?:[ \\t\\uE005]+[A-Za-z_:][\\w.:-]*(?:[ \\t\\uE005]*=[ \\t\\uE005]*(?:[^\\s"'=<>\`\\uE005]+|'[^'\\n]*'|"[^"\\n]*"))?)*[ \\t\\uE005]*/?>|</[A-Za-z][A-Za-z0-9-]*[ \\t\\uE005]*>)[ \\t]*$`,`i`),rV=new RegExp([eV.source,"^ {0,3}(?:>|[-+*](?:[ \\t]|$)|\\d{1,9}[.)](?:[ \\t]|$)|`{3,}|~{3,}|\\|)",`^ {0,3}${wTe.source}`,`^(?: {4}|\\t)`,tV.source,$B.source].join(`|`),`i`),OTe=new RegExp([eV.source,tV.source].join(`|`)),kTe=new RegExp(rV.source.replace(`|^(?: {4}|\\t)`,``),`i`),iV=(e,t)=>{let n=`[${e}]`.repeat(t),r=String.raw`(?:\\[^\s]|[^${e}\\\n])`,i=String.raw`(?:\\[^\s]|[^${e}\s\\])`,a=`${i}(?:${r}*?${i})?`,o=String.raw`[\s\p{P}\p{S}]`,s=e===`*`,c=s?`(?:(?<=^|${o})${n}|${n}(?!${o}))`:`(?<=^|${o})${n}`,l=s?`(?:(?<!${o})${n}|${n}(?=${o}|$))`:`${n}(?=${o}|$)`,u=String.raw`(?:\\|[ \t]*)\n[ \t]*`;return new RegExp(String.raw`(?<![${e}\\])${c}(${a}(?:${u}${a})+)${l}(?![${e}])`,`gu`)},aV=[[`***`,iV(`*`,3)],[`___`,iV(`_`,3)],[`**`,iV(`*`,2)],[`__`,iV(`_`,2)],[`~~`,iV(`~`,2)],[`*`,iV(`*`,1)],[`_`,iV(`_`,1)]],ATe=e=>e.split(`
`).map(e=>{let t=e.length-e.trimStart().length,n=e.length,r=0;for(;n>t&&/[ \t]/.test(e[n-1]);)--n;for(;e[n-r-1]===`\\`;)r+=1;return r%2&&--n,{indent:e.slice(0,t),text:e.slice(t,n),lineEnd:e.slice(n)}}),jTe=e=>aV.some(([,t])=>e.search(t)!==-1),oV=e=>{let t=[...e.matchAll(/`+/g)].map(({0:{length:t},index:n})=>{let r=0;for(;e[n-r-1]===`\\`;)r+=1;return{index:n,length:t,escaped:r%2==1}}),n=[];for(let e=0;e<t.length;e+=1){let r=e+1;for(;r<t.length&&t[r].length!==t[e].length;)r+=1;if(!t[e].escaped&&r<t.length){let{index:i,length:a}=t[r];n.push({start:t[e].index,end:i+a,fenceLength:a}),e=r}}return n},MTe=new RegExp(String.raw`(?<!(?:^|[^\\])(?:\\\\)*[\\!])\[([^[\]\n]*[^[\]\s\\])([ \t]*\n[ \t]*)([^[\]\n]+)\]`+String.raw`\(([^()\s]*(?:[ \t]+"[^"\n]*")?)\)`,`g`),NTe=e=>e.replace(/(?<=^|[\s\p{P}\p{S}])(?<![`\\])`([^`\n]+?)\n([^`\n]+?)`(?=[\s\p{P}\p{S}]|$)(?!`)/gu,"`$1`\n`$2`"),PTe=e=>{if(!e.includes(`[`))return e;let t=oV(e);return e.replace(MTe,(e,n,r,i,a,o)=>t.some(({start:e,end:t})=>o>=e&&o<t)?e:`[${n}](${a})${r}[${i}](${a})`)},FTe=e=>oV(e).some(({start:t,end:n})=>e.slice(t,n).includes(`
`))||/(?<!(?:^|[^\\])(?:\\\\)*\\)\[[^[\]\n]*\n[^[\]]*\](?=[([])/.test(e),ITe=e=>ZB(e,e=>{let t=NTe(e),n;for(;t!==n;)n=t,t=aV.reduce((e,[t,n])=>e.replace(n,(e,n)=>{if(jTe(n))return e;let r=PTe(n);if(FTe(r))return e;let i=ATe(r);return i.some(({text:e})=>/^[*_~]+$/.test(e))||i.slice(1).some(({indent:e,text:t})=>kTe.test(`${e}${t}`))?e:i.map(({indent:e,text:n,lineEnd:r})=>`${e}${t}${n}${t}${r}`).join(`
`)}),t);return t}),sV=``,cV=``,lV=``,uV=``,LTe=e=>{if(!/[\\`][*_~]*$/.test(e))return e;let t=oV(e).findLast(({end:t})=>/^[*_~]*$/.test(e.slice(t)));if(t){let n=t.end-t.fenceLength;return e[n-1]===`\\`?`${e.slice(0,n)}${sV}${e.slice(n)}`:e}let n=[!0,!1].map(t=>{let n=e.length-(t&&e.endsWith(`\\`)?1:0),r=0;for(;n>0&&`*_~`.includes(e[n-1]);)--n;for(;e[n-r-1]===`\\`;)r+=1;return r&&r%2==0?n:-1}).find(e=>e!==-1);return n===void 0?e:`${e.slice(0,n)}${sV}${e.slice(n)}`},RTe=/(?=\\)(?<=(?:^|[^\\])(?:\\\\)*[*_~])|(?=[*_~])(?<=(?:^|[^\\])(?:\\\\)+)/g,zTe=e=>/[*_~]\\|\\[*_~]/.test(e)?e.replace(RTe,(t,n)=>`*_~`.includes(e[n])?`${cV}.`:`.${cV}`):e,BTe=/(?<=[*_~])(?=(?![\0-\x7F])[\p{P}\p{S}])|(?<=(?![\0-\x7F])[\p{P}\p{S}])(?=[*_~])/gu,VTe=e=>/[^\0-\x7F]/.test(e)?e.replace(BTe,(t,n)=>`*_~`.includes(e[n-1])?`.${cV}`:`${cV}.`):e,HTe=e=>{if(!/`[ \t]|\t/.test(e))return e;let t=``,n=0;return oV(e).forEach(({start:r,end:i,fenceLength:a})=>{let o=e.slice(r+a,i-a);t+=`${e.slice(n,r+a)}${/^ +$/.test(o)?uV.repeat(o.length):o.replaceAll(` `,lV)}`,n=i-a}),t+e.slice(n)},UTe=e=>{let t,n=!1;return e.split(`
`).map(e=>{let r=!e.trim();if(t===null&&r&&(t=void 0),t===void 0){let i=TTe.find(([t])=>t.test(e));if(i)[,t]=i;else if(!n&&DTe.test(e))t=null;else return n=!r&&!OTe.test(e)&&!(n&&$B.test(e)),e.includes(` `)?e.replace(ETe,e=>e.replaceAll(` `,lV)):e}return t?.test(e)&&(t=void 0),n=!1,`${e.replaceAll(` `,lV)}`}).join(`
`)},WTe=e=>QB(e.includes(`<`)?ZB(e,UTe):e,e=>HTe(VTe(zTe(LTe(e))))),dV=e=>e.replace(RegExp(`\\.${cV}|${cV}\\.`,`g`),``).replaceAll(sV,``).replaceAll(``,``).replaceAll(lV,` `).replaceAll(uV,` `),GTe=e=>{if(!/^[ \t]*~{3,}/m.test(e))return e;let t=e.split(`
`);return XB(t).filter(({fence:e})=>e.startsWith(`~`)).forEach(({start:e,end:n,closed:r})=>{let i=t.slice(e+1,r?n:n+1),a=Math.max(2,...i.map(e=>e.match(/^[ \t]*(`*)/)[1].length)),o="`".repeat(a+1);t[e]=t[e].replace(/^([ \t]*)~+([ \t]*[\w-]+)?(.*)$/,(e,t,n,r)=>`${t}${o}${n??``}${r.replaceAll("`",n?``:``)}`),r&&(t[n]=t[n].replace(/^([ \t]*)~+[ \t]*$/,`$1${o}`))}),t.join(`
`)},KTe=e=>!!e.trim()&&!rV.test(e),qTe=e=>/^ {0,3}(?:=+|-+)[ \t]*$/m.test(e)?ZB(e,e=>{let t=[];return e.split(`
`).forEach(e=>{let[,n]=e.match($B)??[],r=t.length;for(;r>0&&KTe(t[r-1]);)--r;let i=t[r-1];if(!n||r===t.length||i!==void 0&&i.trim()&&!eV.test(i)){t.push(e);return}let a=t.splice(r).map(e=>e.trim()).join(` `);t.push(`${n.startsWith(`=`)?`#`:`##`} ${a}`)}),t.join(`
`)}):e,JTe=e=>/^>$/m.test(e)?QB(e,e=>e===`>`?`> `:e):e,YTe=e=>/^> $/m.test(e)?QB(e,e=>e===`> `?`>`:e):e,XTe=()=>{let e=$();return Q(e)?GO(e.anchor.getNode(),e=>Z(e)&&!e.isInline())?.getFormatType()??``:``},fV=e=>e instanceof zT?e:jM(e,zT),ZTe=()=>{let e=$();if(!Q(e))return{blockNodeKey:null,blockType:`paragraph`,inlineTypes:[],tableCellKey:HB(),alignment:``};let t=e.anchor.getNode(),n=null,r=oR.filter(t=>e.hasFormat(t));t.getType()!==`root`&&(n=fV(t),_F(n)&&(r.push(`link`),n=n.getParent()),UF(n)&&(n=jM(n,PF)));let i=(()=>{if(!n)return`paragraph`;if(wI(n))return`heading-${n.getTag().match(/\d/)?.[0]}`;if(RF(n))return n.getListType()===`bullet`?`bulleted-list`:`numbered-list`;if(yI(n))return`blockquote`;if(UP(n)||QP(n))return`code-block`;let e=n.getType();return cR.includes(e)?e:`paragraph`})();return{blockNodeKey:n?.getKey()??null,blockType:i,inlineTypes:r,tableCellKey:HB(),alignment:XTe()}},pV=(...e)=>{let t=e.filter(e=>typeof e==`function`);return()=>{t.forEach(e=>e())}},mV=e=>YTe(XL([...e.filter(({tag:e})=>!aCe.includes(e)),GB]).replace(/\n+$/,``)),hV=(e,t,n,r=`markdown`)=>{let i=n??(r===`html`?DB(e):mV(t));return e.getRootElement()?.dispatchEvent(new CustomEvent(`Update`,{detail:{value:i,selection:ZTe()}})),i},QTe=(e,t,n)=>{let r=0,i=!0,a,o=!1;return pV(()=>{o=!0},e.registerUpdateListener(({dirtyElements:s,dirtyLeaves:c}={})=>{if(i||=!s||s.size>0||c.size>0,e?.isComposing())return;r+=1;let l=r;(async()=>{await Iu(100),l!==r||o||e.update(()=>{a=hV(e,t,i?void 0:a,n),i=!1})})()}))},$Te=({node:e,createNode:t,transformer:n,createMarkdown:r})=>{if(r)return r().trim();let i=sk({namespace:`component`,nodes:e?[e]:[],onError:e=>{throw e}}),a=``;try{i.update(()=>{let e=t();oD().append(e.isInline()?EE().append(e):e),a=hV(i,[n])},{discrete:!0})}catch{}return a.trim()},gV=({transformer:e})=>e.type===`text-match`,eEe=e=>{let t=e=>e===void 0?e:dV(e);return Object.assign(e.map(t),{index:e.index,input:e.input,groups:e.groups?Object.fromEntries(Object.entries(e.groups).map(([e,n])=>[e,t(n)])):void 0})},_V=(e,t)=>Object.assign(new RegExp(e),{[Symbol.match]:n=>{let r=+!!n.startsWith(``),i=n.slice(r).match(e);return!i||!r||(i.input=n,t&&i.index===0?i[0]=`${i[0]}`:i.index+=r),i}}),tEe=e=>Array.isArray(e)?`index`in e?eEe(e):e.every(e=>typeof e==`string`)?e.map(e=>dV(e)):e:e,nEe=e=>{let{type:t,handleImportAfterStartMatch:n,importRegExp:r,regExp:i,regExpStart:a,regExpEnd:o,replace:s}=e,c={};return n&&(c.handleImportAfterStartMatch=e=>n({...e,lines:e.lines.map(e=>dV(e))})),r&&(c.importRegExp=_V(r,!1)),t===`element`&&i&&(c.regExp=_V(i,!0)),a&&(c.regExpStart=_V(a,!0)),o instanceof RegExp?c.regExpEnd=_V(o,!0):o?.regExp&&(c.regExpEnd={...o,regExp:_V(o.regExp,!0)}),s&&(c.replace=(...e)=>s(...e.map(tEe))),{...e,...c}},vV=e=>e.multiline!==!1||e.isCodeEditor?e:{...e,modes:e.format===`html`?[`rich-text`]:e.modes,enabledButtons:(e.enabledButtons??[]).filter(e=>sR.includes(e)),components:(e.components??[]).filter(gV)},yV=e=>Z(e)&&!e.isInline()?e.getChildren().flatMap(yV):e.isInline()?[e]:[],rEe=e=>{let t=e.getChildren(),[n]=t;if(!n||t.length===1&&DE(n))return;let r=DE(n)?n:EE();r!==n&&n.insertBefore(r);let i=r.getTextContent().at(-1)??``;t.filter(e=>e!==r).forEach(e=>{let t=yV(e),n=t.map(e=>e.getTextContent()).join(``);t.length&&r.getChildrenSize()&&!/\s/.test(i+n.charAt(0))&&r.append(iE(` `)),r.append(...t),i=n.at(-1)??i,e.remove()})},iEe=e=>{let t=e.getPreviousSibling(),n=e.getNextSibling();if(!t||!n||/\s$/.test(t.getTextContent())||/^\s/.test(n.getTextContent())){e.remove();return}let r=iE(` `),i=_F(t)&&_F(n)&&t.getURL()===n.getURL()&&t.getTitle()===n.getTitle()&&t.getTarget()===n.getTarget()&&t.getRel()===n.getRel(),a=Z(t)?t.getLastDescendant():t,o=Z(n)?n.getFirstDescendant():n;aE(a)&&aE(o)&&(oR.forEach(e=>{a.hasFormat(e)&&o.hasFormat(e)&&r.toggleFormat(e)}),a.getStyle()===o.getStyle()&&r.setStyle(a.getStyle())),i?(t.append(r,...n.getChildren()),n.remove(),e.remove()):e.replace(r)},aEe=e=>pV(e.registerCommand(tw,e=>(e?.preventDefault(),!0),3),e.registerCommand(zC,()=>!0,3),e.registerCommand(RC,()=>!0,3),e.registerNodeTransform($O,iEe),e.registerNodeTransform(UT,rEe)),oEe=(e,t)=>pV(e.registerCommand(LC,e=>{let t=$();if(!e||!Q(t)||!t.isCollapsed())return!1;let{offset:n}=t.anchor,r=t.anchor.getNode(),i=UP(r)?r:jM(r,VP);return!!i&&n===0&&(r.is(i)||!!i.getFirstDescendant()?.is(r))},1),e.registerCommand(tw,t=>Q($())?(t?.preventDefault(),e.dispatchCommand(zC,void 0)):!1,2),e.registerNodeTransform(UT,e=>{let n=e.getChildren();if(n.length===1&&UP(n[0]))return;let[r]=n;if(n.length===1&&Z(r)){let e=HP(t);r.replace(e,!0)}else if(n.length===0){let n=HP(t);e.append(n),n.selectStart()}})),sEe=[[`bulleted-list`,WF,`bullet`],[`numbered-list`,GF,`number`]],cEe=(e,t=[])=>{let n=sEe.filter(([e])=>t.includes(e));return pV(...n.map(([,t,n])=>e.registerCommand(t,()=>(Uxe(n),!0),2)),n.length?e.registerCommand(zC,()=>Kxe(),2):void 0)},lEe=e=>e.registerRootListener(t=>{if(!t)return;let n=t=>{e.update(()=>{if(t.key===`Tab`){let n=$();if(!Q(n))return;let r=fV(n.anchor.getNode());UF(r)&&r.canIndent()&&(t.shiftKey?r.getIndent()>0&&(t.preventDefault(),e.dispatchCommand(cw,void 0)):(t.preventDefault(),e.dispatchCommand(sw,void 0)))}})};return t.addEventListener(`keydown`,n),()=>{t.removeEventListener(`keydown`,n)}}),uEe=[`http`,`https`,`mailto`,`sms`,`tel`],bV=e=>{let t=e.replace(/[\u0000-\u0020]/g,``);if(/^[^/?#]*[&\\]/.test(t))return!1;let n=/^([a-z][a-z\d+.-]*):/i.exec(t)?.[1];return!n||uEe.includes(n.toLowerCase())},dEe=e=>pV(e.registerNodeTransform(hF,e=>{bV(e.getURL())||abe(e)}),e.registerCommand(yF,e=>{let t=typeof e==`string`?e:e?.url??null;return t!==null&&!bV(t)||Rxe(t===null?null:e),!0},2),e.registerCommand(VC,t=>{let n=$();if(!Q(n)||!NM(t,ClipboardEvent)||!t.clipboardData||t.target.matches(`input, textarea`))return!1;let r=t.clipboardData.getData(`text`).trim();return!zc(r)||!bV(r)?!1:(n.isCollapsed()&&lj([iE(r)]),!n.getNodes().some(e=>Z(e)||aE(e)&&!e.isSimpleText())&&(e.dispatchCommand(yF,r),t.preventDefault(),!0))},1)),xV=()=>{let e=$();if(!Q(e))return null;let t=GO(e.anchor.getNode(),_F);return t&&GO(e.focus.getNode(),_F)===t?t:null},fEe=(e,t)=>{let n;return e.getEditorState().read(()=>{let[r,i]=t.isBackward()?[t.focus,t.anchor]:[t.anchor,t.focus];r.getNode().isAttached()&&i.getNode().isAttached()&&(n=qye(e,r.getNode(),r.offset,i.getNode(),i.offset)?.getBoundingClientRect())}),n},pEe=(e,t)=>{let n=`selection`in t?fEe(e,t.selection):t.linkKey?e.getElementByKey(t.linkKey)?.getBoundingClientRect():void 0;if(!n||!(n.top||n.bottom||n.left||n.width||n.height))return;let{top:r,bottom:i,left:a,right:o}=n;return{top:r,bottom:i,left:a,right:o}},SV=async e=>{Qz(e)||(await rB(),await Promise.all([sB(oB(e)),lB(Kz())]))},CV=/\s/,wV=/[!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~]/,mEe=(e,t)=>{let n=0;for(;e[t-n-1]===`\\`;)n+=1;return n%2==1},TV=(e,t,n,r)=>{let i=e[t-1],a=e[t+n],[o,s]=r?[a,i]:[i,a];return o===void 0||CV.test(o)?!1:!wV.test(o)||s===void 0||CV.test(s)||wV.test(s)},EV=(e,t,n,r)=>{if(!TV(e,t,n,r))return!1;if(e[t]!==`_`||!TV(e,t,n,!r))return!0;let i=r?e[t-1]:e[t+n];return i!==void 0&&wV.test(i)},hEe=(e,t,n)=>{let r=[],i=0,a=0;for(;a<e.length;){for(;i<n.length&&n[i].end<=a;)i+=1;let o=e[a],s=n[i];if(s&&s.start<=a)a=s.end;else if(!t.has(o)||mEe(e,a))a+=1;else{let t=1;for(;e[a+t]===o;)t+=1;let n=EV(e,a,t,!0),i=EV(e,a,t,!1);(n||i)&&r.push({char:o,index:a,length:t,canOpen:n,canClose:i,active:!0}),a+=t}}return r},gEe=(e,t)=>{let n={},r=[],i=0;for(;i<e.length;){let a=e[i];if(!a.active||!a.canClose||!a.length)i+=1;else{let o=`${a.char}${a.canOpen}${a.length%3}`,s=n[o]??-1,c=!1;for(let n=i-1;n>s&&!c;--n){let o=e[n],s=o.active&&o.canOpen&&o.length>0&&o.char===a.char&&(!o.canClose&&!a.canOpen||(o.length+a.length)%3!=0||o.length%3==0||a.length%3==0),l=Math.min(o.length,a.length),u=s?t.filter(e=>e[0]===o.char&&e.length<=l).sort((e,t)=>t.length-e.length)[0]:void 0;if(u){c=!0,r.push({start:o.index+o.length-u.length,end:a.index+u.length});for(let t=n+1;t<i;t+=1)e[t].active=!1;o.length-=u.length,a.length-=u.length,o.active=o.length>0,a.length>0?a.index+=u.length:(a.active=!1,i+=1)}}c||(n[o]=i-1,a.active=a.canOpen,i+=1)}}return r},_Ee=(e,t)=>{let n=new Set(e.map(e=>e[0])),r=t.flatMap(({importRegExp:e})=>e?[new RegExp(e.source,`${e.flags.replace(`g`,``)}g`)]:[]),i,a=t=>{let i=oV(t),[a]=i;if(!a)return;let o=gEe(hEe(t,n,i),e),s=({start:e,end:t})=>e<=a.start&&t>=a.end,[c]=[...o].sort((e,t)=>e.start-t.start||t.end-e.end);if(!c||s(c))return;let[l]=o.filter(s).sort((e,t)=>e.start-t.start);if(l&&!r.some(e=>[...t.matchAll(e)].some(({0:{length:e},index:t})=>t<l.start&&t+e>l.start)))return l.start};return e=>(i?.text!==e&&(i={text:e,index:a(e)}),i.index)},vEe=e=>{let t=e.filter(e=>e.type===`text-format`).map(e=>e.tag);if(!t.includes("`"))return e;let n=_Ee(t.filter(e=>e!=="`"),e.filter(e=>e.type===`text-match`));return[{dependencies:[],export:()=>null,importRegExp:Object.assign(/(?!)/,{[Symbol.match]:e=>{let t=n(e);return t===void 0?null:Object.assign([e.slice(t)],{index:t,input:e})}}),regExp:/(?!)/,replace:e=>e,type:`text-match`},...e.map(e=>{if(e.type!==`text-match`)return e;let{getEndIndex:t}=e;return{...e,getEndIndex:(e,r)=>{let i=t?t(e,r):(r.index??0)+r[0].length,a=n(e.getTextContent());return i!==!1&&a!==void 0&&i<=a?!1:i}}})]},yEe=e=>{e.flatMap(e=>Z(e)?e.getAllTextNodes():e).filter(e=>aE(e)).forEach(e=>{let t=e.getTextContent(),n=dV(Qwe(e)??t),r=e.getParent();if(n!==t&&e.setTextContent(n),_F(r)){let e=r.getURL(),t=r.getTitle();dV(e)!==e&&r.setURL(dV(e)),t&&dV(t)!==t&&r.setTitle(dV(t))}})},DV=(e,t)=>{let n=t.some(e=>`regExpStart`in e&&e.regExpStart===ZL.regExpStart),r=t.some(e=>`regExp`in e&&e.regExp===yL.regExp),i=n?GTe(e):e,a=r?qTe(i):i;return{markdown:a,languages:[...a.matchAll(/^`{3,}[ \t]*(?<lang>[\w-]+)/gm)].map(({groups:{lang:e=`plain`}={}})=>e)}},OV=(e,t,{toRoot:n=!1}={})=>{let r=ITe(e),i=WTe(r),a=JTe(i),o=vEe(t),s;return n?(YL(a,o),s=oD().getChildren()):s=XSe(a,o),(i!==r||/[\\&]/.test(i))&&yEe(s),s},kV=new WeakMap,AV=async(e,{languages:t,$import:n,$export:r,formatName:i})=>{let a=(kV.get(e)??0)+1;kV.set(e,a);let o=()=>kV.get(e)!==a;try{await Promise.all(t.map(async e=>SV(e)))}catch(e){if(o())return;throw e}if(o())return;let s=e.getEditorState().isEmpty(),c;if(e.update(()=>{try{n()}catch(e){c=e}},{tag:s?[`sui-import`,`history-merge`]:`sui-import`,discrete:!0}),c)throw Error(`Failed to convert ${i}`,{cause:c});return e.read(r)},bEe=async(e,t,n)=>{let{markdown:r,languages:i}=DV(t,n);return AV(e,{languages:i,$import:()=>{OV(r,n,{toRoot:!0})},$export:()=>mV(n),formatName:`Markdown`})},xEe=async(e,t)=>{let n=new DOMParser().parseFromString(t,`text/html`);return AV(e,{languages:[...n.querySelectorAll(`pre > code`)].map(fB).filter(e=>e!==void 0),$import:()=>{let t=Bwe(e,n);if(t)throw Error(t.nodeType===Node.COMMENT_NODE?`Unsupported comment`:`Unsupported element: <${t.localName}>`);let r=oD(),i=null;r.clear(),EP(e,n).forEach(e=>{(Z(e)||VT(e))&&!e.isInline()?(i=null,r.append(e)):(i||(i=EE(),r.append(i)),i.append(e))}),r.isEmpty()&&r.append(EE()),$()!==null&&r.selectStart()},$export:()=>DB(e),formatName:`HTML`})},SEe=async(e,t,n)=>{let{markdown:r,languages:i}=DV(t,n);await Promise.allSettled(i.map(e=>SV(e))),e.isEditable()&&e.update(()=>{let e=$()?.clone();if(!e)return;let i;try{i=OV(r,n)}catch(e){console.error(e)}cD(e),i?e.insertNodes(i):e.insertRawText(t)},{tag:`paste`})},CEe=1e3,wEe=()=>Sx()?`Meta+Shift+V Meta+Alt+Shift+V`:`Ctrl+Shift+V`,TEe=(e,t)=>{let n=wEe(),r=!1,i=0;return pV(()=>{clearTimeout(i)},e.registerCommand(JC,e=>(r=Dx(e,n),clearTimeout(i),r&&(i=window.setTimeout(()=>{r=!1},CEe)),!1),2),e.registerCommand(VC,n=>{if(!r)return!1;r=!1;let i=NM(n,ClipboardEvent),a=(i?n.clipboardData:NM(n,InputEvent)?n.dataTransfer:null)?.getData(`text/plain`);return!a||i&&zc(a.trim())?!1:(n.preventDefault(),SEe(e,a,t),!0)},2))},EEe=200,DEe=e=>{let{enabledButtons:t=[],components:n=[],useMarkdownShortcuts:r,isCodeEditor:i=!1,defaultLanguage:a=`plain`,format:o=`markdown`,multiline:s=!0}=vV(e);return{enabledButtons:t,components:n,useMarkdownShortcuts:r,isCodeEditor:i,defaultLanguage:a,format:o,multiline:s,hasCodeBlock:t.includes(`code-block`)||i,hasTable:t.includes(`table`)&&!i,hasHorizontalRule:t.includes(`horizontal-rule`)&&!i,hasBlockSyntax:!i&&s}},jV=(e,t)=>[...new Set(Object.entries(e).filter(([e])=>t.includes(e)).flatMap(([,e])=>e))],OEe=({enabledButtons:e,components:t,isCodeEditor:n,format:r,hasCodeBlock:i,hasTable:a,hasHorizontalRule:o,hasBlockSyntax:s})=>Gye({name:`@sveltia/ui/editor`,namespace:`editor`,dependencies:[...i?[Dxe]:[],...a?[Kye(twe,{hasCellMerge:!1,hasCellBackgroundColor:!1,hasHorizontalScroll:!0,hasTabHandler:!0})]:[],...o?[wbe]:[]],$initialEditorState:null,nodes:[...t.map(({node:e})=>e),...jV(rCe,e),...n?[VP,YP]:[],...s?[TN,Pz,SR,OR]:[]],theme:nCe,html:r===`html`?{export:Nwe,import:{...Lwe,...i?Rwe:{}}}:void 0,onError:e=>{console.error(e)}}),kEe=({enabledButtons:e,components:t,isCodeEditor:n,hasBlockSyntax:r})=>{let i=t.map(({transformer:e})=>nEe(e));return[...i,...n?[]:[LB],...jV(iCe,e),...n?[ZL]:[],...r?[Gwe,CTe(i.filter(({type:e})=>e===`text-match`))]:[],...n?[]:[IB]]},AEe=(e,{enabledButtons:t,useMarkdownShortcuts:n,isCodeEditor:r,defaultLanguage:i,format:a,multiline:o,hasCodeBlock:s,hasTable:c},l)=>pV(DSe(e),_Se(e),dCe(e,fCe(),1e3,void 0,void 0,EEe),r?oEe(e,i):void 0,o||r?void 0:aEe(e),n?YSe(e,l):void 0,s?Wwe(e,{...OB,defaultLanguage:i,defaultTheme:Kz()}):void 0,s?pwe(e):void 0,t.includes(`link`)?dEe(e):void 0,c?e.registerNodeTransform(Pz,e=>{rTe(e),a===`markdown`&&iTe(e)}):void 0,cEe(e,t),QTe(e,l,a),lEe(e),r?void 0:TEe(e,l)),jEe=e=>{let t=DEe(e),n=kEe(t),r=mbe(OEe(t));bB.set(r,t.components);let i=AEe(r,t,n);return{editor:r,enabledTransformers:n,dispose:()=>{i(),r.dispose()}}},MEe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`dir`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`children`]),NEe=B(`<div></div>`),PEe={hash:`svelte-4vglyb`,code:`.lexical-root.svelte-4vglyb {overflow:clip;border:1px solid var(--sui-textbox-border-color);border-radius:var(--sui-textbox-border-radius) !important;padding:var(--sui-textbox-multiline-padding);min-height:120px;color:var(--sui-textbox-foreground-color);background-color:var(--sui-textbox-background-color);font-family:var(--sui-textbox-font-family);font-size:var(--sui-textbox-font-size);line-height:var(--sui-textbox-multiline-line-height);transition-duration:200ms;transition-property:outline-color, border-color, color, background-color;outline-offset:calc(var(--sui-focus-ring-width) * -1);}.lexical-root.svelte-4vglyb:not(:first-child) {border-start-start-radius:0 !important;border-start-end-radius:0 !important;}.lexical-root.code.svelte-4vglyb {padding:0;}.lexical-root.code.svelte-4vglyb .code-block {border-radius:0 !important;min-height:120px;}.lexical-root.svelte-4vglyb:focus {color:var(--sui-textbox-foreground-color-focus, var(--sui-textbox-foreground-color));background-color:var(--sui-textbox-background-color-focus, var(--sui-textbox-background-color));}.lexical-root[aria-invalid=true].svelte-4vglyb {border-color:var(--sui-error-border-color);}.lexical-root.svelte-4vglyb :not(.sui):first-child {margin-top:0;}.lexical-root.svelte-4vglyb :not(.sui):last-child {margin-bottom:0;}.lexical-root.svelte-4vglyb strong.italic {font-style:italic;}.lexical-root.svelte-4vglyb .strikethrough {text-decoration:line-through;}.lexical-root.svelte-4vglyb li.nested {list-style-type:none;}.lexical-root.svelte-4vglyb .code-block {position:relative;display:block;padding-block:8px;padding-inline-start:56px;padding-inline-end:8px;background-color:var(--sui-code-background-color);overflow-x:auto;white-space:pre;}.lexical-root.svelte-4vglyb .code-block:not(:first-child) {margin-top:1em;}.lexical-root.svelte-4vglyb .code-block:not(:last-child) {margin-bottom:1em;}.lexical-root.svelte-4vglyb .code-block::before {position:absolute;inset-block:0;inset-inline-start:0;inset-inline-end:auto;content:attr(data-gutter);padding:8px;min-width:40px;color:var(--sui-tertiary-foreground-color);background-color:var(--sui-tertiary-background-color);text-align:end;}.lexical-root.svelte-4vglyb [data-lexical-text=true] {cursor:text;}.lexical-root.svelte-4vglyb :is(th, td) > p {margin:0;white-space:normal;word-break:normal;}.lexical-root.svelte-4vglyb .table-wrapper {overflow-x:auto;}.lexical-root.svelte-4vglyb .table-wrapper:not(:first-child) {margin-top:1em;}.lexical-root.svelte-4vglyb .table-wrapper:not(:last-child) {margin-bottom:1em;}.lexical-root.svelte-4vglyb :is(th, td) {min-width:80px;vertical-align:top;text-align:start;}.lexical-root.svelte-4vglyb th {background-color:var(--sui-secondary-background-color);}.lexical-root.svelte-4vglyb :is(th, td).selected {background-color:var(--sui-selected-background-color);}.lexical-root.svelte-4vglyb .table-selection ::selection {background-color:transparent;}.lexical-root.svelte-4vglyb hr {margin:var(--sui-paragraph-margin) 0;border:none;padding:0;}.lexical-root.svelte-4vglyb hr.selected {outline:2px solid var(--sui-primary-accent-color);outline-offset:4px;}.lexical-root.svelte-4vglyb hr::after {display:block;height:2px;background-color:var(--sui-control-border-color);line-height:2px;content:"";}`};function MV(e,t){O(t,!0),K(e,PEe);let n=J(t,`dir`,3,void 0),r=J(t,`hidden`,3,!1),i=J(t,`disabled`,3,!1),a=J(t,`readonly`,3,!1),o=J(t,`required`,3,!1),s=J(t,`invalid`,3,!1),c=vs(t,MEe),l=ei(`editorStore`),u=j(void 0),d=A(()=>!(i()||a()));L(()=>{l.editor?.setEditable(z(d))}),L(()=>{let{editor:e}=l,t=n()===`ltr`||n()===`rtl`?n():null;e&&e.getEditorState().read(()=>oD().getDirection())!==t&&e.update(()=>{oD().setDirection(t)},{tag:`history-merge`})});let f=e=>{let{hasConverterError:t,useRichText:n,inputValue:r}=l;if(l.pending=!1,t||!n||l.importing)return;let{value:i,selection:a}=e.detail,o=l.getImportedValue(i)??i;r!==o&&(l.useRichText=!1,l.inputValue=o,l.useRichText=!0),l.selection=a},p=e=>{e.target?.closest(`a`)&&e.preventDefault()},m=e=>{l.editor&&lCe(l.editor,e)},h=e=>!!e&&!e.contains(z(u)??null),g,_=({target:e})=>{e instanceof Element&&e.closest(`[data-lexical-decorator]`)&&!dR(e)&&(g=e,window.setTimeout(()=>{g=void 0}))},v=({target:e})=>{let t=e;if(z(u)?.contains(t)){if(t===z(u)&&g?.isConnected)return;eo(()=>{l.componentHasFocus=t!==z(u)})}else t instanceof Element&&h(t.closest(`dialog`))||eo(()=>{l.componentHasFocus=!1})},y=()=>{eo(()=>{l.componentHasFocus&&document.activeElement===document.body&&!g?.isConnected&&![...document.querySelectorAll(`:modal`)].some(h)&&(l.componentHasFocus=!1)})},b=({relatedTarget:e})=>{e||queueMicrotask(y)};So(()=>{let{editor:e,enabledTransformers:t,dispose:n}=jEe(l.config);l.editor=e,l.enabledTransformers=t,z(u)?.addEventListener(`Update`,f),z(u)?.addEventListener(`click`,p),z(u)?.addEventListener(`mousedown`,m),z(u)?.addEventListener(`mousedown`,_),document.addEventListener(`focusin`,v),document.addEventListener(`focusout`,b);let r=e.registerUpdateListener(({dirtyElements:e,dirtyLeaves:t,tags:n})=>{(e.size||t.size)&&!n.has(`sui-import`)&&!n.has(`history-merge`)&&(l.pending=!0),y()});return()=>{r(),z(u)?.removeEventListener(`Update`,f),z(u)?.removeEventListener(`click`,p),z(u)?.removeEventListener(`mousedown`,m),z(u)?.removeEventListener(`mousedown`,_),document.removeEventListener(`focusin`,v),document.removeEventListener(`focusout`,b),n(),e.setRootElement(null),l.initialized=!1,l.editor=void 0}}),L(()=>{l.editor&&z(u)&&(l.editor.setRootElement(z(u)),l.initialized=!0)});var x=NEe();fs(x,()=>({...c,role:`textbox`,"aria-multiline":l.config.multiline!==!1,"aria-hidden":r(),"aria-disabled":i(),"aria-readonly":a(),"aria-required":o(),"aria-invalid":s(),class:`lexical-root`,id:`${l.editorId}-lexical-root`,contenteditable:z(d),hidden:r(),[ss]:{code:l.config.isCodeEditor}}),void 0,void 0,void 0,`svelte-4vglyb`),gs(x,e=>M(u,e),()=>z(u)),U(e,x),k()}var NV=()=>{let e=Ix(`editor`),t=j(!1),n=j(void 0),r=j(Xi([])),i=j(Xi({modes:[],enabledButtons:[],components:[],useMarkdownShortcuts:!0,isCodeEditor:!1,useEmojiAutocomplete:!1})),a=j(``),o=j(Xi({blockNodeKey:null,blockType:`paragraph`,inlineTypes:[]})),s=j(!0),c=j(void 0),l=j(0),u=j(!1),d=j(!1),f=j(!1),p=j(!1),m=j(0),h,g=0,_=!1,v=e=>{M(d,e,!0),e&&(M(s,!1),M(f,!0))},y=async()=>{if(!z(n)||!z(t))return;let e=z(a);g+=1;let o=g;_=!0;try{let t=z(i).format===`html`?await xEe(z(n),z(a)||``):await bEe(z(n),z(a)||``,z(r));t!==void 0&&(h={source:e,exported:t})}catch(t){v(!0),M(a,e,!0),console.error(t)}finally{o===g&&(_=!1)}};return{get editor(){return z(n)},set editor(e){M(n,e,!0)},set enabledTransformers(e){M(r,e,!0)},get enabledTransformers(){return z(r)},get initialized(){return z(t)},set initialized(e){M(t,e,!0)},get config(){return z(i)},set config(e){M(i,vV(e),!0),M(s,z(i).modes[0]===`rich-text`||z(i).isCodeEditor,!0)},get inputValue(){return z(a)},set inputValue(e){let t=z(a)!==e;t&&M(a,e,!0),z(s)&&(t||z(n)?.getEditorState().isEmpty())&&y()},get selection(){return z(o)},set selection(e){M(o,e,!0)},get controlId(){return z(s)?`${e}-lexical-root`:`${e}-plain-text`},get textArea(){return z(c)},set textArea(e){M(c,e,!0)},get toolbarHeight(){return z(l)},set toolbarHeight(e){M(l,e,!0)},get componentHasFocus(){return z(u)},set componentHasFocus(e){M(u,e,!0)},get useRichText(){return z(s)},set useRichText(e){M(s,e,!0)},get hasConverterError(){return z(d)},set hasConverterError(e){v(e)},get showConverterError(){return z(f)},set showConverterError(e){M(f,e,!0)},get pending(){return z(p)||z(m)>0},set pending(e){M(p,e,!0)},get importing(){return _},editorId:e,convertToLexical:y,startOperation:()=>{M(m,z(m)+1);let e=!1;return()=>{e||(e=!0,M(m,z(m)-1))}},getImportedValue:e=>h?.exported===e?h.source:void 0}},PV=(e,{getInputValue:t,setValue:n,setPending:r})=>{L(()=>{r(e.pending)}),L(()=>()=>{r(!1)}),L(()=>{if(!e.initialized)return;let n=t();eo(()=>{e.inputValue=n})}),L(()=>{if(!e.initialized)return;let t=e.inputValue;eo(()=>{n(t)})})},FEe=B(`<!> <!>`,1);function FV(e,t){O(t,!0);let n=J(t,`disabled`,3,!1),r=Rz.map(({id:e,name:t,aliases:n=[]})=>({key:e,label:t,aliases:n})),i=ei(`editorStore`),a=j(`plain`),o=A(()=>r.find(({key:e,aliases:t})=>e===z(a)||t.includes(z(a)))?.key??`plain`),s=()=>{let{blockNodeKey:e}=i.selection,t=i.config.isCodeEditor?oD().getChildren()[0]:e?$E(e):null;return UP(t)?t:null},c=async e=>{let{editor:t}=i;if(!t||z(o)===e)return;let n=i.startOperation();try{await mR(t),await SV(e),t.update(()=>{let t=s();t&&(t.setLanguage(e),M(a,e,!0))},{tag:Lz(t)})}finally{n()}};L(()=>{i.selection.blockNodeKey,i.editor?.read(()=>{let e=s();e&&M(a,e.getLanguage()??i.config.defaultLanguage??`plain`,!0)})});{let t=A(()=>Y(`_sui.text_editor.language`));iC(e,{get disabled(){return n()},get ariaLabel(){return z(t)},get value(){return z(o)},onChange:({detail:{value:e}})=>{c(e)},children:(e,t)=>{var n=FEe(),i=P(n);{let e=A(()=>Y(`_sui.text_editor.plain_text`));KS(i,{get label(){return z(e)},value:`plain`,dir:`ltr`})}No(I(i,2),17,()=>r,({key:e,label:t})=>e,(e,t)=>{let n=()=>z(t).key,r=()=>z(t).label;{let t=A(()=>n()===z(o));KS(e,{get label(){return r()},get value(){return n()},get selected(){return z(t)},dir:`ltr`})}}),U(e,n)},$$slots:{default:!0}})}k()}var IEe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`orientation`,`variant`,`ariaLabel`,`children`]),LEe=B(`<div><div role="none" class="inner svelte-1g217ex"><!></div></div>`),REe={hash:`svelte-1g217ex`,code:`[role=toolbar].svelte-1g217ex {--toolbar-size: var(--sui-secondary-toolbar-size);flex:none !important;display:flex;align-items:center;padding-inline:8px;background-color:var(--toolbar-background-color, transparent);}[role=toolbar].primary.svelte-1g217ex {--toolbar-size: var(--sui-primary-toolbar-size);}
@media (width < 768px) {[role=toolbar].secondary.svelte-1g217ex {padding-inline:0;}
}[role=toolbar][aria-orientation=horizontal].svelte-1g217ex {height:var(--toolbar-size);}[role=toolbar][aria-orientation=vertical].svelte-1g217ex {flex-direction:column;width:var(--toolbar-size);}[role=toolbar].svelte-1g217ex button[role=button]:is([aria-pressed=true], [aria-checked=true]) {background-color:var(--sui-selected-background-color);}[role=toolbar].svelte-1g217ex h2 {flex:auto;display:flex;align-items:center;gap:8px;margin:0;padding-inline-end:12px;min-width:0;font-size:var(--sui-font-size-x-large);}[role=toolbar].svelte-1g217ex h2:first-child {padding-inline-start:12px;}[role=toolbar].svelte-1g217ex h2 span:not(.sui.truncated-text) {font-size:var(--sui-font-size-small);font-weight:var(--sui-font-weight-normal, normal);opacity:0.8;}[role=toolbar].svelte-1g217ex .divider[aria-orientation=horizontal] {margin:0 4px;width:calc(100% - 8px);}[role=toolbar].svelte-1g217ex .divider[aria-orientation=vertical] {margin:4px 0;height:calc(100% - 8px);}.inner.svelte-1g217ex {display:contents;}`};function IV(e,t){K(e,REe);let n=J(t,`hidden`,3,!1),r=J(t,`disabled`,3,!1),i=J(t,`orientation`,3,`horizontal`),a=J(t,`variant`,3,void 0),o=J(t,`ariaLabel`,3,void 0),s=vs(t,IEe);var c=LEe();fs(c,()=>({...s,role:`toolbar`,class:[`sui`,`toolbar`,i(),a(),t.class],hidden:n(),"aria-hidden":n(),"aria-disabled":r(),"aria-orientation":i(),"aria-label":o()}),void 0,void 0,void 0,`svelte-1g217ex`);var l=N(c);xo(N(l),()=>t.children??Cr),D(l),D(c),R(()=>l.inert=r()),U(e,c)}var zEe=new Set([`$$slots`,`$$events`,`$$legacy`,`disabled`,`children`]),BEe=B(`<div role="none" class="wrapper svelte-mopg5v"><!></div>`),VEe={hash:`svelte-mopg5v`,code:`.wrapper.svelte-mopg5v {display:contents;}.wrapper.svelte-mopg5v [role=toolbar] {position:sticky;top:var(--sui-text-editor-toolbar-top, 0px);z-index:var(--sui-text-editor-toolbar-z-index, 100);display:flex;flex-wrap:wrap;gap:4px;border-width:1px 1px 0;border-style:solid;border-color:var(--sui-textbox-border-color);border-start-start-radius:var(--sui-textbox-border-radius);border-start-end-radius:var(--sui-textbox-border-radius);border-end-start-radius:0;border-end-end-radius:0;padding:0 4px;height:auto;min-height:40px;background-color:var(--sui-tertiary-background-color);}.wrapper.svelte-mopg5v [role=toolbar][aria-disabled=true] {filter:none;}.wrapper.svelte-mopg5v .sui.menu-button {padding:0 4px;}.wrapper.svelte-mopg5v .sui.button {flex:none;margin:0 !important;}.wrapper.svelte-mopg5v .sui.button-group {gap:4px;}`};function LV(e,t){O(t,!0),K(e,VEe);let n=J(t,`disabled`,3,!1),r=vs(t,zEe),i=ei(`editorStore`),a=e=>{let t=new ResizeObserver(([e])=>{i.toolbarHeight=e.borderBoxSize[0].blockSize});return t.observe(e),()=>{t.disconnect(),i.toolbarHeight=0}};var o=BEe();IV(N(o),ys(()=>r,{get disabled(){return n()},[wo()]:a,children:(e,n)=>{var r=H();xo(P(r),()=>t.children??Cr),U(e,r)},$$slots:{default:!0}})),D(o),U(e,o),k()}function HEe(e,t){O(t,!0);let n=J(t,`disabled`,3,!1),r=J(t,`readonly`,3,!1);{let t=A(()=>n()||r()),i=A(()=>Y(`_sui.text_editor.code_editor`));LV(e,{get disabled(){return z(t)},get ariaLabel(){return z(i)},children:(e,t)=>{{let t=A(()=>n()||r());FV(e,{get disabled(){return z(t)}})}},$$slots:{default:!0}})}k()}var UEe=new Set([`$$slots`,`$$events`,`$$legacy`,`code`,`lang`,`pending`,`showLanguageSwitcher`,`flex`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`ariaLabel`,`ariaLabelledby`,`ariaDescribedby`,`aria-label`,`aria-labelledby`,`aria-describedby`,`children`]),WEe=B(`<div><!> <!></div> <!>`,1),GEe={hash:`svelte-1qjjbv`,code:`.code-editor.svelte-1qjjbv {margin:var(--sui-focus-ring-width);width:calc(100% - var(--sui-focus-ring-width) * 2);}.code-editor.flex.svelte-1qjjbv:not([hidden]) {display:block;}.code-editor.svelte-1qjjbv {--sui-text-editor-toolbar-top: var(--sui-text-editor-inner-toolbar-top, 0px);--sui-text-editor-toolbar-z-index: var(--sui-text-editor-inner-toolbar-z-index, 100);}.code-editor.svelte-1qjjbv > * {--sui-text-editor-inner-toolbar-top: calc(
var(--sui-text-editor-toolbar-top) + var(--sui-text-editor-toolbar-height)
);--sui-text-editor-inner-toolbar-z-index: calc(var(--sui-text-editor-toolbar-z-index) - 1);}`};function KEe(e,t){O(t,!0),K(e,GEe);let n=J(t,`code`,15,``),r=J(t,`lang`,15,`plain`),i=J(t,`pending`,15,!1),a=J(t,`showLanguageSwitcher`,3,!1),o=J(t,`flex`,3,!1),s=J(t,`hidden`,3,!1),c=J(t,`disabled`,3,!1),l=J(t,`readonly`,3,!1),u=J(t,`required`,3,!1),d=J(t,`invalid`,3,!1),f=J(t,`ariaLabel`,3,void 0),p=J(t,`ariaLabelledby`,3,void 0),m=J(t,`ariaDescribedby`,3,void 0),h=J(t,`aria-label`,3,void 0),g=J(t,`aria-labelledby`,3,void 0),_=J(t,`aria-describedby`,3,void 0),v=vs(t,UEe),y=A(()=>({"aria-label":f()??h(),"aria-labelledby":p()??g(),"aria-describedby":m()??_()})),b=NV();b.config={...b.config,useMarkdownShortcuts:!1,isCodeEditor:!0,defaultLanguage:r()},ti(`editorStore`,b),PV(b,{getInputValue:()=>Rhe(r(),n()),setValue:e=>{let{lang:t,code:i}=zhe(e);r()!==t&&r(t),n()!==i&&n(i)},setPending:e=>{i(e)}});var x=WEe(),S=P(x);fs(S,()=>({...v,role:`none`,class:`sui code-editor`,hidden:s(),[ss]:{flex:o()},[cs]:{"--sui-text-editor-toolbar-height":`${b.toolbarHeight??``}px`}}),void 0,void 0,void 0,`svelte-1qjjbv`);var C=N(S),w=e=>{HEe(e,{get disabled(){return c()},get readonly(){return l()}})};G(C,e=>{a()&&e(w)}),MV(I(C,2),ys(()=>z(y),{get hidden(){return s()},get disabled(){return c()},get readonly(){return l()},get required(){return u()},get invalid(){return d()}})),D(S);var T=I(S,2),ee=e=>{fC(e,{get show(){return b.showConverterError},set show(e){b.showConverterError=e},children:(e,t)=>{bx(e,{status:`error`,children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(`_sui.text_editor.converter_error`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}})};G(T,e=>{b.showConverterError&&e(ee)}),U(e,x),k()}var qEe=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`element`,`flex`,`dir`,`name`,`autoResize`,`useEmojiAutocomplete`,`highlight`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`children`]),JEe=B(`<span> </span>`),YEe=B(`<div aria-hidden="true"></div>`),XEe=B(`<div class="clone auto-resize svelte-7qfco4" aria-hidden="true"> </div>`),ZEe=B(`<div role="none"><textarea></textarea> <!> <!></div>`),QEe={hash:`svelte-7qfco4`,code:`.text-area.svelte-7qfco4 {position:relative;display:inline-grid;margin:var(--sui-focus-ring-width);min-width:var(--sui-textbox-multiline-min-width);}.text-area[hidden].svelte-7qfco4 {display:none;}.text-area.flex.svelte-7qfco4:not([hidden]) {display:inline-grid;width:-moz-available;width:-webkit-fill-available;width:stretch;min-width:0;}:is(textarea.svelte-7qfco4, .clone.svelte-7qfco4) {grid-area:1/1/2/2;display:block;margin:0;width:100%;min-height:8em;border-width:var(--sui-textbox-border-width, 1px);border-color:var(--sui-textbox-border-color);border-radius:var(--sui-textbox-border-radius);padding:var(--sui-textbox-multiline-padding);color:var(--sui-textbox-foreground-color);background-color:var(--sui-textbox-background-color);font-family:var(--sui-textbox-font-family);font-size:var(--sui-textbox-font-size);line-height:var(--sui-textbox-multiline-line-height);font-weight:var(--sui-textbox-font-weight, var(--sui-font-weight-normal, normal));letter-spacing:var(--sui-textbox-letter-spacing, normal);transition:all 200ms;text-align:var(--sui-textbox-text-align, start);text-indent:var(--sui-textbox-text-indent, 0);text-transform:var(--sui-textbox-text-transform, none);word-spacing:var(--sui-word-spacing-normal, normal);}.svelte-7qfco4:is(textarea:where(.svelte-7qfco4), .clone:where(.svelte-7qfco4)):focus {color:var(--sui-textbox-foreground-color-focus, var(--sui-textbox-foreground-color));background-color:var(--sui-textbox-background-color-focus, var(--sui-textbox-background-color));}:is(textarea:where(.svelte-7qfco4), .clone:where(.svelte-7qfco4))[aria-invalid=true].svelte-7qfco4 {border-color:var(--sui-error-border-color);}:is(textarea:where(.svelte-7qfco4), .clone:where(.svelte-7qfco4)).resizing.svelte-7qfco4 {transition-duration:0ms;}.svelte-7qfco4:is(textarea:where(.svelte-7qfco4), .clone:where(.svelte-7qfco4)):is(:where(.svelte-7qfco4):disabled, :where(.svelte-7qfco4):read-only):not(.clone) {background-color:var(--sui-disabled-background-color);}textarea.svelte-7qfco4 {resize:vertical;}textarea.auto-resize.svelte-7qfco4 {overflow:hidden;resize:none;}.clone.svelte-7qfco4 {overflow:hidden;visibility:hidden;scroll-behavior:auto;}.clone.svelte-7qfco4:not(.auto-resize) {position:absolute;inset:0;min-height:0;}.highlighted.svelte-7qfco4 textarea:where(.svelte-7qfco4) {z-index:1;caret-color:var(--sui-textbox-foreground-color);color:transparent !important;background-color:transparent !important;}.highlighted.svelte-7qfco4 textarea:where(.svelte-7qfco4):not(.auto-resize) {scrollbar-gutter:stable;}.highlighted.svelte-7qfco4 textarea:where(.svelte-7qfco4)::placeholder {color:var(--sui-textbox-placeholder-foreground-color, var(--sui-textbox-foreground-color));opacity:var(--sui-textbox-placeholder-opacity, 1);}.highlighted.svelte-7qfco4 .clone:where(.svelte-7qfco4) {visibility:visible;pointer-events:none;}.highlighted.svelte-7qfco4 .clone:where(.svelte-7qfco4) .bold:where(.svelte-7qfco4) {-webkit-text-stroke:0.03em currentColor;}.highlighted.svelte-7qfco4 .clone:where(.svelte-7qfco4) .underline:where(.svelte-7qfco4) {text-decoration-line:underline;}.highlighted.svelte-7qfco4 .clone:where(.svelte-7qfco4) .strikethrough:where(.svelte-7qfco4) {text-decoration-line:line-through;}.highlighted.svelte-7qfco4 .clone:where(.svelte-7qfco4) .underline.strikethrough:where(.svelte-7qfco4) {text-decoration-line:underline line-through;}.highlighted.svelte-7qfco4 .clone:where(.svelte-7qfco4):not(.auto-resize) {scrollbar-gutter:stable;}.highlighted.svelte-7qfco4:focus-within .clone:where(.svelte-7qfco4) {color:var(--sui-textbox-foreground-color-focus, var(--sui-textbox-foreground-color));background-color:var(--sui-textbox-background-color-focus, var(--sui-textbox-background-color));}.highlighted.svelte-7qfco4:is(.disabled:where(.svelte-7qfco4), .readonly:where(.svelte-7qfco4)) .clone:where(.svelte-7qfco4) {background-color:var(--sui-disabled-background-color);}textarea.svelte-7qfco4,
.clone.svelte-7qfco4 {white-space:pre-wrap;word-break:normal;overflow-wrap:anywhere;}`};function RV(e,t){O(t,!0),K(e,QEe);let n=J(t,`value`,15,``),r=J(t,`element`,15),i=J(t,`flex`,3,!1),a=J(t,`dir`,3,void 0),o=J(t,`name`,3,void 0),s=J(t,`autoResize`,3,!1),c=J(t,`useEmojiAutocomplete`,3,!1),l=J(t,`highlight`,3,void 0),u=J(t,`hidden`,3,!1),d=J(t,`disabled`,3,!1),f=J(t,`readonly`,3,!1),p=J(t,`required`,3,!1),m=J(t,`invalid`,3,!1),h=vs(t,qEe),g=A(()=>`${n()}\n`),_=A(()=>{let e=l()?.(n()??``);if(!e)return;let t=e.flatMap(e=>[...e,{content:`
`}]);return t.map(({content:e})=>e).join(``)===z(g)?t:void 0}),v=j(void 0);L(()=>{if(!r()||!z(v))return;let e=r(),t=z(v),n=()=>{t.scrollTop=e.scrollTop,t.scrollLeft=e.scrollLeft};return n(),e.addEventListener(`scroll`,n),()=>{e.removeEventListener(`scroll`,n)}});var y=ZEe();let b;var x=N(y);Uee(x),fs(x,()=>({...h,dir:a(),name:o(),disabled:d()||void 0,readonly:f()||void 0,"aria-hidden":u(),"aria-disabled":d(),"aria-readonly":f(),"aria-required":p(),"aria-invalid":m(),[ss]:{"auto-resize":s()}}),void 0,void 0,void 0,`svelte-7qfco4`),gs(x,e=>r(e),()=>r());var S=I(x,2),C=e=>{var t=YEe();let n;No(t,21,()=>z(_),Ao,(e,t)=>{var n=JEe();let r,i;var a=F(n,!0);R(()=>{r=$o(n,1,`svelte-7qfco4`,null,r,{bold:z(t).bold,underline:z(t).underline,strikethrough:z(t).strikethrough}),i=ts(n,``,i,{color:z(t).color}),W(a,z(t).content)}),U(e,n)}),D(t),gs(t,e=>M(v,e),()=>z(v)),R(()=>{n=$o(t,1,`clone svelte-7qfco4`,null,n,{"auto-resize":s()}),q(t,`dir`,a()),t.dir=t.dir}),U(e,t)},w=e=>{var t=XEe(),n=F(t,!0);R(()=>{q(t,`dir`,a()),W(n,z(g)),t.dir=t.dir}),U(e,t)};G(S,e=>{z(_)?e(C):s()&&e(w,1)});var T=I(S,2),ee=e=>{MS(e,{get element(){return r()}})};G(T,e=>{c()&&!d()&&!f()&&e(ee)}),D(y),R(()=>{b=$o(y,1,`sui text-area ${t.class??``}`,`svelte-7qfco4`,b,{flex:i(),disabled:d(),readonly:f(),highlighted:!!z(_)}),q(y,`hidden`,u()),x.dir=x.dir}),tne(x,n),U(e,y),k()}function $Ee(e,t){O(t,!0);let n=ei(`editorStore`),r=j(void 0),i=()=>{let e=$();if(!Q(e)||!e.isCollapsed()||e.hasFormat(`code`))return;let t=e.anchor.getNode();if(!aE(t)||!t.isSimpleText()||UP(t.getParent()))return;let{offset:n}=e.anchor,r=kS(t.getTextContent().slice(0,n));if(r===void 0)return;let i=t.getKey();return{id:`${i}:${n-r.length-1}`,query:r,nodeKey:i,offset:n}},a=({query:e})=>{let t=window.getSelection();if(!t?.rangeCount)return;let n=t.getRangeAt(0).cloneRange();try{n.setStart(n.startContainer,Math.max(0,n.startOffset-e.length-1))}catch{}let{top:r,bottom:i,left:a,right:o,width:s,height:c}=n.getBoundingClientRect();return r||i||a||s||c?{top:r,bottom:i,left:a,right:o}:void 0},o=(e,t)=>{let{editor:r}=n,{query:i,nodeKey:a,offset:o}=t,s=o-i.length-1;r?.update(()=>{let t=$E(a);if(!aE(t)||t.getTextContent().slice(s,o)!==`:${i}`)return;let n=OS(e.emoji,t.getTextContent().slice(o));t.spliceText(s,i.length+1,n,!0)})},s=()=>{let{editor:e}=n;if(!e)return[];let t=e=>t=>z(r)?.isOpen()?(t?.preventDefault(),e(),!0):!1;return[e.registerCommand(ew,t(()=>z(r)?.moveSelection(1)),4),e.registerCommand($C,t(()=>z(r)?.moveSelection(-1)),4),e.registerCommand(tw,t(()=>z(r)?.selectHighlighted()),4),e.registerCommand(aw,t(()=>z(r)?.selectHighlighted()),4),e.registerCommand(rw,t(()=>z(r)?.close(!0)),4),e.registerUpdateListener(({editorState:e})=>{let t;e.read(()=>{t=i()}),z(r)?.update(t)})]};L(()=>{if(!n.editor||!z(r))return;let e=s();return()=>{e.forEach(e=>e()),z(r)?.close()}}),L(()=>{n.useRichText||z(r)?.close()});{let t=A(()=>n.editor?.getRootElement()??void 0);gs(jS(e,{getAnchorRect:a,onSelect:o,get ariaOwner(){return z(t)}}),e=>M(r,e,!0),()=>z(r))}k()}var eDe=B(`<!> <!> <!> <!>`,1),tDe=B(`<a class="url svelte-1xuqusz" target="_blank" rel="external noopener noreferrer" dir="ltr"> </a> <!> <!>`,1),nDe=B(`<div role="group" class="sui floating-link-editor svelte-1xuqusz" popover="manual"><!></div>`),rDe={hash:`svelte-1xuqusz`,code:`.floating-link-editor.svelte-1xuqusz {position:fixed;inset:auto;z-index:1000;display:flex;align-items:center;gap:4px;margin:0;padding:4px;width:min(400px, 100vw - 16px);font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);border-width:var(--sui-listbox-border-width, 1px);border-style:var(--sui-listbox-border-style, solid);border-color:var(--sui-listbox-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-listbox-border-radius, 4px);color:var(--sui-primary-foreground-color);background-color:var(--sui-secondary-background-color-translucent);box-shadow:0 8px 16px var(--sui-popup-shadow-color);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);}.floating-link-editor.svelte-1xuqusz .sui.text-input {flex:auto;margin:0 !important;min-width:0;}.floating-link-editor.svelte-1xuqusz .sui.button {flex:none;margin:0 !important;}.url.svelte-1xuqusz {flex:auto;overflow:hidden;padding:0 8px;min-width:0;white-space:nowrap;text-overflow:ellipsis;}`};function iDe(e,t){let n=mo();O(t,!0),K(e,rDe);let r=ei(`editorStore`),i=j(void 0),a=j(!1),o=j(void 0),s=j(void 0),c=j(``),l=j(!1),u=!1,d=A(()=>r.config.format===`html`),f=j(void 0),p=j(0),m=j(void 0),h=j(void 0),g=A(()=>!!z(s)),_=A(()=>!!z(c).trim()&&bV(z(c))),v=A(()=>z(g)||!!z(i)&&z(a)&&z(o)!==z(i).key),y=A(()=>z(f)?AS({anchorRect:z(f),listMaxHeight:z(p)||48,viewport:{width:window.innerWidth,height:window.innerHeight},rtl:Tc(),listWidth:Math.min(400,window.innerWidth-16)}):void 0),b=e=>pEe(e,z(s)&&`selection`in z(s)?z(s):{linkKey:z(s)&&`linkKey`in z(s)?z(s).linkKey:z(i)?.key}),x=()=>{let{editor:e}=r;M(f,e&&z(v)?b(e):void 0)},S=async(e,t,n=!1)=>{M(s,e),M(c,t,!0),M(l,n,!0),u=n,M(o,void 0),await Za(),x(),await Za(),z(h)?.focus(),z(h)?.select()},C=()=>{M(s,void 0),M(c,``),M(l,!1)},w=async()=>{r.editor&&await mR(r.editor)},T=()=>{let e,t=``,n=!1;return r.editor?.getEditorState().read(()=>{let r=xV();if(r){e={linkKey:r.getKey()},t=r.getURL(),n=r.getTarget()===`_blank`;return}let i=$()??nj();if(Q(i)&&!i.isCollapsed()){let n=i.getTextContent().trim();n&&(e={selection:i.clone()},t=zc(n)&&bV(n)?n:``)}}),e?(S(e,t,n),!0):!1},ee=async()=>{let{editor:e}=r,t=z(s),n=z(c).trim(),i=z(d)&&z(l)!==u?z(l)?`_blank`:null:void 0;e&&t&&z(_)&&(C(),`linkKey`in t?e.update(()=>{let e=$E(t.linkKey);_F(e)&&(e.setURL(n),i!==void 0&&e.setTarget(i))}):(e.update(()=>{cD(t.selection.clone())}),e.dispatchCommand(yF,i?{url:n,target:i}:n)),await w())},E=async()=>{C(),await w()},te=async()=>{let e=z(i)?.key;e&&(r.editor?.update(()=>{let t=$E(e);_F(t)&&(t.getChildren().forEach(e=>{t.insertBefore(e)}),t.remove())}),await w())},ne=e=>{e.isComposing||(Dx(e,`Enter`)?(e.preventDefault(),z(_)&&ee()):Dx(e,`Escape`)&&(e.preventDefault(),e.stopPropagation(),E()))};L(()=>{let{editor:e}=r;if(!e)return;let t=e.registerCommand(lR,T,2),n=e.registerCommand(rw,e=>!z(v)||z(g)||!z(i)?!1:(e?.preventDefault(),M(o,z(i).key,!0),!0),3),a=e.registerUpdateListener(({editorState:e})=>{e.read(()=>{let e=xV();M(i,e?{key:e.getKey(),url:e.getURL(),target:e.getTarget()}:void 0,!0),z(s)&&(`linkKey`in z(s)?!_F($E(z(s).linkKey)):[z(s).selection.anchor,z(s).selection.focus].some(({key:e})=>!$E(e)?.isAttached()))&&C()}),z(o)&&z(i)?.key!==z(o)&&M(o,void 0),x()}),c=e.registerEditableListener(e=>{e||C()});return()=>{t(),n(),a(),c()}}),L(()=>{r.useRichText||(C(),M(i,void 0))}),L(()=>{z(v),x()}),L(()=>{z(g),z(m)&&(z(m).matches(`:popover-open`)||z(m).showPopover?.(),M(p,z(m).getBoundingClientRect().height,!0))}),So(()=>{let e=e=>{let t=e,n=r.editor?.getRootElement();return!!t&&(!!n?.contains(t)||!!z(m)?.contains(t))},t=({target:t})=>{eo(()=>{M(a,e(t),!0),z(g)&&!z(m)?.contains(t)&&C()})},n=({relatedTarget:e})=>{e||eo(()=>{M(a,!1)})};return window.addEventListener(`scroll`,x,{capture:!0,passive:!0}),window.addEventListener(`resize`,x,{passive:!0}),document.addEventListener(`focusin`,t),document.addEventListener(`focusout`,n),()=>{window.removeEventListener(`scroll`,x,{capture:!0}),window.removeEventListener(`resize`,x),document.removeEventListener(`focusin`,t),document.removeEventListener(`focusout`,n)}});var re=H(),ie=P(re),ae=e=>{var t=nDe();let r;var a=N(t),o=e=>{var t=eDe(),r=P(t);{let e=A(()=>!!z(c).trim()&&!bV(z(c))),t=A(()=>Y(`_sui.text_editor.url`));NS(r,{dir:`ltr`,get id(){return`${n}-url`},flex:!0,get invalid(){return z(e)},get"aria-label"(){return z(t)},onkeydown:e=>{ne(e)},get element(){return z(h)},set element(e){M(h,e,!0)},get value(){return z(c)},set value(e){M(c,e,!0)}})}var i=I(r,2),a=e=>{{let t=e=>{gx(e,{name:`open_in_new`})},n=A(()=>Y(`_sui.text_editor.open_in_new_tab`));Xx(e,{iconic:!0,variant:`ghost`,get pressed(){return z(l)},get"aria-label"(){return z(n)},onclick:()=>{M(l,!z(l))},startIcon:t,$$slots:{startIcon:!0}})}};G(i,e=>{z(d)&&e(a)});var o=I(i,2);{let e=e=>{gx(e,{name:`check`})},t=A(()=>!z(_)),n=A(()=>z(s)&&`linkKey`in z(s)?Y(`_sui.update`):Y(`_sui.insert`));Xx(o,{iconic:!0,variant:`ghost`,get disabled(){return z(t)},get"aria-label"(){return z(n)},onclick:()=>{ee()},startIcon:e,$$slots:{startIcon:!0}})}var u=I(o,2);{let e=e=>{gx(e,{name:`close`})},t=A(()=>Y(`_sui.cancel`));Xx(u,{iconic:!0,variant:`ghost`,get"aria-label"(){return z(t)},onclick:()=>{E()},startIcon:e,$$slots:{startIcon:!0}})}U(e,t)},u=e=>{var t=tDe(),n=P(t),r=F(n,!0),a=I(n,2);{let e=e=>{gx(e,{name:`edit`})},t=A(()=>Y(`_sui.text_editor.edit_link`));Xx(a,{iconic:!0,variant:`ghost`,get"aria-label"(){return z(t)},onclick:()=>{z(i)&&S({linkKey:z(i).key},z(i).url,z(i).target===`_blank`)},startIcon:e,$$slots:{startIcon:!0}})}var o=I(a,2);{let e=e=>{gx(e,{name:`link_off`})},t=A(()=>Y(`_sui.text_editor.remove_link`));Xx(o,{iconic:!0,variant:`ghost`,get"aria-label"(){return z(t)},onclick:()=>{te()},startIcon:e,$$slots:{startIcon:!0}})}R(e=>{q(n,`href`,e),W(r,z(i).url),n.dir=n.dir},[()=>bV(z(i).url)?z(i).url:void 0]),U(e,t)};G(a,e=>{z(g)?e(o):z(i)&&e(u,1)}),D(t),gs(t,e=>M(m,e),()=>z(m)),R(e=>{q(t,`aria-label`,e),r=ts(t,``,r,{top:z(y).top,bottom:z(y).bottom,left:z(y).left})},[()=>Y(`_sui.text_editor.link`)]),so(`mousedown`,t,e=>{e.target.closest(`input`)||e.preventDefault()}),U(e,t)};G(ie,e=>{z(v)&&z(y)&&e(ae)}),U(e,re),k()}co([`mousedown`]);var aDe=60,zV=async(e,t=0)=>e.closest(`dialog`)?.open&&t<aDe?(await new Promise(e=>{window.requestAnimationFrame(e)}),zV(e,t+1)):new Promise(e=>{window.setTimeout(e)}),oDe=B(`<!> <!>`,1);function BV(e,t){O(t,!0);let n=ei(`editorStore`),r=[[[`insert-row-above`,`insert_row_above`],[`insert-row-below`,`insert_row_below`]],[[`insert-column-left`,`insert_column_left`],[`insert-column-right`,`insert_column_right`]],[[`delete-row`,`delete_row`],[`delete-column`,`delete_column`],[`delete-table`,`delete_table`]]],i=async(e,r)=>{let{editor:i}=n;if(!i)return;let a=i.getElementByKey(t.cellKey),o=!!a&&BB(a);i.update(()=>{cTe(e,t.cellKey,{rtl:o})}),await zV(r),await mR(i)};{let t=A(()=>Y(`_sui.text_editor.table_options`));qS(e,{get ariaLabel(){return z(t)},children:(e,t)=>{var n=H();No(P(n),17,()=>r,Ao,(e,t,n)=>{var r=oDe(),a=P(r),o=e=>{FS(e,{})};G(a,e=>{n>0&&e(o)}),No(I(a,2),17,()=>z(t),([e,t])=>e,(e,t)=>{var n=A(()=>Er(z(t),2));let r=()=>z(n)[0],a=()=>z(n)[1];{let t=A(()=>Y(`_sui.text_editor.${a()}`));JS(e,{get label(){return z(t)},onclick:e=>{i(r(),e.currentTarget)}})}}),U(e,r)}),U(e,n)},$$slots:{default:!0}})}k()}var sDe=B(`<div role="none"><!></div>`),cDe={hash:`svelte-pdhbuw`,code:`.table-cell-menu-button.svelte-pdhbuw {position:absolute;z-index:1;translate:-100% 0;}.table-cell-menu-button.rtl.svelte-pdhbuw {translate:0 0;}.table-cell-menu-button[hidden].svelte-pdhbuw {display:none;}.table-cell-menu-button.svelte-pdhbuw .sui.button {margin:0;border-radius:50%;background-color:var(--sui-secondary-background-color);}`};function lDe(e,t){O(t,!0),K(e,cDe);let n=ei(`editorStore`),r=j(null),i=j(!1),a=j(void 0),o=j(void 0),s=A(()=>!!z(r)&&z(i)&&!!z(a)&&n.useRichText),c=A(()=>z(a)?`top: ${z(a).top}px; left: ${z(a).left}px`:void 0),l=()=>z(o)?.parentElement,u=()=>{let e=l(),t=z(r)?n.editor?.getElementByKey(z(r)):void 0;if(!z(i)||!e||!t){M(a,void 0);return}let o=t.getBoundingClientRect(),s=t.closest(`.table-wrapper`).getBoundingClientRect(),c=t.closest(`.lexical-root`).getBoundingClientRect(),u=e.getBoundingClientRect(),d=BB(t),f=Math.max(o.left,s.left),p=Math.min(o.right,s.right),m=Math.max(o.top,c.top),h=Math.min(o.bottom,c.bottom);p<=f||h<=m?M(a,void 0):M(a,{top:m-u.top+4,left:(d?f+4:p-4)-u.left,rtl:d,popupPosition:d?`bottom-right`:`bottom-left`})},d,f=()=>{window.clearTimeout(d),d=window.setTimeout(()=>{let e=l();M(i,!!e?.contains(document.activeElement)||!!z(o)?.querySelector(`[aria-expanded="true"]`),!0),u()})};L(()=>{let{editor:e}=n;if(!e)return;let t=e.registerUpdateListener(({editorState:e})=>{M(r,e.read(HB),!0),u()}),i=e.registerRootListener(e=>{if(!e)return;let t=new ResizeObserver(u);return e.addEventListener(`scroll`,u,{capture:!0}),t.observe(e),()=>{e.removeEventListener(`scroll`,u,{capture:!0}),t.disconnect()}});return()=>{t(),i()}}),So(()=>(window.addEventListener(`resize`,u),document.addEventListener(`focusin`,f),document.addEventListener(`focusout`,f),()=>{window.clearTimeout(d),window.removeEventListener(`resize`,u),document.removeEventListener(`focusin`,f),document.removeEventListener(`focusout`,f)}));var p=sDe();let m;var h=N(p),g=e=>{let t=A(()=>z(r));{let r=e=>{gx(e,{name:`expand_more`})},i=e=>{BV(e,{get cellKey(){return z(t)}})},o=A(()=>z(a)?.popupPosition),s=A(()=>Y(`_sui.text_editor.show_table_options`));hS(e,{iconic:!0,size:`small`,variant:`tertiary`,get popupPosition(){return z(o)},get"aria-label"(){return z(s)},get"aria-controls"(){return n.controlId},endIcon:r,popup:i,$$slots:{endIcon:!0,popup:!0}})}};G(h,e=>{z(s)&&z(r)&&e(g)}),D(p),gs(p,e=>M(o,e),()=>z(o)),R(()=>{m=$o(p,1,`table-cell-menu-button svelte-pdhbuw`,null,m,{rtl:z(a)?.rtl}),q(p,`hidden`,!z(s)),ts(p,z(c))}),so(`mousedown`,p,e=>{e.preventDefault()}),U(e,p),k()}co([`mousedown`]);var uDe={bold:`**`,italic:`_`,strikethrough:`~~`,code:"`"},dDe=/^(?:#{1,6}[ \t]+|>[ \t]?|[-*+][ \t]+|\d+[.)][ \t]+)/,fDe=/^[ \t]*(?:```|~~~)/,pDe=({value:e,start:t,end:n})=>{let r=e.lastIndexOf(`
`,t-1)+1,i=n>t&&e[n-1]===`
`?n-1:n,a=e.indexOf(`
`,i);return{lineStart:r,lineEnd:a===-1?e.length:a}},VV=({value:e,start:t})=>e.slice(0,t).split(`
`).length-1,HV=(e,t)=>{let n;for(let r=0;r<e.length;r+=1){if(fDe.test(e[r])){if(n===void 0)n=r;else{if(t>=n&&t<=r)return{open:n,close:r};n=void 0}}if(n===void 0&&r>=t)return}return n!==void 0&&t>=n?{open:n,close:e.length}:void 0},mDe=e=>{let t=e.value.split(`
`),n=VV(e),r=t[n];if(HV(t,n))return`code-block`;let[,i]=r.match(/^(#{1,6})[ \t]/)??[];return i?`heading-${i.length}`:/^[-*+][ \t]/.test(r)?`bulleted-list`:/^\d+[.)][ \t]/.test(r)?`numbered-list`:r.startsWith(`>`)?`blockquote`:`paragraph`},hDe=({value:e,start:t,end:n},r)=>{let i=uDe[r],{length:a}=i,o=e.slice(t,n);if(o.length>=a*2&&o.startsWith(i)&&o.endsWith(i)){let e=o.slice(a,-a);return{start:t,end:n,text:e,selectionStart:t,selectionEnd:t+e.length}}if(e.slice(t-a,t)===i&&e.slice(n,n+a)===i)return{start:t-a,end:n+a,text:o,selectionStart:t-a,selectionEnd:n-a};let[,s,c,l]=o.match(/^(\s*)([\s\S]*?)(\s*)$/),u=`${s}${c.split(`
`).map(e=>e.trim()?`${i}${e}${i}`:e).join(`
`)}${l}`;if(!c){let e=t+s.length+a;return{start:t,end:n,text:`${s}${i}${i}${l}`,selectionStart:e,selectionEnd:e}}return{start:t,end:n,text:u,selectionStart:t+s.length+a,selectionEnd:t+u.length-l.length-a}},UV=(e,t)=>{let{value:n,start:r,end:i}=e,a=n.split(`
`),o=HV(a,VV(e));if(o){let{open:e,close:n}=o,s=a.slice(0,e).join(`
`).length+ +!!e,c=s+a.slice(e,n+1).join(`
`).length,l=a.slice(e+1,n).join(`
`),u=s+a[e].length+1,d=e=>Math.min(Math.max(e-u,0),l.length),f=UV({value:l,start:d(r),end:d(i)},t);return{start:s,end:c,text:`${l.slice(0,f.start)}${f.text}${l.slice(f.end)}`,selectionStart:s+f.selectionStart,selectionEnd:s+f.selectionEnd}}let{lineStart:s,lineEnd:c}=pDe(e),l=n.slice(s,c).split(`
`);if(t===`code-block`)return{start:s,end:c,text:`\`\`\`\n${l.join(`
`)}\n\`\`\``,selectionStart:r+4,selectionEnd:i+4};let[,u]=t.match(/^heading-(\d)$/)??[],d=0,f=e=>u?e.trim()?`${`#`.repeat(Number(u))} `:``:t===`bulleted-list`?e.trim()?`- `:``:t===`numbered-list`?e.trim()?(d+=1,`${d}. `):``:t===`blockquote`?e.trim()?`> `:`>`:``,p=0,m=r,h=i,g=l.map((e,t)=>{let[n=``]=e.match(dDe)??[],a=e.slice(n.length),o=f(a),c=s+l.slice(0,t).join(`
`).length+ +!!t,u=c+n.length,d=c+e.length,g=u+p+o.length-n.length,_=e=>g+Math.max(e-u,0);return r>=c&&r<=d&&(m=_(r)),i>=c&&i<=d&&(h=_(i)),p+=o.length-n.length,`${o}${a}`});return i>c&&(h=i+p),{start:s,end:c,text:g.join(`
`),selectionStart:m,selectionEnd:Math.max(m,h)}},gDe=({value:e,start:t,end:n},{url:r,text:i})=>{let[,a,o,s]=e.slice(t,n).match(/^(\s*)([\s\S]*?)(\s*)$/),c=`[${((i??o).trim()||r).replace(/([[\]\\])/g,`\\$1`)}](${/[\s()<>]/.test(r)?`<${r.replace(/[<>]/g,encodeURIComponent)}>`:r})`,l=t+a.length+c.length;return{start:t,end:n,text:`${a}${c}${s}`,selectionStart:l,selectionEnd:l}},WV=({value:e,start:t,end:n},r,{block:i=!1}={})=>{if(!i){let e=t+r.length;return{start:t,end:n,text:r,selectionStart:e,selectionEnd:e}}let a=e.slice(0,t).replace(/[ \t]*$/,``),o=e.slice(n).replace(/^[ \t]*/,``),s=a.length,c=e.length-o.length,l=`${a?a.endsWith(`
`)?``:a.endsWith(`
`)?`
`:`
`:``}${r}${o.startsWith(`
`)?``:o.startsWith(`
`)?`
`:`
`}`,u=s+l.length;return{start:s,end:c,text:l,selectionStart:u,selectionEnd:u}},GV=({value:e,selectionStart:t,selectionEnd:n})=>({value:e,start:t,end:n}),_De=async e=>{let t=Date.now()+1e3;for(;;){if(e.focus(),document.activeElement===e||Date.now()>t)return document.activeElement===e;await new Promise(e=>{window.setTimeout(e,20)})}},KV=({readOnly:e,disabled:t})=>!e&&!t,qV=async(e,{start:t,end:n,text:r,selectionStart:i,selectionEnd:a})=>{if(!KV(e))return;let o=await _De(e);e.value.slice(t,n)!==r&&(e.setSelectionRange(t,n),o&&typeof document.execCommand==`function`&&(r?document.execCommand(`insertText`,!1,r):document.execCommand(`delete`,!1))&&e.value.slice(t,t+r.length)===r||(e.setRangeText(r,t,n),e.dispatchEvent(new Event(`input`,{bubbles:!0})))),e.setSelectionRange(i,a)},JV=async(e,t)=>{e&&await qV(e,t(GV(e)))},YV=(e,t,n)=>{let r=r=>{KV(e)&&Dx(r,Sx()?`Meta+${t}`:`Ctrl+${t}`)&&(r.preventDefault(),n())};return e.addEventListener(`keydown`,r),()=>{e.removeEventListener(`keydown`,r)}},vDe=async(e,t)=>{let n=$Te(t);if(!n){e.focus();return}let r=t.transformer?.type!==`text-match`;await qV(e,WV(GV(e),n,{block:r}))},XV=/[ \t]*(?:\r?\n[ \t]*)+/g,yDe=({value:e,caret:t})=>{let n=e.slice(0,t).replace(XV,` `);return{value:n+e.slice(t).replace(XV,` `),caret:n.length}},bDe=e=>{let t=e=>{let{inputType:t}=e;if(t===`insertLineBreak`||t===`insertParagraph`){e.preventDefault();return}let n=e.data||e.dataTransfer?.getData(`text/plain`)||``;(t===`insertFromPaste`||t===`insertReplacementText`)&&n.includes(`
`)&&typeof document.execCommand==`function`&&(e.preventDefault(),document.execCommand(`insertText`,!1,n.replace(XV,` `)))},n=()=>{let{value:t,selectionStart:n}=e;if(!t.includes(`
`))return;let r=yDe({value:t,caret:n});e.value=r.value,e.setSelectionRange(r.caret,r.caret)};return e.addEventListener(`beforeinput`,t),e.addEventListener(`input`,n,{capture:!0}),()=>{e.removeEventListener(`beforeinput`,t),e.removeEventListener(`input`,n,{capture:!0})}},xDe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`ariaLabel`,`children`]),SDe=B(`<div><!></div>`),CDe={hash:`svelte-1lqxga9`,code:`.button-group.svelte-1lqxga9 {flex:none;display:inline-flex;align-items:center;}`};function wDe(e,t){K(e,CDe);let n=J(t,`ariaLabel`,3,void 0),r=vs(t,xDe);var i=SDe();fs(i,()=>({...r,role:`group`,class:`sui button-group ${t.class??``}`,"aria-label":n()}),void 0,void 0,void 0,`svelte-1lqxga9`),xo(N(i),()=>t.children??Cr),D(i),U(e,i)}function TDe(e,t){O(t,!0);let n=ei(`editorStore`),r=A(()=>n.selection.alignment??``),i=A(()=>uR.find(({type:e})=>e===z(r))?.icon??`format_align_left`),a=async(e,t)=>{let{editor:r}=n;r&&(r.dispatchCommand(lw,e),await zV(t),await mR(r))};{let t=e=>{gx(e,{get name(){return z(i)}})},o=e=>{{let t=A(()=>Y(`_sui.text_editor.alignment_options`));qS(e,{get ariaLabel(){return z(t)},children:(e,t)=>{var i=H();Oo(P(i),()=>n.selection,e=>{var t=H();No(P(t),17,()=>uR,e=>e.type,(e,t)=>{{let n=e=>{gx(e,{get name(){return z(t).icon}})},i=A(()=>Y(`_sui.text_editor.${z(t).labelKey}`)),o=A(()=>z(r)===z(t).type);XS(e,{get label(){return z(i)},get checked(){return z(o)},onclick:e=>{a(z(t).type,e.currentTarget)},startIcon:n,$$slots:{startIcon:!0}})}}),U(e,t)}),U(e,i)},$$slots:{default:!0}})}},s=A(()=>Y(`_sui.text_editor.show_alignment_options`));hS(e,{get"aria-label"(){return z(s)},get"aria-controls"(){return n.controlId},startIcon:t,popup:o,$$slots:{startIcon:!0,popup:!0}})}k()}function EDe(e,t){O(t,!0);let n=ei(`editorStore`),r=A(()=>n.selection.inlineTypes.includes(t.type)),i={bold:`B`,italic:`I`},a=async()=>{let{editor:e,textArea:r,useRichText:i}=n;i?e&&(await mR(e),e.dispatchCommand(GC,t.type)):JV(r,e=>hDe(e,t.type))};L(()=>{let{textArea:e}=n,r=i[t.type];if(e&&r)return YV(e,r,()=>{a()})});{let i=e=>{gx(e,{get name(){return aR[t.type].icon}})},o=A(()=>Y(`_sui.text_editor.${aR[t.type].labelKey}`));Xx(e,{iconic:!0,get"aria-label"(){return z(o)},get"aria-controls"(){return n.controlId},get pressed(){return z(r)},onclick:()=>{a()},startIcon:i,$$slots:{startIcon:!0}})}k()}function DDe(e,t){O(t,!0);let n=ei(`editorStore`),{labelKey:r,icon:i}=aR[`horizontal-rule`],a=async()=>{let{editor:e,textArea:t,useRichText:r}=n;r?e&&(e.update(()=>{eTe()}),await mR(e)):await JV(t,e=>WV(e,`***`,{block:!0}))};{let t=e=>{gx(e,{get name(){return i}})},o=A(()=>Y(`_sui.text_editor.${r}`));Xx(e,{iconic:!0,get"aria-label"(){return z(o)},get"aria-controls"(){return n.controlId},onclick:()=>{a()},startIcon:t,$$slots:{startIcon:!0}})}k()}var ZV=(e,t)=>{let{textArea:n,useRichText:r}=e;if(!r){n&&vDe(n,t);return}let{createNode:i}=t;e.editor?.update(()=>{let e=i();lj(e.isInline()?[e]:[e,EE()])})};function ODe(e,t){O(t,!0);let n=ei(`editorStore`),r=A(()=>t.component.label),i=A(()=>t.component.icon);{let a=e=>{var t=H(),n=P(t),r=e=>{gx(e,{get name(){return z(i)}})};G(n,e=>{z(i)&&e(r)}),U(e,t)},o=A(()=>!!z(i)),s=A(()=>z(i)?void 0:z(r));Xx(e,{get iconic(){return z(o)},get label(){return z(s)},get title(){return z(r)},get"aria-label"(){return z(r)},get"aria-controls"(){return n.controlId},onclick:()=>{ZV(n,t.component)},startIcon:a,$$slots:{startIcon:!0}})}k()}var kDe=B(`<div role="none"><label> </label> <!></div>`),ADe=B(`<div role="none"><!></div>`),jDe=B(`<div role="none"><label> </label> <!></div> <!> <!>`,1),MDe=B(`<!> <!>`,1);function NDe(e,t){let n=mo();O(t,!0);let r=`link`,i=ei(`editorStore`),a=A(()=>i.selection.inlineTypes.includes(r)),o=j(!1),s=j(!1),c=j(``),l=j(``),u=j(!1),d=A(()=>i.config.format===`html`&&i.useRichText),f=A(()=>!!z(c).trim()&&bV(z(c))),p=e=>{M(c,zc(e)&&bV(e)?e:``,!0),M(s,!!e),M(o,!0)},m=()=>{let{textArea:e,useRichText:t}=i;if(t)i.editor?.getEditorState().read(()=>{p(Aye().trim())});else if(e){let{value:t,start:n,end:r}=GV(e);p(t.slice(n,r).trim())}},h=()=>{i.useRichText&&i.editor?.dispatchCommand(lR,void 0)||m()},g=e=>{Dx(e,`Enter`)&&z(f)&&M(o,!1)},_=async e=>{let{textArea:t,useRichText:n}=i;if(!n)t&&(e.detail.returnValue===`cancel`?t.focus():JV(t,e=>gDe(e,{url:z(c).trim(),text:z(s)?void 0:z(l)}))),M(c,``),M(l,``);else{if(e.detail.returnValue!==`cancel`){if(!i.editor)return;await new Promise(e=>{i.editor?.update(async()=>{let t=$()??nj()?.clone();Q(t)||(t=ZA()),z(s)||(M(l,z(l).trim(),!0),M(l,z(l)||z(c),!0),lj([iE(z(l))])),cD(t),e(void 0)})}),await mR(i.editor),i.editor.dispatchCommand(yF,z(d)&&z(u)?{url:z(c),target:`_blank`}:z(c))}else i.editor&&await mR(i.editor);M(c,``),M(l,``),M(u,!1)}},v=()=>i.editor?.registerCommand(JC,e=>(Dx(e,Sx()?`Meta+K`:`Ctrl+K`)&&(e.preventDefault(),h()),!1),2);L(()=>{let{textArea:e}=i;if(e)return YV(e,`K`,()=>{h()})}),L(()=>{if(i.editor)return v()});var y=MDe(),b=P(y);{let e=e=>{gx(e,{get name(){return aR[r].icon}})},t=A(()=>Y(`_sui.text_editor.${aR[r].labelKey}`)),n=A(()=>z(a)&&i.useRichText);Xx(b,{iconic:!0,get"aria-label"(){return z(t)},get"aria-controls"(){return i.controlId},get pressed(){return z(n)},onclick:()=>{h()},startIcon:e,$$slots:{startIcon:!0}})}var x=I(b,2);{let e=A(()=>Y(`_sui.text_editor.insert_link`)),t=A(()=>!z(f)),r=A(()=>Y(`_sui.insert`));SS(x,{get title(){return z(e)},get okDisabled(){return z(t)},get okLabel(){return z(r)},restoreFocus:!1,onClose:e=>{_(e)},get open(){return z(o)},set open(e){M(o,e,!0)},children:(e,t)=>{var r=jDe(),i=P(r),a=N(i),o=F(a,!0),f=I(a,2);{let e=A(()=>!!z(c).trim()&&!bV(z(c))),t=A(()=>Y(`_sui.text_editor.url`));NS(f,{dir:`ltr`,get id(){return`${n}-url`},flex:!0,get invalid(){return z(e)},get"aria-label"(){return z(t)},onkeydown:e=>{g(e)},get value(){return z(c)},set value(e){M(c,e,!0)}})}D(i);var p=I(i,2),m=e=>{var t=kDe(),r=N(t),i=F(r,!0),a=I(r,2);{let e=A(()=>Y(`_sui.text_editor.text`));NS(a,{dir:`auto`,get id(){return`${n}-text`},flex:!0,get"aria-label"(){return z(e)},onkeydown:e=>{g(e)},get value(){return z(l)},set value(e){M(l,e,!0)}})}D(t),R(e=>{q(r,`for`,`${n}-text`),W(i,e)},[()=>Y(`_sui.text_editor.text`)]),U(e,t)};G(p,e=>{z(s)||e(m)});var h=I(p,2),_=e=>{var t=ADe(),n=N(t);{let e=A(()=>Y(`_sui.text_editor.open_in_new_tab`));vS(n,{get label(){return z(e)},get checked(){return z(u)},set checked(e){M(u,e,!0)}})}D(t),U(e,t)};G(h,e=>{z(d)&&e(_)}),R(e=>{q(a,`for`,`${n}-url`),W(o,e)},[()=>Y(`_sui.text_editor.url`)]),U(e,r)},$$slots:{default:!0}})}U(e,y),k()}function PDe(e,t){O(t,!0);let n=ei(`editorStore`);{let r=e=>{gx(e,{name:`arrow_drop_down`,class:`small-arrow`})},i=e=>{qS(e,{children:(e,r)=>{var i=H();No(P(i),17,()=>t.components,e=>e.id,(e,t)=>{let r=A(()=>z(t));JS(e,{get label(){return z(r).label},onclick:()=>{ZV(n,z(t))},startIcon:e=>{var t=H(),n=P(t),i=e=>{gx(e,{get name(){return z(r).icon}})};G(n,e=>{z(r).icon&&e(i)}),U(e,t)},$$slots:{startIcon:!0}})}),U(e,i)},$$slots:{default:!0}})},a=A(()=>Y(`_sui.insert`));hS(e,{get label(){return z(a)},endIcon:r,popup:i,$$slots:{endIcon:!0,popup:!0}})}k()}var FDe=e=>typeof e==`number`&&Number.isFinite(e)&&e>0?e:1,QV=e=>{let[t,n=`0`]=String(e).toLowerCase().split(`e`),r=(t.split(`.`)[1]?.length??0)-Number(n);return Math.max(r,0)},IDe=({fractional:e,min:t})=>typeof t==`number`&&t>=0?e?`decimal`:`numeric`:`text`,$V=new Map,LDe=e=>{let t=e||``,n=$V.get(t);if(n===void 0){try{n=new Intl.NumberFormat(e||void 0).formatToParts(1.5).find(({type:e})=>e===`decimal`).value}catch{n=`.`}$V.set(t,n)}return n},RDe=(e,t)=>{let n=LDe(t);if(!e||n===`.`||e.includes(`.`))return e;let r=e.split(n);return r.length===2?r.join(`.`):e},eH=e=>{let t=e.trim()?Number(e):NaN;return Number.isNaN(t)?void 0:t},tH=e=>Number(e||0),nH=(e,t)=>typeof t==`number`&&tH(e)<=t,rH=(e,t)=>typeof t==`number`&&tH(e)>=t,zDe=(e,{step:t,direction:n,min:r,max:i})=>{if(Number.isNaN(Number(e))||(n>0?rH(e,i):nH(e,r)))return;let a=QV(t),o=Number((tH(e)+t*n).toFixed(a));return typeof i==`number`&&o>i?String(i):typeof r==`number`&&o<r?String(r):o.toFixed(a)},BDe=(e,{required:t=!1,min:n,max:r}={})=>{if(t&&(eH(e)===void 0||e===``))return!0;if(e===void 0||e===``)return!1;let i=Number(e);return Number.isNaN(i)||typeof n==`number`&&tH(e)<n||typeof r==`number`&&tH(e)>r},VDe=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`invalid`,`flex`,`min`,`max`,`step`,`fractional`,`inputmode`,`class`,`hidden`,`disabled`,`readonly`,`required`,`children`,`increaseIcon`,`decreaseIcon`,`onChange`,`onkeydown`,`oninput`]),HDe=B(`<div role="none" class="buttons svelte-11p915l"><!> <!></div>`),UDe=B(`<span hidden=""> </span>`),WDe=B(`<div role="none"><!> <!></div>`),GDe={hash:`svelte-11p915l`,code:`.number-input.svelte-11p915l {display:inline-flex;align-items:center;position:relative;margin:var(--sui-focus-ring-width);min-width:var(--sui-textbox-singleline-min-width);}.number-input.stepper.svelte-11p915l {--sui-number-input-end-padding: 24px;}.number-input.flex.svelte-11p915l:not([hidden]) {display:inline-flex;width:-moz-available;width:-webkit-fill-available;width:stretch;min-width:0;}.number-input.svelte-11p915l:not(.disabled) button[aria-disabled='true'] {filter:grayscale(0) opacity(1);}.number-input.svelte-11p915l:not(.disabled) button[aria-disabled='true'] * {filter:grayscale(1) opacity(var(--sui-disabled-opacity, 0.35));}.number-input.svelte-11p915l input {padding-right:var(--sui-number-input-end-padding, 8px);}.number-input.svelte-11p915l .text-input {flex:auto;margin:0 !important;width:0;min-width:0 !important;}.buttons.svelte-11p915l {display:flex;flex-direction:column;position:absolute;inset-block:2px;right:2px;z-index:3;width:18px;}.buttons.svelte-11p915l button {flex:none;margin:0 !important;border-width:0;border-radius:3px;padding:0;width:100%;height:50%;min-height:0;}.buttons.svelte-11p915l button .icon {font-size:16px;}.number-input.svelte-11p915l:dir(rtl) {--sui-textbox-text-align: right;}.number-input.svelte-11p915l:dir(rtl) .buttons:where(.svelte-11p915l) {right:auto;left:2px;}.number-input.svelte-11p915l:dir(rtl) input {padding-right:8px;padding-left:var(--sui-number-input-end-padding, 8px);}`};function iH(e,t){let n=mo();O(t,!0),K(e,GDe);let r=J(t,`value`,15),i=J(t,`invalid`,15,!1),a=J(t,`flex`,3,!1),o=J(t,`min`,3,void 0),s=J(t,`max`,3,void 0),c=J(t,`step`,3,1),l=J(t,`fractional`,3,void 0),u=J(t,`inputmode`,3,void 0),d=J(t,`hidden`,3,!1),f=J(t,`disabled`,3,!1),p=J(t,`readonly`,3,!1),m=J(t,`required`,3,!1),h=vs(t,VDe),g=j(!1),_=j(``),v=A(()=>c()!==-1),y=A(()=>FDe(c())),b=A(()=>l()??(!z(v)||QV(z(y))>0)),x=A(()=>{let e=typeof o()==`number`,t=typeof s()==`number`;if(!(z(v)||!e&&!t))return e&&t?Y(`_sui.number_input.range`,{values:{min:o(),max:s()}}):e?Y(`_sui.number_input.min`,{values:{min:o()}}):Y(`_sui.number_input.max`,{values:{max:s()}})}),S=A(()=>[h[`aria-describedby`],z(x)?`${n}-range`:void 0].filter(Boolean).join(` `)||void 0),C=A(()=>RDe(z(_),t.lang??Ec.current)),w=A(()=>nH(z(C),o())),T=A(()=>rH(z(C),s()));L(()=>{let e=r();eo(()=>{eH(z(C))!==e&&M(_,String(e??``),!0)})}),L(()=>{r(eH(z(C)))}),L(()=>{z(g)&&i(BDe(z(C),{required:m(),min:o(),max:s()}))});let ee=e=>{let t=zDe(z(C),{step:z(y),direction:e,min:o(),max:s()});t!==void 0&&M(_,t,!0)},E=()=>{ee(-1)},te=()=>{ee(1)};var ne=WDe();let re;var ie=N(ne),ae=e=>{var r=HDe(),i=N(r);{let e=e=>{var n=H(),r=P(n),i=e=>{var n=H();xo(P(n),()=>t.increaseIcon),U(e,n)},a=e=>{gx(e,{name:`expand_less`})};G(r,e=>{t.increaseIcon?e(i):e(a,-1)}),U(e,n)},r=A(()=>f()||p()||Number.isNaN(Number(z(C)))||z(T)),a=A(()=>Y(`_sui.number_input.increase`));Xx(i,{iconic:!0,get disabled(){return z(r)},get"aria-label"(){return z(a)},get"aria-controls"(){return n},onclick:()=>{te()},startIcon:e,$$slots:{startIcon:!0}})}var a=I(i,2);{let e=e=>{var n=H(),r=P(n),i=e=>{var n=H();xo(P(n),()=>t.decreaseIcon),U(e,n)},a=e=>{gx(e,{name:`expand_more`})};G(r,e=>{t.decreaseIcon?e(i):e(a,-1)}),U(e,n)},r=A(()=>f()||p()||Number.isNaN(Number(z(C)))||z(w)),i=A(()=>Y(`_sui.number_input.decrease`));Xx(a,{iconic:!0,get disabled(){return z(r)},get"aria-label"(){return z(i)},get"aria-controls"(){return n},onclick:()=>{E()},startIcon:e,$$slots:{startIcon:!0}})}D(r),U(e,r)},oe=e=>{var t=UDe(),r=F(t,!0);R(()=>{q(t,`id`,`${n}-range`),W(r,z(x))}),U(e,t)};G(ie,e=>{z(v)?e(ae):z(x)&&e(oe,1)});var se=I(ie,2);{let e=A(()=>z(v)?`spinbutton`:`textbox`),c=A(()=>z(v)&&Number.isFinite(r())?r():void 0),l=A(()=>z(v)?o():void 0),y=A(()=>z(v)?s():void 0),x=A(()=>u()??IDe({fractional:z(b),min:o()}));NS(se,ys({dir:`ltr`},()=>h,{get role(){return z(e)},get id(){return n},spellcheck:`false`,get flex(){return a()},get hidden(){return d()},get disabled(){return f()},get readonly(){return p()},get required(){return m()},get invalid(){return i()},get"aria-valuenow"(){return z(c)},get"aria-valuemin"(){return z(l)},get"aria-valuemax"(){return z(y)},get inputmode(){return z(x)},get"aria-describedby"(){return z(S)},onkeydown:e=>{let{key:n,ctrlKey:r,metaKey:i,altKey:a,shiftKey:o}=e,s=o||a||r||i,c=z(v)&&!f()&&!p()&&!s;n===`ArrowDown`&&c&&(e.preventDefault(),E()),n===`ArrowUp`&&c&&(e.preventDefault(),te()),z(g)||M(g,!0),t.onkeydown?.(e)},oninput:e=>{z(g)||M(g,!0),t.oninput?.(e)},get onChange(){return t.onChange},get value(){return z(_)},set value(e){M(_,e,!0)}}))}D(ne),R(()=>{re=$o(ne,1,`sui number-input ${t.class??``}`,`svelte-11p915l`,re,{flex:a(),disabled:f(),readonly:p(),stepper:z(v)}),q(ne,`hidden`,d())}),U(e,ne),k()}var KDe=B(`<div role="none" class="table-size svelte-xxp5r9"><label> </label> <!> <label> </label> <!></div>`),qDe=B(`<!> <!>`,1),JDe={hash:`svelte-xxp5r9`,code:`.table-size.svelte-xxp5r9 {display:grid;grid-template-columns:auto 1fr;align-items:center;gap:8px 16px;}`};function YDe(e,t){let n=mo();O(t,!0),K(e,JDe);let r=J(t,`disabled`,3,!1),i=ei(`editorStore`),a=j(!1),o=j(Xi(3)),s=j(Xi(3)),c=A(()=>zB(z(o))),l=A(()=>zB(z(s))),u=A(()=>!!z(c)&&!!z(l)),d=()=>{z(c)||M(o,3,!0),z(l)||M(s,3,!0),M(a,!0)},f=e=>{Dx(e,`Enter`)&&z(u)&&M(a,!1)},p=async({rows:e,columns:t})=>{let{editor:n}=i;n&&(n.update(()=>{nTe(e,t)}),await mR(n))},m=async({rows:e,columns:t})=>{let n=tTe(e,t);await JV(i.textArea,e=>{let t=WV(e,n,{block:!0}),r=t.start+t.text.indexOf(n)+2;return{...t,selectionStart:r,selectionEnd:r}})},h=async e=>{if(e.detail.returnValue!==`cancel`&&z(c)&&z(l)){let e={rows:z(c),columns:z(l)};i.useRichText?await p(e):await m(e)}else i.useRichText?i.editor&&await mR(i.editor):i.textArea?.focus()};var g=qDe(),_=P(g);{let e=e=>{gx(e,{get name(){return aR.table.icon}})},t=A(()=>Y(`_sui.text_editor.${aR.table.labelKey}`));Xx(_,{iconic:!0,get disabled(){return r()},get"aria-label"(){return z(t)},get"aria-controls"(){return i.controlId},onclick:()=>{d()},startIcon:e,$$slots:{startIcon:!0}})}var v=I(_,2);{let e=A(()=>Y(`_sui.text_editor.insert_table`)),t=A(()=>!z(u)),r=A(()=>Y(`_sui.insert`));SS(v,{size:`x-small`,get title(){return z(e)},get okDisabled(){return z(t)},get okLabel(){return z(r)},restoreFocus:!1,onClose:e=>{h(e)},get open(){return z(a)},set open(e){M(a,e,!0)},children:(e,t)=>{var r=KDe(),i=N(r),a=F(i,!0),u=I(i,2);{let e=A(()=>!z(c)),t=A(()=>Y(`_sui.text_editor.rows`));iH(u,{get id(){return`${n}-rows`},min:1,get max(){return 50},get invalid(){return z(e)},get"aria-label"(){return z(t)},onkeydown:e=>{f(e)},get value(){return z(o)},set value(e){M(o,e,!0)}})}var d=I(u,2),p=F(d,!0),m=I(d,2);{let e=A(()=>!z(l)),t=A(()=>Y(`_sui.text_editor.columns`));iH(m,{get id(){return`${n}-columns`},min:1,get max(){return 50},get invalid(){return z(e)},get"aria-label"(){return z(t)},onkeydown:e=>{f(e)},get value(){return z(s)},set value(e){M(s,e,!0)}})}D(r),R((e,t)=>{q(i,`for`,`${n}-rows`),W(a,e),q(d,`for`,`${n}-columns`),W(p,t)},[()=>Y(`_sui.text_editor.rows`),()=>Y(`_sui.text_editor.columns`)]),U(e,r)},$$slots:{default:!0}})}U(e,g),k()}function XDe(e,t){O(t,!0);let n={paragraph:EE,blockquote:vI,"code-block":HP},r={"bulleted-list":WF,"numbered-list":GF},i=ei(`editorStore`),a=A(()=>i.selection.blockType===t.type),o=async()=>{if(!i.useRichText){JV(i.textArea,e=>UV(e,t.type));return}if(!i.editor)return;await mR(i.editor);let[,e]=t.type.match(/^heading-(\d)$/)??[],a=e?()=>CI(`h${e}`):n[t.type];a&&i.editor.update(()=>{Yye($(),a)}),t.type in r&&i.editor.dispatchCommand(r[t.type],void 0)};var s=H();Oo(P(s),()=>z(a),e=>{{let n=e=>{gx(e,{get name(){return aR[t.type].icon}})},r=A(()=>Y(`_sui.text_editor.${aR[t.type].labelKey}`));YS(e,{get label(){return z(r)},get checked(){return z(a)},onclick:()=>{z(a)||o()},startIcon:n,$$slots:{startIcon:!0}})}}),U(e,s),k()}var aH=B(`<!> <!>`,1),ZDe=B(`<!> <!> <!> <!> <!>`,1),oH=B(`<!> <!> <!> <!>`,1);function QDe(e,t){O(t,!0);let n=J(t,`disabled`,3,!1),r=J(t,`readonly`,3,!1),i=ei(`editorStore`),a=A(()=>Ac([`paragraph`,...i.config.enabledButtons.filter(e=>cR.includes(e))])),o=A(()=>i.config.format===`html`),s=A(()=>i.useRichText||!z(o)),c=A(()=>i.config.enabledButtons.includes(`table`)),l=A(()=>z(o)&&i.useRichText&&i.config.enabledButtons.includes(`align`)),u=A(()=>i.config.enabledButtons.includes(`horizontal-rule`)),d=A(()=>i.useRichText?i.selection.tableCellKey??null:null),f=A(()=>!!z(d)&&!z(o)),p=A(()=>z(f)?i.config.components.filter(gV):i.config.components),m=A(()=>z(p).filter(({trigger:e=`menuitem`})=>e===`button`)),h=A(()=>z(p).filter(({trigger:e=`menuitem`})=>e===`menuitem`)),g=A(()=>z(c)||!z(f)&&z(u)||z(p).length>0),_=A(()=>z(s)&&!z(f)),v=A(()=>Ac(i.config.enabledButtons.filter(e=>sR.includes(e))));{let t=A(()=>n()||r()||i.componentHasFocus),p=A(()=>Y(`_sui.text_editor.text_editor`));LV(e,{get disabled(){return z(t)},get ariaLabel(){return z(p)},children:(e,t)=>{var n=oH(),r=P(n),p=e=>{{let t=e=>{{let t=A(()=>aR[i.selection.blockType]?.icon??`format_paragraph`);gx(e,{get name(){return z(t)}})}},n=e=>{{let t=A(()=>Y(`_sui.text_editor.text_style_options`));qS(e,{get ariaLabel(){return z(t)},children:(e,t)=>{var n=H();No(P(n),16,()=>z(a),e=>e,(e,t)=>{XDe(e,{get type(){return t}})}),U(e,n)},$$slots:{default:!0}})}},r=A(()=>Y(`_sui.text_editor.show_text_style_options`));hS(e,{get"aria-label"(){return z(r)},get"aria-controls"(){return i.controlId},startIcon:t,popup:n,$$slots:{startIcon:!0,popup:!0}})}};G(r,e=>{z(_)&&z(a).length>1&&e(p)});var y=I(r,2),b=e=>{var t=aH(),n=P(t);FS(n,{orientation:`vertical`}),FV(I(n,2),{}),U(e,t)},x=e=>{var t=oH(),n=P(t),r=e=>{var t=aH(),n=P(t),r=e=>{FS(e,{orientation:`vertical`})};G(n,e=>{z(_)&&z(a).length>1&&e(r)});var o=I(n,2);{let e=e=>{gx(e,{name:`table_edit`})},t=e=>{BV(e,{get cellKey(){return z(d)}})},n=A(()=>Y(`_sui.text_editor.show_table_options`));hS(o,{get"aria-label"(){return z(n)},get"aria-controls"(){return i.controlId},startIcon:e,popup:t,$$slots:{startIcon:!0,popup:!0}})}U(e,t)};G(n,e=>{z(c)&&z(d)&&e(r)});var o=I(n,2),s=e=>{var t=aH(),n=P(t);FS(n,{orientation:`vertical`}),wDe(I(n,2),{children:(e,t)=>{var n=H();No(P(n),16,()=>z(v),e=>e,(e,t)=>{var n=H(),r=P(n),i=e=>{NDe(e,{})},a=e=>{EDe(e,{get type(){return t}})};G(r,e=>{t===`link`?e(i):e(a,-1)}),U(e,n)}),U(e,n)},$$slots:{default:!0}}),U(e,t)};G(o,e=>{z(v).length&&e(s)});var p=I(o,2),y=e=>{var t=aH(),n=P(t);FS(n,{orientation:`vertical`}),TDe(I(n,2),{}),U(e,t)};G(p,e=>{z(l)&&e(y)});var b=I(p,2),x=e=>{var t=ZDe(),n=P(t);FS(n,{orientation:`vertical`});var r=I(n,2),i=e=>{{let t=A(()=>!!z(d));YDe(e,{get disabled(){return z(t)}})}};G(r,e=>{z(c)&&e(i)});var a=I(r,2),o=e=>{DDe(e,{})};G(a,e=>{z(u)&&!z(f)&&e(o)});var s=I(a,2);No(s,17,()=>z(m),e=>e.id,(e,t)=>{ODe(e,{get component(){return z(t)}})});var l=I(s,2),p=e=>{PDe(e,{get components(){return z(h)}})};G(l,e=>{z(h).length&&e(p)}),U(e,t)};G(b,e=>{z(g)&&e(x)}),U(e,t)};G(y,e=>{i.useRichText&&i.selection.blockType===`code-block`?e(b):z(s)&&e(x,1)});var S=I(y,2);yS(S,{flex:!0});var C=I(S,2),w=e=>{{let t=e=>{{let t=A(()=>z(o)?`html`:`markdown`);gx(e,{get name(){return z(t)}})}},n=A(()=>!i.useRichText),r=A(()=>Y(`_sui.text_editor.${z(o)?`edit_in_html`:`edit_in_markdown`}`));Xx(e,{iconic:!0,get disabled(){return i.hasConverterError},get pressed(){return z(n)},get"aria-label"(){return z(r)},onclick:()=>{i.useRichText=!i.useRichText,i.useRichText&&i.convertToLexical()},startIcon:t,$$slots:{startIcon:!0}})}};G(C,e=>{i.config.modes.length>1&&e(w)}),U(e,n)},$$slots:{default:!0}})}k()}var $De=new Set(`$$slots.$$events.$$legacy.value.pending.format.flex.dir.modes.buttons.components.multiline.minimal.useMarkdownShortcuts.useEmojiAutocomplete.hidden.disabled.readonly.required.invalid.ariaLabel.ariaLabelledby.ariaDescribedby.aria-label.aria-labelledby.aria-describedby.children`.split(`.`)),eOe=B(`<div><!> <!> <!> <!> <!> <!></div> <!>`,1),tOe={hash:`svelte-2xn2h5`,code:`.text-editor.svelte-2xn2h5 {position:relative;margin:var(--sui-focus-ring-width);width:calc(100% - var(--sui-focus-ring-width) * 2);}.text-editor.flex.svelte-2xn2h5:not([hidden]) {display:block;}.text-editor.svelte-2xn2h5:is(.single-line:where(.svelte-2xn2h5), .minimal:where(.svelte-2xn2h5)) > .lexical-root, .text-editor.svelte-2xn2h5:is(.single-line:where(.svelte-2xn2h5), .minimal:where(.svelte-2xn2h5)) > .text-area > :is(textarea, .clone) {min-height:0;}.text-editor.minimal.svelte-2xn2h5 > .lexical-root,
.text-editor.minimal.svelte-2xn2h5 > .text-area > :is(textarea, .clone) {max-height:240px;}.text-editor.minimal.svelte-2xn2h5 > .lexical-root,
.text-editor.minimal.svelte-2xn2h5 > .text-area > textarea {overflow:auto;}.text-editor.minimal.svelte-2xn2h5 > .lexical-root {--sui-text-editor-inner-toolbar-top: 0px;}.text-editor.minimal.svelte-2xn2h5 > .text-area > :is(textarea, .clone) {scrollbar-gutter:stable;}.text-editor.svelte-2xn2h5 .sui.text-area {margin:0 !important;width:100% !important;min-width:auto;}.text-editor.svelte-2xn2h5 .sui.text-area textarea {border-start-start-radius:0 !important;border-start-end-radius:0 !important;border-end-start-radius:var(--sui-textbox-border-radius) !important;border-end-end-radius:var(--sui-textbox-border-radius) !important;outline-offset:calc(var(--sui-focus-ring-width) * -1);}.text-editor.svelte-2xn2h5 {--sui-text-editor-toolbar-top: var(--sui-text-editor-inner-toolbar-top, 0px);--sui-text-editor-toolbar-z-index: var(--sui-text-editor-inner-toolbar-z-index, 100);}.text-editor.svelte-2xn2h5 > * {--sui-text-editor-inner-toolbar-top: calc(
var(--sui-text-editor-toolbar-top) + var(--sui-text-editor-toolbar-height)
);--sui-text-editor-inner-toolbar-z-index: calc(var(--sui-text-editor-toolbar-z-index) - 1);}`};function nOe(e,t){O(t,!0),K(e,tOe);let n=J(t,`value`,15,``),r=J(t,`pending`,15,!1),i=J(t,`format`,3,`markdown`),a=J(t,`flex`,3,!1),o=J(t,`dir`,3,void 0),s=J(t,`modes`,19,()=>[`rich-text`,`plain-text`]),c=J(t,`buttons`,19,()=>[...sR,...cR]),l=J(t,`components`,19,()=>[]),u=J(t,`multiline`,3,!0),d=J(t,`minimal`,3,!1),f=J(t,`useMarkdownShortcuts`,3,!0),p=J(t,`useEmojiAutocomplete`,3,!0),m=J(t,`hidden`,3,!1),h=J(t,`disabled`,3,!1),g=J(t,`readonly`,3,!1),_=J(t,`required`,3,!1),v=J(t,`invalid`,3,!1),y=J(t,`ariaLabel`,3,void 0),b=J(t,`ariaLabelledby`,3,void 0),x=J(t,`ariaDescribedby`,3,void 0),S=J(t,`aria-label`,3,void 0),C=J(t,`aria-labelledby`,3,void 0),w=J(t,`aria-describedby`,3,void 0),T=vs(t,$De),ee=A(()=>({"aria-label":y()??S(),"aria-labelledby":b()??C(),"aria-describedby":x()??w()})),E=NV();E.config={...E.config,modes:s(),enabledButtons:c(),components:l(),multiline:u(),useMarkdownShortcuts:f(),useEmojiAutocomplete:p(),format:i()},ti(`editorStore`,E);let te=i()===`html`?`html`:`markdown`,ne=2e4,re=j(Xi(Kz())),ie=j(0),ae=A(()=>!E.useRichText&&!m()),oe=A(()=>o()===`auto`&&E.useRichText?void 0:o()),se=A(()=>!z(ae)||te!==`markdown`||E.inputValue.length>ne?``:[...new Set([...E.inputValue.matchAll(/^[ \t]*(?:```|~~~)[ \t]*(?<lang>[\w+#-]+)/gm)].map(({groups:e})=>e?.lang))].join(`,`)),ce=e=>{if(z(ie),!(!z(ae)||e.length>ne))return Swe(e,te,{theme:z(re)})};L(()=>qz(async()=>{let e=Kz();z(ae)&&await SV(te),e===Kz()&&M(re,e,!0)})),L(()=>{if(!z(ae))return;let e=z(se)?z(se).split(`,`):[];z(re),eo(()=>{SV(te).then(async()=>{M(ie,z(ie)+1),await Promise.all(e.map(e=>SV(e))),M(ie,z(ie)+1)})})}),L(()=>{let{textArea:e,useRichText:t}=E;if(!e||t)return;let n=()=>{E.selection={blockNodeKey:null,blockType:document.activeElement===e?mDe(GV(e)):`paragraph`,inlineTypes:[]}},r=[`selectionchange`,`select`,`input`,`keyup`,`mouseup`,`focus`];return eo(n),r.forEach(t=>e.addEventListener(t,n)),()=>{r.forEach(t=>e.removeEventListener(t,n))}}),L(()=>{let{textArea:e}=E;if(e&&!u())return bDe(e)}),PV(E,{getInputValue:()=>n(),setValue:e=>{n()!==e&&n(e)},setPending:e=>{r(e)}});var le=eOe(),ue=P(le);fs(ue,()=>({...T,role:`none`,class:`sui text-editor`,hidden:m(),[ss]:{flex:a(),"single-line":!u(),minimal:d()},[cs]:{"--sui-text-editor-toolbar-height":`${E.toolbarHeight??``}px`}}),void 0,void 0,void 0,`svelte-2xn2h5`);var de=N(ue);QDe(de,{get disabled(){return h()},get readonly(){return g()}});var fe=I(de,2);{let e=A(()=>!E.useRichText||m());MV(fe,ys(()=>z(ee),{get dir(){return o()},get hidden(){return z(e)},get disabled(){return h()},get readonly(){return g()},get required(){return _()},get invalid(){return v()}}))}var pe=I(fe,2);{let e=A(()=>u()?void 0:1),t=A(()=>u()?void 0:!1),n=A(()=>E.useRichText||m());RV(pe,ys(()=>z(ee),{get id(){return`${E.editorId??``}-plain-text`},autoResize:!0,get rows(){return z(e)},get"aria-multiline"(){return z(t)},get useEmojiAutocomplete(){return p()},highlight:ce,get flex(){return a()},get dir(){return z(oe)},get hidden(){return z(n)},get disabled(){return h()},get readonly(){return g()},get required(){return _()},get invalid(){return v()},get element(){return E.textArea},set element(e){E.textArea=e},get value(){return E.inputValue},set value(e){E.inputValue=e}}))}var me=I(pe,2),he=e=>{$Ee(e,{})};G(me,e=>{E.config.useEmojiAutocomplete&&!h()&&!g()&&e(he)});var ge=I(me,2),_e=e=>{iDe(e,{})},ve=A(()=>E.config.enabledButtons.includes(`link`)&&!h()&&!g());G(ge,e=>{z(ve)&&e(_e)});var ye=I(ge,2),be=e=>{lDe(e,{})},xe=A(()=>E.config.enabledButtons.includes(`table`)&&!h()&&!g());G(ye,e=>{z(xe)&&e(be)}),D(ue);var Se=I(ue,2),Ce=e=>{fC(e,{get show(){return E.showConverterError},set show(e){E.showConverterError=e},children:(e,t)=>{bx(e,{status:`error`,children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(`_sui.text_editor.converter_error`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}})};G(Se,e=>{E.showConverterError&&e(Ce)}),U(e,le),k()}var rOe=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`element`,`class`,`disabled`,`readonly`,`required`,`invalid`,`ariaLabel`,`onclick`,`oninput`]),iOe=B(`<input/>`),aOe={hash:`svelte-hzctkj`,code:`.color-input.svelte-hzctkj {display:inline-block;margin:var(--sui-focus-ring-width);border-width:var(--sui-color-input-border-width, 1px);border-color:var(--sui-color-input-border-color, var(--sui-control-border-color));border-radius:var(--sui-color-input-border-radius, var(--sui-button-medium-border-radius));padding:var(--sui-color-input-padding, 3px);width:var(--sui-color-input-width, calc(var(--sui-button-medium-height) * 1.5));height:var(--sui-color-input-height, var(--sui-button-medium-height));color:inherit;background-color:var(--sui-color-input-background-color, var(--sui-textbox-background-color));font-family:var(--sui-textbox-font-family);cursor:pointer;transition:all 200ms;}.color-input.svelte-hzctkj:is(:where(.svelte-hzctkj):hover, :where(.svelte-hzctkj):focus-visible) {background-color:var(--sui-color-input-background-color-focus, var(--sui-hover-background-color));}.color-input.svelte-hzctkj:active {background-color:var(--sui-color-input-background-color-active, var(--sui-active-background-color));}.color-input[aria-readonly=true].svelte-hzctkj {cursor:default;background-color:var(--sui-disabled-background-color);}.color-input[aria-invalid=true].svelte-hzctkj {border-color:var(--sui-error-border-color);}.color-input.svelte-hzctkj::-webkit-color-swatch-wrapper {padding:0;}.color-input.svelte-hzctkj::-webkit-color-swatch {border:1px solid var(--sui-secondary-border-color);border-radius:calc(var(--sui-button-medium-border-radius) / 2);}.color-input.svelte-hzctkj::-moz-color-swatch {border:1px solid var(--sui-secondary-border-color);border-radius:calc(var(--sui-button-medium-border-radius) / 2);}`};function oOe(e,t){O(t,!0),K(e,aOe);let n=J(t,`value`,15),r=J(t,`element`,15),i=J(t,`disabled`,3,!1),a=J(t,`readonly`,3,!1),o=J(t,`required`,3,!1),s=J(t,`invalid`,3,!1),c=J(t,`ariaLabel`,3,void 0),l=vs(t,rOe),u=e=>{a()&&e.preventDefault(),t.onclick?.(e)},d=e=>{n(e.currentTarget.value),t.oninput?.(e)};var f=iOe();fs(f,()=>({...l,value:n()??``,type:`color`,class:`sui color-input ${t.class??``}`,disabled:i()||void 0,"aria-label":c()??l[`aria-label`],"aria-disabled":i(),"aria-readonly":a(),"aria-required":o(),"aria-invalid":s(),onclick:u,oninput:d}),void 0,void 0,void 0,`svelte-hzctkj`,!0),gs(f,e=>r(e),()=>r()),U(e,f),k()}var sOe=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`element`,`type`,`min`,`max`,`step`,`class`,`disabled`,`readonly`,`required`,`invalid`,`ariaLabel`,`oninput`]),cOe=B(`<input/>`),lOe={hash:`svelte-r4j4k8`,code:`.date-time-input.svelte-r4j4k8 {display:inline-block;margin:var(--sui-focus-ring-width);width:auto;min-width:0;height:var(--sui-textbox-height);text-transform:var(--sui-date-time-input-text-transform, uppercase);font-variant-numeric:tabular-nums;border-width:var(--sui-textbox-border-width, 1px);border-color:var(--sui-textbox-border-color);border-radius:var(--sui-textbox-border-radius);padding:var(--sui-textbox-singleline-padding);color:var(--sui-textbox-foreground-color);background-color:var(--sui-textbox-background-color);font-family:var(--sui-textbox-font-family);font-size:var(--sui-textbox-font-size);line-height:var(--sui-textbox-singleline-line-height);font-weight:var(--sui-textbox-font-weight, var(--sui-font-weight-normal, normal));letter-spacing:var(--sui-textbox-letter-spacing, normal);transition:all 200ms;}.date-time-input.svelte-r4j4k8:focus {color:var(--sui-textbox-foreground-color-focus, var(--sui-textbox-foreground-color));background-color:var(--sui-textbox-background-color-focus, var(--sui-textbox-background-color));}.date-time-input[aria-invalid=true].svelte-r4j4k8 {border-color:var(--sui-error-border-color);}.date-time-input.svelte-r4j4k8:read-only {color:var(--sui-secondary-foreground-color);border-color:var(--sui-textbox-border-color) !important;}.date-time-input.svelte-r4j4k8:is(:where(.svelte-r4j4k8):disabled, :where(.svelte-r4j4k8):read-only) {background-color:var(--sui-disabled-background-color);}.date-time-input.svelte-r4j4k8::-webkit-calendar-picker-indicator {cursor:pointer;}.date-time-input.svelte-r4j4k8:is(:where(.svelte-r4j4k8):disabled, :where(.svelte-r4j4k8):read-only)::-webkit-calendar-picker-indicator {cursor:default;}`};function uOe(e,t){O(t,!0),K(e,lOe);let n=J(t,`value`,15),r=J(t,`element`,15),i=J(t,`type`,3,`date`),a=J(t,`min`,3,void 0),o=J(t,`max`,3,void 0),s=J(t,`step`,3,void 0),c=J(t,`disabled`,3,!1),l=J(t,`readonly`,3,!1),u=J(t,`required`,3,!1),d=J(t,`invalid`,3,!1),f=J(t,`ariaLabel`,3,void 0),p=vs(t,sOe),m=e=>{n(e.currentTarget.value),t.oninput?.(e)};var h=cOe();fs(h,()=>({...p,value:n()??``,type:i(),min:a(),max:o(),step:s(),class:`sui date-time-input ${t.class??``}`,disabled:c()||void 0,readonly:l()||void 0,"aria-label":f()??p[`aria-label`],"aria-disabled":c(),"aria-readonly":l(),"aria-required":u(),"aria-invalid":d(),oninput:m}),void 0,void 0,void 0,`svelte-r4j4k8`,!0),gs(h,e=>r(e),()=>r()),U(e,h),k()}var dOe=new Set([`$$slots`,`$$events`,`$$legacy`,`mask`,`value`,`flex`,`monospace`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`children`,`visibilityIcon`]),fOe=B(`<div role="none"><!> <!></div>`),pOe={hash:`svelte-4ez2rh`,code:`.password-input.svelte-4ez2rh,
.secret-input.svelte-4ez2rh {display:inline-flex;align-items:center;margin:var(--sui-focus-ring-width);min-width:var(--sui-textbox-singleline-min-width);}.password-input.flex.svelte-4ez2rh:not([hidden]),
.secret-input.flex.svelte-4ez2rh:not([hidden]) {display:inline-flex;width:-moz-available;width:-webkit-fill-available;width:stretch;min-width:0;}.password-input.svelte-4ez2rh .text-input,
.secret-input.svelte-4ez2rh .text-input {flex:auto;margin:0 !important;width:0;min-width:0 !important;}.password-input.svelte-4ez2rh input,
.secret-input.svelte-4ez2rh input {border-start-end-radius:0;border-end-end-radius:0;}.password-input.svelte-4ez2rh button,
.secret-input.svelte-4ez2rh button {margin-block:0;margin-inline-end:0;flex:none;margin-inline-start:-1px;border-width:1px;border-color:var(--sui-textbox-border-color);width:var(--sui-textbox-height);aspect-ratio:1/1;}.password-input.svelte-4ez2rh button:last-child,
.secret-input.svelte-4ez2rh button:last-child {border-start-start-radius:0;border-start-end-radius:4px;border-end-end-radius:4px;border-end-start-radius:0;}.password-input.svelte-4ez2rh button .icon,
.secret-input.svelte-4ez2rh button .icon {font-size:var(--sui-font-size-xx-large);}.secret-input.show.svelte-4ez2rh input {-webkit-text-security:none;}.secret-input.svelte-4ez2rh input {-webkit-text-security:disc;}.password-input.svelte-4ez2rh:dir(rtl),
.secret-input.svelte-4ez2rh:dir(rtl) {--sui-textbox-text-align: right;}`};function mOe(e,t){let n=mo();O(t,!0),K(e,pOe);let r=J(t,`value`,15),i=J(t,`flex`,3,!1),a=J(t,`monospace`,3,!0),o=J(t,`hidden`,3,!1),s=J(t,`disabled`,3,!1),c=J(t,`readonly`,3,!1),l=J(t,`required`,3,!1),u=J(t,`invalid`,3,!1),d=vs(t,dOe),f=j(!1),p=A(()=>t.mask===`type`?{show:`_sui.password_input.show_password`,hide:`_sui.password_input.hide_password`}:{show:`_sui.secret_input.show_secret`,hide:`_sui.secret_input.hide_secret`});var m=fOe();let h;var g=N(m);NS(g,ys({dir:`ltr`},()=>t.mask===`css`?{autocomplete:`off`,autocapitalize:`off`,autocorrect:`off`}:{},()=>d,{get id(){return n}},()=>t.mask===`type`?{type:z(f)?`text`:`password`}:{},{spellcheck:`false`,get flex(){return i()},get monospace(){return a()},get hidden(){return o()},get disabled(){return s()},get readonly(){return c()},get required(){return l()},get invalid(){return u()},get value(){return r()},set value(e){r(e)}}));var _=I(g,2);{let e=e=>{var n=H(),r=P(n),i=e=>{var n=H();xo(P(n),()=>t.visibilityIcon),U(e,n)},a=e=>{{let t=A(()=>z(f)?`visibility_off`:`visibility`);gx(e,{get name(){return z(t)}})}};G(r,e=>{t.visibilityIcon?e(i):e(a,-1)}),U(e,n)},r=A(()=>s()||c()),i=A(()=>Y(z(f)?z(p).hide:z(p).show));Xx(_,{iconic:!0,get disabled(){return z(r)},get pressed(){return z(f)},get"aria-label"(){return z(i)},get"aria-controls"(){return n},onclick:()=>{M(f,!z(f))},startIcon:e,$$slots:{startIcon:!0}})}D(m),R(()=>{h=$o(m,1,`sui ${t.mask===`type`?`password-input`:`secret-input`} ${t.class??``}`,`svelte-4ez2rh`,h,{flex:i(),disabled:s(),readonly:c(),show:t.mask===`css`&&z(f)}),q(m,`hidden`,o())}),U(e,m),k()}var hOe=new Set([`$$slots`,`$$events`,`$$legacy`,`value`]);function sH(e,t){O(t,!0);let n=J(t,`value`,15),r=vs(t,hOe);mOe(e,ys(()=>r,{mask:`css`,get value(){return n()},set value(e){n(e)}})),k()}var gOe=new Set([`$$slots`,`$$events`,`$$legacy`,`selected`,`expanded`,`class`,`hidden`,`disabled`,`label`,`value`,`valueType`,`children`,`items`,`startIcon`,`endIcon`,`chevronIcon`,`onChange`,`onSelect`,`onExpand`]),_Oe=B(`<span role="none" class="chevron svelte-1pcxmh7" data-action="toggle"><!></span>`),vOe=B(`<span role="none" class="chevron placeholder svelte-1pcxmh7"></span>`),yOe=B(`<span role="none" class="end-icon svelte-1pcxmh7"><!></span>`),bOe=B(`<div role="group" class="group svelte-1pcxmh7"><!></div>`),xOe=B(`<div><div role="none" class="row svelte-1pcxmh7"><!> <!> <span role="none" class="label svelte-1pcxmh7"><!></span> <!></div> <!></div>`),SOe={hash:`svelte-1pcxmh7`,code:`.end-icon.svelte-1pcxmh7 {display:contents;}[role=treeitem].svelte-1pcxmh7 {display:block;}[role=treeitem][hidden].svelte-1pcxmh7 {display:none;}[role=treeitem].svelte-1pcxmh7:focus-visible {outline-color:transparent;}[role=treeitem].svelte-1pcxmh7:focus-visible > .row:where(.svelte-1pcxmh7) {outline-color:var(--sui-focus-ring-color);outline-offset:calc(var(--sui-focus-ring-width) * -1);}[role=treeitem][aria-selected=true].svelte-1pcxmh7 > .row:where(.svelte-1pcxmh7) {color:var(--sui-highlight-foreground-color);background-color:var(--sui-selected-background-color);}[role=treeitem].svelte-1pcxmh7 > .row:where(.svelte-1pcxmh7):hover {color:var(--sui-highlight-foreground-color);background-color:var(--sui-hover-background-color);}[role=treeitem].svelte-1pcxmh7 > .row:where(.svelte-1pcxmh7):active {background-color:var(--sui-active-background-color);}[role='tree'][aria-readonly='true'] [role=treeitem].svelte-1pcxmh7 > .row:where(.svelte-1pcxmh7) {cursor:default;}[role='tree'][aria-readonly='true'] [role=treeitem].svelte-1pcxmh7 > .row:where(.svelte-1pcxmh7):is(:where(.svelte-1pcxmh7):hover, :where(.svelte-1pcxmh7):active) {color:var(--sui-tree-foreground-color);background-color:transparent;}[role='tree'][aria-readonly='true'] [role=treeitem].svelte-1pcxmh7 > .row:where(.svelte-1pcxmh7) > .chevron:where(.svelte-1pcxmh7):not(.placeholder) {cursor:pointer;}[role='tree'][aria-readonly='true'] [role=treeitem][aria-selected=true].svelte-1pcxmh7 > .row:where(.svelte-1pcxmh7):is(:where(.svelte-1pcxmh7):hover, :where(.svelte-1pcxmh7):active) {color:var(--sui-highlight-foreground-color);background-color:var(--sui-selected-background-color);}[role=treeitem][aria-expanded=true].svelte-1pcxmh7 > .row:where(.svelte-1pcxmh7) > .chevron:where(.svelte-1pcxmh7):dir(ltr) {transform:rotate(90deg);}[role=treeitem][aria-expanded=true].svelte-1pcxmh7 > .row:where(.svelte-1pcxmh7) > .chevron:where(.svelte-1pcxmh7):dir(rtl) {transform:rotate(-90deg);}.row.svelte-1pcxmh7 {display:flex;align-items:center;gap:4px;border-radius:var(--sui-tree-item-border-radius, var(--sui-option-border-radius, 4px));padding:var(--sui-tree-item-padding, var(--sui-option-padding, 0 8px));min-height:var(--sui-tree-item-height, var(--sui-option-height));cursor:pointer;transition:background-color 200ms;}.chevron.svelte-1pcxmh7 {flex:none;display:flex;align-items:center;justify-content:center;margin-inline-start:calc((var(--sui-tree-item-level, 1) - 1) * var(--sui-tree-item-indent, 16px));width:var(--sui-tree-item-chevron-size, 24px);height:var(--sui-tree-item-chevron-size, 24px);transition:transform 200ms;}.label.svelte-1pcxmh7 {flex:auto;overflow:hidden;padding:0 4px;white-space:nowrap;text-overflow:ellipsis;}.group.svelte-1pcxmh7 {display:block;}.group[hidden].svelte-1pcxmh7 {display:none;}`};function cH(e,t){let n=mo();O(t,!0),K(e,SOe);let r=J(t,`selected`,15,!1),i=J(t,`expanded`,15,!1),a=J(t,`hidden`,3,!1),o=J(t,`disabled`,3,!1),s=J(t,`label`,3,``),c=J(t,`value`,3,void 0),l=J(t,`valueType`,3,void 0),u=vs(t,gOe),d=A(()=>c()===void 0?s():c()),f=A(()=>l()===void 0?Mx(z(d)):l()),p=(ei(`sui:tree-item-level`)??0)+1;ti(`sui:tree-item-level`,p);let m=e=>{r(e.detail.selected),t.onChange?.(e)},h=e=>{i(e.detail.expanded),t.onExpand?.(e)},g=e=>{t.onSelect?.(e)},_=e=>{let t=[[`Change`,m],[`Expand`,h],[`Select`,g]];return t.forEach(([t,n])=>{e.addEventListener(t,n)}),()=>{t.forEach(([t,n])=>{e.removeEventListener(t,n)})}};var v=xOe();fs(v,()=>({...u,id:n,role:`treeitem`,class:`sui treeitem ${t.class??``}`,tabindex:`-1`,hidden:a(),"aria-hidden":a(),"aria-disabled":o(),"aria-selected":r(),"aria-expanded":t.items?i():void 0,"aria-level":p,"aria-labelledby":t.endIcon?`${n}-label ${n}-end`:`${n}-label`,"data-label":s(),"data-value":z(d),"data-type":z(f)}),void 0,void 0,void 0,`svelte-1pcxmh7`);var y=N(v);let b;var x=N(y),S=e=>{var n=_Oe(),r=N(n),i=e=>{var n=H();xo(P(n),()=>t.chevronIcon),U(e,n)},a=e=>{{let t=A(()=>Tc()?`chevron_left`:`chevron_right`);gx(e,{get name(){return z(t)}})}};G(r,e=>{t.chevronIcon?e(i):e(a,-1)}),D(n),U(e,n)},C=e=>{U(e,vOe())};G(x,e=>{t.items?e(S):e(C,-1)});var w=I(x,2);xo(w,()=>t.startIcon??Cr);var T=I(w,2),ee=N(T),E=e=>{var t=V();R(()=>W(t,s())),U(e,t)},te=e=>{var n=H();xo(P(n),()=>t.children??Cr),U(e,n)};G(ee,e=>{s()?e(E):e(te,-1)}),D(T);var ne=I(T,2),re=e=>{var r=yOe();xo(N(r),()=>t.endIcon),D(r),R(()=>q(r,`id`,`${n}-end`)),U(e,r)};G(ne,e=>{t.endIcon&&e(re)}),D(y);var ie=I(y,2),ae=e=>{var n=bOe();xo(N(n),()=>t.items),D(n),R(()=>q(n,`hidden`,!i())),U(e,n)};G(ie,e=>{t.items&&e(ae)}),D(v),qo(v,()=>_),R(()=>{b=ts(y,``,b,{"--sui-tree-item-level":p}),q(T,`id`,`${n}-label`)}),U(e,v),k()}var lH=`[role="treeitem"]`,COe=class{#e=new aS;constructor(e,{clickToSelect:t=!0,selectionFollowsFocus:n,expandOnSelect:r=!0}={}){e.dispatchEvent(new CustomEvent(`Initializing`)),this.parent=e,this.id=Ix(`tree`),this.clickToSelect=t,this.expandOnSelect=r,this.selectionFollowsFocusOption=n,this.anchor=void 0,this.activated=!1,this.destroyed=!1,this._onClick=sS(this,e=>this.onClick(e)),this._onKeyDown=sS(this,e=>this.onKeyDown(e)),this._onFocusIn=sS(this,e=>this.onFocusIn(e)),this.observer=new globalThis.MutationObserver(()=>{this.update()}),this.parent.tabIndex=-1,e.addEventListener(`click`,this._onClick),e.addEventListener(`keydown`,this._onKeyDown),e.addEventListener(`focusin`,this._onFocusIn),cS(this,()=>this.destroyed)}activate(){if(this.activated)return;let{parent:e}=this;this.activated=!0,this.update(),this.observer.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`hidden`,`aria-hidden`,`aria-disabled`,`aria-expanded`]}),e.dispatchEvent(new CustomEvent(`Initialized`))}get multi(){return this.parent.getAttribute(`aria-multiselectable`)===`true`}get selectionFollowsFocus(){return this.selectionFollowsFocusOption??!this.multi}get isDisabled(){return this.parent.matches(`[aria-disabled="true"]`)}get isReadOnly(){return this.parent.matches(`[aria-readonly="true"]`)}get allItems(){return[...this.parent.querySelectorAll(lH)]}get visibleItems(){let e=[],t=n=>{[...n.children].forEach(n=>{if(n.getAttribute(`role`)!==`treeitem`){t(n);return}let r=n;if(r.matches(`[hidden], [aria-hidden="true"]`)||(e.push(r),this.isParent(r)&&!this.isExpanded(r)))return;let i=this.getGroup(r);i&&t(i)})};return t(this.parent),e}get activeItems(){return this.visibleItems.filter(e=>!e.matches(`[aria-disabled="true"]`))}get selectedItems(){return[...this.parent.querySelectorAll(`${lH}[aria-selected="true"]`)]}get currentItem(){return this.allItems.find(e=>e.tabIndex===0)}getGroup(e){return[...e.children].find(e=>e.getAttribute(`role`)===`group`)}getChildItems(e){let t=this.getGroup(e);return t?this.getItemsInGroup(t):[]}getItemsInGroup(e){let t=[],n=e=>{[...e.children].forEach(e=>{let r=e.getAttribute(`role`);r===`treeitem`?t.push(e):r!==`group`&&r!==`tree`&&n(e)})};return n(e),t}getParentItem(e){return e.parentElement?.closest(lH)??void 0}isParent(e){return e.hasAttribute(`aria-expanded`)}isExpanded(e){return e.getAttribute(`aria-expanded`)===`true`}getLabel(e){return e.dataset.label??e.querySelector(`.label`)?.textContent??``}update(){let{allItems:e,activeItems:t}=this;e.forEach((e,t)=>{e.id||=`${this.id}-item-${t+1}`,e.hasAttribute(`aria-selected`)||e.setAttribute(`aria-selected`,`false`)}),[this.parent,...this.parent.querySelectorAll(`[role="group"]`)].forEach(e=>{let t=this.getItemsInGroup(e);t.forEach((e,n)=>{e.setAttribute(`aria-posinset`,String(n+1)),e.setAttribute(`aria-setsize`,String(t.length))})});let n=t.find(e=>e===document.activeElement)??t.find(e=>e.tabIndex===0)??t.find(e=>e.getAttribute(`aria-selected`)===`true`)??t[0];this.setTabStop(n)}scrollIntoView(e){$x(e)}setTabStop(e){this.parent.querySelectorAll(`${lH}[tabindex]:not([tabindex="-1"])`).forEach(t=>{t!==e&&(t.tabIndex=-1)}),e&&(e.tabIndex=0)}focusItem(e,{select:t=this.selectionFollowsFocus}={}){this.setTabStop(e),e.focus(),e.dispatchEvent(new CustomEvent(`Focus`)),this.scrollIntoView(e),t&&this.selectItem(e)}setSelected(e,t){e.getAttribute(`aria-selected`)===`true`!==t&&(e.setAttribute(`aria-selected`,String(t)),e.dispatchEvent(new CustomEvent(`Change`,{detail:{selected:t}})),t&&e.dispatchEvent(new CustomEvent(`Select`)))}selectItem(e,{additive:t=!1,range:n=!1}={}){if(this.isDisabled||this.isReadOnly)return;let{multi:r,anchor:i}=this,a=r&&n&&i&&i!==e?this.visibleItems:[],o=a.indexOf(i);if(o!==-1){let t=[o,a.indexOf(e)].sort((e,t)=>e-t);a.forEach((e,n)=>{this.setSelected(e,n>=t[0]&&n<=t[1]&&!e.matches(`[aria-disabled="true"]`))})}else r&&t?(this.setSelected(e,e.getAttribute(`aria-selected`)!==`true`),this.anchor=e):(this.selectedItems.forEach(t=>{t!==e&&this.setSelected(t,!1)}),this.setSelected(e,!0),this.anchor=e);this.parent.dispatchEvent(new CustomEvent(`Change`,{detail:tS(e)}))}selectAll(e){this.isDisabled||this.isReadOnly||!this.multi||(this.activeItems.forEach(e=>{this.setSelected(e,!0)}),this.parent.dispatchEvent(new CustomEvent(`Change`,{detail:tS(e)})))}expandItem(e,t){if(this.isDisabled||!this.isParent(e)||this.isExpanded(e)===t)return;let n=this.getGroup(e);e.setAttribute(`aria-expanded`,String(t)),n&&(n.hidden=!t),e.dispatchEvent(new CustomEvent(`Expand`,{detail:{expanded:t}})),this.update()}expandSiblings(e){let t=this.getParentItem(e),n=t?this.getGroup(t):this.parent;n&&this.getItemsInGroup(n).forEach(e=>{this.expandItem(e,!0)})}typeAhead(e,t){let n=this.activeItems,r=oS(n.map(e=>rS(this.getLabel(e))),this.#e.push(e),n.indexOf(t));r!==-1&&n[r]!==t&&this.focusItem(n[r])}onFocusIn(e){let t=e.target.closest(lH);t&&!t.matches(`[aria-disabled="true"]`)&&this.setTabStop(t)}onClick(e){let t=e.target,n=t.closest(lH);if(!n||e.button!==0||this.isDisabled)return;if(n.matches(`[aria-disabled="true"]`)){e.preventDefault();return}let{ctrlKey:r,metaKey:i,shiftKey:a}=e;t.closest(`[data-action="toggle"]`)?(e.preventDefault(),this.focusItem(n,{select:!1}),this.expandItem(n,!this.isExpanded(n))):(this.focusItem(n,{select:!1}),this.clickToSelect&&this.selectItem(n,{additive:r||i,range:a}),this.expandOnSelect&&!r&&!i&&!a&&this.expandItem(n,!this.isExpanded(n)))}onKeyDown(e){let{key:t,ctrlKey:n,metaKey:r,shiftKey:i,altKey:a}=e,{activeItems:o,multi:s}=this;if(this.isDisabled||a||!o.length)return;let c=e.target.closest(lH),l=(c&&o.includes(c)?c:void 0)??this.currentItem??o[0],u=o.indexOf(l),{prevKey:d,nextKey:f}=iS(`horizontal`,Tc());if(t===`a`&&(n||r))s&&(e.preventDefault(),this.selectAll(l));else if(!(n||r)){if(t===`Enter`)e.preventDefault(),l.click();else if(t===` `)e.preventDefault(),s?this.selectItem(l,{additive:!i,range:i}):this.selectItem(l);else if(t===`ArrowDown`||t===`ArrowUp`){e.preventDefault();let n=o[t===`ArrowDown`?u+1:u-1];if(!n)return;s&&i?(this.focusItem(n,{select:!1}),this.selectItem(n,{additive:!0})):this.focusItem(n)}else if(t===f){if(e.preventDefault(),!this.isParent(l))return;if(!this.isExpanded(l)){this.expandItem(l,!0);return}let t=this.getChildItems(l).find(e=>o.includes(e));t&&this.focusItem(t)}else if(t===d){if(e.preventDefault(),this.isParent(l)&&this.isExpanded(l)){this.expandItem(l,!1);return}let t=this.getParentItem(l);t&&o.includes(t)&&this.focusItem(t)}else t===`Home`||t===`End`?(e.preventDefault(),this.focusItem(t===`Home`?o[0]:o[o.length-1])):t===`*`?(e.preventDefault(),this.expandSiblings(l)):t.length===1&&t.trim()&&this.typeAhead(t,l)}}destroy(){this.destroyed=!0,this.#e.reset(),this.observer.disconnect(),this.parent.removeEventListener(`click`,this._onClick),this.parent.removeEventListener(`keydown`,this._onKeyDown),this.parent.removeEventListener(`focusin`,this._onFocusIn)}},wOe=e=>t=>{let n=new COe(t,e);return()=>{n.destroy()}},TOe=new Set([`$$slots`,`$$events`,`$$legacy`,`element`,`class`,`hidden`,`disabled`,`readonly`,`multiple`,`clickToSelect`,`selectionFollowsFocus`,`expandOnSelect`,`ariaLabel`,`children`,`onChange`]),EOe=B(`<div><div role="none" class="inner svelte-pcj1df"><!></div></div>`),DOe={hash:`svelte-pcj1df`,code:`[role=tree].svelte-pcj1df {display:flex;flex-direction:column;margin:var(--sui-focus-ring-width);border-width:var(--sui-tree-border-width, 1px);border-style:var(--sui-tree-border-style, solid);border-color:var(--sui-tree-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-tree-border-radius, 4px);padding:var(--sui-tree-padding, 4px);min-width:var(--sui-tree-min-width, calc(var(--sui-option-height) * 5));overflow:auto;color:var(--sui-tree-foreground-color, var(--sui-control-foreground-color));background-color:var(--sui-tree-background-color);font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);}.inner.svelte-pcj1df {display:contents;}`};function uH(e,t){O(t,!0),K(e,DOe);let n=J(t,`element`,15),r=J(t,`hidden`,3,!1),i=J(t,`disabled`,3,!1),a=J(t,`readonly`,3,!1),o=J(t,`multiple`,3,!1),s=J(t,`clickToSelect`,3,!0),c=J(t,`selectionFollowsFocus`,3,void 0),l=J(t,`expandOnSelect`,3,!0),u=J(t,`ariaLabel`,3,void 0),d=vs(t,TOe);var f=EOe(),p=e=>{t.onChange?.(e)};fs(f,()=>({...d,role:`tree`,class:`sui tree ${t.class??``}`,hidden:r(),"aria-hidden":r(),"aria-disabled":i(),"aria-readonly":a()||void 0,"aria-multiselectable":o(),"aria-label":u(),onChange:p}),void 0,void 0,void 0,`svelte-pcj1df`);var m=N(f);xo(N(m),()=>t.children??Cr),D(m),D(f),gs(f,e=>n(e),()=>n()),qo(f,()=>wOe({clickToSelect:s(),selectionFollowsFocus:c(),expandOnSelect:l()})),R(()=>m.inert=i()),U(e,f),k()}var OOe=[`text`,`search`,`url`,`tel`,`email`,`password`,`number`],kOe=e=>document.documentElement.matches(`[data-env="dev"]`)?!0:e instanceof Element?e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&OOe.includes(e.type)||e.closest(`[role="textbox"]`)?.contentEditable===`true`:!1,AOe={hash:`svelte-h4yylm`,code:`
/* https://fontsource.org/fonts/source-sans-3/cdn */
@font-face {font-family:'Source Sans 3';font-style:normal;font-display:swap;font-weight:200 900;src:url(https://cdn.jsdelivr.net/fontsource/fonts/source-sans-3:vf@5.3.1/latin-wght-normal.woff2)
format('woff2-variations');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;size-adjust:110%;
}
/* https://fontsource.org/fonts/noto-mono/cdn */
@font-face {font-family:'Noto Mono';font-style:normal;font-display:swap;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/noto-mono@5.3.0/latin-400-normal.woff2)
format('woff2');
}
/* https://fontsource.org/fonts/material-symbols-outlined/cdn */
@font-face {font-family:'Material Symbols Outlined';font-style:normal;font-display:block;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/material-symbols-outlined:vf@5.3.9/latin-wght-normal.woff2)
format('woff2-variations');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}.material-symbols-outlined {
/* stylelint-disable-next-line font-family-no-missing-generic-family-keyword */font-family:'Material Symbols Outlined';font-weight:normal;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;overflow-wrap:normal;direction:ltr;-moz-font-feature-settings:'liga';font-feature-settings:'liga';}`};function jOe(e){K(e,AOe)}var MOe=new Set([`$$slots`,`$$events`,`$$legacy`,`orientation`,`children`]),NOe=B(`<meta name="viewport"/> <meta name="google" content="notranslate"/> <!>`,1),POe=B(`<div class="font-loader svelte-455qcr" aria-hidden="true">Loading <strong>Sveltia</strong> <em>UI</em> <span role="none" class="material-symbols-outlined">favorite</span></div>`),FOe=B(`<!> <div><!></div>`,1),IOe={hash:`svelte-455qcr`,code:`:root,
:host {--sui-base-hue: 210;--sui-highlight-foreground-color: hsl(var(--sui-foreground-color-1-hsl));--sui-primary-foreground-color: hsl(var(--sui-foreground-color-2-hsl));--sui-secondary-foreground-color: hsl(var(--sui-foreground-color-3-hsl));--sui-tertiary-foreground-color: hsl(var(--sui-foreground-color-4-hsl));--sui-disabled-foreground-color: hsl(var(--sui-foreground-color-5-hsl));--sui-error-foreground-color: hsl(
var(--sui-error-color-hue) var(--sui-alert-foreground-color-saturation)
var(--sui-alert-foreground-color-lightness)
);--sui-warning-foreground-color: hsl(
var(--sui-warning-color-hue) var(--sui-alert-foreground-color-saturation)
var(--sui-alert-foreground-color-lightness)
);--sui-info-foreground-color: hsl(
var(--sui-info-color-hue) var(--sui-alert-foreground-color-saturation)
var(--sui-alert-foreground-color-lightness)
);--sui-success-foreground-color: hsl(
var(--sui-success-color-hue) var(--sui-alert-foreground-color-saturation)
var(--sui-alert-foreground-color-lightness)
);--sui-hover-background-color: hsl(var(--sui-background-color-5-hsl) / 35%);--sui-selected-background-color: hsl(var(--sui-background-color-5-hsl) / 75%);--sui-active-background-color: hsl(var(--sui-background-color-5-hsl) / 100%);--sui-content-background-color: hsl(var(--sui-background-color-1-hsl));--sui-code-background-color: hsl(var(--sui-background-color-3-hsl));--sui-primary-background-color: hsl(var(--sui-background-color-2-hsl));--sui-primary-background-color-translucent: hsl(var(--sui-background-color-2-hsl) / 80%);--sui-secondary-background-color: hsl(var(--sui-background-color-3-hsl));--sui-secondary-background-color-translucent: hsl(var(--sui-background-color-3-hsl) / 80%);--sui-tertiary-background-color: hsl(var(--sui-background-color-4-hsl));--sui-tertiary-background-color-translucent: hsl(var(--sui-background-color-4-hsl) / 80%);--sui-disabled-background-color: hsl(var(--sui-background-color-4-hsl));--sui-error-background-color: hsl(
var(--sui-error-color-hue) var(--sui-alert-background-color-saturation)
var(--sui-alert-background-color-lightness)
);--sui-warning-background-color: hsl(
var(--sui-warning-color-hue) var(--sui-alert-background-color-saturation)
var(--sui-alert-background-color-lightness)
);--sui-info-background-color: hsl(
var(--sui-info-color-hue) var(--sui-alert-background-color-saturation)
var(--sui-alert-background-color-lightness)
);--sui-success-background-color: hsl(
var(--sui-success-color-hue) var(--sui-alert-background-color-saturation)
var(--sui-alert-background-color-lightness)
);--sui-disabled-opacity: 0.35;--sui-modal-border-width: 0;--sui-focus-ring-width: 2px;--sui-focus-ring-color: var(--sui-primary-accent-color);--sui-focus-ring-offset: 1px;--sui-primary-border-color: hsl(var(--sui-border-color-2-hsl));--sui-secondary-border-color: hsl(var(--sui-border-color-3-hsl));--sui-error-border-color: hsl(
var(--sui-error-color-hue) var(--sui-alert-border-color-saturation)
var(--sui-error-border-color-lightness, var(--sui-alert-border-color-lightness))
);--sui-warning-border-color: hsl(
var(--sui-warning-color-hue) var(--sui-alert-border-color-saturation)
var(--sui-alert-border-color-lightness)
);--sui-info-border-color: hsl(
var(--sui-info-color-hue) var(--sui-alert-border-color-saturation)
var(--sui-alert-border-color-lightness)
);--sui-success-border-color: hsl(
var(--sui-success-color-hue) var(--sui-alert-border-color-saturation)
var(--sui-alert-border-color-lightness)
);--sui-popup-shadow-color: hsl(var(--sui-shadow-color) / 40%);--sui-popup-backdrop-color: hsl(var(--sui-shadow-color) / 40%);--sui-font-family-default: "Source Sans 3", system-ui, sans-serif;--sui-font-size-xxx-large: 25px;--sui-font-size-xx-large: 21px;--sui-font-size-x-large: 19px;--sui-font-size-large: 17px;--sui-font-size-default: 15px;--sui-font-size-small: 13px;--sui-font-size-x-small: 11px;--sui-font-weight-normal: 400;--sui-font-weight-bold: 700;--sui-font-family-monospace: "Noto Sans Mono", ui-monospace, monospace;--sui-font-size-monospace: 0.9em;--sui-line-height-default: 1.2;--sui-line-height-compact: 1.4;--sui-line-height-comfortable: 1.6;--sui-word-spacing-normal: 1px;--sui-heading-margin: 0;--sui-heading-font-family: var(--sui-font-family-default);--sui-heading-font-weight: var(--sui-font-weight-bold);--sui-heading-line-height: var(--sui-line-height-default);--sui-paragraph-margin: 1.75em;--sui-menuitem-font-size: 14px;--sui-control-small-border-width: 1px;--sui-control-small-border-radius: calc(var(--sui-control-small-height) / 8);--sui-control-small-padding: 0 calc((var(--sui-control-small-height) / 5));--sui-control-small-height: 24px;--sui-control-medium-border-width: 1px;--sui-control-medium-border-radius: calc(var(--sui-control-medium-height) / 8);--sui-control-medium-padding: 0 calc((var(--sui-control-medium-height) / 4));--sui-control-medium-height: 32px;--sui-control-large-border-width: 1px;--sui-control-large-border-radius: calc(var(--sui-control-large-height) / 8);--sui-control-large-padding: 0 calc((var(--sui-control-large-height) / 3));--sui-control-large-height: 40px;--sui-control-border-color: hsl(var(--sui-border-color-2-hsl));--sui-control-foreground-color: var(--sui-primary-foreground-color);--sui-control-background-color: hsl(var(--sui-background-color-4-hsl));--sui-control-font-family: var(--sui-font-family-default);--sui-control-font-size: var(--sui-font-size-default);--sui-control-line-height: var(--sui-line-height-compact);--sui-button-small-border-radius: var(--sui-control-small-border-radius);--sui-button-small-padding: var(--sui-control-small-padding);--sui-button-small-height: var(--sui-control-small-height);--sui-button-medium-border-radius: var(--sui-control-medium-border-radius);--sui-button-medium-padding: var(--sui-control-medium-padding);--sui-button-medium-height: var(--sui-control-medium-height);--sui-button-large-border-radius: var(--sui-control-large-border-radius);--sui-button-large-padding: var(--sui-control-large-padding);--sui-button-large-height: var(--sui-control-large-height);--sui-button-border-color: var(--sui-control-border-color);--sui-button-background-color: var(--sui-control-background-color);--sui-checkbox-border-radius: var(--sui-control-medium-border-radius);--sui-checkbox-height: 20px;--sui-checkbox-border-color: hsl(var(--sui-border-color-1-hsl));--sui-checkbox-background-color: var(--sui-control-background-color);--sui-readonly-accent-color: var(--sui-tertiary-foreground-color);--sui-readonly-accent-color-inverted: var(--sui-primary-background-color);--sui-option-border-radius: var(--sui-control-medium-border-radius);--sui-option-padding: calc((var(--sui-control-medium-height) / 6))
calc((var(--sui-control-medium-height) / 5));--sui-option-height: var(--sui-control-medium-height);--sui-listbox-border-radius: var(--sui-control-medium-border-radius);--sui-listbox-border-color: var(--sui-control-border-color);--sui-listbox-foreground-color: var(--sui-control-foreground-color);--sui-listbox-background-color: hsl(var(--sui-background-color-1-hsl));--sui-tree-border-radius: var(--sui-control-medium-border-radius);--sui-tree-border-color: var(--sui-control-border-color);--sui-tree-foreground-color: var(--sui-control-foreground-color);--sui-tree-background-color: hsl(var(--sui-background-color-1-hsl));--sui-tree-item-border-radius: var(--sui-control-medium-border-radius);--sui-tree-item-padding: var(--sui-option-padding);--sui-tree-item-height: var(--sui-control-medium-height);--sui-tree-item-indent: 16px;--sui-textbox-border-radius: var(--sui-control-medium-border-radius);--sui-textbox-height: var(--sui-control-medium-height);--sui-textbox-border-color: var(--sui-control-border-color);--sui-textbox-foreground-color: var(--sui-control-foreground-color);--sui-textbox-background-color: hsl(var(--sui-background-color-1-hsl));--sui-textbox-font-family: var(--sui-font-family-default);--sui-textbox-font-size: var(--sui-font-size-default);--sui-textbox-singleline-padding: 0 8px;--sui-textbox-singleline-min-width: 240px;--sui-textbox-singleline-line-height: var(--sui-line-height-compact);--sui-textbox-multiline-padding: 16px;--sui-textbox-multiline-min-width: 480px;--sui-textbox-multiline-line-height: var(--sui-line-height-comfortable);--sui-tab-height: var(--sui-control-medium-height);--sui-tab-small-height: var(--sui-control-small-height);--sui-tab-medium-height: var(--sui-control-medium-height);--sui-tab-large-height: var(--sui-control-large-height);--sui-primary-toolbar-size: 56px;--sui-secondary-toolbar-size: 48px;--sui-bottom-navigation-height: var(--sui-primary-toolbar-size);--sui-primary-row-height: 56px;--sui-secondary-row-height: 40px;}
@media (pointer: coarse) {:root,
:host {--sui-menuitem-height: 40px;--sui-control-small-height: 32px;--sui-control-medium-height: 40px;--sui-control-large-height: 48px;--sui-checkbox-height: 24px;--sui-secondary-row-height: 48px;}
}
@media (prefers-reduced-transparency) {:root,
:host {--sui-primary-background-color-translucent: hsl(var(--sui-background-color-2-hsl));--sui-secondary-background-color-translucent: hsl(var(--sui-background-color-3-hsl));--sui-tertiary-background-color-translucent: hsl(var(--sui-background-color-4-hsl));}
}:root[data-theme=light],
:host[data-theme=light] {color-scheme:light;--sui-foreground-color-1-hsl: var(--sui-base-hue) 5% 5%;--sui-foreground-color-2-hsl: var(--sui-base-hue) 5% 25%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 5% 35%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 5% 45%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 5% 65%;--sui-background-color-1-hsl: var(--sui-base-hue) 5% 100%;--sui-background-color-2-hsl: var(--sui-base-hue) 5% 98%;--sui-background-color-3-hsl: var(--sui-base-hue) 5% 95%;--sui-background-color-4-hsl: var(--sui-base-hue) 5% 92%;--sui-background-color-5-hsl: var(--sui-base-hue) 5% 84%;--sui-border-color-1-hsl: var(--sui-base-hue) 5% 60%;--sui-border-color-2-hsl: var(--sui-base-hue) 5% 72%;--sui-border-color-3-hsl: var(--sui-base-hue) 5% 80%;--sui-shadow-color: var(--sui-base-hue) 10% 0%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 80% 40%);--sui-primary-accent-color-light: hsl(var(--sui-base-hue) 80% 45%);--sui-primary-accent-color: hsl(var(--sui-base-hue) 80% 40%);--sui-primary-accent-color-dark: hsl(var(--sui-base-hue) 80% 35%);--sui-primary-accent-color-inverted: hsl(var(--sui-base-hue) 10% 100%);--sui-primary-accent-color-translucent: hsl(var(--sui-base-hue) 80% 50% / 60%);--sui-primary-accent-color-translucent-light: hsl(var(--sui-base-hue) 80% 50% / 40%);--sui-error-color-hue: 0;--sui-warning-color-hue: 40;--sui-info-color-hue: 210;--sui-success-color-hue: 100;--sui-alert-foreground-color-saturation: 85%;--sui-alert-foreground-color-lightness: 25%;--sui-alert-background-color-saturation: 65%;--sui-alert-background-color-lightness: 90%;--sui-alert-border-color-saturation: 48%;--sui-alert-border-color-lightness: 68%;--sui-error-border-color-lightness: 60%;}:root[data-theme=dark],
:host[data-theme=dark] {color-scheme:dark;--sui-foreground-color-1-hsl: var(--sui-base-hue) 10% 95%;--sui-foreground-color-2-hsl: var(--sui-base-hue) 10% 75%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 10% 65%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 10% 55%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 10% 35%;--sui-background-color-1-hsl: var(--sui-base-hue) 10% 8%;--sui-background-color-2-hsl: var(--sui-base-hue) 10% 10%;--sui-background-color-3-hsl: var(--sui-base-hue) 10% 13%;--sui-background-color-4-hsl: var(--sui-base-hue) 10% 16%;--sui-background-color-5-hsl: var(--sui-base-hue) 10% 26%;--sui-border-color-1-hsl: var(--sui-base-hue) 10% 40%;--sui-border-color-2-hsl: var(--sui-base-hue) 10% 24%;--sui-border-color-3-hsl: var(--sui-base-hue) 10% 20%;--sui-shadow-color: var(--sui-base-hue) 10% 0%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 100% 60%);--sui-primary-accent-color-light: hsl(var(--sui-base-hue) 100% 45%);--sui-primary-accent-color: hsl(var(--sui-base-hue) 100% 40%);--sui-primary-accent-color-dark: hsl(var(--sui-base-hue) 100% 35%);--sui-primary-accent-color-inverted: hsl(var(--sui-base-hue) 10% 100%);--sui-primary-accent-color-translucent: hsl(var(--sui-base-hue) 80% 50% / 60%);--sui-primary-accent-color-translucent-light: hsl(var(--sui-base-hue) 80% 50% / 40%);--sui-error-color-hue: 0;--sui-warning-color-hue: 40;--sui-info-color-hue: 210;--sui-success-color-hue: 100;--sui-alert-foreground-color-saturation: 85%;--sui-alert-foreground-color-lightness: 75%;--sui-alert-background-color-saturation: 40%;--sui-alert-background-color-lightness: 10%;--sui-alert-border-color-saturation: 48%;--sui-alert-border-color-lightness: 38%;}
@media (prefers-color-scheme: light) {:root:not([data-theme]),
:host:not([data-theme]) {color-scheme:light;--sui-foreground-color-1-hsl: var(--sui-base-hue) 5% 5%;--sui-foreground-color-2-hsl: var(--sui-base-hue) 5% 25%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 5% 35%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 5% 45%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 5% 65%;--sui-background-color-1-hsl: var(--sui-base-hue) 5% 100%;--sui-background-color-2-hsl: var(--sui-base-hue) 5% 98%;--sui-background-color-3-hsl: var(--sui-base-hue) 5% 95%;--sui-background-color-4-hsl: var(--sui-base-hue) 5% 92%;--sui-background-color-5-hsl: var(--sui-base-hue) 5% 84%;--sui-border-color-1-hsl: var(--sui-base-hue) 5% 60%;--sui-border-color-2-hsl: var(--sui-base-hue) 5% 72%;--sui-border-color-3-hsl: var(--sui-base-hue) 5% 80%;--sui-shadow-color: var(--sui-base-hue) 10% 0%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 80% 40%);--sui-primary-accent-color-light: hsl(var(--sui-base-hue) 80% 45%);--sui-primary-accent-color: hsl(var(--sui-base-hue) 80% 40%);--sui-primary-accent-color-dark: hsl(var(--sui-base-hue) 80% 35%);--sui-primary-accent-color-inverted: hsl(var(--sui-base-hue) 10% 100%);--sui-primary-accent-color-translucent: hsl(var(--sui-base-hue) 80% 50% / 60%);--sui-primary-accent-color-translucent-light: hsl(var(--sui-base-hue) 80% 50% / 40%);--sui-error-color-hue: 0;--sui-warning-color-hue: 40;--sui-info-color-hue: 210;--sui-success-color-hue: 100;--sui-alert-foreground-color-saturation: 85%;--sui-alert-foreground-color-lightness: 25%;--sui-alert-background-color-saturation: 65%;--sui-alert-background-color-lightness: 90%;--sui-alert-border-color-saturation: 48%;--sui-alert-border-color-lightness: 68%;--sui-error-border-color-lightness: 60%;}
}
@media (prefers-color-scheme: dark) {:root:not([data-theme]),
:host:not([data-theme]) {color-scheme:dark;--sui-foreground-color-1-hsl: var(--sui-base-hue) 10% 95%;--sui-foreground-color-2-hsl: var(--sui-base-hue) 10% 75%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 10% 65%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 10% 55%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 10% 35%;--sui-background-color-1-hsl: var(--sui-base-hue) 10% 8%;--sui-background-color-2-hsl: var(--sui-base-hue) 10% 10%;--sui-background-color-3-hsl: var(--sui-base-hue) 10% 13%;--sui-background-color-4-hsl: var(--sui-base-hue) 10% 16%;--sui-background-color-5-hsl: var(--sui-base-hue) 10% 26%;--sui-border-color-1-hsl: var(--sui-base-hue) 10% 40%;--sui-border-color-2-hsl: var(--sui-base-hue) 10% 24%;--sui-border-color-3-hsl: var(--sui-base-hue) 10% 20%;--sui-shadow-color: var(--sui-base-hue) 10% 0%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 100% 60%);--sui-primary-accent-color-light: hsl(var(--sui-base-hue) 100% 45%);--sui-primary-accent-color: hsl(var(--sui-base-hue) 100% 40%);--sui-primary-accent-color-dark: hsl(var(--sui-base-hue) 100% 35%);--sui-primary-accent-color-inverted: hsl(var(--sui-base-hue) 10% 100%);--sui-primary-accent-color-translucent: hsl(var(--sui-base-hue) 80% 50% / 60%);--sui-primary-accent-color-translucent-light: hsl(var(--sui-base-hue) 80% 50% / 40%);--sui-error-color-hue: 0;--sui-warning-color-hue: 40;--sui-info-color-hue: 210;--sui-success-color-hue: 100;--sui-alert-foreground-color-saturation: 85%;--sui-alert-foreground-color-lightness: 75%;--sui-alert-background-color-saturation: 40%;--sui-alert-background-color-lightness: 10%;--sui-alert-border-color-saturation: 48%;--sui-alert-border-color-lightness: 38%;}
}:root[data-contrast=more][data-theme=light],
:host[data-contrast=more][data-theme=light] {--sui-foreground-color-2-hsl: var(--sui-base-hue) 5% 10%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 5% 18%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 5% 28%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 5% 45%;--sui-background-color-3-hsl: var(--sui-base-hue) 5% 93%;--sui-background-color-4-hsl: var(--sui-base-hue) 5% 88%;--sui-background-color-5-hsl: var(--sui-base-hue) 5% 70%;--sui-border-color-1-hsl: var(--sui-base-hue) 5% 40%;--sui-border-color-2-hsl: var(--sui-base-hue) 5% 55%;--sui-border-color-3-hsl: var(--sui-base-hue) 5% 65%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 80% 32%);--sui-primary-accent-color-light: hsl(var(--sui-base-hue) 80% 37%);--sui-primary-accent-color: hsl(var(--sui-base-hue) 80% 32%);--sui-primary-accent-color-dark: hsl(var(--sui-base-hue) 80% 26%);--sui-alert-foreground-color-lightness: 18%;--sui-alert-border-color-saturation: 55%;--sui-alert-border-color-lightness: 40%;--sui-error-border-color-lightness: 40%;--sui-hover-background-color: hsl(var(--sui-background-color-5-hsl) / 60%);--sui-selected-background-color: hsl(var(--sui-background-color-5-hsl));--sui-active-background-color: hsl(var(--sui-background-color-5-hsl));--sui-primary-background-color-translucent: hsl(var(--sui-background-color-2-hsl));--sui-secondary-background-color-translucent: hsl(var(--sui-background-color-3-hsl));--sui-tertiary-background-color-translucent: hsl(var(--sui-background-color-4-hsl));--sui-popup-shadow-color: hsl(var(--sui-shadow-color) / 70%);--sui-popup-backdrop-color: hsl(var(--sui-shadow-color) / 60%);--sui-textbox-border-color: hsl(var(--sui-border-color-1-hsl));--sui-textbox-placeholder-foreground-color: var(--sui-tertiary-foreground-color);--sui-textbox-placeholder-opacity: 1;--sui-disabled-opacity: 0.6;--sui-modal-border-width: 1px;}:root[data-contrast=more][data-theme=dark],
:host[data-contrast=more][data-theme=dark] {--sui-foreground-color-2-hsl: var(--sui-base-hue) 10% 92%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 10% 85%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 10% 75%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 10% 55%;--sui-background-color-1-hsl: var(--sui-base-hue) 10% 4%;--sui-background-color-2-hsl: var(--sui-base-hue) 10% 7%;--sui-background-color-3-hsl: var(--sui-base-hue) 10% 12%;--sui-background-color-4-hsl: var(--sui-base-hue) 10% 18%;--sui-background-color-5-hsl: var(--sui-base-hue) 10% 40%;--sui-border-color-1-hsl: var(--sui-base-hue) 10% 60%;--sui-border-color-2-hsl: var(--sui-base-hue) 10% 50%;--sui-border-color-3-hsl: var(--sui-base-hue) 10% 40%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 100% 70%);--sui-focus-ring-color: var(--sui-primary-accent-color-text);--sui-alert-foreground-color-lightness: 85%;--sui-alert-border-color-saturation: 55%;--sui-alert-border-color-lightness: 55%;--sui-hover-background-color: hsl(var(--sui-background-color-5-hsl) / 60%);--sui-selected-background-color: hsl(var(--sui-background-color-5-hsl));--sui-active-background-color: hsl(var(--sui-background-color-5-hsl));--sui-primary-background-color-translucent: hsl(var(--sui-background-color-2-hsl));--sui-secondary-background-color-translucent: hsl(var(--sui-background-color-3-hsl));--sui-tertiary-background-color-translucent: hsl(var(--sui-background-color-4-hsl));--sui-popup-shadow-color: hsl(var(--sui-shadow-color) / 70%);--sui-popup-backdrop-color: hsl(var(--sui-shadow-color) / 60%);--sui-textbox-border-color: hsl(var(--sui-border-color-1-hsl));--sui-textbox-placeholder-foreground-color: var(--sui-tertiary-foreground-color);--sui-textbox-placeholder-opacity: 1;--sui-disabled-opacity: 0.6;--sui-modal-border-width: 1px;}
@media (prefers-color-scheme: light) {:root[data-contrast=more]:not([data-theme]),
:host[data-contrast=more]:not([data-theme]) {--sui-foreground-color-2-hsl: var(--sui-base-hue) 5% 10%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 5% 18%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 5% 28%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 5% 45%;--sui-background-color-3-hsl: var(--sui-base-hue) 5% 93%;--sui-background-color-4-hsl: var(--sui-base-hue) 5% 88%;--sui-background-color-5-hsl: var(--sui-base-hue) 5% 70%;--sui-border-color-1-hsl: var(--sui-base-hue) 5% 40%;--sui-border-color-2-hsl: var(--sui-base-hue) 5% 55%;--sui-border-color-3-hsl: var(--sui-base-hue) 5% 65%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 80% 32%);--sui-primary-accent-color-light: hsl(var(--sui-base-hue) 80% 37%);--sui-primary-accent-color: hsl(var(--sui-base-hue) 80% 32%);--sui-primary-accent-color-dark: hsl(var(--sui-base-hue) 80% 26%);--sui-alert-foreground-color-lightness: 18%;--sui-alert-border-color-saturation: 55%;--sui-alert-border-color-lightness: 40%;--sui-error-border-color-lightness: 40%;--sui-hover-background-color: hsl(var(--sui-background-color-5-hsl) / 60%);--sui-selected-background-color: hsl(var(--sui-background-color-5-hsl));--sui-active-background-color: hsl(var(--sui-background-color-5-hsl));--sui-primary-background-color-translucent: hsl(var(--sui-background-color-2-hsl));--sui-secondary-background-color-translucent: hsl(var(--sui-background-color-3-hsl));--sui-tertiary-background-color-translucent: hsl(var(--sui-background-color-4-hsl));--sui-popup-shadow-color: hsl(var(--sui-shadow-color) / 70%);--sui-popup-backdrop-color: hsl(var(--sui-shadow-color) / 60%);--sui-textbox-border-color: hsl(var(--sui-border-color-1-hsl));--sui-textbox-placeholder-foreground-color: var(--sui-tertiary-foreground-color);--sui-textbox-placeholder-opacity: 1;--sui-disabled-opacity: 0.6;--sui-modal-border-width: 1px;}
}
@media (prefers-color-scheme: dark) {:root[data-contrast=more]:not([data-theme]),
:host[data-contrast=more]:not([data-theme]) {--sui-foreground-color-2-hsl: var(--sui-base-hue) 10% 92%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 10% 85%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 10% 75%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 10% 55%;--sui-background-color-1-hsl: var(--sui-base-hue) 10% 4%;--sui-background-color-2-hsl: var(--sui-base-hue) 10% 7%;--sui-background-color-3-hsl: var(--sui-base-hue) 10% 12%;--sui-background-color-4-hsl: var(--sui-base-hue) 10% 18%;--sui-background-color-5-hsl: var(--sui-base-hue) 10% 40%;--sui-border-color-1-hsl: var(--sui-base-hue) 10% 60%;--sui-border-color-2-hsl: var(--sui-base-hue) 10% 50%;--sui-border-color-3-hsl: var(--sui-base-hue) 10% 40%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 100% 70%);--sui-focus-ring-color: var(--sui-primary-accent-color-text);--sui-alert-foreground-color-lightness: 85%;--sui-alert-border-color-saturation: 55%;--sui-alert-border-color-lightness: 55%;--sui-hover-background-color: hsl(var(--sui-background-color-5-hsl) / 60%);--sui-selected-background-color: hsl(var(--sui-background-color-5-hsl));--sui-active-background-color: hsl(var(--sui-background-color-5-hsl));--sui-primary-background-color-translucent: hsl(var(--sui-background-color-2-hsl));--sui-secondary-background-color-translucent: hsl(var(--sui-background-color-3-hsl));--sui-tertiary-background-color-translucent: hsl(var(--sui-background-color-4-hsl));--sui-popup-shadow-color: hsl(var(--sui-shadow-color) / 70%);--sui-popup-backdrop-color: hsl(var(--sui-shadow-color) / 60%);--sui-textbox-border-color: hsl(var(--sui-border-color-1-hsl));--sui-textbox-placeholder-foreground-color: var(--sui-tertiary-foreground-color);--sui-textbox-placeholder-opacity: 1;--sui-disabled-opacity: 0.6;--sui-modal-border-width: 1px;}
}
@media (prefers-contrast: more) {:root:not([data-contrast])[data-theme=light],
:host:not([data-contrast])[data-theme=light] {--sui-foreground-color-2-hsl: var(--sui-base-hue) 5% 10%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 5% 18%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 5% 28%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 5% 45%;--sui-background-color-3-hsl: var(--sui-base-hue) 5% 93%;--sui-background-color-4-hsl: var(--sui-base-hue) 5% 88%;--sui-background-color-5-hsl: var(--sui-base-hue) 5% 70%;--sui-border-color-1-hsl: var(--sui-base-hue) 5% 40%;--sui-border-color-2-hsl: var(--sui-base-hue) 5% 55%;--sui-border-color-3-hsl: var(--sui-base-hue) 5% 65%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 80% 32%);--sui-primary-accent-color-light: hsl(var(--sui-base-hue) 80% 37%);--sui-primary-accent-color: hsl(var(--sui-base-hue) 80% 32%);--sui-primary-accent-color-dark: hsl(var(--sui-base-hue) 80% 26%);--sui-alert-foreground-color-lightness: 18%;--sui-alert-border-color-saturation: 55%;--sui-alert-border-color-lightness: 40%;--sui-error-border-color-lightness: 40%;--sui-hover-background-color: hsl(var(--sui-background-color-5-hsl) / 60%);--sui-selected-background-color: hsl(var(--sui-background-color-5-hsl));--sui-active-background-color: hsl(var(--sui-background-color-5-hsl));--sui-primary-background-color-translucent: hsl(var(--sui-background-color-2-hsl));--sui-secondary-background-color-translucent: hsl(var(--sui-background-color-3-hsl));--sui-tertiary-background-color-translucent: hsl(var(--sui-background-color-4-hsl));--sui-popup-shadow-color: hsl(var(--sui-shadow-color) / 70%);--sui-popup-backdrop-color: hsl(var(--sui-shadow-color) / 60%);--sui-textbox-border-color: hsl(var(--sui-border-color-1-hsl));--sui-textbox-placeholder-foreground-color: var(--sui-tertiary-foreground-color);--sui-textbox-placeholder-opacity: 1;--sui-disabled-opacity: 0.6;--sui-modal-border-width: 1px;}:root:not([data-contrast])[data-theme=dark],
:host:not([data-contrast])[data-theme=dark] {--sui-foreground-color-2-hsl: var(--sui-base-hue) 10% 92%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 10% 85%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 10% 75%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 10% 55%;--sui-background-color-1-hsl: var(--sui-base-hue) 10% 4%;--sui-background-color-2-hsl: var(--sui-base-hue) 10% 7%;--sui-background-color-3-hsl: var(--sui-base-hue) 10% 12%;--sui-background-color-4-hsl: var(--sui-base-hue) 10% 18%;--sui-background-color-5-hsl: var(--sui-base-hue) 10% 40%;--sui-border-color-1-hsl: var(--sui-base-hue) 10% 60%;--sui-border-color-2-hsl: var(--sui-base-hue) 10% 50%;--sui-border-color-3-hsl: var(--sui-base-hue) 10% 40%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 100% 70%);--sui-focus-ring-color: var(--sui-primary-accent-color-text);--sui-alert-foreground-color-lightness: 85%;--sui-alert-border-color-saturation: 55%;--sui-alert-border-color-lightness: 55%;--sui-hover-background-color: hsl(var(--sui-background-color-5-hsl) / 60%);--sui-selected-background-color: hsl(var(--sui-background-color-5-hsl));--sui-active-background-color: hsl(var(--sui-background-color-5-hsl));--sui-primary-background-color-translucent: hsl(var(--sui-background-color-2-hsl));--sui-secondary-background-color-translucent: hsl(var(--sui-background-color-3-hsl));--sui-tertiary-background-color-translucent: hsl(var(--sui-background-color-4-hsl));--sui-popup-shadow-color: hsl(var(--sui-shadow-color) / 70%);--sui-popup-backdrop-color: hsl(var(--sui-shadow-color) / 60%);--sui-textbox-border-color: hsl(var(--sui-border-color-1-hsl));--sui-textbox-placeholder-foreground-color: var(--sui-tertiary-foreground-color);--sui-textbox-placeholder-opacity: 1;--sui-disabled-opacity: 0.6;--sui-modal-border-width: 1px;}
}
@media (prefers-contrast: more) and (prefers-color-scheme: light) {:root:not([data-contrast]):not([data-theme]),
:host:not([data-contrast]):not([data-theme]) {--sui-foreground-color-2-hsl: var(--sui-base-hue) 5% 10%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 5% 18%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 5% 28%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 5% 45%;--sui-background-color-3-hsl: var(--sui-base-hue) 5% 93%;--sui-background-color-4-hsl: var(--sui-base-hue) 5% 88%;--sui-background-color-5-hsl: var(--sui-base-hue) 5% 70%;--sui-border-color-1-hsl: var(--sui-base-hue) 5% 40%;--sui-border-color-2-hsl: var(--sui-base-hue) 5% 55%;--sui-border-color-3-hsl: var(--sui-base-hue) 5% 65%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 80% 32%);--sui-primary-accent-color-light: hsl(var(--sui-base-hue) 80% 37%);--sui-primary-accent-color: hsl(var(--sui-base-hue) 80% 32%);--sui-primary-accent-color-dark: hsl(var(--sui-base-hue) 80% 26%);--sui-alert-foreground-color-lightness: 18%;--sui-alert-border-color-saturation: 55%;--sui-alert-border-color-lightness: 40%;--sui-error-border-color-lightness: 40%;--sui-hover-background-color: hsl(var(--sui-background-color-5-hsl) / 60%);--sui-selected-background-color: hsl(var(--sui-background-color-5-hsl));--sui-active-background-color: hsl(var(--sui-background-color-5-hsl));--sui-primary-background-color-translucent: hsl(var(--sui-background-color-2-hsl));--sui-secondary-background-color-translucent: hsl(var(--sui-background-color-3-hsl));--sui-tertiary-background-color-translucent: hsl(var(--sui-background-color-4-hsl));--sui-popup-shadow-color: hsl(var(--sui-shadow-color) / 70%);--sui-popup-backdrop-color: hsl(var(--sui-shadow-color) / 60%);--sui-textbox-border-color: hsl(var(--sui-border-color-1-hsl));--sui-textbox-placeholder-foreground-color: var(--sui-tertiary-foreground-color);--sui-textbox-placeholder-opacity: 1;--sui-disabled-opacity: 0.6;--sui-modal-border-width: 1px;}
}
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {:root:not([data-contrast]):not([data-theme]),
:host:not([data-contrast]):not([data-theme]) {--sui-foreground-color-2-hsl: var(--sui-base-hue) 10% 92%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 10% 85%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 10% 75%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 10% 55%;--sui-background-color-1-hsl: var(--sui-base-hue) 10% 4%;--sui-background-color-2-hsl: var(--sui-base-hue) 10% 7%;--sui-background-color-3-hsl: var(--sui-base-hue) 10% 12%;--sui-background-color-4-hsl: var(--sui-base-hue) 10% 18%;--sui-background-color-5-hsl: var(--sui-base-hue) 10% 40%;--sui-border-color-1-hsl: var(--sui-base-hue) 10% 60%;--sui-border-color-2-hsl: var(--sui-base-hue) 10% 50%;--sui-border-color-3-hsl: var(--sui-base-hue) 10% 40%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 100% 70%);--sui-focus-ring-color: var(--sui-primary-accent-color-text);--sui-alert-foreground-color-lightness: 85%;--sui-alert-border-color-saturation: 55%;--sui-alert-border-color-lightness: 55%;--sui-hover-background-color: hsl(var(--sui-background-color-5-hsl) / 60%);--sui-selected-background-color: hsl(var(--sui-background-color-5-hsl));--sui-active-background-color: hsl(var(--sui-background-color-5-hsl));--sui-primary-background-color-translucent: hsl(var(--sui-background-color-2-hsl));--sui-secondary-background-color-translucent: hsl(var(--sui-background-color-3-hsl));--sui-tertiary-background-color-translucent: hsl(var(--sui-background-color-4-hsl));--sui-popup-shadow-color: hsl(var(--sui-shadow-color) / 70%);--sui-popup-backdrop-color: hsl(var(--sui-shadow-color) / 60%);--sui-textbox-border-color: hsl(var(--sui-border-color-1-hsl));--sui-textbox-placeholder-foreground-color: var(--sui-tertiary-foreground-color);--sui-textbox-placeholder-opacity: 1;--sui-disabled-opacity: 0.6;--sui-modal-border-width: 1px;}
}.material-symbols-outlined {font-variation-settings:"FILL" 0, "wght" 300, "GRAD" 0, "opsz" 24;}*,
::before,
::after {overflow-anchor:none;scroll-behavior:smooth;box-sizing:border-box;outline-offset:0px;outline-width:var(--sui-focus-ring-width) !important;outline-style:solid;outline-color:transparent;border-width:0;border-style:solid;vertical-align:top;font-size-adjust:inherit;}
@media (prefers-reduced-motion) {*,
::before,
::after {scroll-behavior:auto;transition-duration:1ms !important;}
}::selection {background-color:var(--sui-primary-accent-color-translucent-light);}* {-webkit-tap-highlight-color:transparent;}:focus {z-index:1;outline-width:0;}:focus-visible {outline-color:var(--sui-focus-ring-color);outline-offset:var(--sui-focus-ring-offset, 0);z-index:2;}h1 {margin:var(--sui-h1-margin, var(--sui-heading-margin));font-size:var(--sui-h1-font-size, 34px);font-family:var(--sui-h1-font-family, var(--sui-heading-font-family));font-weight:var(--sui-h1-font-weight, var(--sui-heading-font-weight));line-height:var(--sui-h1-line-height, var(--sui-heading-line-height));}h2 {margin:var(--sui-h2-margin, var(--sui-heading-margin));font-size:var(--sui-h2-font-size, 30px);font-family:var(--sui-h2-font-family, var(--sui-heading-font-family));font-weight:var(--sui-h2-font-weight, var(--sui-heading-font-weight));line-height:var(--sui-h2-line-height, var(--sui-heading-line-height));}h3 {margin:var(--sui-h3-margin, var(--sui-heading-margin));font-size:var(--sui-h3-font-size, 26px);font-family:var(--sui-h3-font-family, var(--sui-heading-font-family));font-weight:var(--sui-h3-font-weight, var(--sui-heading-font-weight));line-height:var(--sui-h3-line-height, var(--sui-heading-line-height));}h4 {margin:var(--sui-h4-margin, var(--sui-heading-margin));font-size:var(--sui-h4-font-size, 22px);font-family:var(--sui-h4-font-family, var(--sui-heading-font-family));font-weight:var(--sui-h4-font-weight, var(--sui-heading-font-weight));line-height:var(--sui-h4-line-height, var(--sui-heading-line-height));}h5 {margin:var(--sui-h5-margin, var(--sui-heading-margin));font-size:var(--sui-h5-font-size, 18px);font-family:var(--sui-h5-font-family, var(--sui-heading-font-family));font-weight:var(--sui-h5-font-weight, var(--sui-heading-font-weight));line-height:var(--sui-h5-line-height, var(--sui-heading-line-height));}h6 {margin:var(--sui-h6-margin, var(--sui-heading-margin));font-size:var(--sui-h6-font-size, 14px);font-family:var(--sui-h6-font-family, var(--sui-heading-font-family));font-weight:var(--sui-h6-font-weight, var(--sui-heading-font-weight));line-height:var(--sui-h6-line-height, var(--sui-heading-line-height));}strong {font-weight:var(--sui-font-weight-bold, bold);}a {color:var(--sui-primary-accent-color-text);text-decoration:none;text-underline-offset:2px;}a:is(:hover, :focus, :active) {text-decoration:underline;}:is(:root, :host)[data-underline-links="true"] a {text-decoration:underline;}:is(p, ul, ol, dl) {margin:var(--sui-paragraph-margin) 0;line-height:var(--sui-line-height-comfortable);}:is(ul, ol) {padding-inline:2em;}:is(code, pre) {border-radius:4px;background-color:var(--sui-code-background-color);font-family:var(--sui-font-family-monospace);font-size:var(--sui-font-size-monospace);vertical-align:-0.05em;}pre {padding:8px;line-height:var(--sui-line-height-compact);-webkit-user-select:text;user-select:text;}code {padding:2px 4px;}table {border-collapse:collapse;}:is(th, td) {border:1px solid var(--sui-textbox-border-color);padding:8px;}blockquote {margin-inline:16px 0;border-inline-start:4px solid var(--sui-textbox-border-color);padding-inline-start:12px;}:is(.disabled, [aria-disabled=true], [inert]):not(body) {cursor:default;pointer-events:none;-webkit-user-select:none;user-select:none;filter:grayscale(1) opacity(var(--sui-disabled-opacity, 0.35));}:is(.disabled, [aria-disabled=true], [inert]):not(body) * {filter:grayscale(0) opacity(1);}:is(.disabled, [aria-disabled=true], [inert]) * {cursor:default;pointer-events:none;-webkit-user-select:none;user-select:none;}:is(.readonly, [aria-readonly=true]):not(body) {cursor:default;}:is(.readonly, [aria-readonly=true]):not(body) * {cursor:default;}.font-loader.svelte-455qcr {position:absolute;inset-inline-start:-99999px;font-family:var(--sui-font-family-default);}.app-shell.svelte-455qcr {position:fixed;inset:0;overflow:hidden;width:100%;height:100%;color:var(--sui-primary-foreground-color);background-color:var(--sui-primary-background-color);font-family:var(--sui-font-family-default);font-size:var(--sui-font-size-default);font-weight:var(--sui-font-weight-normal, normal);word-spacing:var(--sui-word-spacing-normal);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-user-select:none;user-select:none;touch-action:none;cursor:default;}.app-shell.horizontal.svelte-455qcr {display:flex;flex-direction:row;overflow:hidden;}.app-shell.vertical.svelte-455qcr {display:flex;flex-direction:column;overflow:hidden;}`};function LOe(e,t){O(t,!0),K(e,IOe);let n=J(t,`orientation`,3,`horizontal`),r=vs(t,MOe),i=j(!1);So(()=>{let e=globalThis.matchMedia(`(prefers-color-scheme: dark)`),{dataset:t}=document.documentElement,n=()=>{t.autoTheming!==`false`&&(t.theme=e.matches?`dark`:`light`)};n(),e.addEventListener(`change`,n);let r=globalThis.setTimeout(()=>{M(i,!0)},1e3);return()=>{e.removeEventListener(`change`,n),globalThis.clearTimeout(r)}});var a=FOe();Ko(`455qcr`,e=>{var t=NOe(),n=P(t);jOe(I(n,4),{}),R(e=>q(n,`content`,e),[()=>`width=device-width, initial-scale=1, maximum-scale=1, interactive-widget=resizes-content`]),U(e,t)});var o=P(a),s=e=>{var t=POe();ts(t,``,{},{opacity:`0`}),U(e,t)};G(o,e=>{z(i)||e(s)});var c=I(o,2),l=e=>e.preventDefault(),u=e=>e.preventDefault(),d=e=>{kOe(e.target)||e.preventDefault()};fs(c,()=>({...r,role:`none`,class:[`sui`,`app-shell`,n()],ondragover:l,ondrop:u,oncontextmenu:d}),void 0,void 0,void 0,`svelte-455qcr`),xo(N(c),()=>t.children??Cr),D(c),U(e,a),k()}var ROe=B(`<div role="none" class="sui empty-state svelte-csncls"><!></div>`),zOe={hash:`svelte-csncls`,code:`.empty-state.svelte-csncls {display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;padding:16px;width:100%;height:100%;text-align:center;}`};function dH(e,t){K(e,zOe);let n=J(t,`children`,3,void 0);var r=ROe();xo(N(r),()=>n()??Cr),D(r),U(e,r)}var BOe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`ariaLabel`,`children`]),VOe=B(`<div><div role="none" class="inner svelte-1kki94y"><!></div></div>`),HOe={hash:`svelte-1kki94y`,code:`.inner.svelte-1kki94y {display:contents;}`};function fH(e,t){K(e,HOe);let n=J(t,`hidden`,3,!1),r=J(t,`disabled`,3,!1),i=J(t,`ariaLabel`,3,void 0),a=vs(t,BOe);var o=VOe();fs(o,()=>({...a,role:`group`,class:`sui group ${t.class??``}`,hidden:n(),"aria-hidden":n(),"aria-disabled":r(),"aria-label":i()}),void 0,void 0,void 0,`svelte-1kki94y`);var s=N(o);xo(N(s),()=>t.children??Cr),D(s),D(o),R(()=>s.inert=r()),U(e,o)}var UOe=B(`<div class="placeholder svelte-gsis8"></div>`),WOe={hash:`svelte-gsis8`,code:`.placeholder.svelte-gsis8 {height:64px;}`};function pH(e,t){O(t,!0),K(e,WOe);let n=J(t,`eager`,3,!1),r=j(null),i=j(Xi(n()));L(()=>(z(r)&&(async()=>{await Vx(z(r)),M(i,!0)})(),()=>{z(r)&&Lx(z(r))}));var a=H(),o=P(a),s=e=>{var n=H();xo(P(n),()=>t.children),U(e,n)},c=e=>{var t=UOe();gs(t,e=>M(r,e),()=>z(r)),U(e,t)};G(o,e=>{z(i)?e(s):e(c,-1)}),U(e,a),k()}var GOe={ok:`OK`,cancel:`Cancel`,close:`Close`,clear:`Clear`,insert:`Insert`,update:`Update`,remove:`Remove`,collapse:`Collapse`,expand:`Expand`,dismiss:`Dismiss`,alert:{error:`Error`,warning:`Warning`,info:`Information`,success:`Success`},role_descriptions:{disclosure:`disclosure`,option_group:`option group`,menu_item_group:`menu item group`,checkbox_group:`checkbox group`,table_head:`table head`,table_body:`table body`,table_foot:`table foot`,grid_head:`grid head`,grid_body:`grid body`,grid_foot:`grid foot`},emoji_suggestions:`Emoji Suggestions`,calendar:{year:`Year`,previous_decade:`Previous Decade`,next_decade:`Next Decade`,month:`Month`,previous_month:`Previous Month`,next_month:`Next Month`,today:`Today`},split_button:{x_options:`{$name} Options`,more_options:`More Options`},combobox:{select_an_option:`Select an option…`,filter_options:`Filter Options`,no_matching_options:`No matching options found`},number_input:{increase:`Increase`,decrease:`Decrease`,range:`From {$min} to {$max}`,min:`Minimum {$min}`,max:`Maximum {$max}`},password_input:{show_password:`Show Password`,hide_password:`Hide Password`},secret_input:{show_secret:`Show Secret`,hide_secret:`Hide Secret`},select_tags:{selected_options:`Selected Options`,remove_x:`Remove {$name}`},text_editor:{text_editor:`Text Editor`,code_editor:`Code Editor`,text_style_options:`Text Style Options`,show_text_style_options:`Show Text Style Options`,paragraph:`Paragraph`,heading_1:`Heading 1`,heading_2:`Heading 2`,heading_3:`Heading 3`,heading_4:`Heading 4`,heading_5:`Heading 5`,heading_6:`Heading 6`,bulleted_list:`Bulleted List`,numbered_list:`Numbered List`,blockquote:`Block Quote`,code_block:`Code Block`,bold:`Bold`,italic:`Italic`,strikethrough:`Strikethrough`,code:`Code`,link:`Link`,insert_link:`Insert Link`,edit_link:`Edit Link`,remove_link:`Remove Link`,text:`Text`,url:`URL`,open_in_new_tab:`Open in New Tab`,insert_table:`Insert Table`,rows:`Rows`,columns:`Columns`,table_options:`Table Options`,show_table_options:`Show Table Options`,insert_row_above:`Insert Row Above`,insert_row_below:`Insert Row Below`,insert_column_left:`Insert Column Left`,insert_column_right:`Insert Column Right`,delete_row:`Delete Row`,delete_column:`Delete Column`,delete_table:`Delete Table`,insert_horizontal_rule:`Insert Horizontal Rule`,alignment_options:`Alignment Options`,show_alignment_options:`Show Alignment Options`,align_left:`Left Align`,align_center:`Center Align`,align_right:`Right Align`,align_justify:`Justify Align`,edit_in_markdown:`Edit in Markdown`,edit_in_html:`Edit in HTML`,converter_error:`Unable to enable rich text mode. Please use the plain text editor instead.`,language:`Language`,plain_text:`Plain Text`}};function KOe(e,t){O(t,!0);let n=J(t,`currentValue`,15),r=J(t,`required`,3,!0),i=J(t,`readonly`,3,!1),a=J(t,`invalid`,3,!1);var o=()=>n()??!1,s=e=>{n(e)};aC(e,{get checked(){return o()},set checked(e){s(e)},get readonly(){return i()},get required(){return r()},get invalid(){return a()},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`}}),k()}var qOe=B(`<p> </p>`);function JOe(e,t){O(t,!0);let n=J(t,`currentValue`,3,!1);var r=H(),i=P(r),a=e=>{var t=qOe(),r=F(t,!0);R(e=>W(r,e),[()=>Y(`boolean.${n()}`)]),U(e,t)};G(i,e=>{typeof n()==`boolean`&&e(a)}),U(e,r),k()}var mH=(e,t)=>e?.widget===`relation`&&e.collection===t,hH=(e,t)=>e.pendingEntries.filter(e=>e.collectionName===t),gH=(e,t)=>hH(e,t).filter(({baseEntry:e})=>!e),YOe=({collectionName:e,fileName:t,isIndexFile:n,currentValues:r,extraValues:i})=>[...Object.values(r).map(r=>({valueMap:r,fieldArgs:{collectionName:e,fileName:t,isIndexFile:n}})),...Object.values(i).map(e=>({valueMap:e}))],XOe=({collectionName:e,entry:t})=>Object.values(t.locales).flatMap(({content:t})=>t?[{valueMap:t,fieldArgs:{collectionName:e}}]:[]),ZOe=(e,{collectionName:t,values:n})=>e.some(({valueMap:e,fieldArgs:r})=>Object.entries(e).some(([i,a])=>{if(!n.includes(a))return!1;if(!r)return!0;let o=lh({...r,valueMap:e,keyPath:i});return!o||mH(o,t)})),_H=e=>{let t=YOe(e),n=new Set,r=()=>{let r=e.pendingEntries.filter(e=>!n.has(e)&&ZOe(t,e));return r.forEach(e=>{n.add(e),t.push(...XOe(e))}),r.length>0};for(;r(););return n},vH=e=>e.pendingEntries?.some(({baseEntry:e})=>!!e)?[..._H(e)].filter(({baseEntry:e})=>!!e):[],QOe=e=>{let t=_H(e);return e.pendingEntries.filter(e=>t.has(e)).map(e=>el(e))},yH=e=>{let{output_code_only:t=!1,keys:n={code:`code`,lang:`lang`}}=e;return t?void 0:n},bH=(e,t)=>{let n=yH(e);return!!n&&[n.code,n.lang].includes(t)},xH=(e,t)=>Qd(e,(e,n)=>String(t(n)??``)),SH=(e,t)=>e.map(e=>{let{defaultValue:n,truthyValue:r,falsyValue:i}=e.args,a={...e.args},o=!1;if(n!==void 0){let e=xH(n,t);e!==n&&(a.defaultValue=e,o=!0)}if(r!==void 0){let e=xH(r,t);e!==r&&(a.truthyValue=e,o=!0)}if(i!==void 0){let e=xH(i,t);e!==i&&(a.falsyValue=e,o=!0)}let{customArgs:s}=e,c;return s?.some(e=>typeof e==`string`&&e.includes(`{{`))&&(c=s.map(e=>typeof e==`string`?xH(e,t):e)),!o&&!c?e:{...e,args:a,...c?{customArgs:c}:{}}}),$Oe=o(((e,t,n)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(n,(function(){var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),a=n-i<0,o=t.clone().add(r+(a?-1:1),l);return+(-(r+(n-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:c,d:s,D:f,h:o,m:a,s:i,ms:r,Q:u}[e]||String(e||``).toLowerCase().replace(/s$/,``)},u:function(e){return e===void 0}},y=`en`,b={};b[y]=g;var x=`$isDayjsObject`,S=function(e){return e instanceof ee||!(!e||!e[x])},C=function e(t,n,r){var i;if(!t)return y;if(typeof t==`string`){var a=t.toLowerCase();b[a]&&(i=a),n&&(b[a]=n,i=a);var o=t.split(`-`);if(!i&&o.length>1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new ee(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var ee=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<w(e)},_.$g=function(e,t,n){return T.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!T.u(t)||t,u=T.p(e),p=function(e,t){var i=T.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},m=function(e,t){return T.w(n.toDate()[e].apply(n.toDate(`s`),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},h=this.$W,g=this.$M,_=this.$D,v=`set`+(this.$u?`UTC`:``);switch(u){case d:return r?p(1,0):p(31,11);case l:return r?p(1,g):p(0,g+1);case c:var y=this.$locale().weekStart||0,b=(h<y?h+7:h)-y;return p(r?_-b:_+(6-b),g);case s:case f:return m(v+`Hours`,0);case o:return m(v+`Minutes`,1);case a:return m(v+`Seconds`,2);case i:return m(v+`Milliseconds`,3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,c=T.p(e),u=`set`+(this.$u?`UTC`:``),p=(n={},n[s]=u+`Date`,n[f]=u+`Date`,n[l]=u+`Month`,n[d]=u+`FullYear`,n[o]=u+`Hours`,n[a]=u+`Minutes`,n[i]=u+`Seconds`,n[r]=u+`Milliseconds`,n)[c],m=c===s?this.$D+(t-this.$W):t;if(c===l||c===d){var h=this.clone().set(f,1);h.$d[p](m),h.init(),this.$d=h.set(f,Math.min(this.$D,h.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[T.p(e)]()},_.add=function(r,u){var f,p=this;r=Number(r);var m=T.p(u),h=function(e){var t=w(p);return T.w(t.date(t.date()+Math.round(e*r)),p)};if(m===l)return this.set(l,this.$M+r);if(m===d)return this.set(d,this.$y+r);if(m===s)return h(1);if(m===c)return h(7);var g=(f={},f[a]=t,f[o]=n,f[i]=e,f)[m]||1,_=this.$d.getTime()+r*g;return T.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||`YYYY-MM-DDTHH:mm:ssZ`,i=T.z(this),a=this.$H,o=this.$m,s=this.$M,c=n.weekdays,l=n.months,u=n.meridiem,d=function(e,n,i,a){return e&&(e[n]||e(t,r))||i[n].slice(0,a)},f=function(e){return T.s(a%12||12,e,`0`)},m=u||function(e,t,n){var r=e<12?`AM`:`PM`;return n?r.toLowerCase():r};return r.replace(h,(function(e,r){return r||function(e){switch(e){case`YY`:return String(t.$y).slice(-2);case`YYYY`:return T.s(t.$y,4,`0`);case`M`:return s+1;case`MM`:return T.s(s+1,2,`0`);case`MMM`:return d(n.monthsShort,s,l,3);case`MMMM`:return d(l,s);case`D`:return t.$D;case`DD`:return T.s(t.$D,2,`0`);case`d`:return String(t.$W);case`dd`:return d(n.weekdaysMin,t.$W,c,2);case`ddd`:return d(n.weekdaysShort,t.$W,c,3);case`dddd`:return c[t.$W];case`H`:return String(a);case`HH`:return T.s(a,2,`0`);case`h`:return f(1);case`hh`:return f(2);case`a`:return m(a,o,!0);case`A`:return m(a,o,!1);case`m`:return String(o);case`mm`:return T.s(o,2,`0`);case`s`:return String(t.$s);case`ss`:return T.s(t.$s,2,`0`);case`SSS`:return T.s(t.$ms,3,`0`);case`Z`:return i}return null}(e)||i.replace(`:`,``)}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(r,f,p){var m,h=this,g=T.p(f),_=w(r),v=(_.utcOffset()-this.utcOffset())*t,y=this-_,b=function(){return T.m(h,_)};switch(g){case d:m=b()/12;break;case l:m=b();break;case u:m=b()/3;break;case c:m=(y-v)/6048e5;break;case s:m=(y-v)/864e5;break;case o:m=y/n;break;case a:m=y/t;break;case i:m=y/e;break;default:m=y}return p?m:T.a(m)},_.daysInMonth=function(){return this.endOf(l).$D},_.$locale=function(){return b[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},_.clone=function(){return T.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},g}(),E=ee.prototype;return w.prototype=E,[[`$ms`,r],[`$s`,i],[`$m`,a],[`$H`,o],[`$W`,s],[`$M`,l],[`$y`,d],[`$D`,f]].forEach((function(e){E[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),w.extend=function(e,t){return e.$i||=(e(t,ee,w),!0),w},w.locale=C,w.isDayjs=S,w.unix=function(e){return w(1e3*e)},w.en=b[y],w.Ls=b,w.p={},w}))})),eke=o(((e,t,n)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_customParseFormat=r()})(n,(function(){var e={LTS:`h:mm:ss A`,LT:`h:mm A`,L:`MM/DD/YYYY`,LL:`MMMM D, YYYY`,LLL:`MMMM D, YYYY h:mm A`,LLLL:`dddd, MMMM D, YYYY h:mm A`},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d/,r=/\d\d/,i=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,o={},s=function(e){return(e=+e)+(e>68?1900:2e3)},c=function(e){return function(t){this[e]=+t}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||={}).offset=function(e){if(!e||e===`Z`)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return n===0?0:t[0]===`+`?-n:n}(e)}],u=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},d=function(e,t){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?`pm`:`PM`);return n},f={A:[a,function(e){this.afternoon=d(e,!1)}],a:[a,function(e){this.afternoon=d(e,!0)}],Q:[n,function(e){this.month=3*(e-1)+1}],S:[n,function(e){this.milliseconds=100*e}],SS:[r,function(e){this.milliseconds=10*e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[i,c(`seconds`)],ss:[i,c(`seconds`)],m:[i,c(`minutes`)],mm:[i,c(`minutes`)],H:[i,c(`hours`)],h:[i,c(`hours`)],HH:[i,c(`hours`)],hh:[i,c(`hours`)],D:[i,c(`day`)],DD:[r,c(`day`)],Do:[a,function(e){var t=o.ordinal,n=e.match(/\d+/);if(this.day=n[0],t)for(var r=1;r<=31;r+=1)t(r).replace(/\[|\]/g,``)===e&&(this.day=r)}],w:[i,c(`week`)],ww:[r,c(`week`)],M:[i,c(`month`)],MM:[r,c(`month`)],MMM:[a,function(e){var t=u(`months`),n=(u(`monthsShort`)||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(n<1)throw Error();this.month=n%12||n}],MMMM:[a,function(e){var t=u(`months`).indexOf(e)+1;if(t<1)throw Error();this.month=t%12||t}],Y:[/[+-]?\d+/,c(`year`)],YY:[r,function(e){this.year=s(e)}],YYYY:[/\d{4}/,c(`year`)],Z:l,ZZ:l};function p(n){for(var r=n,i=o&&o.formats,a=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var a=r&&r.toUpperCase();return n||i[r]||e[r]||i[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),s=a.length,c=0;c<s;c+=1){var l=a[c],u=f[l],d=u&&u[0],p=u&&u[1];a[c]=p?{regex:d,parser:p}:l.replace(/^\[|\]$/g,``)}return function(e){for(var t={},n=0,r=0;n<s;n+=1){var i=a[n];if(typeof i==`string`)r+=i.length;else{var o=i.regex,c=i.parser,l=e.slice(r),u=o.exec(l)[0];c.call(t,u),e=e.replace(u,``)}}return function(e){var t=e.afternoon;if(t!==void 0){var n=e.hours;t?n<12&&(e.hours+=12):n===12&&(e.hours=0),delete e.afternoon}}(t),t}}return function(e,t,n){n.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(s=e.parseTwoDigitYear);var r=t.prototype,i=r.parse;r.parse=function(e){var t=e.date,r=e.utc,a=e.args;this.$u=r;var s=a[1];if(typeof s==`string`){var c=!0===a[2],l=!0===a[3],u=c||l,d=a[2];l&&(d=a[2]),o=this.$locale(),!c&&d&&(o=n.Ls[d]),this.$d=function(e,t,n,r){try{if([`x`,`X`].indexOf(t)>-1)return new Date((t===`X`?1e3:1)*e);var i=p(t)(e),a=i.year,o=i.month,s=i.day,c=i.hours,l=i.minutes,u=i.seconds,d=i.milliseconds,f=i.zone,m=i.week,h=new Date,g=s||(a||o?1:h.getDate()),_=a||h.getFullYear(),v=0;a&&!o||(v=o>0?o-1:h.getMonth());var y,b=c||0,x=l||0,S=u||0,C=d||0;return f?new Date(Date.UTC(_,v,g,b,x,S,C+60*f.offset*1e3)):n?new Date(Date.UTC(_,v,g,b,x,S,C)):(y=new Date(_,v,g,b,x,S,C),m&&(y=r(y).week(m).toDate()),y)}catch{return new Date(``)}}(t,s,r,n),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),u&&t!=this.format(s)&&(this.$d=new Date(``)),o={}}else if(s instanceof Array)for(var f=s.length,m=1;m<=f;m+=1){a[1]=s[m-1];var h=n.apply(this,a);if(h.isValid()){this.$d=h.$d,this.$L=h.$L,this.init();break}m===f&&(this.$d=new Date(``))}else i.call(this,e)}}}))})),tke=o(((e,t,n)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_localizedFormat=r()})(n,(function(){var e={LTS:`h:mm:ss A`,LT:`h:mm A`,L:`MM/DD/YYYY`,LL:`MMMM D, YYYY`,LLL:`MMMM D, YYYY h:mm A`,LLLL:`dddd, MMMM D, YYYY h:mm A`};return function(t,n,r){var i=n.prototype,a=i.format;r.en.formats=e,i.format=function(t){t===void 0&&(t=`YYYY-MM-DDTHH:mm:ssZ`);var n=this.$locale().formats,r=function(t,n){return t.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,r,i){var a=i&&i.toUpperCase();return r||n[i]||e[i]||n[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))}(t,n===void 0?{}:n);return a.call(this,r)}}}))})),nke=o(((e,t,n)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_utc=r()})(n,(function(){var e=`minute`,t=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(r,i,a){var o=i.prototype;a.utc=function(e){return new i({date:e,utc:!0,args:arguments})},o.utc=function(t){var n=a(this.toDate(),{locale:this.$L,utc:!0});return t?n.add(this.utcOffset(),e):n},o.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var s=o.parse;o.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),s.call(this,e)};var c=o.init;o.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else c.call(this)};var l=o.utcOffset;o.utcOffset=function(r,i){var a=this.$utils().u;if(a(r))return this.$u?0:a(this.$offset)?l.call(this):this.$offset;if(typeof r==`string`&&(r=function(e){e===void 0&&(e=``);var r=e.match(t);if(!r)return null;var i=(``+r[0]).match(n)||[`-`,0,0],a=i[0],o=60*i[1]+ +i[2];return o===0?0:a===`+`?o:-o}(r),r===null))return this;var o=Math.abs(r)<=16?60*r:r;if(o===0)return this.utc(i);var s=this.clone();if(i)return s.$offset=o,s.$u=!1,s;var c=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(s=this.local().add(o+c,e)).$offset=o,s.$x.$localOffset=c,s};var u=o.format;o.format=function(e){var t=e||(this.$u?`YYYY-MM-DDTHH:mm:ss[Z]`:``);return u.call(this,t)},o.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},o.isUTC=function(){return!!this.$u},o.toISOString=function(){return this.toDate().toISOString()},o.toString=function(){return this.toDate().toUTCString()};var d=o.toDate;o.toDate=function(e){return e===`s`&&this.$offset?a(this.format(`YYYY-MM-DD HH:mm:ss:SSS`)).toDate():d.call(this)};var f=o.diff;o.diff=function(e,t,n){if(e&&this.$u===e.$u)return f.call(this,e,t,n);var r=this.local(),i=a(e).local();return f.call(r,i,t,n)}}}))})),CH=l($Oe(),1),wH=l(eke(),1),TH=l(tke(),1),EH=l(nke(),1),DH=RegExp(`[\\p{Z}[\\p{C}--[\\u200C\\u200D]]!"#$%\\x26'\\(\\)*+,\\/:;<=>?@\\[\\\\\\]^\`\\{\\|\\}]`,`v`),OH=/[^\w-~]/,kH=({loader:e,notLoadedMessage:t})=>{let n,r,i=tl(!1),a=async()=>(r??=(async()=>{let t;try{t=await e()}catch(e){throw r=void 0,e}return n=t,i.current=!0,t})(),r);return{loaded:i,load:a,preload:()=>{a().catch(()=>{})},get:()=>{if(!n)throw Error(t);return n},reset:()=>{n=void 0,r=void 0,i.current=!1}}},rke=/\p{M}/gu,AH=kH({loader:async()=>(await Jc(`@sindresorhus/transliterate`,`index.js`)).default,notLoadedMessage:`The transliterate library is not loaded yet.`}),ike=async()=>{try{await AH.load()}catch(e){console.error(`Failed to load the transliterate library`,e)}},ake=(e,t)=>{let n=e.normalize(`NFD`);return AH.loaded.current?AH.get()(n,{locale:t?.replaceAll(`_`,`-`)}):n.replaceAll(rke,``)};AH.reset;var oke=/^\.+/,ske=/\.+$/,cke={unicode:new RegExp(DH,`gv`),ascii:new RegExp(OH,`g`)},lke=new Map,jH=e=>{let t=Fc(e);return Nl(lke,t,()=>({consecutivePattern:RegExp(`(?:${t})+`,`g`),trimPattern:RegExp(`^(?:${t})+|(?:${t})+$`,`g`),leadingDotsPattern:RegExp(`^(?:\\.|${t})+`),trailingDotsPattern:RegExp(`(?:\\.|${t})+$`)}))},MH=({sanitize_replacement:e=`-`,trim:t=!0}={})=>e&&t?jH(e).trailingDotsPattern:ske,NH=e=>e.replace(MH(Dl.current?.slug),``),PH=()=>Dl.current?.slug?.timezone===`local`?void 0:`UTC`,FH=(e,{fallback:t=!0,locale:n=void 0,maxLength:r=void 0}={})=>{let{slug:{encoding:i=`unicode`,clean_accents:a=!1,sanitize_replacement:o=`-`,maxlength:s=void 0,trim:c=!0,lowercase:l=!0}={}}=Dl.current??{},u=r??s,d=e;a&&(d=ake(d,n)),d=d.replaceAll(cke[i===`ascii`?`ascii`:`unicode`],` `),d=d.trim().replaceAll(/\s+/g,o);let f=oke;if(o){let e=jH(o);d=d.replace(e.consecutivePattern,o),c&&(d=d.replace(e.trimPattern,``),{leadingDotsPattern:f}=e)}let p=MH({sanitize_replacement:o,trim:c});return d=d.replace(f,``),d=d.replace(p,``),!d&&t&&(d=jc(`short`)),typeof u==`number`&&d.length>u&&(d=Ic(d,u,{ellipsis:``}),d=d.replace(p,``)),l&&(d=d.toLowerCase()),d},IH=e=>FH(e.trim(),{fallback:!1}),LH=({takenNames:e,name:t,format:n=IH,isReserved:r=void 0})=>{let i=t.trim();if(!i)return`empty`;let a=n(i);if(!a||i.includes(`/`)||i.startsWith(`.`)||a.startsWith(`.`))return`invalid`;if(r?.(a))return`reserved`;let o=a.normalize().toLowerCase();return e.some(e=>e.normalize().toLowerCase()===o)?`duplicate`:void 0},uke=new Set([`local`,`utc`]),RH=new WeakMap,zH=e=>typeof e==`string`&&!uke.has(e),BH=e=>{let t=RH.get(e);if(t)return t;let{type:n=`datetime-local`,min:r=void 0,max:i=void 0,step:a=void 0,format:o,date_format:s=void 0,time_format:c=void 0,picker_utc:l=!1,input_timezone:u=`local`,output_utc:d=!1}=e,f=typeof u==`string`&&u!==`any`?u:`local`,p=typeof s==`string`?s:``,m=typeof c==`string`?c:``,h=n===`date`||c===!1,g=n===`time`||s===!1,_=h?`9999-12-31`:g?void 0:`9999-12-31T23:59`,v=e.input_timezone===void 0?l?`utc`:`local`:f,y={type:h?`date`:g?`time`:`datetime-local`,min:typeof r==`string`&&r?r:void 0,max:typeof i==`string`&&i?i:_,step:typeof a==`number`&&Number.isInteger(a)&&a>0||a===`any`?a:void 0,format:o||[p,m].join(` `).trim()||void 0,dateOnly:h,timeOnly:g,inputTimeZone:v,outputUTC:e.output_utc===void 0?l:d,utc:v===`utc`,singleCustomTimeZone:zH(v)?v:void 0};return RH.set(e,y),y},dke=async e=>(await Jc(`dayjs`,`esm/locale/${e}.js`)).default,fke=new Set(`af,am,ar-iq,ar-dz,ar-kw,ar-ly,ar-ma,ar-sa,ar-tn,ar,az,be,bg,bi,bm,bn-bd,bn,bo,br,bs,ca,cs,cv,cy,da,de-at,de-ch,de,dv,en-au,el,en-gb,en-ie,en-il,en-in,en-nz,en-sg,en-tt,en-ca,en,eo,es-mx,es-pr,es-us,es-do,et,eu,fa,fi,fr-ca,fr-ch,fr,fo,fy,ga,gd,gl,gom-latn,gu,he,hi,hr,ht,hu,hy-am,id,is,it-ch,it,jv,ka,kk,km,ko,ku,ky,kn,lb,ja,lt,lv,me,mi,mk,ml,mn,mr,ms-my,ms,mt,lo,my,nb,ne,nl,nl-be,nn,pa-in,pl,pt-br,pt,rn,ro,es,ru,rw,sd,se,si,sk,sl,oc-lnc,sq,sr-cyrl,sr,ss,sv-fi,sv,sw,ta,te,tet,tg,th,tl-ph,tlh,tr,tzl,tzm,ug-cn,uk,tk,ur,uz-latn,uz,vi,x-pseudo,tzm-latn,yo,zh-cn,zh-hk,zh-tw,zh`.split(`,`)),VH=new Set([`en`]),HH=new Map,pke=new Map,mke=e=>{let t;try{t=new Intl.Locale(e)}catch{return}let{language:n,script:r,region:i}=t,a=[e.toLowerCase()];return r&&i&&a.push(`${n}-${r}-${i}`),r&&a.push(`${n}-${r}`),i&&a.push(`${n}-${i}`),r&&!i&&a.push(`${n}-${t.maximize().region}`),a.push(n),a.map(e=>e.toLowerCase()).find(e=>fke.has(e))},UH=e=>Nl(pke,e,()=>mke(e)),hke=e=>{if(VH.has(e))return Promise.resolve();let t=HH.get(e);return t||(t=(async()=>{try{CH.default.locale(await dke(e),void 0,!0),VH.add(e)}catch(t){console.error(`Failed to load the Day.js locale “${e}”`,t)}finally{HH.delete(e)}})(),HH.set(e,t)),t},gke=async e=>{let t=new Set([...e].map(UH).filter(e=>e!==void 0));await Promise.all([...t].map(hke))},WH=(e,t)=>{let{localize_format:n}=e,r=typeof n==`string`?n:n===!0&&t&&t!==`_default`?t:void 0;if(!r)return;let i=UH(r);return i&&i!==`en`&&VH.has(i)?i:void 0},_ke=o(((e,t,n)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_advancedFormat=r()})(n,(function(){return function(e,t){var n=t.prototype,r=n.format;n.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return r.bind(this)(e);var i=this.$utils(),a=(e||`YYYY-MM-DDTHH:mm:ssZ`).replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(e){switch(e){case`Q`:return Math.ceil((t.$M+1)/3);case`Do`:return n.ordinal(t.$D);case`gggg`:return t.weekYear();case`GGGG`:return t.isoWeekYear();case`wo`:return n.ordinal(t.week(),`W`);case`w`:case`ww`:return i.s(t.week(),e===`w`?1:2,`0`);case`W`:case`WW`:return i.s(t.isoWeek(),e===`W`?1:2,`0`);case`k`:case`kk`:return i.s(String(t.$H===0?24:t.$H),e===`k`?1:2,`0`);case`X`:return Math.floor(t.$d.getTime()/1e3);case`x`:return t.$d.getTime();case`z`:return`[`+t.offsetName()+`]`;case`zzz`:return`[`+t.offsetName(`long`)+`]`;default:return e}}));return r.bind(this)(a)}}}))})),vke=o(((e,t,n)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_timezone=r()})(n,(function(){var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(n,r,i){var a,o=function(e,n,r){r===void 0&&(r={});var i=new Date(e);return function(e,n){n===void 0&&(n={});var r=n.timeZoneName||`short`,i=e+`|`+r,a=t[i];return a||(a=new Intl.DateTimeFormat(`en-US`,{hour12:!1,timeZone:e,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,timeZoneName:r}),t[i]=a),a}(n,r).formatToParts(i)},s=function(t,n){for(var r=o(t,n),a=[],s=0;s<r.length;s+=1){var c=r[s],l=c.type,u=c.value,d=e[l];d>=0&&(a[d]=parseInt(u,10))}var f=a[3],p=f===24?0:f,m=a[0]+`-`+a[1]+`-`+a[2]+` `+p+`:`+a[4]+`:`+a[5]+`:000`,h=+t;return(i.utc(m).valueOf()-(h-=h%1e3))/6e4},c=r.prototype;c.tz=function(e,t){if(e===void 0&&(e=a),!this.isValid())return this;var n,r=this.utcOffset(),o=this.toDate(),c=o.toLocaleString(`en-US`,{timeZone:e}),l=s(+o,e);if(!Number(l))n=this.utcOffset(0,t);else if(n=i(c,{locale:this.$L}).$set(`millisecond`,this.$ms).utcOffset(l,!0),t){var u=n.utcOffset();n=n.add(r-u,`minute`)}return n.$x.$timezone=e,n},c.offsetName=function(e){var t=this.$x.$timezone||i.tz.guess(),n=o(this.valueOf(),t,{timeZoneName:e}).find((function(e){return e.type.toLowerCase()===`timezonename`}));return n&&n.value};var l=c.startOf;c.startOf=function(e,t){if(!this.$x||!this.$x.$timezone)return l.call(this,e,t);var n=i(this.format(`YYYY-MM-DD HH:mm:ss:SSS`),{locale:this.$L});return l.call(n,e,t).tz(this.$x.$timezone,!0)},i.tz=function(e,t,n){var r=n&&t,o=n||t||a,c=s(+i(),o);if(typeof e!=`string`)return i(e).tz(o);var l=i.utc(e,r).valueOf();if(Number.isNaN(l)){var u=i(NaN);return u.$x.$timezone=o,u}var d=function(e,t,n){var r=e-60*t*1e3,i=s(r,n);if(t===i)return[r,t];var a=s(r-=60*(i-t)*1e3,n);return i===a?[r,i]:[e-60*Math.min(i,a)*1e3,Math.max(i,a)]}(l,c,o),f=d[0],p=d[1],m=i(f).utcOffset(p);return m.$x.$timezone=o,m},i.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},i.tz.setDefault=function(e){a=e}}}))})),GH=l(_ke(),1),KH=l(vke(),1);CH.default.extend(GH.default),CH.default.extend(wH.default),CH.default.extend(TH.default),CH.default.extend(EH.default),CH.default.extend(KH.default);var qH=e=>e instanceof Date&&!Number.isNaN(e.getTime()),JH=e=>e?CH.default.utc:CH.default,YH=/\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}(?::?\d{2})?)$/i,yke=/[XxZ]/,bke=/[AaHhkmSsXx]|LT|LLL|lll/,XH=e=>e.replaceAll(/\[.*?]/g,``),ZH=e=>yke.test(XH(e)),QH=(e,t)=>YH.test(e)&&bke.test(XH(t))&&!ZH(t),$H=(e,t,n,r)=>e(t,n,r,QH(t,n)),eU=({value:e,format:t,parseAsUTC:n,localeKey:r})=>{let i=JH(n),a=$H(i,e,t,r);return a.isValid()?a:i(e)},tU=(e,t,n)=>(n?e.locale(n):e).format(t),nU=(e,t)=>t===`UTC`?e.toDate():CH.default.tz(e.format(`YYYY-MM-DDTHH:mm:ss.SSS`),t).toDate(),rU=(e,t)=>{if(!t||YH.test(e))return new Date(e);let n=CH.default.utc(e);return n.isValid()?nU(n,t):void 0},iU=e=>{let{format:t,dateOnly:n,utc:r,outputUTC:i,singleCustomTimeZone:a}=BH(e);return r||t&&i?`UTC`:n?void 0:a},aU=(e,t,n)=>{let{format:r,timeOnly:i}=BH(t);if(!e)return;let a=iU(t),o;if(r){let i=WH(t,n);if(a===`UTC`||!a){let t=eU({value:e,format:r,parseAsUTC:a===`UTC`,localeKey:i});o=t.isValid()?t.toDate():void 0}else{let t=$H(JH(!0),e,r,i);o=t.isValid()?ZH(r)?t.toDate():nU(t,a):rU(e,a)}}else o=rU(i?`${new Date().toJSON().split(`T`)[0]}T${e}`:e,a);if(qH(o))return o;console.error(`Invalid Date`,e)},xke=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),oU={0:`�`,128:`€`,130:`‚`,131:`ƒ`,132:`„`,133:`…`,134:`†`,135:`‡`,136:`ˆ`,137:`‰`,138:`Š`,139:`‹`,140:`Œ`,142:`Ž`,145:`‘`,146:`’`,147:`“`,148:`”`,149:`•`,150:`–`,151:`—`,152:`˜`,153:`™`,154:`š`,155:`›`,156:`œ`,158:`ž`,159:`Ÿ`};function sU(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=48&&t<=57}function Ske(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function Cke(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function cU(e){return Cke(e)||sU(e)}var lU=document.createElement(`i`);function uU(e){let t=`&`+e+`;`;lU.innerHTML=t;let n=lU.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}var wke=[``,`Named character references must be terminated by a semicolon`,`Numeric character references must be terminated by a semicolon`,`Named character references cannot be empty`,`Numeric character references cannot be empty`,`Named character references must be known`,`Numeric character references cannot be disallowed`,`Numeric character references cannot be outside the permissible Unicode range`];function dU(e,t){let n=t||{},r=typeof n.additional==`string`?n.additional.charCodeAt(0):n.additional,i=[],a=0,o=-1,s=``,c,l;n.position&&(`start`in n.position||`indent`in n.position?(l=n.position.indent,c=n.position.start):c=n.position);let u=(c?c.line:0)||1,d=(c?c.column:0)||1,f=m(),p;for(a--;++a<=e.length;)if(p===10&&(d=(l?l[o]:0)||1),p=e.charCodeAt(a),p===38){let t=e.charCodeAt(a+1);if(t===9||t===10||t===12||t===32||t===38||t===60||Number.isNaN(t)||r&&t===r){s+=String.fromCharCode(p),d++;continue}let o=a+1,c=o,l=o,u;if(t===35){l=++c;let t=e.charCodeAt(l);t===88||t===120?(u=`hexadecimal`,l=++c):u=`decimal`}else u=`named`;let _=``,v=``,y=``,b=u===`named`?cU:u===`decimal`?sU:Ske;for(l--;++l<=e.length;){let t=e.charCodeAt(l);if(!b(t))break;y+=String.fromCharCode(t),u===`named`&&xke.includes(y)&&(_=y,v=uU(y))}let x=e.charCodeAt(l)===59;if(x){l++;let e=u===`named`&&uU(y);e&&(_=y,v=e)}let S=1+l-o,C=``;if(x||n.nonTerminated!==!1){if(!y)u!==`named`&&h(4,S);else if(u===`named`){if(x&&!v)h(5,1);else if(_!==y&&(l=c+_.length,S=1+l-c,x=!1),!x){let t=_?1:3;if(n.attribute){let n=e.charCodeAt(l);n===61?(h(t,S),v=``):cU(n)?v=``:h(t,S)}else h(t,S)}C=v}else{x||h(2,S);let e=Number.parseInt(y,u===`hexadecimal`?16:10);if(Tke(e))h(7,S),C=`�`;else if(e in oU)h(6,S),C=oU[e];else{let t=``;Eke(e)&&h(6,S),e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10|55296),e=56320|e&1023),C=t+String.fromCharCode(e)}}}if(C){g(),f=m(),a=l-1,d+=l-o+1,i.push(C);let t=m();t.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,C,{start:f,end:t},e.slice(o-1,l)),f=t}else y=e.slice(o-1,l),s+=y,d+=y.length,a=l-1}else p===10&&(u++,o++,d=0),Number.isNaN(p)?g():(s+=String.fromCharCode(p),d++);return i.join(``);function m(){return{line:u,column:d,offset:a+((c?c.offset:0)||0)}}function h(e,t){let r;n.warning&&(r=m(),r.column+=t,r.offset+=t,n.warning.call(n.warningContext||void 0,wke[e],r,e))}function g(){s&&=(i.push(s),n.text&&n.text.call(n.textContext||void 0,s,{start:f,end:m()}),``)}}function Tke(e){return e>=55296&&e<=57343||e>1114111}function Eke(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534}var Dke=e=>{let t=e,n=!0;for(;n;){let e=t;t=t.replaceAll(/([_*`~])([^_*`~]+)\1/g,`$2`),t=t.replaceAll(/([_*`~]{2,3})(.+?)\1/g,`$2`),n=t!==e}return t},Oke=new cr,kke=RegExp(`<(?:br|hr)\\b[^>]*>|</(?:address|article|aside|blockquote|caption|dd|details|div|dl|dt|figcaption|figure|footer|h[1-6]|header|li|main|nav|ol|p|pre|section|summary|table|tbody|td|tfoot|th|thead|tr|ul)\\s*>`,`gi`),Ake=new Map,fU=e=>Ll(Ake,e,()=>dU(dt(Oke.parse(e).replaceAll(kke,`$& `),{ALLOWED_TAGS:[]})).replaceAll(/\s+/g,` `).trim(),100);CH.default.extend(wH.default),CH.default.extend(TH.default),CH.default.extend(EH.default);var jke=/^\d{4}-[01]\d-[0-3]\d$/,Mke=/T\d{2}:\d{2}(?::\d{2})?(?:\.\d+)?Z$/,pU=Object.freeze([`date`,`default`,`localize`,`lower`,`plainify`,`slugify`,`ternary`,`truncate`,`upper`]),mU=/^[A-Za-z_]\w*$/,Nke=RegExp(`^(?<method>${mU.source.slice(1,-1)})(?:\\((?<args>.*)\\))?$`,`s`),Pke=/\s*(?:'(?<string>.*?)'|(?<number>-?\d+(?:\.\d+)?))\s*(?<separator>,|$)/sy,Fke=Object.entries({date:/^date\('(?<format>.+?)'(?:,\s*'(?<timeZone>.+?)')?\)$/,default:/^default\('(?<defaultValue>.*?)'\)$/,ternary:/^ternary\('(?<truthyValue>.*?)',\s*'(?<falsyValue>.*?)'\)$/,truncate:/^truncate\((?<max>\d+)(?:,\s*'(?<ellipsis>.*?)')?\)$/}),Ike=e=>{let t=[];if(!e.trim())return t;let n=new RegExp(Pke),r;do{let i=n.exec(e)?.groups;if(!i)return;t.push(i.string??Number(i.number)),{separator:r}=i}while(r);return t},Lke=e=>{for(let[t,n]of Fke){let r=Object.entries(e.match(n)?.groups??{});if(r.length)return{method:t,args:Object.fromEntries(r.filter(([,e])=>e!==void 0))}}let{method:t,args:n}=e.match(Nke)?.groups??{};if(t&&!pU.includes(t)){if(n===void 0)return{method:t,args:{}};let e=Ike(n);if(e)return{method:t,args:{},customArgs:e}}return{method:e,args:{}}},hU=e=>{let t=[],n=``,r=!1;for(let i=0;i<e.length;i+=1){let a=e[i];a===`'`&&(!r&&[`(`,`,`].includes(Zd(e,i,-1))?r=!0:r&&[`,`,`)`].includes(Zd(e,i,1))&&(r=!1)),a===`|`&&!r?(t.push(n.trim()),n=``):n+=a}return t.push(n.trim()),t},Rke=new Map,gU=e=>Ll(Rke,e,()=>{let[t,...n]=hU(e.trim());return Object.freeze({value:t,transformations:Object.freeze(n.map(e=>{let{method:t,args:n,customArgs:r}=Lke(e);return Object.freeze({method:t,args:Object.freeze(n),...r?{customArgs:Object.freeze(r)}:{}})}))})},500),zke=e=>String(e??``).toUpperCase(),Bke=e=>String(e??``).toLowerCase(),Vke=(e,{format:t,timeZone:n},r,i)=>{let a=String(e),{format:o,dateOnly:s,utc:c}=BH(r),l=o?WH(r,i):void 0,u=n===`utc`||c||s&&!!a.match(jke)||s&&!!a.match(Mke),d=o&&!(e instanceof Date)?eU({value:a,format:o,parseAsUTC:u,localeKey:l}):JH(u)(a);return d.isValid()?tU(d,t,l):``},Hke=(e,{defaultValue:t})=>e?String(e):t,Uke=(e,{truthyValue:t,falsyValue:n})=>e?t:n,Wke=(e,{max:t,ellipsis:n=`…`})=>Ic(String(e??``),Number(t),{ellipsis:n}),Gke=e=>fU(String(e??``)),Kke=new WeakMap,qke=({method:e,transform:t,value:n,customArgs:r,locale:i})=>{try{let e=t(n,{args:[...r??[]],locale:i===`_default`?void 0:i});if(typeof e?.then==`function`)throw e.then(void 0,()=>void 0),TypeError(`The function must return a string, not a Promise`);return String(e??``)}catch(r){let i=Nl(Kke,t,()=>new Set);return i.has(e)||(i.add(e),console.error(`The custom “${e}” string transformation failed. Further errors are not logged:`,r)),String(n??``)}},Jke=({fieldConfig:e,value:t,transformation:n,locale:r})=>{let{method:i,args:a,customArgs:o}=n;switch(i){case`upper`:return zke(t);case`lower`:return Bke(t);case`plainify`:return Gke(t);case`slugify`:return FH(String(t??``),{fallback:!1,locale:r});case`date`:return Vke(t,a,e??{},r);case`default`:return Hke(t,a);case`ternary`:return Uke(t,a);case`truncate`:return Wke(t,a);default:{let e=Gd.get(i);return e?qke({method:i,transform:e,value:t,customArgs:o,locale:r}):String(t)}}},_U=({fieldConfig:e,value:t,transformations:n,locale:r})=>(n.forEach(n=>{t=Jke({fieldConfig:e,value:t,transformation:n,locale:r})}),t),Yke=/^\d{4}-[01]\d-[0-3]\d$/,Xke=/T00:00(?::00)?(?:\.000)?Z$/,vU={year:`numeric`,month:`short`,day:`numeric`},yU={hour:`numeric`,minute:`numeric`,hour12:!0},Zke={...vU,...yU},Qke=new Map,bU=(e,t)=>Number.isNaN(e.getTime())?`Invalid Date`:Nl(Qke,t??``,()=>new Intl.DateTimeFormat(t??void 0,Zke)).format(e),xU={year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,timeZoneName:`longOffset`},SU=new Map,$ke=e=>{let t=e??``,n=SU.get(t);return n||(n=new Intl.DateTimeFormat(`en-US`,{...xU,hourCycle:`h23`,timeZone:e}),SU.set(t,n)),n},CU=({date:e=new Date,timeZone:t=void 0}={})=>Object.fromEntries($ke(t).formatToParts(e).filter(({type:e})=>e in xU).map(({type:e,value:t})=>[e,t])),eAe=/(?<hours>[+-]\d{2})(?::?(?<minutes>\d{2}))?(?::?(?<seconds>\d{2}))?(?:\.\d+)?$|Z$/,wU=e=>String(Math.abs(Number(e))).padStart(2,`0`),tAe=new Map,TU=(e,t)=>{if(typeof e!=`string`||!e.trim())return;let{inputTimeZone:n}=BH(t);if(n===`local`||n===`utc`)return;let r=new Date(e);if(Number.isNaN(r.getTime()))return;let i=e.match(eAe);if(!i?.groups)return;let{hours:a,minutes:o=`0`}=i.groups,s=i[0]===`Z`?`+00:00`:`${a.startsWith(`-`)?`-`:`+`}${wU(a)}:${wU(o)}`;return(Nl(tAe,n,()=>new Intl.DateTimeFormat(`en-US`,{timeZone:n,timeZoneName:`longOffset`})).formatToParts(r).find(e=>e.type===`timeZoneName`)?.value??``).replace(`GMT`,``)===s?n:void 0},nAe=(e,t)=>{let n=TU(e,t);if(n)return n;let{inputTimeZone:r,singleCustomTimeZone:i}=BH(t);if(i)return i;try{let e=Intl.DateTimeFormat().resolvedOptions().timeZone;if(r===`local`)return e}catch{return r===`local`?``:void 0}},EU=(e,t=new Date)=>{try{let n=new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`longOffset`}).formatToParts(t).find(e=>e.type===`timeZoneName`)?.value??``,r=e.split(`/`).pop()?.replaceAll(`_`,` `)??e;return`(${n.replace(`GMT`,``)}) ${r}`}catch{return e}};CH.default.extend(GH.default),CH.default.extend(wH.default),CH.default.extend(TH.default),CH.default.extend(EH.default),CH.default.extend(KH.default);var rAe=/^(?<date>\d{4}-[01]\d-[0-3]\d)(?:T00:00(?::00)?(?:\.000)?Z)?$/,iAe=/(?:^|T)(?<time>[0-2]\d:[0-5]\d)(?!\d)/,aAe=/(?:^|T)[0-2]\d:[0-5]\d:[0-5]\d/,DU=({date:e,timeZone:t,inputTimeZone:n,dateOnly:r,timeOnly:i,includeUTCSeconds:a=!1,includeSeconds:o=!1})=>{let s=t||(n===`utc`?`UTC`:void 0),{year:c,month:l,day:u,hour:d,minute:f,second:p}=CU({date:e,timeZone:s}),m=`${c}-${l}-${u}`,h=`${d}:${f}${o?`:${p}`:``}`;return r?m:i?h:a&&s===`UTC`?`${m}T${h}${o?``:`:00`}.000Z`:`${m}T${h}`},oAe=({newValue:e,currentValue:t,fieldConfig:n,locale:r})=>{if(e===void 0||e===t)return!1;let i=aU(e,n,r),a=aU(t,n,r);return i!==void 0&&a!==void 0?i.getTime()!==a.getTime():i!==void 0||a!==void 0||e===``},OU=(e,t,{date:n=void 0,includeSeconds:r=!1}={})=>{let{dateOnly:i,timeOnly:a,inputTimeZone:o}=BH(e);return DU({date:n,timeZone:t,inputTimeZone:o,dateOnly:i,timeOnly:a,includeUTCSeconds:!0,includeSeconds:r})},kU=(e,t,n)=>{let r=e.valueOf(),i=e.utcOffset(),a=CH.default.utc(r+i*6e4),o=t.replaceAll(/\[[^\]]+]|X|x/g,e=>e===`X`?`[${Math.floor(r/1e3)}]`:e===`x`?`[${r}]`:e);return(n?a.locale(n):a).utcOffset(i,!0).format(o)},AU=(e,t,n,r)=>{let i=iU(n);return i?kU(e.utcOffset(e.tz(i).utcOffset()),t,r):tU(e,t,r)},jU=({inputValue:e,currentValue:t,fieldConfig:n,timeZone:r,outputUTC:i,locale:a})=>{let{format:o,dateOnly:s,timeOnly:c,inputTimeZone:l,outputUTC:u}=BH(n),d=i??u,f=!!e&&aAe.test(e),p=f?`HH:mm:ss`:`HH:mm`,m=s?`YYYY-MM-DD`:c?p:`YYYY-MM-DDT${p}`,h=l===`utc`?`UTC`:l===`local`?d?r:void 0:r||l;if(e===``)return``;if(!e)return;if(o){let t=WH(n,a),r=JH(!!h),i=r(e,m);if(i.isValid()||(i=r(e)),!i.isValid())return``;if(s)return tU(i,o,t);if(!h)return tU(d?i.utc():i,o,t);let c=CH.default.tz(i.format(`YYYY-MM-DDTHH:mm:ss`),h);return d?tU(c.utc(),o,t):kU(c,o,t)}if(s)return e;let g=t?`:00${t.endsWith(`.000`)?`.000`:``}`:`:00`;if(c){let t=f?e:`${e}${g}`;return l===`utc`?`${t}Z`:t}return l===`utc`?CH.default.utc(e).format():d?(r?CH.default.tz(e,r):(0,CH.default)(e)).utc().format():r&&l!==`local`?kU(CH.default.tz(e,r),`YYYY-MM-DDTHH:mm:ssZ`):f?e:`${e}${g}`},MU=(e,{date:t=void 0,includeSeconds:n=!1,locale:r=void 0}={})=>{let{singleCustomTimeZone:i,outputUTC:a}=BH(e);return jU({inputValue:OU(e,i,{date:t,includeSeconds:n}),currentValue:``,fieldConfig:e,timeZone:i,outputUTC:a,locale:r})},NU=({currentValue:e,fieldConfig:t,timeZone:n,locale:r})=>{let{dateOnly:i,timeOnly:a,inputTimeZone:o,format:s}=BH(t),c=TU(e,t)??n,l=s?WH(t,r):void 0;if(!e)return``;let u=s&&(0,CH.default)(e,s,l,!0).isValid()?void 0:i?e.match(rAe)?.groups?.date:a?e.match(iAe)?.groups?.time:void 0;if(u)return u;if(i&&s){let t=eU({value:e,format:s,parseAsUTC:!1,localeKey:l});return t.isValid()?t.format(`YYYY-MM-DD`):``}let d=aU(e,t,r);return d?DU({date:d,timeZone:c,inputTimeZone:o,dateOnly:i,timeOnly:a}):``},sAe=({fieldConfig:e,value:t,sourceLocale:n,targetLocale:r})=>{if(e.widget!==`datetime`||e.localize_format!==!0||typeof t!=`string`||!t)return t;let i=e,{format:a}=BH(i),o=WH(i,n),s=WH(i,r);if(!a||o===s)return t;let c=eU({value:t,format:a,parseAsUTC:!0,localeKey:o});return c.isValid()?tU(c,a,s??`en`):t};CH.default.extend(GH.default),CH.default.extend(wH.default),CH.default.extend(TH.default),CH.default.extend(EH.default),CH.default.extend(KH.default);var cAe=new Map,PU=({locale:e,parts:t,timeZone:n})=>Nl(cAe,[e,t,n].join(`|`),()=>t===`time`?new Intl.DateTimeFormat(e,{...yU,timeZone:n}):t===`date`?new Intl.DateTimeFormat(e,{...vU,timeZone:n}):new Intl.DateTimeFormat(e,{...vU,...yU,timeZone:n,timeZoneName:void 0})),lAe=/[+-]\d{2}:?\d{2}/g,uAe=(e,t,n,r)=>[...new Set(e.match(lAe))].some(i=>kU(t.utcOffset(i),n,r)===e),FU=({locale:e,fieldConfig:t,currentValue:n})=>{let{format:r,dateOnly:i,timeOnly:a,utc:o,singleCustomTimeZone:s}=BH(t),c=o?`UTC`:s;if(typeof n!=`string`||!n.trim())return``;if(r){let i=WH(t,e);if(QH(n,r)){let a=aU(n,t,e);return a?AU((0,CH.default)(a),r,t,i):``}let a=eU({value:n,format:r,parseAsUTC:o,localeKey:i});return a.isValid()?ZH(r)?uAe(n,a,r,i)?n:AU(a,r,t,i):a.format(r):(console.error(`Invalid Date`,n),``)}let l=aU(n,t,e),u=Ef(e);return qH(l)?a?PU({locale:u,parts:`time`,timeZone:c}).format(l):i?PU({locale:u,parts:`date`,timeZone:o||Yke.test(n)||Xke.test(n)?`UTC`:c}).format(l):PU({locale:u,parts:`datetime`,timeZone:c}).format(l):``},dAe=new Map,IU=e=>Nl(dAe,e,()=>Intl.NumberFormat(e,{maximumFractionDigits:20})),LU=({widget:e,value_type:t})=>t??(e===`compute`?`string`:`int`),RU=e=>[`float`,`float/string`].includes(LU(e)),zU=e=>![`int`,`float`].includes(LU(e)),BU=e=>e.widget===`number`||e.widget===`compute`&&LU(e)!==`string`,VU=e=>(e.widget===`number`||e.widget===`compute`)&&!zU(e),HU=e=>typeof e==`number`?e:typeof e==`string`&&e.trim()?Number(e):NaN,UU=(e,t)=>{if(RU(t))return Number.isFinite(e)?e+0:NaN;let n=Math.trunc(e);return Number.isSafeInteger(n)?n+0:NaN},WU=(e,t)=>e==null||typeof e==`string`&&!e.trim()?!1:Number.isNaN(UU(Number(e),t)),GU=({inputValue:e,fieldConfig:t})=>{if(typeof e==`string`)return e;if(e===void 0||Number.isNaN(e))return zU(t)?``:null;let n=UU(e,t);return Number.isNaN(n)?String(e):zU(t)?String(n):n},fAe=({currentValue:e,fieldConfig:t,inputValue:n=void 0})=>{if(WU(e,t)&&e===GU({inputValue:n,fieldConfig:t}))return n;if(typeof e==`number`)return e;if(typeof e!=`string`||!e.trim())return;let r=UU(Number(e),t);return Number.isNaN(r)?void 0:r},KU=e=>e==null||e===``,qU=({entry:e,locale:t,...n})=>Nje({...n,entry:e,locale:Xp(e.locales,t)}),JU=e=>{if(!Array.isArray(e))return e;let t=e.filter(e=>!KU(e));return t.length?t:void 0},pAe=Bl(()=>Bp.current,()=>new WeakMap),mAe=e=>Nl(pAe(),e,()=>jy(Object.values(e.locales)[0].path)),YU=e=>mAe(e).map(({collectionName:e})=>Kf(e)).filter(e=>!!e),hAe=/^\/(?<pattern>.+)\/(?<flags>[dgimsuvy]*)$/,gAe=/[gy]/g,_Ae=e=>{try{return RegExp(``,e),!0}catch{return!1}},XU=e=>{if(e instanceof RegExp){let t=e.flags.replace(gAe,``);return t===e.flags?e:new RegExp(e.source,t)}if(typeof e==`string`&&e){let{pattern:t,flags:n}=e.match(hAe)?.groups??{};if(t!==void 0)try{return XU(new RegExp(t,n))}catch{if(_Ae(n))return}try{return new RegExp(e)}catch{}}},ZU=tl([]),vAe=rl(()=>new Set(ZU.current.map(e=>e.id))),yAe=new WeakMap,bAe=e=>Nl(yAe,e,()=>{let{filter:t}=e._type===`entry`?e:{},n=t?.field;if(n!==void 0)return{field:n,pattern:XU(t?.pattern),values:t?.value===void 0?[]:Array.isArray(t.value)?t.value:[t.value]}}),QU=(e,t)=>{let n=bAe(e);if(!n||cf(e,t))return!0;let{field:r,pattern:i,values:a}=n,o=qU({entry:t,locale:e._i18n.defaultLocale,collectionName:e.name,key:r,resolveRef:!1}),s=Array.isArray(o)?o:[o??null];return i?s.some(e=>e!=null&&i.test(String(e))):s.some(e=>a.includes(e))},$U=e=>YU(e).filter(t=>!t.hide&&QU(t,e)),eW={entrySource:void 0,folderSource:void 0,buckets:void 0,map:new Map,folderMap:new Map},tW=()=>{if(!eW.buckets){let e=new Map;Vp.current.forEach(t=>{new Set(YU(t).map(({name:e})=>e)).forEach(n=>{Nl(e,n,()=>[]).push(t)})}),eW.buckets=e}return eW.buckets},xAe=e=>{let t=Kf(e);return t?(tW().get(e)??[]).filter(e=>QU(t,e)):[]},nW=()=>{let e=Vp.current,t=Bp.current;(e!==eW.entrySource||t!==eW.folderSource)&&(eW.entrySource=e,eW.folderSource=t,eW.buckets=void 0,eW.map=new Map,eW.folderMap=new Map)},rW=e=>{nW();let t=eW.map.get(e);if(t)return t;let n=xAe(e);return eW.map.set(e,n),n},SAe=(e,t)=>{let{_file:{fullPathRegEx:n=void 0,subPath:r=void 0}={}}=e._type===`entry`?e:{};if(!n)return[];let{defaultLocale:i}=e._i18n,a=new Set(t);return Vp.current.flatMap(e=>{if(a.has(e))return[];let t={},o={};Object.values(e.locales).forEach(e=>{let{subPath:a,locale:s=i}=e.path.match(n)?.groups??{};a&&(t[s]={...e,slug:ey({subPath:a,subPathTemplate:r})},o[s]=a)});let s=Xp(t,i);if(!s)return[];let{slug:c}=t[s],l=o[s];return[{...e,slug:c,subPath:l,locales:t}]})},iW=e=>(nW(),Nl(eW.folderMap,e,()=>{let t=Kf(e),n=tW().get(e)??[];return t?[...n,...SAe(t,n)]:n})),aW=(e,t)=>{let n=Kf(e);return!n||af(n)===void 0?t.length:t.filter(e=>!cf(n,e)).length},CAe=e=>of(e)?!rW(e.name).some(t=>cf(e,t)):!1,wAe=`order`,oW=e=>e?._type===`entry`&&(!!e.reorder||jd(e)),sW=e=>{let t=e?.reorder;if(t&&typeof e.file!=`string`)return X(t)&&typeof t.key==`string`&&t.key?t.key:wAe},cW=e=>{let t=e?.reorder;if(X(t)&&typeof t.group==`string`&&t.group)return t.group},lW=e=>{if(jd(e))return e=>e.arrayIndex??0;let t=sW(e);if(!t)return()=>void 0;let{defaultLocale:n}=e._i18n;return e=>{let r=Zp(e,{defaultLocale:n})?.content?.[t],i=typeof r==`number`||typeof r==`string`&&r.trim()?Number(r):NaN;return Number.isFinite(i)?i:void 0}},uW=(e,t)=>{let n=lW(t),r=e.map(e=>({entry:e,v:n(e)}));return r.sort((e,t)=>e.v!==void 0&&t.v!==void 0?e.v-t.v:e.v===void 0?t.v===void 0?0:1:-1),r.map(({entry:e})=>e)},dW=e=>e?.identifier_field??`title`,TAe=new WeakMap,EAe=e=>Nl(TAe,e,()=>{let t=new Map;return e.forEach(({value:e,label:n})=>{t.has(e)||t.set(e,n)}),t}),DAe=new WeakMap,fW=0,pW=e=>Nl(DAe,e,()=>{let e=fW;return fW+=1,e}),mW=e=>tf(e)?e:e===`slug`?`{{fields.slug}}`:`{{${e}}}`,OAe=e=>{if(!e||e.widget!==`list`)return!1;let t=`fields`in e,n=`types`in e;return t||n},hW=e=>e?.name||e?.login||e?.email,kAe=/^#+[^\S\n\r\u2028\u2029]+(.*)$/gm,AAe=e=>{if(!e.endsWith(`}`))return e;for(let t=e.indexOf(`{#`,1);t>0&&!(t+2>=e.length-1);t=e.indexOf(`{#`,t+1))if(/\s/.test(e[t-1]))return e.slice(0,t).trimEnd();return e},jAe=e=>e.matchAll(kAe).map(([,e])=>AAe(e.trim())).find(e=>!!e)??``,gW=``,MAe=/<(?!\/?(?:strong|em|code)(?:\s[^>]*)?>)/g,_W=(e,{allowMarkdown:t=!1}={})=>(e=fr(e.replace(MAe,gW)),t&&(e=dU(e)),e=dt(e,{ALLOWED_TAGS:t?[`strong`,`em`,`code`]:[],ALLOWED_ATTR:[]}),t||(e=dU(e)),e.replaceAll(gW,t?`&lt;`:`<`).trim()),vW=(e,{identifierField:t=`title`,useBody:n=!0}={})=>{let r=[t,`title`,`name`,`label`].find(t=>typeof e[t]==`string`&&!!e[t].trim());return r?e[r].trim():n&&typeof e.body==`string`?jAe(e.body):``},NAe=(e,t)=>{let{slug:n,entryPath:r,basePath:i,fullPathRegEx:a,locales:o,localeSuffixes:s,commitDate:c,commitAuthor:l}=t;if(e===`slug`)return n;if(e===`locales`)return o.sort((e,t)=>e.localeCompare(t)).join(`, `);if(e===`dirname`)return $p(r,{basePath:i,fullPathRegEx:a});if(e===`filename`||e===`extension`)return Oie(r,s)[e];if(e===`commit_date`)return c??``;if(e===`commit_author`)return hW(l)},yW=!1,bW=e=>{if(e?.widget===`relation`)return!0;if(e?.widget===`list`){let{field:t}=e,{fields:n}=e,{types:r}=e;return!n&&!r&&bW(t)}return!1},xW=(e,t)=>{let{content:n,collectionName:r,fileName:i,isIndexFile:a,replaceSubContext:o,locale:s,fallbackSummary:c}=t,{value:l,transformations:u}=gU(e),d=nf(l),f={collectionName:r,fileName:i,valueMap:n,keyPath:d,isIndexFile:a},p=NAe(l,o),m=SH(u,e=>xW(e,t));if(p===void 0&&(m.some(({method:e})=>e===`date`||e===`ternary`)?p=Object.hasOwn(n,d)?n[d]:void 0:(bW(lh(f))&&(yW=!0),p=VG({...f,locale:s})),d===`title`&&!p&&(p=c)),p===void 0)return``;if(p instanceof Date&&!m.length){let{year:e,month:t,day:n}=CU({date:p});return`${e}-${t}-${n}`}return m.length&&(p=_U({fieldConfig:lh({...f}),value:p,transformations:m,locale:s})),String(p)},PAe=new WeakMap,SW,CW=0,FAe=()=>{let e=Vp.current;return e!==SW&&(SW=e,CW+=1),CW},IAe=(e,t,n)=>{let r=n?Wp(e,n):void 0;if(r)return{collectionFile:r,isIndexFile:!1,label:Kp(r),template:r.summary};let i=cf(e,t),{label:a,summary:o}=i&&of(e)||{};return{isIndexFile:i,label:a,template:o}},LAe=(e,t,{locale:n,useTemplate:r=!1,allowMarkdown:i=!1,template:a,useIndexFileLabel:o=!0,fileName:s}={})=>{let{_type:c,name:l}=e,{collectionFile:u,isIndexFile:d,label:f,template:p}=IAe(e,t,s);if((u||d&&o)&&!(r&&a===void 0&&p))return f;let{defaultLocale:m}=(u??e)._i18n,{_file:{basePath:h,fullPathRegEx:g}={},summary:_}=c===`entry`?e:{},v=dW(c===`entry`?e:void 0),y=a??p??_,{locales:b,slug:x,commitDate:S,commitAuthor:C}=t,w=n??m,T=Object.hasOwn(b,w)?w:Object.keys(b)[0]??w,{content:ee={},path:E=``}=b[T]??{},te=vW(ee,{identifierField:v})||f||x.replaceAll(`-`,` `);if(!r||!y)return _W(te,{allowMarkdown:i});let ne={content:ee,collectionName:l,fileName:u?.name,isIndexFile:d,replaceSubContext:{slug:x,entryPath:E,basePath:h,fullPathRegEx:g,locales:Object.keys(b),localeSuffixes:kie(u??e),commitDate:S,commitAuthor:C},locale:T,fallbackSummary:te};return _W(Qd(y,(e,t)=>xW(t,ne)),{allowMarkdown:i})},wW=(e,t,n={})=>{let{locale:r,useTemplate:i=!1,allowMarkdown:a=!1,template:o,useIndexFileLabel:s=!0,fileName:c}=n,l=Nl(Nl(PAe,t,()=>new WeakMap),e,()=>new Map),u=[r??``,i?`1`:`0`,a?`1`:`0`,o??``,s?`1`:`0`,c??``,Ec.current].join(`
`),d=FAe(),f=l.get(u);if(f&&(f.generation===void 0||f.generation===d))return f.summary;let p=yW;yW=!1;let m=LAe(e,t,n),h=yW;return yW=p||h,l.set(u,{summary:m,generation:h?d:void 0}),m},RAe=(e,t)=>{if(!Wp(e,t)?.summary)return;let n=Jp(e.name,t);return n?wW(e,n,{fileName:t,useTemplate:!0,allowMarkdown:!0}):void 0},TW=(e,t)=>{let n=e?.[t];return n==null?``:String(n)},EW=(e,t,n,{stored:r=!1}={})=>{let{slug:i,locale:a,getDisplayValue:o}=t,{content:s,locales:c,defaultLocale:l}=n;if(e===`slug`)return i;if(e===`locale`)return a;let u=nf(e);return r?TW(s,u)||TW(c[l]?.content,u):o(u)||o(u,l)||``},zAe=(e,t)=>{let{content:n,locales:r,defaultLocale:i,identifierField:a}=t;return vW(n,{identifierField:a})||vW(r[i]?.content||{},{identifierField:a})||e.slug},DW=(e,t,n,r)=>{let{label:i,value:a,searchValue:o}=e,s=!1;return t.forEach(e=>{let t=`{{${e}}}`,c=EW(e,n,r);if(a.includes(t)){let i=EW(e,n,r,{stored:!0});i||(s=!0),a=a.replaceAll(t,()=>i)}i=i.replaceAll(t,()=>c),o=o?.replaceAll(t,()=>c)??``}),{label:i.trim()||zAe(n,r),value:s?``:a,searchValue:o.trim()}},OW=e=>{let t=[];return Qd(e,(e,n)=>(t.push(n),``)),t},BAe=(e,t)=>{let n=e.value_field,r=mW(n||`{{slug}}`),i=e.display_fields??[r===`{{slug}}`?`{{${t}}}`:r],a=e.search_fields??i,o=i.map(mW).join(` `),s=a.map(mW).join(` `),c=Ac([...OW(o),...OW(r),...OW(s)]);return{_valueField:r,_displayField:o,_searchField:s,allFieldNames:c,hasListFields:c.some(e=>e.includes(`*`))}},VAe=/\.(\d+)$/,HAe=(e,t)=>{let n=new Map;return e.filter(e=>e.includes(`*`)).forEach(e=>{let r=e.replace(/\.\*.*$/,``),i=lh({...t,keyPath:r});n.set(e,{baseFieldName:r,fieldConfig:i,isComplexListField:OAe(i)})}),Map.groupBy(n.entries(),([,{baseFieldName:e}])=>e)},kW=({templates:e,replacements:t,staticFieldNames:n,context:r,fallbackContext:i})=>{let{_displayField:a,_valueField:o,_searchField:s}=e,c=e=>t.reduce((e,[t,n])=>e.replaceAll(`{{${t}}}`,()=>n),e),{label:l,value:u,searchValue:d}=DW({label:c(a),value:c(o),searchValue:c(s)},n,r,i);return{label:l,value:t.some(([e,t])=>o.includes(`{{${e}}}`)&&String(t??``)===``)?``:u,searchValue:d||l}},UAe=new Map,AW=(e,t,n=t)=>Object.entries(e).filter(([e])=>t.test(e)).map(([e,t])=>{let r=e.match(n);return{index:parseInt(r[1],10),value:t}}).sort((e,t)=>e.index-t.index),WAe=({baseFieldName:e,groupEntries:t,content:n,templates:r,allFieldNames:i,context:a,fallbackContext:o})=>{let s=AW(n,Nl(UAe,e,()=>RegExp(`^${Fc(e)}\\.\\d+$`)),VAe),c=i.filter(e=>!e.includes(`*`));return s.map(({value:e})=>kW({templates:r,replacements:t.map(([t])=>[t,e]),staticFieldNames:c,context:a,fallbackContext:o}))},jW=/^(.+)\.\*\.(.+)$/,GAe=new Map,KAe=e=>{let t=null;return e.some(([e])=>(t=e.match(jW),!!t)),t},qAe=({groupEntries:e,content:t,templates:n,allFieldNames:r,context:i,fallbackContext:a})=>{let[,o,s]=KAe(e)??[];if(!o)return[];let c=AW(t,Nl(GAe,`${o}:${s}`,()=>{let e=Fc(o),t=Fc(s);return RegExp(`^${e}\\.([0-9]+)\\.${t}$`)})),l=r.filter(e=>!e.includes(`*`));return c.map(({index:r})=>kW({templates:n,replacements:e.flatMap(([e])=>{let[,n,i]=e.match(jW)??[];return n?[[e,t[`${n}.${r}.${i}`]??``]]:[]}),staticFieldNames:l,context:i,fallbackContext:a}))},JAe=({baseFieldGroups:e,content:t,templates:n,allFieldNames:r,context:i,fallbackContext:a})=>{let o=[],s=!1;return e.forEach((e,c)=>{if(e.length===0)return;let[,l]=e[0],u={groupEntries:e,content:t,templates:n,allFieldNames:r,context:i,fallbackContext:a},d=l.isComplexListField?qAe({...u}):WAe({...u,baseFieldName:c});o.push(...d),s=!0}),{results:o,hasProcessedListFields:s}},YAe=({templates:e,allFieldNames:t,context:n,fallbackContext:r})=>{let{_displayField:i,_valueField:a,_searchField:o}=e,{label:s,value:c,searchValue:l}=DW({label:i,value:a,searchValue:o},t,n,r);return{label:s,value:c,searchValue:l||s}},MW=e=>e.filter(({value:e})=>!!e),XAe=({refEntry:e,content:t,collection:n,templates:r,fileName:i,locale:a,identifierField:o,pendingEntries:s=void 0})=>{let{locales:c}=e,{name:l,_i18n:{defaultLocale:u}}=n,{allFieldNames:d,hasListFields:f}=r,p=yf(n,e.slug),m={collectionName:l,fileName:i,isIndexFile:cf(n,e),keyPath:``},h={slug:p,locale:a,getDisplayValue:(e,n)=>VG({...m,keyPath:e,valueMap:n?c[n]?.content??{}:t,locale:n??a,pendingEntries:s})},g={content:t,locales:c,defaultLocale:u,identifierField:o};if(!f)return MW([YAe({templates:r,allFieldNames:d,context:h,fallbackContext:g})]);let{results:_,hasProcessedListFields:v}=JAe({baseFieldGroups:HAe(d,m),content:t,templates:r,allFieldNames:d,context:h,fallbackContext:g});if(v)return MW(_);let{_displayField:y,_valueField:b,_searchField:x}=r,{label:S,value:C,searchValue:w}=DW({label:y,value:b,searchValue:x},d.filter(e=>!e.includes(`*`)),h,g);return MW([{label:S,value:C,searchValue:w||S}])},NW=e=>e===!0||e===`translate`||e===`duplicate_if_empty`,PW=e=>e===`duplicate`||e===`sync`,FW=e=>NW(e)||PW(e),IW=e=>e===void 0||e===!1||e===`none`,LW=({fieldConfig:e,getFieldArgs:t})=>{if(e.i18n!==void 0)return e.i18n;let n=t.keyPath.split(`.`);for(let e=n.length-2;e>=0;--e)if(!eh(n[e])){let{i18n:r}=lh({...t,keyPath:n.slice(0,e+1).join(`.`)})??{};if(r!==void 0)return r}},RW=e=>PW(LW(e)),zW=e=>LW(e)===`sync`,BW=({getFieldArgs:e,locale:t,defaultLocale:n,keyPath:r})=>{if(t===n)return!0;let i=r.split(`.`),a=!1,o;return i.every((t,n)=>{if(n<i.length-1&&eh(t))return!0;let r=lh({...e,keyPath:i.slice(0,n+1).join(`.`)});return r?(a=!0,o=r.i18n===void 0?o:r.i18n,FW(o)):a})},ZAe=new WeakMap,VW=({getFieldArgs:e,locale:t,defaultLocale:n,content:r,defaultContent:i})=>{if(t===n||!i)return r;let{collectionName:a,fileName:o,isIndexFile:s}=e,c=JSON.stringify([a,o,s,t,n]);return{...Nl(Nl(ZAe,i,()=>new Map),c,()=>{let r={...e,valueMap:i};return Object.fromEntries(Object.entries(i).filter(([e])=>!BW({getFieldArgs:r,locale:t,defaultLocale:n,keyPath:e})))}),...r}},QAe=(e,t)=>{let{defaultLocale:n}=Rf(e),r=e?.currentValues[n];if(!e||!r||t===n)return;let i=ch(e,{valueMap:r});return{values:r,isShared:e=>!BW({getFieldArgs:i,locale:t,defaultLocale:n,keyPath:e})}},$Ae=/^{{fields\.(.+?)}}$/,eje=new Map,HW=(e,t)=>{let n=e[t];if(n!==void 0&&!Array.isArray(n))return n;let r=Nl(eje,t,()=>RegExp(`^${Fc(t)}\\.\\d+$`)),i=Object.keys(e).filter(e=>r.test(e)).map(t=>e[t]);return i.length?i:n},tje=(e,t,n=void 0,r=void 0)=>e.map(({field:e,values:i,exclude:a})=>({field:e,exclude:a,values:i.flatMap(e=>{if(typeof e!=`string`)return[e];if(e===`{{slug}}`)return n?[n]:[];let i=e.match($Ae);if(!i)return[e];let a=t?HW(t,i[1]):void 0;return a===void 0&&r?.isShared(i[1])&&(a=HW(r.values,i[1])),Array.isArray(a)?a:a===void 0?[]:[a]})})),nje=({refEntries:e,collection:t,locale:n,fileName:r=void 0,entryFilters:i=[],defaultLocale:a=void 0})=>{let o=new Map,s=(e,i,s)=>{let c=HW(i,s),l=a?e.locales[a]?.content:void 0;return c!==void 0||!l||l===i||Nl(o,s,()=>BW({getFieldArgs:{collectionName:t.name,fileName:r,valueMap:l},locale:n,defaultLocale:a,keyPath:s}))?c:HW(l,s)};return e.filter(e=>!r||r===e.slug).map(e=>{let{content:t}=e.locales[n]??(a?e.locales[a]:void 0)??e.locales._default??{};return{refEntry:e,hasContent:!!t&&Object.keys(t).length>0,content:t??{}}}).filter(({hasContent:e,content:n,refEntry:r})=>e&&i.every(({field:e,values:i,exclude:a=!1})=>{if(i.length===0)return!0;let o=e===`slug`,c=nf(e),l=o?yf(t,r.slug):s(r,n,c),u=Array.isArray(l)?l.some(e=>i.includes(e)):i.includes(l);return a?!u:u}))},UW=[`eq`,`ne`,`lt`,`lte`,`gt`,`gte`,`in`,`not_in`,`empty`],WW=e=>{let{field:t,pattern:n}=e,r={field:t};return n!==void 0&&(r.pattern=n),UW.forEach(t=>{e[t]!==void 0&&(r[t]=e[t])}),r},GW=e=>!!e&&UW.some(t=>e[t]!==void 0),KW=e=>{let{field:t,pattern:n}=e,r=[t],i=Object.fromEntries(UW.filter(t=>e[t]!==void 0).map(t=>[t,e[t]]));return n===void 0?Object.keys(i).length&&r.push(null):r.push(String(n)),Object.keys(i).length&&r.push(i),JSON.stringify(r)},qW=e=>e===`*other`?Y(`other`):e,JW=(e,t,n)=>{let r=XU(t);return[...Map.groupBy(e,e=>{let t=n(e);return t==null?`*other`:r?String(t).match(r)?.[0]??`*other`:String(t)})].sort(([e],[t])=>Bc(qW(e),qW(t)))},YW=(e,t,n)=>{let{field:r,pattern:i}=t??{};return r?Object.fromEntries(JW(e,i,e=>n(e,r))):e.length?{"*":e}:{}},XW=(e,t,n)=>n?n.test(String(e??``)):e===t,ZW=(e,t,n)=>n?Bc(e,t):e-t,QW=(e,t,n,r)=>{let i=e.map(e=>({item:e,key:t(e)})),a=i.filter(({key:e})=>e!==void 0),o=i.filter(({key:e})=>e===void 0);return a.sort(({key:e},{key:t})=>ZW(e,t,n)),r===`descending`&&a.reverse(),[...a,...o].forEach(({item:t},n)=>{e[n]=t}),e},rje=e=>e.filter(e=>e!==`*`),$W=e=>e?KW(e):void 0,eG=(e,t)=>{let n=$W(t);return n!==void 0&&!!e?.some(e=>e.collapsed===!0&&KW(WW(e))===n)},tG=e=>e?`expandedGroups`:`collapsedGroups`,nG=(e,t,n=!1)=>{let r=$W(e.group);return r===void 0||t===`*`?!1:!!e[tG(n)]?.[r]?.includes(t)!==n},rG=(e,t,n)=>{let r=$W(e.group);if(r===void 0)return e;let i=tG(n),{[r]:a,...o}=e[i]??{},s=t.length?{...o,[r]:t}:o,{[i]:c,...l}=e;return Object.keys(s).length?{...l,[i]:s}:l},iG=(e,t,n,r=!1)=>{let i=$W(e.group),a=tG(r),o=(i===void 0?[]:e[a]?.[i]??[]).filter(e=>e!==t);return n!==r&&o.push(t),rG(e,o,r)},aG=(e,t,n,r=!1)=>rG(e,n===r?[]:[...t],r),oG=async(e,t,n,{defaults:r={}}={})=>{let i=Sb(e,`ui-settings`),a;try{a=await i?.get(t)}catch{}let o={...r,...X(a)?a:{}};n.current=o;let s=o;return ol(()=>{let{current:e}=n;(0,Qc.default)(e,s)||(s=e,(async()=>{try{await i?.set(t,e)}catch{}})())})},sG=(e,t)=>{if(Array.isArray(e))return{options:e};if(X(e)){let n=e[t],r=e.default;if(Array.isArray(n)){let e=r?n.find(({name:e})=>e===r):void 0;return{options:n,default:e?WW(e):void 0}}}return{options:[]}},ije=e=>Array.isArray(e)&&e.every(e=>typeof e==`string`),cG=e=>{let t=X(e)?e.default_sort:void 0;return t===!0||t===`asc`||t===`desc`},aje=e=>{let t=[],n={},r;return e.forEach(e=>{if(typeof e==`string`){t.push(e);return}if(!X(e)||typeof e.field!=`string`)return;let{field:i,label:a}=e;t.push(i),typeof a==`string`&&a.trim()&&(n[i]=a),!r&&cG(e)&&(r=e)}),{keys:t,...Object.keys(n).length?{labels:n}:{},...r?{defaultKey:r.field,defaultOrder:r.default_sort===`desc`?`descending`:`ascending`}:{}}},lG=e=>{if(Array.isArray(e))return aje(e);if(X(e)){let{fields:t,default:n}=e;return ije(t)?X(n)?{keys:t,defaultKey:n.field,defaultOrder:[`descending`,`Descending`].includes(n.direction??``)?`descending`:`ascending`}:{keys:t}:{keys:[]}}return{keys:[]}},uG=[`slug`,`commit_author`,`commit_date`],oje=[`dirname`,`filename`,`extension`,`locales`],sje=/^\{\{\s*(?:fields\.)?([^\s|{}]+)\s*\}\}$/,dG=e=>tf(e),fG=e=>{let{table_columns:t,summary_fields:n}=e;if(Array.isArray(t))return t.map(e=>X(e)?{key:e.field,label:e.label}:{key:e});if(Array.isArray(n))return n.map(e=>({key:e===`summary`?`_summary`:e}))},cje=new Map,pG=e=>Nl(cje,e,()=>{try{return new Intl.Locale(e).maximize()}catch{return}}),mG=e=>{let t=pG(e);return t&&`${t.language}-${t.script}`},hG=e=>mG(e)??e.toLowerCase(),lje=(e,t)=>{if(Object.hasOwn(e,t))return t;let n=hG(t),r=Object.keys(e).filter(e=>hG(e)===n);return r.find(e=>!e.includes(`-`))??r[0]},gG=(e,t)=>{let n=e[`${t}_localized`];return X(n)?n:void 0},_G=({config:e,option:t,locale:n})=>{if(!e)return;let r=gG(e,t);if(r){if(n&&n!==`_default`&&Object.hasOwn(r,n))return r[n];let e=Ec.current?lje(r,Ec.current):void 0;if(e!==void 0)return r[e]}return e[t]},vG=({config:e,locale:t})=>_G({config:e,option:`label`,locale:t})||e.name||``,yG=({fieldConfig:e,locale:t,defaultLocale:n})=>{let r=gG(e,`default`);if(!r)return e;let{default_localized:i,...a}=e,o=PW(e.i18n)?n:t;return Object.hasOwn(r,o)?{...a,default:r[o]}:a},bG=[`title`,`name`,`date`,`author`,`description`],uje=[`ascending`,`descending`],dje=[`date`,`commit_date`],xG={slug:String,commit_author:String,commit_date:Date,_summary:String,_manual:String},SG=Object.keys(xG),fje=e=>e?{keys:[e,...bG.filter(t=>t!==e)],defaultKey:e}:{keys:[...bG]},CG=({collection:e,isCommitAuthorAvailable:t,isCommitDateAvailable:n})=>{let{name:r,identifier_field:i,sortable_fields:a,summary:o,_i18n:{i18nEnabled:s,canonicalSlug:c}}=e,l=a?lG(a):fje(i),u=[...l.keys],{defaultKey:d,defaultOrder:f}=l,{labels:p}=l;o&&u.unshift(`_summary`);let m=s?[...SG,c.key]:SG;u=Ac(u).filter(e=>!!e&&(m.includes(e)||!!lh({collectionName:r,keyPath:e})));let h=u.includes(`commit_author`),g=u.includes(`commit_date`),_=jd(e);t&&!_?!u.includes(`author`)&&!h&&u.push(`commit_author`):h&&(u=u.filter(e=>e!==`commit_author`)),n&&!_?!u.includes(`date`)&&!g&&u.push(`commit_date`):g&&(u=u.filter(e=>e!==`commit_date`));let v=sW(e);return(v||jd(e))&&(u=u.filter(e=>e!==v),u.includes(`_manual`)||u.unshift(`_manual`),d=`_manual`,f=`ascending`),d=d&&u.includes(d)?d:u[0],f??=d?`ascending`:void 0,{keys:u,labels:p,default:{key:d,order:f}}},wG=({key:e,fieldConfig:t})=>Object.hasOwn(xG,e)?xG[e]:t?.widget===`boolean`?Boolean:t&&VU(t)?Number:String,TG=({collection:e,key:t})=>{if([...SG,`name`].includes(t))return Y(`sort_keys.${t}`);if(t.includes(`.`))return t.split(`.`).map((t,n,r)=>{if(eh(t))return;let i=r.slice(0,n+1).join(`.`);return _G({config:lh({collectionName:e.name,keyPath:i}),option:`label`})||t}).filter(Boolean).join(` – `);let n=e.fields?.find(({name:e})=>e===t);return _G({config:n,option:`label`})||t},EG=rl(()=>{let e=Uf.current;if(e?._type!==`entry`)return[];let{current:t}=Vp,{keys:n,labels:r}=CG({collection:e,isCommitAuthorAvailable:t.some(e=>!!e.commitAuthor),isCommitDateAvailable:t.some(e=>!!e.commitDate)});return n.map(t=>{let n=lh({collectionName:e.name,keyPath:t}),i={key:t,label:r?.[t]??TG({collection:e,key:t})};return wG({key:t,fieldConfig:n})===Number&&(i.type=`number`),i})}),pje=1e3,mje=[`title`,`summary`,`description`],hje=({key:e,type:t,collection:n,locale:r,collectionName:i,dateFieldConfig:a,isMarkdownField:o})=>e===`_summary`?e=>wW(n,e,{locale:r,useTemplate:!0}):a?t=>{let n=aU(qU({entry:t,locale:r,collectionName:i,key:e}),a,r)?.getTime()??NaN;return Number.isNaN(n)?void 0:n}:t===String?t=>{let n=JU(qU({entry:t,locale:r,collectionName:i,key:e}));if(KU(n))return;let a=String(n);return o?Dke(a.slice(0,pje)):a}:t===Boolean?t=>+(qU({entry:t,locale:r,collectionName:i,key:e})===!0):t=>{let n=JU(qU({entry:t,locale:r,collectionName:i,key:e})),a=KU(n)?NaN:Number(n);return Number.isNaN(a)?void 0:a},DG=({collection:e,key:t,locale:n})=>{let{name:r}=e,i=lh({collectionName:r,keyPath:t}),a=wG({key:t,fieldConfig:i}),o=i?.widget===`datetime`?i:void 0;return{getSortKey:hje({key:t,type:a,collection:e,locale:n,collectionName:r,dateFieldConfig:o,isMarkdownField:Rd.includes(i?.widget??``)||mje.includes(t)}),isStringType:!o&&a===String}},gje=(e,t)=>{let n=e.findIndex(e=>cf(t,e));return n>-1&&e.unshift(e.splice(n,1)[0]),e},OG=(e,t,{key:n,order:r}={})=>{let i=[...e];if(n===void 0)return i;let{_i18n:{defaultLocale:a}}=t,{getSortKey:o,isStringType:s}=n===`_manual`||n===sW(t)?{getSortKey:lW(t),isStringType:!1}:DG({collection:t,key:n,locale:a});return QW(i,o,s,r),gje(i,t)},_je=({collection:e,key:t,locale:n})=>{if(t===`_manual`||t===sW(e))return{getSortKey:lW(e),isStringType:!1};let{defaultLocale:r}=e._i18n,i=DG({collection:e,key:t,locale:n}),a=n===r?i:DG({collection:e,key:t,locale:r}),o=n!==r&&!SG.includes(t)&&!BW({getFieldArgs:{collectionName:e.name,valueMap:{}},locale:n,defaultLocale:r,keyPath:t});return{getSortKey:e=>e.locales[n]&&!o?i.getSortKey(e):a.getSortKey(e),isStringType:i.isStringType}},vje=({groups:e,collection:t,sortBy:n,locale:r})=>{let{field:i,direction:a}=n,{getSortKey:o,isStringType:s}=_je({collection:t,key:i,locale:r}),c=a===`descending`?-1:1,l=e.flatMap(({refEntry:e,options:t})=>{let n=o(e);return t.map(e=>({option:e,sortKey:n}))});return l.sort((e,t)=>{if(e.sortKey!==t.sortKey){if(e.sortKey===void 0)return 1;if(t.sortKey===void 0)return-1;let n=ZW(e.sortKey,t.sortKey,s);if(n)return n*c}return Bc(e.option.label,t.option.label)}),l.map(({option:e})=>e)},yje=new Map,bje=100,kG=new Set,xje=10,AG=new WeakMap,jG=(e=[])=>e.map(e=>pW(e)).join(`,`),Sje=(e,t,n)=>{let r=n.filter(e=>e.collectionName===t).map(({entry:e})=>e),i=new Map(r.map(e=>[e.id,e]));return r.length?[...e.map(e=>{let t=i.get(e.id);return i.delete(e.id),t??e}),...i.values()]:e},Cje=(e,t,n=[])=>{if(!n.length)return e;let r=AG.get(e);return r||(r=new Map,AG.set(e,r)),Ll(r,jG(n),()=>Sje(e,t,n),xje)},MG=({locale:e,fieldConfig:t,refEntries:n,entryFilters:r=[],pendingEntries:i=void 0})=>{let{collection:a,file:o}=t,s=Kf(a);if(!s)return[];let{_type:c,_i18n:{defaultLocale:l}}=s,u=dW(c===`entry`?s:void 0),d=BAe(t,u);return nje({refEntries:n,collection:s,locale:e,fileName:o,entryFilters:r,defaultLocale:l}).map(({refEntry:t,content:n})=>({refEntry:t,options:XAe({refEntry:t,content:n,collection:s,templates:d,fileName:o,locale:e,identifierField:u,pendingEntries:i})}))},NG=e=>MG(e).flatMap(({options:e})=>e),wje=({collection:e,file:t})=>{if(t){let n=Jp(e,t);return n?[n]:[]}return rW(e)},PG=({locale:e,fieldConfig:t,refEntries:n,currentLocaleValues:r=void 0,currentSlug:i=void 0,pendingEntries:a=void 0,sharedValues:o=void 0})=>{let{collection:s,file:c,filters:l,sort_by:u}=t,d=tje(l??[],r,i,o),f=JSON.stringify(d.map(({values:e})=>e)),p=`${e}|${`${pW(t)}|${pW(n)}`}|${jG(a)}|${f}`;return kG.has(p)?[]:Ll(yje,p,()=>{kG.add(p);try{let r=Kf(s);if(r&&!c&&u?.field)return vje({groups:MG({locale:e,fieldConfig:t,refEntries:n,entryFilters:d,pendingEntries:a}),collection:r,sortBy:u,locale:e});let i=!c&&oW(r),o=NG({locale:e,fieldConfig:t,refEntries:i?uW(n,r):n,entryFilters:d,pendingEntries:a});return c||i?o:o.sort((e,t)=>Bc(e.label,t.label))}finally{kG.delete(p)}},bje)},FG=({locale:e,fieldConfig:t,refEntry:n,pendingEntries:r=void 0})=>NG({locale:e,fieldConfig:t,refEntries:[n],pendingEntries:r}),IG=({fieldConfig:e,valueMap:t,keyPath:n,locale:r,pendingEntries:i=void 0})=>{let{multiple:a,collection:o}=e,s=EAe(PG({locale:r,fieldConfig:e,refEntries:Cje(rW(o),o,i),pendingEntries:i})),c=e=>e!=null&&s.get(String(e))||e;return a?sm(t,n).map(e=>c(t[e])):c(t[n])},Tje=new Map,Eje=1e3,Dje=new WeakMap,Oje=e=>Nl(Dje,e,()=>JSON.stringify(e)),kje=({fieldConfig:e,valueMap:t,keyPath:n})=>{let{multiple:r,options:i}=e,a=kc(i),o;r&&(o=sm(t,n).map(e=>t[e]));let s=`${n}|${Oje(i)}|${JSON.stringify(r?o:t[n])}`,c=e=>i.find(t=>t.value===e)?.label||e;return Ll(Tje,s,()=>{if(r)return a?o.map(c):o;let e=t[n];return a?c(e):e},Eje)},LG=e=>X(e)?e.value:e,RG=({fieldConfig:e,value:t})=>e.options.some(e=>LG(e)===t),Aje=({fieldConfig:e,currentValue:t})=>{let{options:n,multiple:r=!1}=e,i=kc(n),a=e=>i&&n.find(t=>t.value===e)?.label||String(e);return r?Array.isArray(t)?t.map(a).sort():[]:t===void 0||t===null&&!RG({fieldConfig:e,value:null})?[]:[a(t)]},zG=e=>e===null?`number`:typeof e,BG=e=>e===void 0||typeof e==`string`?``:null,jje=e=>Rd.includes(e?.widget),VG=({collectionName:e,fileName:t,componentName:n=void 0,valueMap:r={},keyPath:i,locale:a,transformations:o,isIndexFile:s=!1,pendingEntries:c=void 0,plainText:l=!1})=>{let u=lh({collectionName:e,fileName:t,componentName:n,valueMap:r,keyPath:i,isIndexFile:s}),d=Object.hasOwn(r,i)?r[i]:void 0;if(d===void 0&&o?.length)return String(_U({fieldConfig:u,value:``,transformations:o,locale:a}));if(u?.widget===`datetime`&&(o?.some(({method:e})=>e===`date`)||(d=FU({locale:a,fieldConfig:u,currentValue:d}))),u?.widget===`relation`&&(d=IG({fieldConfig:u,valueMap:r,keyPath:i,locale:a,pendingEntries:c})),u?.widget===`select`&&(d=kje({fieldConfig:u,valueMap:r,keyPath:i})),u?.widget===`list`){let{field:o}=u,{fields:f}=u,{types:p}=u;if(!(f||p)){let u=sm(r,i);d=kf(a).format((o?u.map(i=>VG({collectionName:e,fileName:t,componentName:n,valueMap:r,keyPath:i,locale:a,isIndexFile:s,pendingEntries:c,plainText:l})):u.map(e=>r[e]).filter(e=>typeof e==`string`)).filter(e=>!!e))}}if(u&&VU(u)&&d!=null&&d!==``){let e=Number(d);Number.isNaN(e)||(d=IU(Ef(a)).format(e))}return l&&jje(u)&&typeof d==`string`&&(d=fU(d)),Array.isArray(d)&&(d=kf(a).format(d)),o?.length&&(d=_U({fieldConfig:u,value:d,transformations:o,locale:a})),String(d??``)},Mje=({valueMap:e,locale:t,keyPath:n,keyPathPrefix:r,getFieldArgs:i,plainText:a=!1})=>{let o=[`${n}.title`,`${n}.name`,...rm(e,r)].find(t=>{let n=e[t];if(!t.startsWith(r)||!(Uu(n)||typeof n==`number`&&!Number.isNaN(n)))return!1;let a=lh({...i,keyPath:t});return!!a&&a.widget!==`hidden`});return o?VG({...i,keyPath:o,locale:t,plainText:a}):``},Nje=({entry:e,locale:t,collectionName:n,key:r,resolveRef:i=!0})=>{let{slug:a,locales:o,commitAuthor:s,commitDate:c}=e;if(r===`slug`)return a;if(r===`commit_author`)return hW(s);if(r===`commit_date`)return c;let{content:l}=o[t]??{};if(l===void 0)return;let u=Kf(n);if(!u)return;let d=lh({collectionName:n,keyPath:r,isIndexFile:cf(u,e)});if(i&&d?.widget===`relation`)return IG({fieldConfig:d,valueMap:l,keyPath:r,locale:t});if(d&&(d.widget===`list`||oh(d))){let e=sm(l,r);if(e.length)return e.map(e=>l[e])}let f=Object.hasOwn(l,r)?l[r]:void 0;if(f===void 0&&(d?.widget===`object`||d?.widget===`list`)){let e=rm(l,`${r}.`);if(e.length)return e.map(e=>l[e])}return f},HG=({collectionName:e,fileName:t,keyPath:n,itemKeyPath:r=n,valueMap:i,isIndexFile:a=!1,locale:o,summaryTemplate:s,hasSingleSubField:c=!1})=>{let l={collectionName:e,fileName:t,keyPath:``,valueMap:i,isIndexFile:a};if(!s)return c?VG({...l,keyPath:r,locale:o,plainText:!0}):Mje({valueMap:i,locale:o,keyPath:r,keyPathPrefix:`${r}.`,getFieldArgs:l,plainText:!0});let u=(e,t)=>{let i=nf(e);if(c){let e=lh({...l,keyPath:n});if(!(`field`in e)||e.field.name!==i)return``}return VG({...l,keyPath:c?r:`${r}.${i}`,locale:o,plainText:!0,transformations:t?SH(t,e=>u(gU(e).value)):void 0})};return Qd(s,(e,t)=>{let{value:n,transformations:r}=gU(t);return u(n,r)})},Pje=({fieldType:e,type:t,typeKey:n,types:r})=>t?`The “${t}” type is not defined for the ${e} field.`:`The type key is not found in the ${e===`list`?`list item`:`object`}. The item must include the “${n}” property with one of the defined types: ${r.map(e=>e.name).join(`, `)}`,UG=({fieldType:e,keyPath:t,...n})=>{console.warn(`${e===`list`?`List item`:`Object field`} ${t}: ${Pje({fieldType:e,...n})}`)},WG=({types:e,fields:t,summary:n,type:r})=>{if(!e)return{typeConfig:void 0,unknownType:!1,subFields:t??[],summaryTemplate:n};let i=r?e.find(({name:e})=>e===r):void 0;return{typeConfig:i,unknownType:!i,subFields:i?.fields??[],summaryTemplate:i?.summary||n}},GG=(e,t)=>t?`${e}<${t}>`:e,KG=({typedKeyPath:e,type:t,subFieldName:n})=>`${GG(e,t)}.${n}`,qG=({fieldConfig:e,value:t,sourceLocale:n,targetLocale:r})=>{let{value_field:i}=e;return typeof t!=`string`||typeof i!=`string`||!i.startsWith(`{{locale}}/`)||!t.startsWith(`${n}/`)?t:`${r}/${t.slice(n.length+1)}`},JG=e=>sAe({...e,value:qG(e)}),Fje=[`code`,`datetime`,`file`,`image`,`markdown`,`number`,`relation`,`richtext`,`select`,`string`,`text`],YG=e=>e.i18n===`duplicate_if_empty`&&Fje.includes(e.widget??`string`)&&!oh(e),XG=(e,t)=>{if(e.widget!==`code`)return t;let n=yH(e);return n?`${t}.${n.code}`:t},ZG=({content:e,fieldConfig:t,keyPath:n})=>Cm(e[XG(t,n)]),Ije=(e,t)=>{let n=t(e);if(n)return YG(n)?{fieldConfig:n,fieldKeyPath:e}:void 0;let r=e.lastIndexOf(`.`);if(r<0)return;let i=e.slice(0,r),a=t(i);return a?.widget===`code`&&YG(a)&&XG(a,i)!==i?{fieldConfig:a,fieldKeyPath:i}:void 0},QG=({fieldConfig:e,targetValue:t,previousValue:n,sourceLocale:r,targetLocale:i})=>Cm(t)||t===JG({fieldConfig:e,value:n,sourceLocale:r,targetLocale:i}),$G=e=>{let t=`field`in e,n=`fields`in e,r=`types`in e;return{hasSingleSubField:t,hasMultiSubFields:n,hasVariableTypes:r,hasSubFields:t||n||r}},Lje=e=>vh(e).some(e=>bh(e,e=>PW(e.i18n)||YG(e))),eK=e=>e.widget===`list`&&NW(e.i18n)&&Lje(e),tK=(e,t=``)=>e.flatMap(e=>{let n=t?`${t}.${e.name}`:e.name;if(eK(e))return[n];let{fields:r}=e;return e.widget===`object`&&r?tK(r,n):[]}),nK=({fieldConfig:e,itemCount:t})=>e.max===1&&t<=1,Rje=({index:e,...t})=>HG({...t,itemKeyPath:`${t.keyPath}.${e}`}),rK=(e,t)=>{let n=e[t];return X(n)?n.__sc_item_id??t:t},iK=(e,t,{assignIds:n=!1}={})=>{e.forEach((e,r)=>{X(e)&&(n&&(e.__sc_item_id??=crypto.randomUUID()),e.__sc_item_original_key_path??=`${t}.${r}`)})},aK=e=>{let{keyPath:t}=e,n=t.lastIndexOf(`.`);if(n<0)return;let r=t.slice(0,n),i=lh({...e,keyPath:r});if(!i)return;let{widget:a}=i;return a===`keyvalue`||a===`list`&&!$G(i).hasSubFields&&eh(t.slice(n+1))||a===`code`&&yH(i)?{keyPath:r,fieldConfig:i}:void 0},oK=/\.[^.]*$/,sK=e=>{let t=aK(e)?.fieldConfig;return t?.widget===`keyvalue`?t:void 0},cK=(e,t,{live:n=!0}={})=>{let r=`${t}.`;return rm(e,r,{live:n}).map(t=>[vm(t.slice(r.length)),e[t]])},lK=(e,t,n)=>{rm(e,`${t}.`,{live:!0}).forEach(t=>{delete e[t]}),n.length&&e[t]===null&&delete e[t],n.forEach(([n,r])=>{e[`${t}.${_m(n)}`]=r})},zje=({content:e,referenceContent:t,keyPath:n})=>{let r=cK(e,n),i=r.map(([e])=>e),a=cK(t,n).map(([e])=>e).filter(e=>i.includes(e)),o=[...a,...i.filter(e=>!a.includes(e))];o.some((e,t)=>e!==i[t])&&lK(e,n,o.map(e=>r[i.indexOf(e)]))},uK=(e,t)=>{let n=new Map;return Object.keys(e).forEach(r=>{if(!r.includes(`.`)||!t(e,r))return;let i=r.replace(oK,``),a=n.get(i);a?a.push(r):n.set(i,[r])}),n},Bje=({draft:e,isRealKey:t,locales:n})=>{let{collectionName:r,fileName:i,isIndexFile:a,originalValues:o,currentValues:s}=e;return(n??Object.keys(s)).some(e=>{let n=s[e],c=uK(o[e],t);return[...uK(n,t)].some(([e,t])=>{let o=c.get(e);return t.some((e,t)=>e!==o[t])&&!!sK({collectionName:r,fileName:i,isIndexFile:a,keyPath:t[0],valueMap:n})})})},dK=RegExp(`\\.__sc_\\w+$`),fK=[`collection`,`collectionFile`,`fields`,`originalEntry`],pK=0,mK=()=>!pK,hK=e=>{pK+=1;let t=()=>{--pK},n;try{n=e()}catch(e){throw t(),e}return n instanceof Promise?n.finally(t):(t(),n)},gK=e=>{Object.keys(e?.files??{}).forEach(e=>{URL.revokeObjectURL(e)})},_K=e=>Object.fromEntries(Object.entries(e).filter(([e])=>!dK.test(e))),vK=(e,t)=>!dK.test(t)&&e[t]!==void 0,yK=(e,t,{relative:n=!1,dropEmptyPlaceholders:r=!1}={})=>{let i=`${t}.`;return Object.fromEntries([...Object.hasOwn(e,t)?[t]:[],...rm(e,i)].filter(t=>{if(!vK(e,t))return!1;let n=e[t];return!(r&&(X(n)||Array.isArray(n))&&!Object.keys(n).length)}).map(t=>[n?t.slice(i.length):t,e[t]]))},bK=(e,t)=>{let n=0;return Object.keys(t).some(r=>vK(t,r)?(n+=1,!Object.hasOwn(e,r)||!(0,Qc.default)(e[r],t[r])):!1)||Object.keys(e).filter(t=>vK(e,t)).length!==n},xK=({originalLocales:e,currentLocales:t},n)=>Object.keys(n).filter(n=>e[n]!==!1||t[n]!==!1),Vje=(e,t)=>{let{originalValues:n,currentValues:r}=e;return t.length!==xK(e,n).length||t.some(e=>{let t=n[e];return!t||bK(t,r[e])})},SK=e=>{if(!e)return!1;let{originalLocales:t,currentLocales:n,originalSlugs:r,currentSlugs:i,originalPath:a,currentPath:o}=e,s=xK(e,e.currentValues);return!(0,Qc.default)(t,n)||!(0,Qc.default)(r,i)||Lc(a??``)!==Lc(o??``)||Vje(e,s)||Bje({draft:e,isRealKey:vK,locales:s})||vH(e).length>0},CK=({currentLocales:e={},currentPath:t,currentSlugs:n={},currentValues:r={},files:i})=>({currentLocales:Oc(e),currentSlugs:Oc(n),...t===void 0?{}:{currentPath:t},currentValues:Oc(r),files:Object.fromEntries(Object.entries(i).map(([e,{file:t,folder:n,replace:r,subfolderPath:i,nameTemplate:a}])=>[e,{file:t,folder:n&&Oc(n),replace:r,subfolderPath:i,...a?{nameTemplate:{...a,randomValues:new Map(a.randomValues),dateTimeParts:{...a.dateTimeParts}}}:{}}]))}),wK=Symbol(`valueMapVersion`),TK=e=>e?.[wK],EK=Symbol(`subtreeVersions`),Hje=class{#e=j(0);get count(){return z(this.#e)}set count(e){M(this.#e,e,!0)}},Uje=(e,t)=>{let n=e?.[EK];if(!n)return;let r=n.get(t);return r?r.count:TK(e)},DK=(e={},{onSet:t,onDelete:n}={})=>{let r=Xi(e),i=j(0),a=new Set(Object.keys(e)),o=new Map,s=e=>{let t=e.split(`.`);return t.map((e,n)=>t.slice(0,n+1).join(`.`))},c=e=>{s(e).forEach(e=>{o.has(e)||o.set(e,new Hje)})},l=e=>{M(i,z(i)+1),s(e).forEach(e=>{o.get(e).count+=1})};return a.forEach(e=>{c(e)}),new Proxy(r,{get:(e,t)=>t===wK?z(i):t===EK?o:e[t],ownKeys:e=>{let t=new Set(Reflect.ownKeys(e));return[...[...a].filter(e=>t.has(e)),...[...t].filter(e=>!a.has(e))]},set:(e,n,r)=>{let i=e[n],o=!(n in e);return i!==r&&(e[n]=r,a.add(n),c(n),l(n)),t?.(e,n,r,i,o),!0},deleteProperty:(e,t)=>{let r=e[t];return t in e&&(delete e[t],a.delete(t),l(t)),n?.(e,t,r),!0}})},OK=new WeakMap,kK=(e,t,n=`currentValues`)=>{let r=e?.[n]?.[t];if(!r)return{};let i=TK(r);if(i===void 0)return Yr(r);let a=OK.get(r);if(a?.version===i)return a.snapshot;let o=eo(()=>Yr(r));return OK.set(r,{version:i,snapshot:o}),o},AK=e=>Object.fromEntries(Object.keys(e.currentValues??{}).map(t=>[t,kK(e,t)])),jK=(e,t,n,r=`currentValues`)=>Uje(e?.[r]?.[t],n)===void 0?kK(e,t,r):eo(()=>kK(e,t,r)),MK=`entry-draft`,NK=`data-entry-draft-root`,PK=new WeakMap,Wje=new WeakMap,Gje=e=>Object.fromEntries(Object.entries(e.originalValues).map(([e,t])=>[e,t&&Nl(Wje,t,()=>eo(()=>Yr(t)))])),Kje=e=>e&&{...e,originalValues:Gje(e),currentValues:AK(e)},FK=class{#e=j();get current(){return z(this.#e)}set current(e){M(this.#e,e)}#t=A(()=>SK(Kje(this.current)));get modified(){return z(this.#t)}set modified(e){M(this.#t,e)}},IK=e=>ti(MK,e),LK=()=>ei(MK),RK=e=>new Map([[MK,e]]),zK=(e,t)=>{e.setAttribute(NK,``),PK.set(e,t)},qje=e=>{let t=e?.closest(`[${NK}]`);return t?PK.get(t):void 0},BK=e=>{queueMicrotask(e)},VK=`field-editor`,HK=e=>e===`extraValues`,UK=()=>ei(VK)??{},WK=e=>{ti(VK,e)},GK=new Set,KK=tl(!1),Jje=e=>{let t=()=>{GK.delete(e),KK.current=!!GK.size};GK.add(e),KK.current=!0,e.then(t,t)},qK=async()=>{for(;GK.size;)await Promise.allSettled(GK)},JK=async e=>{await qK(),e()},YK=e=>{L(()=>{if(!e())return;let{promise:t,resolve:n}=Promise.withResolvers();return Jje(t),async()=>{await Za(),n()}})};function Yje(e,t){O(t,!0);let n=LK(),{valueStoreKey:r=`currentValues`}=UK(),i=J(t,`currentValue`,15),a=J(t,`required`,3,!0),o=J(t,`readonly`,3,!1),s=J(t,`invalid`,3,!1),c=j(``),l=j(``),u=j(!1),d=A(()=>Tr(t.fieldConfig.default_language,`plain`)),f=A(()=>Tr(t.fieldConfig.allow_language_selection,!0)),p=A(()=>Tr(t.fieldConfig.output_code_only,!1)),m=A(()=>Tr(t.fieldConfig.keys,()=>({code:`code`,lang:`lang`}),!0)),h=A(()=>jK(n.current,t.locale,t.keyPath,r)),g=A(()=>`${t.keyPath}.${z(m).code}`),_=A(()=>`${t.keyPath}.${z(m).lang}`),v={code:``,lang:``},y=()=>{if(z(p))typeof i()==`string`?z(c)!==i()&&M(c,i(),!0):M(c,``),M(l,z(d),!0);else{let e=z(h)[z(g)],t=z(h)[z(_)]||z(d);typeof e==`string`?z(c)!==e&&M(c,e,!0):M(c,``),typeof t==`string`?z(l)!==t&&M(l,t,!0):M(l,z(d),!0),v={code:z(c),lang:z(h)[z(_)]===``?``:z(l)}}},b=()=>{if(z(p)){i()!==z(c)&&i(z(c));return}if(z(c)===v.code&&z(l)===v.lang)return;let e=n.current;if(!e)return;v={code:z(c),lang:z(l)};let a={};if((!X(z(h)[t.keyPath])||Object.keys(z(h)[t.keyPath]).length)&&(a[t.keyPath]={}),z(h)[z(g)]!==z(c)&&(a[z(g)]=z(c)),z(h)[z(_)]!==z(l)&&(a[z(_)]=z(l)),!Object.keys(a).length)return;let o=e[r][t.locale];BK(()=>{Object.assign(o,a)})};sl(()=>z(h),()=>{y()}),sl(()=>[z(c),z(l)],()=>{b()}),YK(()=>z(u));var x=H();Do(P(x),Iu,null,e=>{var n=H();Oo(P(n),()=>JSON.stringify(t.fieldConfig),e=>{KEe(e,{get showLanguageSwitcher(){return z(f)},flex:!0,get readonly(){return o()},get required(){return a()},get invalid(){return s()},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`},get code(){return z(c)},set code(e){M(c,e,!0)},get lang(){return z(l)},set lang(e){M(l,e,!0)},get pending(){return z(u)},set pending(e){M(u,e,!0)}})}),U(e,n)}),U(e,x),k()}var Xje=B(`<pre> </pre>`);function Zje(e,t){O(t,!0);let n=LK(),r=A(()=>Tr(t.fieldConfig.default_language,``)),i=A(()=>Tr(t.fieldConfig.output_code_only,!1)),a=A(()=>Tr(t.fieldConfig.keys,()=>({code:`code`,lang:`lang`}),!0)),o=A(()=>jK(n.current,t.locale,t.keyPath)),s=A(()=>`${t.keyPath}.${z(a).code}`),c=A(()=>`${t.keyPath}.${z(a).lang}`),l=A(()=>z(i)?t.currentValue:z(o)[z(s)]),u=A(()=>z(i)?z(r):z(o)[z(c)]);var d=H(),f=P(d),p=e=>{var t=Xje(),n=F(t,!0);R(()=>{$o(t,1,Yo(z(u)?`language-${z(u)}`:void 0)),W(n,z(l))}),U(e,t)};G(f,e=>{z(l)&&e(p)}),U(e,d),k()}var XK=/^#(?<r>[0-9a-f]{2})(?<g>[0-9a-f]{2})(?<b>[0-9a-f]{2})(?<a>[0-9a-f]{2})?$/i,ZK=e=>Number.parseInt(e,16),Qje=(e,{enableAlpha:t=!1}={})=>{let{r:n,g:r,b:i,a}=e?.match(XK)?.groups??{};if(!n)return``;let o=t&&a?` / ${Math.round(ZK(a)/255*100)}%`:``;return`rgb(${ZK(n)} ${ZK(r)} ${ZK(i)}${o})`},$je=/^#[0-9a-f]{6}$/i,eMe=e=>{if(typeof e!=`string`)return;let{r:t,g:n,b:r,a:i=`ff`}=e.match(XK)?.groups??{};if(t)return{rgb:`#${t}${n}${r}`,alpha:ZK(i)}},QK=({rgb:e,alpha:t,enableAlpha:n=!1})=>$je.test(e)?n?`${e}${t.toString(16).padStart(2,`0`)}`:e:``,tMe=({currentValue:e,rgb:t,alpha:n,enableAlpha:r=!1})=>{let i=eMe(e);if(i)return i;if((e==null||e===``)&&QK({rgb:t,alpha:n,enableAlpha:r})!==``)return{rgb:``,alpha:255}},nMe=B(` <!>`,1),rMe=B(`<span role="none" class="value svelte-udhsyb"><!> <!></span>`),iMe=B(`<div role="none" class="svelte-udhsyb"><!> <!> <!></div>`),aMe={hash:`svelte-udhsyb`,code:`div.svelte-udhsyb {display:flex;align-items:center;gap:8px;.value:where(.svelte-udhsyb) {display:flex;align-items:center;gap:8px;.sui.text-input {width:88px;min-width:0;}.sui.slider {padding:8px;--sui-slider-base-width: 80px;}}}`};function oMe(e,t){let n=mo();O(t,!0),K(e,aMe);let r=J(t,`currentValue`,15),i=J(t,`required`,3,!0),a=J(t,`readonly`,3,!1),o=J(t,`invalid`,3,!1),s=j(``),c=j(255),l=A(()=>Tr(t.fieldConfig.allowInput,!1)),u=A(()=>Tr(t.fieldConfig.enableAlpha,!1)),d={rgb:``,alpha:255},f=()=>{let e=tMe({currentValue:r(),rgb:z(s),alpha:z(c),enableAlpha:z(u)});e&&(z(s)!==e.rgb&&M(s,e.rgb,!0),z(u)&&z(c)!==e.alpha&&M(c,e.alpha,!0)),d={rgb:z(s),alpha:z(c)}},p=()=>{if(z(s)===d.rgb&&z(c)===d.alpha)return;let e=QK({rgb:z(s),alpha:z(c),enableAlpha:z(u)});r()!==e&&r(e)};sl(()=>r(),()=>{f()}),sl(()=>[z(s),z(c)],()=>{p()});var m=iMe(),h=N(m);oOe(h,{get id(){return`${n}-picker`},get readonly(){return a()},get required(){return i()},get invalid(){return o()},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`},get value(){return z(s)},set value(e){M(s,e,!0)}});var g=I(h,2),_=e=>{var r=rMe(),d=N(r),f=e=>{NS(e,{dir:`ltr`,get id(){return`${n}-input`},get invalid(){return o()},get readonly(){return a()},get required(){return i()},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`},get value(){return z(s)},set value(e){M(s,e,!0)}})};G(d,e=>{z(l)&&e(f)});var p=I(d,2),m=e=>{var t=nMe(),n=P(t),r=I(n);{let e=A(()=>!z(s)),t=A(()=>Y(`opacity`));she(r,{min:0,max:255,get disabled(){return z(e)},get readonly(){return a()},get sliderLabel(){return z(t)},get value(){return z(c)},set value(e){M(c,e,!0)}})}R(e=>W(n,`${e??``} `),[()=>Y(`opacity`)]),U(e,t)};G(p,e=>{z(u)&&e(m)}),D(r),U(e,r)};G(g,e=>{(z(l)||z(u))&&e(_)});var v=I(g,2),y=e=>{{let t=A(()=>Y(`clear`)),r=A(()=>!z(s)),i=A(()=>`${n}-picker ${z(l)?`${n}-input`:``}`);Xx(e,{variant:`tertiary`,get label(){return z(t)},get disabled(){return z(r)},get"aria-controls"(){return z(i)},onclick:()=>{M(s,``),M(c,255)}})}};G(v,e=>{!a()&&!i()&&e(y)}),D(m),U(e,m),k()}var sMe=B(`<p><span role="none" class="preview svelte-1m6xsa0"><span role="none" class="color svelte-1m6xsa0"></span> <span role="none" class="value"> </span> <span role="none" class="value"> </span></span></p>`),cMe={hash:`svelte-1m6xsa0`,code:`.preview.svelte-1m6xsa0 {display:inline-flex;align-items:center;gap:8px;.color:where(.svelte-1m6xsa0) {display:block;width:24px;height:24px;border-radius:24px;}}`};function lMe(e,t){O(t,!0),K(e,cMe);let n=A(()=>Tr(t.fieldConfig.enableAlpha,!1)),r=A(()=>Qje(t.currentValue,{enableAlpha:z(n)}));var i=H(),a=P(i),o=e=>{var n=sMe(),i=N(n),a=N(i);let o;var s=I(a,2),c=F(s,!0),l=F(I(s,2),!0);D(i),D(n),R(()=>{o=ts(a,``,o,{"background-color":t.currentValue}),W(c,t.currentValue),W(l,z(r))}),U(e,n)},s=A(()=>typeof t.currentValue==`string`&&t.currentValue.trim());G(a,e=>{z(s)&&e(o)}),U(e,i),k()}function uMe(e,t){O(t,!0);let n=J(t,`required`,3,!0),r=J(t,`readonly`,3,!1),i=J(t,`invalid`,3,!1);{let a=A(()=>String(t.currentValue));NS(e,{dir:`auto`,get value(){return z(a)},flex:!0,get readonly(){return r()},get required(){return n()},get invalid(){return i()},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`}})}k()}var $K=e=>{let t=new Map;return Object.keys(e).forEach(e=>{let n=e.split(`.`),r=``;n.forEach((e,n)=>{if(n>0){let n=t.get(r);n?n.add(e):t.set(r,new Set([e]))}r=n===0?e:`${r}.${e}`})}),{childSegmentMap:t}},eq=(e,t)=>e.childSegmentMap.has(t),tq=(e,t)=>[...e.childSegmentMap.get(t)??[]].filter(eh).map(Number).sort((e,t)=>e-t),nq=e=>{let t=new Map;return Object.keys(e).forEach(e=>{let n=0;for(;;){let r=e.indexOf(`.`,n);if(r===-1)return;let i=e.indexOf(`.`,r+1),a=i===-1?e.length:i,o=e.slice(r+1,a);if(eh(o)){let n=e.slice(0,r),i=t.get(n);i?i.add(Number(o)):t.set(n,new Set([Number(o)]))}n=r+1}}),t},rq=(e,t)=>[...e.get(t)??[]].sort((e,t)=>e-t),dMe=/\s*(?:(?<number>\d+(?:\.\d+)?|\.\d+)|(?<tag>\0)|(?<name>[A-Za-z_]\w*)|(?<punctuator>[-+*/%(),]))/y,fMe=/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[-+]?\d+)?$/i,iq=e=>e.reduce((e,t)=>e+t,0),aq={abs:{minArgs:1,maxArgs:1,fn:Math.abs},ceil:{minArgs:1,maxArgs:1,fn:Math.ceil},floor:{minArgs:1,maxArgs:1,fn:Math.floor},round:{minArgs:1,maxArgs:2,fn:(e,t=0)=>rh(e,Math.trunc(t))},avg:{minArgs:1,maxArgs:1/0,aggregate:e=>e.length?iq(e)/e.length:void 0},count:{minArgs:1,maxArgs:1/0,aggregate:e=>e.length,anyValue:!0},max:{minArgs:1,maxArgs:1/0,aggregate:e=>e.length?Math.max(...e):void 0},min:{minArgs:1,maxArgs:1/0,aggregate:e=>e.length?Math.min(...e):void 0},sum:{minArgs:1,maxArgs:1/0,aggregate:iq}},pMe=100,mMe=new Map,hMe=e=>{let t=[],n=new RegExp(dMe),r=0,i=e.trimEnd().length;for(;n.lastIndex<i;){let i=n.exec(e)?.groups;if(!i)return;i.number===void 0?i.tag===void 0?i.name===void 0?t.push({type:`punctuator`,value:i.punctuator}):t.push({type:`name`,name:i.name}):(t.push({type:`tag`,index:r}),r+=1):t.push({type:`number`,value:Number(i.number)})}return t},gMe=e=>{let t=0,n=new Set,r=n=>{let r=e[t];return r?.type===`punctuator`&&r.value===n&&(t+=1,!0)},i,a=(e,t)=>{let n=t();for(;n;){let i=e.find(r);if(!i)break;let a=t();n=a?{type:`binary`,operator:i,left:n,right:a}:void 0}return n},o=()=>{let e=[];if(r(`)`))return e;do{let t=i();if(!t)return;e.push(t)}while(r(`,`));return r(`)`)?e:void 0},s=()=>{let a=e[t];if(a?.type===`number`||a?.type===`tag`)return t+=1,a;if(a?.type===`name`){t+=1;let{name:e}=a,i=Object.hasOwn(aq,e)?aq[e]:void 0,s=i&&r(`(`)?o():void 0;return!i||!s||s.length<i.minArgs||s.length>i.maxArgs?void 0:(i.aggregate&&s.forEach(e=>{e.type===`tag`&&n.add(e.index)}),{type:`call`,name:e,args:s})}if(r(`(`)){let e=i();return e&&r(`)`)?e:void 0}},c=()=>{let e=[`-`,`+`].find(r);if(!e)return s();let t=c();return t?{type:`unary`,operator:e,operand:t}:void 0},l=()=>a([`*`,`/`,`%`],c);i=()=>a([`+`,`-`],l);let u=i();return{tree:t===e.length?u:void 0,allItemsTagIndexes:n}},oq=e=>Ll(mMe,e,()=>{let{tags:t,literals:n}=$d(e),r=hMe(n.join(`\0`)),{tree:i,allItemsTagIndexes:a}=r?gMe(r):{tree:void 0,allItemsTagIndexes:new Set};return{tree:i,tags:t.map((e,t)=>({content:e,allItems:a.has(t)}))}},pMe),sq=e=>String(e??``).trim(),cq=e=>{let t=sq(e);return fMe.test(t)?Number(t):void 0},_Me=e=>!sq(e),vMe=(e,t,n,r)=>{let i=[];for(let a of t){let t=a.type===`tag`?n[a.index]:void 0;if(Array.isArray(t))for(let n of t.filter(e=>!_Me(e))){let t=e.anyValue?0:cq(n);if(t===void 0)return;i.push(t)}else{let e=r(a);if(e===void 0)return;i.push(e)}}return e.aggregate(i)},lq=(e,t)=>{if(e.type===`number`)return e.value;if(e.type===`tag`)return t[e.index];if(e.type===`unary`){let n=lq(e.operand,t);return n===void 0?void 0:e.operator===`-`?-n:n}if(e.type===`call`){let n=aq[e.name];if(n.aggregate)return vMe(n,e.args,t,e=>lq(e,t));let r=e.args.map(e=>lq(e,t));return r.includes(void 0)?void 0:n.fn(...r)}let n=lq(e.left,t),r=lq(e.right,t);if(n!==void 0&&r!==void 0)switch(e.operator){case`+`:return n+r;case`-`:return n-r;case`*`:return n*r;case`/`:return n/r;default:return n%r}},yMe=(e,t)=>{let{tree:n,tags:r}=oq(e);if(!n)return;let i=lq(n,r.map(({content:e,allItems:n})=>n?[t(e,{allItems:n})].flat():cq(t(e,{allItems:n}))));return i!==void 0&&Number.isFinite(i)?i:void 0},bMe=new WeakMap,uq=e=>{let t=e.split(`.`).findLast(eh);return t===void 0?void 0:Number(t)},dq=e=>Object.hasOwn(Xd,e),fq=e=>{let{tags:t,literals:n}=$d(e),r=t.map(e=>gU(e).value),i=n.map(Fc),a=r.findIndex(e=>!dq(e)),o=r.findLastIndex(e=>!dq(e)),s=(e,t)=>r.slice(e,t).map((t,n)=>`${i[e+n]}(${Xd[t].pattern})`).join(``)+i[t],c=a===-1?s(0,r.length):`${s(0,a)}[\\s\\S]*${s(o+1,r.length)}`;return{uuidTags:r.map((e,t)=>({tagName:e,extractable:a===-1||t<a||t>o})).filter(({tagName:e})=>dq(e)),regex:RegExp(`^${c}$`,`i`)}},xMe=(e=``)=>fq(e).uuidTags.length>0,SMe=({valueTemplate:e,keyPath:t,valueMap:n})=>{let{uuidTags:r,regex:i}=fq(e);if(!r.length)return[];let a=n[t],o=typeof a==`string`?a.match(i)?.slice(1):void 0;if(o?.length===r.length)return o;let s=Nl(bMe,n,()=>new Map),c=s.get(t);if(c?.length!==r.length&&(c=r.map(({tagName:e})=>jc(Xd[e].length)),s.set(t,c)),!o)return c;let l=0;return r.map(({extractable:e},t)=>{if(!e)return c[t];let n=o[l];return l+=1,n})},CMe=(e,t)=>{let n=zU(t),r=!RU(t),i=e===void 0?void 0:(r?Math.round(e):th(e))+0;return i===void 0||r&&!Number.isSafeInteger(i)?n?``:null:n?String(i):i},wMe=({value:e,fieldConfig:t,canonicalLocale:n})=>{let r=String(e??``),i=Number(e);return BU(t)&&r.trim()&&Number.isFinite(i)?IU(n).format(i):r},TMe=new WeakMap,EMe=({fieldKeyPath:e,ownKeyPath:t,allItems:n,valueMap:r})=>{let i=e.split(`.`),a=i.lastIndexOf(`*`);if(a===-1)return[e];let o=t.split(`.`),s=[[]];return i.forEach((e,t)=>{e===`*`?s=s.flatMap(e=>{let i=n&&t===a,s=o[t];return!i&&eh(s??``)&&e.every((e,t)=>e===o[t])?[[...e,s]]:n?rq(Nl(TMe,r,()=>nq(r)),e.join(`.`)).map(t=>[...e,String(t)]):[]}):s.forEach(t=>t.push(e))}),s.map(e=>e.join(`.`))},DMe=(e,t)=>Object.fromEntries(Object.entries(e).filter(([e])=>e.startsWith(t)).map(([e,n])=>[e.slice(t.length),n])),OMe=(e,t)=>{let{keyPath:n,valueMap:r,keyPathPrefix:i,componentName:a,collectionName:o,fileName:s,isIndexFile:c}=e;return i?a&&lh({collectionName:o,fileName:s,isIndexFile:c,keyPath:t,componentName:a})?(e.componentValues??=DMe(r,i),{valueMap:e.componentValues,componentName:a,ownKeyPath:n.slice(i.length)}):{valueMap:e.entryValueMap,ownKeyPath:i.split(`:`)[0]}:{valueMap:r,ownKeyPath:n}},kMe=(e,t)=>!!e&&(BU(e)||t&&(e.widget===`select`||e.widget===`relation`)),pq=(e,t,n,r)=>{let{locale:i,collectionName:a,fileName:o,isIndexFile:s,numeric:c,listFormatter:l}=e,{valueMap:u,componentName:d}=n,f={collectionName:a,fileName:o,componentName:d,valueMap:u,keyPath:t,isIndexFile:s},p=u[t],m=p!==void 0;if(m){let e=lh(f);if(kMe(e,c)){let t=String(p??``);return r.length?_U({fieldConfig:e,value:t,transformations:r,locale:i}):t}}let h=VG({...f,locale:i,transformations:m?r:void 0}),g=Array.isArray(h)?l.format(h):String(h);return!m&&r.length?_U({value:g,transformations:r,locale:i}):g},AMe=({fieldConfig:e,keyPath:t,locale:n,valueMap:r,collectionName:i,fileName:a,isIndexFile:o=!1,keyPathPrefix:s=``,entryValueMap:c={}})=>{let{value:l=``}=e,u=BU(e);if(!u&&l===`{{index}}`)return uq(t)??``;let d=u?[]:SMe({valueTemplate:l,keyPath:t,valueMap:r}),f=0,p={keyPath:t,locale:n,valueMap:r,collectionName:i,fileName:a,isIndexFile:o,keyPathPrefix:s,entryValueMap:c,componentName:s?r[`${s}__sc_component_name`]:void 0,numeric:u,listFormatter:kf(n)},m=(e,{allItems:r=!1}={})=>{let{value:i,transformations:a}=gU(e);if(i===`index`){let e=String(uq(t)??``);return r?[e]:e}let o=SH(a,e=>dq(gU(e).value)?``:m(e));if(Yd.test(i)){let e=nf(i),t=OMe(p,e),n=EMe({fieldKeyPath:e,ownKeyPath:t.ownKeyPath,allItems:r,valueMap:t.valueMap});return r?n.map(e=>pq(p,e,t,o)):pq(p,n[0]??e,t,o)}if(!dq(i))return r?[]:``;let s=d[f];return f+=1,o.length&&(s=_U({value:s,transformations:o,locale:n})),r?[s]:s};return u?CMe(yMe(l,m),e):Qd(l,(e,t)=>m(t))},jMe=B(`<p> </p>`);function MMe(e,t){O(t,!0);let n=A(()=>Ef(t.locale));var r=jMe(),i=F(r,!0);R((e,t)=>{q(r,`lang`,z(n)),q(r,`dir`,e),W(i,t),r.dir=r.dir},[()=>Df(t.locale),()=>wMe({value:t.currentValue,fieldConfig:t.fieldConfig,canonicalLocale:z(n)})]),U(e,r),k()}var mq=(e,t,n)=>{let r=t?.media_libraries?.[e];if(r!=null)return r;let{media_library:i}=t??{},a=El.current?.media_library?.name??n;return i&&(i.name??a)===e&&(!n||a===e)?i:void 0},hq=(e,t)=>{if(t===void 0)return e;if(!t||!e)return t;let n={...e,...t};return Object.entries(t).forEach(([t,r])=>{X(r)&&X(e[t])&&(n[t]={...e[t],...r})}),n},gq=(e,t)=>hq(mq(e,El.current),mq(e,t)),_q=tl(!1),vq=tl(!1),yq=tl(!1),bq=new URL(`https://console.cloudinary.com/console/media_library`).origin,NMe=[`cloud_name`,`api_key`,`username`,`timestamp`,`signature`,`integration`,`use_saml`,`saml_iframe_support`],PMe=[`integration`,`inline_container`,`z_index`,`multiple`,`max_files`,`default_transformations`,`insert_caption`,`remove_header`,`folder`,`search`,`collection`,`asset`,`transformation`,`sandboxNotAllowedAttributes`,`theme`],FMe=(e=El.current)=>mq(`cloudinary`,e),xq=new Map,Sq=e=>{let t=e?JSON.stringify(e):`global`,n=xq.get(t);if(n)return n;let r=gq(`cloudinary`,e)||{},i={...r,config:{...r.config}};return xq.set(t,i),i},Cq=e=>{let t=gq(`cloudinary`,e),{cloud_name:n,api_key:r}=(t?t.config:void 0)??{};return{cloudName:n,apiKey:r}},IMe=e=>{let{cloudName:t,apiKey:n}=Cq(e);return!!(t&&n)},LMe=e=>{let{cloudName:t}=Cq();return!!t&&e.startsWith(`https://res.cloudinary.com/${t}/`)},wq=({origin:e,data:t})=>{if(e===bq){if(typeof t==`string`)try{t=JSON.parse(t)}catch{return}return X(t)?t:void 0}},RMe={serviceType:`cloud_storage`,serviceId:`cloudinary`,serviceLabel:`Cloudinary`,serviceURL:`https://cloudinary.com/`,showServiceLink:!0,hotlinking:!0,authType:`widget`,developerURL:`https://cloudinary.com/documentation/`,apiKeyURL:`https://console.cloudinary.com/settings/api-keys`,apiKeyPattern:/^[A-Za-z0-9_-]{15,}$/,isEnabled:IMe,isAssetURL:LMe},Tq=(e,{noopener:t=!0}={})=>{if(!e)return null;let n=t?`noopener,noreferrer`:``;return window.open(e,`_blank`,n)},zMe=B(`<!> <div role="none"> </div>`,1);function Eq(e,t){O(t,!0);let n=J(t,`multiple`,3,!1),r=J(t,`hidden`,3,!1),i=A(()=>Sq(t.fieldConfig)),a=null,o=()=>{let{folder:e}=z(i).config,r={...Object.fromEntries(Object.entries(z(i).config).filter(([e])=>PMe.includes(e))),multiple:n(),max_files:t.fieldConfig?.max??z(i).config.max_files??20,folder:{path:e?.path??``,resource_type:e?.resource_type??t.kind}},o={type:`ML_WIDGET_SHOW`,data:{mlId:a?.dataset?.mlId,config:r}};console.debug(`Cloudinary Panel sending message:`,o),a?.contentWindow?.postMessage(JSON.stringify(o),bq)},s=({assets:e})=>{let{output_filename_only:n=!1,use_transformations:r=!0}=z(i),a=e.map(e=>{let t=e.secure_url;if(n){let{public_id:t,format:n}=e;return{url:n?`${t}.${n}`:t}}return r?{url:e.derived?.[0]?.secure_url??t}:{url:t}});t.onSelect(a)},c=e=>{let t=wq(e);t&&(console.debug(`Cloudinary Panel received message:`,t),t.type===`login`&&t.consoleDomain&&(_q.current=!0,yq.current=!0),t.type===`ML_WIDGET_INSERT_DATA`&&(yq.current=!1,s(t.data)),t.type===`ML_WIDGET_HIDE`&&(yq.current=!1))};So(()=>(a=document.querySelector(`iframe#cloudinary-iframe`),window.addEventListener(`message`,c),()=>{window.removeEventListener(`message`,c)})),L(()=>{z(i)&&vq.current&&o()});var l=H(),u=P(l),d=e=>{dH(e,{children:(e,t)=>{var n=H(),r=P(n),i=e=>{{let t=A(()=>Y(`cloud_storage.cloudinary.open_library`));Xx(e,{variant:`primary`,get label(){return z(t)},onclick:()=>{yq.current=!0}})}},a=e=>{var t=zMe(),n=P(t);{let e=A(()=>Y(`cloud_storage.cloudinary.activate.button_label`));Xx(n,{variant:`primary`,get label(){return z(e)},onclick:()=>{Tq(`https://console.cloudinary.com/console/media_library/cms_login?cms=true`,{noopener:!1})}})}var r=F(I(n,2),!0);R(e=>W(r,e),[()=>Y(`cloud_storage.cloudinary.activate.description`)]),U(e,t)};G(r,e=>{_q.current?e(i):e(a,-1)}),U(e,n)},$$slots:{default:!0}})};G(u,e=>{r()||e(d)}),U(e,l),k()}var BMe=B(`<strong></strong>`),VMe=B(`<!>/`,1),HMe=B(`<span class="name svelte-1ngvthn" dir="ltr" aria-hidden="true"><!> <!></span>`),UMe={hash:`svelte-1ngvthn`,code:`.name.svelte-1ngvthn {color:var(--sui-tertiary-foreground-color);strong {color:var(--sui-primary-foreground-color);font-weight:var(--sui-font-weight-normal);}}`};function Dq(e,t){O(t,!0),K(e,UMe);let n={ALLOWED_TAGS:[`wbr`],ALLOWED_ATTR:[]},r=J(t,`children`,3,void 0),i=A(()=>t.path?Lc(t.path).split(`/`):t.caption?[t.caption]:[]),a=e=>dt(e.replace(/([-_.])/g,`$1<wbr>`),n);var o=H(),s=P(o),c=e=>{var t=HMe(),n=N(t);Nx(n,{lines:2,children:(e,t)=>{var n=H();No(P(n),19,()=>z(i),(e,t)=>`${e}-${t}`,(e,t,n)=>{var r=H(),o=P(r),s=e=>{var n=BMe();Lo(n,()=>a(z(t)),!0),D(n),U(e,n)},c=e=>{var n=VMe();Lo(P(n),()=>a(z(t))),Ur(),U(e,n)};G(o,e=>{z(n)===z(i).length-1?e(s):e(c,-1)}),U(e,r)}),U(e,n)},$$slots:{default:!0}}),xo(I(n,2),()=>r()??Cr),D(t),R(()=>t.dir=t.dir),U(e,t)};G(s,e=>{z(i).length&&e(c)}),U(e,o),k()}var Oq=e=>{{let t=A(()=>Tc()?`chevron_left`:`chevron_right`);gx(e,{get name(){return z(t)},class:`separator`})}},kq=(e,t)=>{let n=()=>(t?.()).label,r=()=>(t?.()).onClick;var i=GMe(),a=P(i);Xx(a,{variant:`link`,class:`crumb`,get onclick(){return r()},children:(e,t)=>{var r=WMe(),i=F(r,!0);R(()=>W(i,n())),U(e,r)},$$slots:{default:!0}}),Oq(I(a,2)),U(e,i)},WMe=B(`<bdi class="svelte-r6xh9b"> </bdi>`),GMe=B(`<!> <!>`,1),KMe=B(`<!> <!> <!>`,1),qMe=B(`<span class="crumb svelte-r6xh9b"><bdi> </bdi></span> <!>`,1),JMe=B(`<nav><!> <span class="current svelte-r6xh9b"><bdi> </bdi></span> <div class="copy svelte-r6xh9b" aria-hidden="true" inert=""><!> <span class="current svelte-r6xh9b"><bdi> </bdi></span></div></nav>`),YMe={hash:`svelte-r6xh9b`,code:`.breadcrumb.svelte-r6xh9b {position:relative;display:flex;align-items:center;gap:4px;min-width:0;white-space:nowrap;
/* A name is cut short with an ellipsis rather than wrapped, down to the least width the script
above gives it, so the trail stays one line tall */& > .crumb,
& > .current:where(.svelte-r6xh9b) {flex:0 1 auto;overflow:hidden;min-width:0;text-overflow:ellipsis;}.current:where(.svelte-r6xh9b) {display:block;}.copy:where(.svelte-r6xh9b) {position:absolute;inset-block-start:0;inset-inline-start:0;display:flex;align-items:center;gap:4px;visibility:hidden;pointer-events:none;& > :where(.svelte-r6xh9b) {flex:none;}}.sui.button.crumb {display:block;color:var(--sui-secondary-foreground-color);font-size:inherit;.label {display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}&:hover .label {color:var(--sui-primary-foreground-color);}}.separator,
.more {flex:none;color:var(--sui-secondary-foreground-color);}}`};function Aq(e,t){O(t,!0),K(e,YMe);let n=J(t,`class`,3,``),r=j(void 0),i=j(void 0),a=j(!1),o=A(()=>t.items.slice(0,-1)),s=A(()=>t.items.at(-1)),c=A(()=>z(o).slice(1)),l=A(()=>z(c).length>0),u=e=>e.querySelector(`bdi`)?.textContent??``,d=()=>{if(!z(r)||!z(i))return;let e=parseFloat(getComputedStyle(z(r)).fontSize),t={},n=(z(i).children.length-1)*4;[...z(i).children].forEach(r=>{let{classList:i}=r,{width:a}=r.getBoundingClientRect();if(i.contains(`crumb`)||i.contains(`current`)){let o=Math.min(a,e*(i.contains(`current`)?6:4.5));t[u(r)]=o,n+=o}else n+=a}),[...z(r).children].forEach(e=>{let{classList:n}=e;(n.contains(`crumb`)||n.contains(`current`))&&(e.style.minWidth=`${t[u(e)]}px`)}),M(a,z(l)&&n>z(r).clientWidth+1,!0)};L(()=>{t.items;let e=z(r);if(!e)return;let n=new ResizeObserver(()=>{requestAnimationFrame(()=>{d()})});return n.observe(e),eo(()=>{d()}),document.fonts.ready.then(()=>{d()}),()=>{n.disconnect()}}),L(()=>{z(a),eo(()=>{d()})});var f=JMe(),p=N(f),m=e=>{var t=KMe(),n=P(t);kq(n,()=>z(o)[0]);var r=I(n,2);{let e=e=>{gx(e,{name:`more_horiz`})},t=e=>{{let t=A(()=>Y(`more_folders`));qS(e,{get ariaLabel(){return z(t)},children:(e,t)=>{var n=H();No(P(n),17,()=>z(c),Ao,(e,t)=>{let n=()=>z(t).label,r=()=>z(t).onClick;JS(e,{variant:`ghost`,get label(){return n()},get onclick(){return r()},startIcon:e=>{gx(e,{name:`folder`})},$$slots:{startIcon:!0}})}),U(e,n)},$$slots:{default:!0}})}},n=A(()=>Y(`more_folders`));hS(r,{variant:`ghost`,iconic:!0,size:`small`,class:`more`,get"aria-label"(){return z(n)},endIcon:e,popup:t,$$slots:{endIcon:!0,popup:!0}})}Oq(I(r,2)),U(e,t)},h=e=>{var t=H();No(P(t),17,()=>z(o),Ao,(e,t)=>{kq(e,()=>z(t))}),U(e,t)};G(p,e=>{z(a)?e(m):e(h,-1)});var g=I(p,2),_=F(N(g),!0);D(g);var v=I(g,2),y=N(v);No(y,17,()=>z(o),Ao,(e,t)=>{let n=()=>z(t).label;var r=qMe(),i=P(r),a=F(N(i),!0);D(i),Oq(I(i,2)),R(()=>W(a,n())),U(e,r)});var b=I(y,2),x=F(N(b),!0);D(b),D(v),gs(v,e=>M(i,e),()=>z(i)),D(f),gs(f,e=>M(r,e),()=>z(r)),R(e=>{$o(f,1,Yo([`breadcrumb`,n(),{folded:z(a)}]),`svelte-r6xh9b`),q(f,`aria-label`,e),W(_,z(s).label),W(x,z(s).label)},[()=>Y(`folder`)]),U(e,f),k()}var jq=({libraryName:e=`default`,fieldConfig:t}={})=>{let n=El.current,r=mq(e,n,`default`),i=mq(e,t,`default`),a=hq(r,i);if(a===!1)return!1;if(e!=="default")return{...a};let o={...n?.media_libraries?.all,...r?r.config:void 0,...t?.media_libraries?.all,...i?i.config:void 0};return a?.config!==void 0||Object.keys(o).length>0?{...a,config:o}:{...a}},Mq=[`avif`,`gif`,`heic`,`jpeg`,`png`,`webp`],XMe=[`image/heic`,`image/heif`],Nq=Mq.filter(e=>e!==`heic`).map(e=>`image/${e}`),Pq=/\.(?:avif|gif|heic|heif|jfif|jpe?g|jpe|png|webp)$/i,Fq=[`svg`],ZMe=[`image/svg+xml`],QMe=/\.(?:svg)$/i,$Me=[...Mq,...Fq],Iq=[...Nq,...ZMe],Lq=[...Iq,...XMe],eNe={avif:`AVIF`,gif:`GIF`,heic:`HEIC`,jpeg:`JPEG`,png:`PNG`,webp:`WebP`,svg:`SVG`},Rq=e=>{let t=e===Lq.join(`,`);if(t||e===Iq.join(`,`))return $Me.filter(e=>t||e!==`heic`).map(e=>eNe[e])},tNe=[`webp`],zq=(e,t,n)=>[...n].every((n,r)=>e[t+r]===n.charCodeAt(0)),Bq=e=>e&128?3*2**((e&7)+1):0,Vq=(e,t)=>{let n=t;for(;n<e.length&&e[n]!==0;)n+=e[n]+1;return n+1},nNe=e=>{let t=13+Bq(e[10]),n=0;for(;t<e.length;){let r=e[t];if(r===33)t=Vq(e,t+2);else if(r===44){if(n+=1,n>1)return!0;t=Vq(e,t+10+Bq(e[t+9])+1)}else break}return!1},rNe=e=>zq(e,12,`VP8X`)&&!!(e[20]&2),iNe=e=>{let t=new DataView(e.buffer,e.byteOffset,e.byteLength),n=8;for(;n+8<=e.length;){if(zq(e,n+4,`acTL`))return!0;if(zq(e,n+4,`IDAT`))return!1;n+=t.getUint32(n)+12}return!1},aNe=async(e,t)=>{if(t!==`gif`&&t!==`webp`&&t!==`png`)return!1;let n;try{n=new Uint8Array(await e.arrayBuffer())}catch{return!1}return t===`gif`?nNe(n):t===`webp`?rNe(n):iNe(n)},oNe=64,sNe=new Set([`heic`,`heix`,`heim`,`heis`,`hevc`,`hevx`,`hevm`,`hevs`,`mif1`,`msf1`]),cNe=new Set([`avif`,`avis`]),Hq=(e,t,n=0)=>[...t].every((t,r)=>e[n+r]===t.charCodeAt(0)),Uq=(e,t)=>String.fromCharCode(...e.subarray(t,t+4)),lNe=e=>{if(e.length<12||Uq(e,4)!==`ftyp`)return[];let t=new DataView(e.buffer,e.byteOffset).getUint32(0),n=Math.min(t,e.length),r=[Uq(e,8)];for(let t=16;t+4<=n;t+=4)r.push(Uq(e,t));return r},Wq=async e=>{let t;try{t=new Uint8Array(await e.slice(0,oNe).arrayBuffer())}catch{return}if(t.length<12)return;if(Hq(t,`ÿØÿ`))return`jpeg`;if(Hq(t,`‰PNG`))return`png`;if(Hq(t,`GIF8`))return`gif`;if(Hq(t,`RIFF`)&&Hq(t,`WEBP`,8))return`webp`;let n=lNe(t);if(n.some(e=>cNe.has(e)))return`avif`;if(n.some(e=>sNe.has(e)))return`heic`},Gq={},uNe=async e=>{if(e in Gq)return Gq[e];let t=`image/${e}`,n=new OffscreenCanvas(1,1);n.getContext(`2d`);let r=(await n.convertToBlob({type:t})).type===t;return Gq[e]=r,r},dNe=e=>{let{data:t}=e.getContext(`2d`).getImageData(0,0,e.width,e.height);for(let e=3;e<t.length;e+=4)if(t[e]<255)return!0;return!1},Kq=async(e,{format:t=`webp`,quality:n=85,nativeOnly:r=!1}={})=>{let i=`image/${t}`,a=await uNe(t);if(!a&&r)return e.convertToBlob({type:dNe(e)?`image/png`:`image/jpeg`,quality:n/100});if(!a&&tNe.includes(t)){let r=e.getContext(`2d`).getImageData(0,0,e.width,e.height);try{let e=(await Jc(`@jsquash/${t}`,`encode.js?module`)).default,a=await e(r,{quality:n});return new Blob([a],{type:i})}catch{}}return e.convertToBlob({type:i,quality:n/100})},fNe=1e4,qq,Jq=!1,Yq,pNe=Qv(1),mNe=()=>{let e=`${qc(`@discourse/heic`)}/index.js`;return`
import(${JSON.stringify(e)}).then(
({ decode }) => {
self.onmessage = async ({ data }) => {
try {
const { width, height, data: pixels } = await decode(data);
postMessage({ width, height, data: pixels }, [pixels.buffer]);
} catch (error) {
postMessage({ error: String(error?.message ?? error) });
}
};
postMessage({ ready: true });
},
(error) => postMessage({ error: String(error?.message ?? error) }),
);
`},Xq=class extends Error{},hNe=()=>new Promise((e,t)=>{let n=new Blob([mNe()],{type:`text/javascript`}),r=URL.createObjectURL(n),i;try{i=new Worker(r,{type:`module`})}catch(e){URL.revokeObjectURL(r),t(new Xq(`Failed to create a worker`,{cause:e}));return}let a=({data:n})=>{s(),n.ready?e(i):(i.terminate(),t(Error(n.error)))},o=e=>{s(),i.terminate(),t(new Xq(e.message))},s=()=>{i.removeEventListener(`message`,a),i.removeEventListener(`error`,o),URL.revokeObjectURL(r)};i.addEventListener(`message`,a),i.addEventListener(`error`,o)}),gNe=()=>(clearTimeout(Yq),qq??=hNe().catch(e=>{throw qq=void 0,e}),qq),_Ne=async()=>{let e=await qq;qq=void 0,e?.terminate()},vNe=(e,t)=>new Promise((n,r)=>{let i=({data:e})=>{if(o(),Yq=setTimeout(_Ne,fNe),e.error)r(Error(e.error));else try{n(new ImageData(e.data,e.width,e.height))}catch(e){r(e)}},a=t=>{o(),qq=void 0,e.terminate(),r(Error(t.message))},o=()=>{e.removeEventListener(`message`,i),e.removeEventListener(`error`,a)};e.addEventListener(`message`,i),e.addEventListener(`error`,a),e.postMessage(t,[t])}),yNe=async e=>{let{decode:t}=await Jc(`@discourse/heic`,`index.js`);return t(e)},bNe=async e=>{if(!Jq){let t;try{t=await gNe()}catch(e){if(!(e instanceof Xq))throw e;Jq=!0}if(t)return vNe(t,e)}return yNe(e)},xNe=e=>pNe(async()=>bNe(await e.arrayBuffer())),Zq=({format:e=`png`,quality:t=85,width:n=void 0,height:r=void 0,fit:i=`scale-down`,nativeOnly:a=!1}={})=>({format:e,quality:t,width:n,height:r,fit:i,nativeOnly:a}),SNe=({width:e,height:t},{width:n=e,height:r=t,fit:i=`scale-down`}={})=>{let a={scale:1,width:e,height:t};if(e===n&&t===r)return a;let o=e<=n&&t<=r,s=1,c=0,l=0;if(i===`scale-down`){if(o)return a;i=`contain`}return i===`contain`&&(s=Math.min(n/e,r/t),c=e*s,l=t*s),{scale:s,width:c,height:l}},Qq=(e,t,n)=>{let{scale:r,width:i,height:a}=SNe(t,n);return e.width=i,e.height=a,{scale:r,width:i,height:a}},$q={format:`webp`,quality:85,width:512,height:512,fit:`contain`,nativeOnly:!0},CNe=async({blob:e})=>{let t=URL.createObjectURL(e),n=new Image;return new Promise((e,r)=>{n.addEventListener(`load`,()=>{e({source:n,naturalWidth:n.naturalWidth,naturalHeight:n.naturalHeight}),URL.revokeObjectURL(t)},{once:!0}),n.addEventListener(`error`,()=>{URL.revokeObjectURL(t),r(Error(`Failed to decode image`))},{once:!0}),n.src=t})},wNe=async({blob:e})=>{let t=URL.createObjectURL(e),n=document.createElement(`video`);return new Promise((e,r)=>{n.addEventListener(`canplay`,()=>{n.pause(),e({source:n,naturalWidth:n.videoWidth,naturalHeight:n.videoHeight}),URL.revokeObjectURL(t)},{once:!0}),n.addEventListener(`error`,()=>{document.body.removeChild(n),URL.revokeObjectURL(t),r(Error(`Failed to decode video`))},{once:!0}),n.muted=!0,n.autoplay=!0,n.playsInline=!0,n.style.opacity=`0`,n.style.pointerEvents=`none`,document.body.appendChild(n),n.src=t})},TNe=async e=>e.type.startsWith(`video/`)?wNe({blob:e}):CNe({blob:e}),ENe=async e=>{if(await Wq(e)===`heic`)return createImageBitmap(await xNe(e))},eJ=async(e,t={})=>{let{format:n,quality:r,width:i,height:a,fit:o,nativeOnly:s}=Zq(t),c,l=0,u=0;try{c=await createImageBitmap(e)}catch{c=await ENe(e)}c?{width:l,height:u}=c:{source:c,naturalWidth:l,naturalHeight:u}=await TNe(e);let d=i??l,f=a??u,p=new OffscreenCanvas(512,512),m=p.getContext(`2d`);return Qq(p,{width:l,height:u},{fit:o,width:d,height:f}),m.drawImage(c,0,0,p.width,p.height),c instanceof HTMLVideoElement?document.body.removeChild(c):`close`in c&&c.close(),Kq(p,{format:n,quality:r,nativeOnly:s})},DNe=async e=>{let t=await e.text();try{let{optimize:n}=await Jc(`svgo`,`dist/svgo.browser.js`),{data:r}=n(t);return new Blob([r],{type:e.type})}catch{}return e},tJ=e=>typeof e==`string`&&e.trim()?e.trim():void 0,nJ=({fieldConfig:e}={})=>{let t=jq({fieldConfig:e}),{max_file_size:n,multiple:r,slugify_filename:i,filename_template:a,transformations:o}=typeof t==`boolean`?{}:t?.config??{};return{enabled:t!==!1,config:{max_file_size:typeof n==`number`&&Number.isInteger(n)?n:1/0,multiple:typeof r==`boolean`&&r,slugify_filename:typeof i==`boolean`&&i,filename_template:tJ(a),transformations:X(o)?o:void 0}}},rJ=e=>e&&Mq.includes(e)?e:void 0,ONe=async e=>{let[t,n]=e.type.split(`/`);if(t!==`image`&&!Pq.test(e.name))return{};let r=rJ(n);return{sourceFormat:rJ(await Wq(e))??r,declaredFormat:r}},iJ=e=>!!(e?.heic??e?.raster_image),kNe=e=>iJ(e)?Lq:Iq,aJ=({accept:e,image:t,transformations:n})=>e??(t?kNe(n).join(`,`):void 0),oJ=({name:e,type:t},n)=>Wc({name:e,type:t||gp.getType(e)||``},(n??``).split(`,`).map(e=>e.trim()).filter(Boolean)),ANe=async(e,t)=>{let[n,r]=e.type.split(`/`);if(n===`image`&&r===`svg+xml`)return t.svg?.optimize?new File([await DNe(e)],e.name,{type:e.type}):e;let{sourceFormat:i,declaredFormat:a}=await ONe(e);if(!i)return e;let o=t,s=o[i]??(a?o[a]:void 0)??t.raster_image;if(!s||await aNe(e,i))return e;let{format:c=`webp`,quality:l=85,width:u,height:d}=s,f;try{f=await eJ(e,{format:c,quality:l,width:u,height:d})}catch(t){if(i===`heic`)throw Error(`Failed to decode HEIC image`,{cause:t});return e}let[,p]=f.type.split(`/`),m=Pq.test(e.name)?e.name.replace(Pq,`.${p}`):`${e.name}.${p}`;return new File([f],m,{type:f.type})},sJ=tl(``),cJ=tl(),lJ=tl(),uJ=tl(),dJ=e=>!!e&&e.internalPath!==void 0&&!e.entryRelative&&!e.hasTemplateTags,fJ=(e,t)=>t===``?e:e.startsWith(`${t}/`)?e.slice(t.length+1):``,pJ=(e,t)=>dJ(e)?fJ(t,e.internalPath):``,mJ=(e,t=void 0)=>{if(t)return{folder:t,subfolderPath:pJ(t,e)};let n=Sy.current,r=n.find(({internalPath:t,collectionName:n})=>e===`-/all`?t===void 0&&n===void 0:t===e);if(r)return{folder:r,subfolderPath:``};let i=n.filter(t=>dJ(t)&&(t.internalPath===``||e.startsWith(`${t.internalPath}/`))).sort((e,t)=>t.internalPath.length-e.internalPath.length)[0];return i?{folder:i,subfolderPath:pJ(i,e)}:void 0},hJ=rl(()=>{let e=wy.current;return dJ(e)?$l([e.internalPath,sJ.current]):void 0}),gJ=rl(()=>yy(hJ.current??``)),_J=({dirPath:e,paths:t})=>{let n=e?`${e}/`:``,r=new Set;return t.forEach(e=>{if(!e.startsWith(n))return;let t=e.indexOf(`/`,n.length);t>n.length&&r.add(e.slice(n.length,t))}),[...r].sort(Bc).map(t=>({name:t,path:$l([e,t])}))},vJ=({subfolders:e,fileNames:t,exclude:n=void 0,dirPath:r=void 0})=>[...e.map(({name:e})=>e).filter(e=>e!==n),...t,...r===void 0?[]:_J({dirPath:r,paths:Sy.current.filter(({internalPath:e,hasTemplateTags:t})=>e&&!t).map(({internalPath:e})=>`${e}/`)}).map(({name:e})=>e)],yJ=e=>vJ({subfolders:_J({dirPath:e,paths:[...Dp.current,...Ip.current].map(({path:e})=>e)}),fileNames:[],dirPath:e}),bJ=e=>[...new Set([...Vp.current.flatMap(({locales:e})=>Object.values(e).map(({path:e})=>e)),...Ip.current.map(({path:e})=>e)].filter(t=>eu(t)===e).map(tu))],xJ=({rootLabel:e,subfolderNames:t,onBrowse:n})=>t.length?[...[e,...t.slice(0,-1)].map((e,r)=>({label:e,onClick:()=>{n({depth:r,path:t.slice(0,r).join(`/`)})}})),{label:t.at(-1)}]:[],SJ=e=>mJ(e)?.folder.internalPath,CJ=({dirPath:e,assets:t})=>{let n=SJ(e),r=Ip.current.filter(({path:e})=>SJ(eu(e))===n);return _J({dirPath:e,paths:[...t,...r].map(({path:e})=>e)})},wJ=({dirPath:e,assets:t})=>t.filter(({path:t})=>eu(t)===e),TJ=({folder:e,subfolderPath:t})=>e?.internalPath===void 0?void 0:$l([e.internalPath,t]),EJ=e=>{let{slugify_filename:t}=nJ().config,n=Zl(e.trim());return t?FH(n,{fallback:!1}):n},jNe=({name:e,takenNames:t})=>LH({name:e,takenNames:t,format:EJ,isReserved:Hle}),MNe={hash:`svelte-mz75if`,code:`.picker-breadcrumb {flex:none;padding:0 8px 8px;.current {font-weight:var(--sui-font-weight-bold);}}`};function DJ(e,t){O(t,!0),K(e,MNe);let n=J(t,`onNavigate`,3,void 0),r=A(()=>xJ({rootLabel:t.rootLabel,subfolderNames:t.path?t.path.split(`/`):[],onBrowse:({path:e})=>{n()?.(e)}}));var i=H(),a=P(i),o=e=>{Aq(e,{class:`picker-breadcrumb`,get items(){return z(r)}})};G(a,e=>{z(r).length&&e(o)}),U(e,i),k()}var NNe=B(`<span role="none" class="icon check-background"><!></span>`),PNe=B(`<div role="none"><!></div>`),FNe={hash:`svelte-1fitgoo`,code:`.wrapper.svelte-1fitgoo {display:contents;[role='option'] {position:relative;& > .icon.check {display:none;}&[aria-selected='false'] {.check-background {border-color:var(--sui-checkbox-border-color);background-color:var(--sui-checkbox-background-color);.icon {display:none;}}}&[aria-selected='true'] {.check-background {border-color:var(--sui-primary-accent-color);color:var(--sui-primary-accent-color-inverted);background-color:var(--sui-primary-accent-color);}}.check-background {display:flex;justify-content:center;align-items:center;border-width:1px;border-radius:var(--sui-checkbox-border-radius);width:20px;height:20px;pointer-events:none;.icon {color:inherit !important;font-size:20px;}}}&.grid {.check-background {position:absolute;inset-block-start:8px;inset-inline-start:8px;z-index:1;}}&.list {.check-background {margin-inline-start:16px;}}}`};function OJ(e,t){K(e,FNe);let n=J(t,`viewType`,3,`grid`);var r=PNe();KS(N(r),{label:``,get"aria-label"(){return t.ariaLabel},get value(){return t.value},get selected(){return t.selected},get onChange(){return t.onChange},startIcon:e=>{var n=H(),r=P(n),i=e=>{var t=NNe();gx(N(t),{name:`check`,class:`icon check`}),D(t),U(e,t)};G(r,e=>{t.multiple&&e(i)}),U(e,n)},children:(e,n)=>{var r=H();xo(P(r),()=>t.children??Cr),U(e,r)},$$slots:{startIcon:!0,default:!0}}),D(r),R(()=>$o(r,1,`wrapper ${n()??``}`,`svelte-1fitgoo`)),U(e,r)}var INe=()=>{let e=document.querySelector(`#page-container`);e instanceof HTMLElement&&(e.tabIndex=-1,e.focus())},kJ=()=>{let e=document.activeElement;return()=>{e.isConnected&&e!==document.body&&!e.closest(`[inert]`)?e.focus():INe()}},AJ=(e,t)=>{let n=performance.now(),r=()=>{e(document.activeElement)&&performance.now()-n<t&&window.requestAnimationFrame(r)};window.requestAnimationFrame(r)},jJ=({timeout:e=2e3}={})=>{let t=document.querySelector(`#page-container`);if(!(t instanceof HTMLElement))return;let n=()=>{let e=t.querySelector(`[role="grid"] [tabindex="0"]`);e instanceof HTMLElement?e.focus():(t.tabIndex=-1,t.focus())};n(),AJ(e=>e===document.body||e===t?(n(),!0):t.contains(e),e)},MJ=async e=>{await Za();let t=e();t&&(t.tabIndex=0,t.focus())},LNe=(e,{timeout:t=2e3}={})=>{AJ(t=>{if(t!==document.body&&t!==e)return!1;let n=e.querySelector(`[role="listbox"]`);return n instanceof HTMLElement?(n.focus(),!1):(t===document.body&&e.isConnected&&(e.tabIndex=-1,e.focus()),!0)},t)},RNe=e=>{},zNe=B(`<div role="none" class="wrapper svelte-82chpg"><!></div>`),BNe={hash:`svelte-82chpg`,code:`.wrapper.svelte-82chpg {display:contents;.listbox.subfolders {gap:4px;margin-bottom:8px;border-width:0;padding:0;min-width:0;background-color:transparent;&.grid {display:grid;grid-template-columns:repeat(auto-fill, minmax(160px, 1fr));}.option button {border-radius:var(--sui-control-medium-border-radius);min-width:0;height:40px;.label {overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}}}}`};function VNe(e,t){O(t,!0),K(e,BNe);let n=J(t,`viewType`,3,`grid`),r=J(t,`onOpen`,3,void 0),i=J(t,`multiple`,3,!1),a=J(t,`selectedPaths`,19,()=>[]),o=J(t,`onSelect`,3,void 0),s=j(void 0),c=!1,l=e=>{let t=z(s)?.closest(`[data-focus-scope]`),n=!!z(s)?.contains(document.activeElement);r()?.(e),n&&t instanceof HTMLElement&&LNe(t)},u=(e,t)=>{o()?!i()&&e.detail===1&&c&&o()(t,!1):l(t)},d=e=>{if(!o()||e.key!==`Enter`)return;let n=z(s)?.querySelector(`[role="option"].focused`)?.getAttribute(`data-value`),r=t.subfolders.find(e=>e.path===n);r&&(e.preventDefault(),e.stopPropagation(),l(r))};var f=zNe(),p=N(f);{let e=A(()=>!!o()&&i()),r=A(()=>Y(`folders`));WS(p,{get class(){return`subfolders ${n()??``}`},get multiple(){return z(e)},get ariaLabel(){return z(r)},children:(e,n)=>{var r=H();No(P(r),17,()=>t.subfolders,e=>e.path,(e,t)=>{{let n=e=>{gx(e,{name:`folder`})},r=A(()=>!!o()&&a().includes(z(t).path)),i=A(()=>Y(`folder`)),s=A(()=>o()?void 0:RNe);KS(e,{get label(){return z(t).name},get value(){return z(t).path},get selected(){return z(r)},get"aria-description"(){return z(i)},get checkIcon(){return z(s)},onChange:e=>{o()?.(z(t),e.detail.selected)},onclickcapture:()=>{c=a().includes(z(t).path)},onclick:e=>{u(e,z(t))},ondblclick:()=>{o()&&l(z(t))},startIcon:n,$$slots:{startIcon:!0}})}}),U(e,r)},$$slots:{default:!0}})}D(f),gs(f,e=>M(s,e),()=>z(s)),oo(`keydown`,f,d,!0),U(e,f),k()}var HNe=B(`<div role="none" class="wrapper svelte-umbokg"><!></div>`),UNe=B(`<!> <!>`,1),WNe={hash:`svelte-umbokg`,code:`.wrapper.svelte-umbokg {display:contents;.listbox {gap:4px;border-width:0;.option {button {border-radius:var(--sui-control-medium-border-radius);padding:4px;width:100%;height:auto;transition:none;&:focus-visible {outline-color:transparent;}.preview {flex:none;border-radius:var(--sui-control-medium-border-radius);aspect-ratio:1 / 1;object-fit:contain;}}}.name {min-height:calc(var(--sui-font-size-default) * 2);white-space:normal;line-height:var(--sui-line-height-compact);}}.listbox.grid {display:grid;grid-template-columns:repeat(auto-fill, minmax(160px, 1fr));.option {button {flex-direction:column;justify-content:flex-start;.preview {width:100%;height:auto;}.name {flex:none;margin:4px 0 12px;padding:0 8px;width:100%;min-height:calc(var(--sui-font-size-default) * 3);&:empty {display:none;}}}}button[aria-selected='true'] {outline-offset:-2px;outline-width:2px !important;outline-style:solid;outline-color:var(--sui-primary-accent-color-light);}}.listbox.list {.option {button {gap:16px;.preview {width:64px;}.name {flex:auto;padding-inline:0 8px;}}button[aria-selected='true'] {outline-offset:-2px;outline-width:2px !important;outline-style:solid;outline-color:var(--sui-primary-accent-color-light);}}}}`};function NJ(e,t){O(t,!0),K(e,WNe);let n=J(t,`viewType`,3,`grid`),r=J(t,`gridId`,3,void 0),i=J(t,`multiple`,3,!1),a=J(t,`kind`,3,void 0),o=J(t,`subfolders`,19,()=>[]),s=J(t,`onOpenSubfolder`,3,void 0),c=J(t,`selectedSubfolderPaths`,19,()=>[]),l=J(t,`onSelectSubfolder`,3,void 0);var u=UNe(),d=P(u),f=e=>{VNe(e,{get subfolders(){return o()},get viewType(){return n()},get multiple(){return i()},get onOpen(){return s()},get selectedPaths(){return c()},get onSelect(){return l()}})};G(d,e=>{o().length&&e(f)});var p=I(d,2),m=e=>{var o=HNe(),s=N(o);{let e=A(()=>Y(`assets_dialog.available_${a()===`image`?`images`:`files`}`));WS(s,{get id(){return r()},get class(){return n()},get multiple(){return i()},get ariaLabel(){return z(e)},children:(e,n)=>{tC(e,{get items(){return t.items},get itemKey(){return t.itemKey},get renderItem(){return t.renderItem}})},$$slots:{default:!0}})}D(o),U(e,o)};G(p,e=>{t.items.length&&e(m)}),U(e,u),k()}var GNe=B(`<p role="alert" class="svelte-1r41hf4"> </p>`),KNe=B(`<p role="alert" class="warning svelte-1r41hf4"> </p>`),qNe=B(`<p class="svelte-1r41hf4"> </p> <!>`,1),JNe=B(`<div role="status" class="note svelte-1r41hf4"> </div>`),YNe=B(`<!> <div role="none" class="svelte-1r41hf4"><!></div> <!> <div role="none" class="error svelte-1r41hf4"><!></div>`,1),XNe={hash:`svelte-1r41hf4`,code:`p.svelte-1r41hf4 {margin:0 0 8px;}div.svelte-1r41hf4 {display:flex;align-items:center;gap:4px;}.warning.svelte-1r41hf4 {color:var(--sui-warning-foreground-color);}.note.svelte-1r41hf4 {margin:4px 0 0;color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);}.error.svelte-1r41hf4 {margin:0;color:var(--sui-error-foreground-color);font-size:var(--sui-font-size-small);}`};function PJ(e,t){let n=mo();O(t,!0),K(e,XNe);let r=J(t,`open`,15,!1),i=J(t,`onOpen`,3,void 0),a=J(t,`onClose`,3,void 0),o=J(t,`warning`,3,void 0),s=J(t,`blockedMessage`,3,void 0),c=J(t,`value`,15,``),l=J(t,`element`,15),u=J(t,`oninput`,3,void 0),d=J(t,`note`,3,void 0),f=J(t,`error`,3,void 0);SS(e,{get title(){return t.title},get okLabel(){return t.okLabel},get okDisabled(){return t.okDisabled},get onOk(){return t.onOk},get onOpen(){return i()},get onClose(){return a()},get open(){return r()},set open(e){r(e)},children:(e,r)=>{var i=YNe(),a=P(i),p=e=>{var t=GNe(),n=F(t,!0);R(()=>W(n,s())),U(e,t)},m=e=>{var n=qNe(),r=P(n),i=F(r,!0),a=I(r,2),s=e=>{var t=KNe(),n=F(t,!0);R(()=>W(n,o())),U(e,t)};G(a,e=>{o()&&e(s)}),R(()=>W(i,t.description)),U(e,n)};G(a,e=>{s()?e(p):e(m,-1)});var h=I(a,2),g=N(h);{let e=A(()=>!!s()),r=A(()=>!!f());NS(g,{dir:`auto`,flex:!0,get disabled(){return z(e)},get ariaLabel(){return t.ariaLabel},get invalid(){return z(r)},get"aria-errormessage"(){return`${n}-error`},get oninput(){return u()},get value(){return c()},set value(e){c(e)},get element(){return l()},set element(e){l(e)}})}D(h);var _=I(h,2),v=e=>{var t=JNe(),n=F(t,!0);R(()=>W(n,d())),U(e,t)};G(_,e=>{d()&&e(v)});var y=I(_,2),b=N(y),x=e=>{var t=V();R(()=>W(t,f())),U(e,t)};G(b,e=>{f()&&e(x)}),D(y),R(()=>q(y,`id`,`${n}-error`)),U(e,i)},$$slots:{default:!0}}),k()}function FJ(e,t){O(t,!0);let n=J(t,`open`,15,!1),r=J(t,`warning`,3,void 0),i=J(t,`name`,3,``),a=J(t,`onClose`,3,void 0),o=j(``),s=j(!1),c=A(()=>jNe({name:z(o),takenNames:t.takenNames})),l=A(()=>z(s)&&!!z(c)),u=A(()=>!!i()&&EJ(z(o))===i());L(()=>{n()&&(M(o,i()),M(s,!1))});{let i=A(()=>!!z(c)||z(u)),d=A(()=>Y(`new_folder_name`)),f=A(()=>z(l)?Y(`new_folder_error.${z(c)}`):void 0);PJ(e,{get title(){return t.title},get okLabel(){return t.okLabel},get okDisabled(){return z(i)},onOk:()=>{t.onSubmit(EJ(z(o)))},get onClose(){return a()},get description(){return t.description},get warning(){return r()},get ariaLabel(){return z(d)},oninput:()=>{M(s,!0)},get error(){return z(f)},get open(){return n()},set open(e){n(e)},get value(){return z(o)},set value(e){M(o,e,!0)}})}k()}var ZNe=/(?<path>.+?)(?:\/[^/]+)?$/,QNe=(e,t)=>{if(!t)return!1;let n=tu(e);return n===t||n.startsWith(`${t}.`)},IJ=(e,t)=>{if(e._type!==`entry`)return;let{subPath:n}=e._file,r=t.substring(0,t.lastIndexOf(`.`)),i=n?.includes(`/`)?tu(n):void 0;if(i&&!i.includes(`{{`)||QNe(r,vf(e)))return r.match(ZNe)?.groups?.path;if(n?.includes(`/`))return r},LJ=({collection:e,entryFilePath:t,internalPath:n})=>IJ(e,t)??(e._type===`entry`?Uc(t).dirname??n:n),RJ=({entry:e,locale:t,collectionName:n})=>{let r=Zp(e,{locale:t}).path,i=eu(r),a=n?Kf(n):void 0;return a?LJ({collection:a,entryFilePath:r,internalPath:i}):i},$Ne=(e,{ignoreCase:t=!1}={})=>{let n=e.includes(`/`),r=e.replace(/^\//,``),i=``;for(let e=0;e<r.length;e+=1){let t=r[e];if(r.startsWith(`**/`,e))i+=`(?:.*/)?`,e+=2;else if(r.startsWith(`/**`,e)&&e+3===r.length)i+=`/.*`,e+=2;else if(t===`*`)i+=`[^/]*`;else if(t===`?`)i+=`[^/]`;else if(t===`[`&&r.indexOf(`]`,e+2)>0){let t=r.indexOf(`]`,e+2),n=r.slice(e+1,t).replace(/^!/,`^`).replaceAll(`\\`,`\\\\`);i+=`[${n}]`,e=t}else i+=t.replace(/[$()+.[\\\]^{|}]/,`\\$&`)}return RegExp(n?`^${i}$`:`(?:^|/)${i}$`,t?`i`:``)},ePe=(e,{ignoreCase:t=!1}={})=>e.split(/\r?\n/).flatMap(e=>{let[n,...r]=e.trim().split(/\s+/);if(!n||/^[#"]|^\[attr\]/.test(n)||n.endsWith(`/`))return[];let i=r.findLast(e=>/^[-!]?filter(?:=|$)/.test(e));return i?[{regex:$Ne(n,{ignoreCase:t}),lfs:i===`filter=lfs`}]:[]}),tPe=async(e,t,{ignoreCase:n=!1}={})=>{let r=new Map,i=t=>{let i=r.get(t);return i||(i=e.readFile(t,{encoding:`utf8`}).then(e=>ePe(e,{ignoreCase:n}),()=>[]),r.set(t,i)),i};for(let e of t){let t=e.split(`/`),n=!1,r=[...t.map((e,n)=>{let r=t.slice(0,n).join(`/`);return{file:r?`${r}/.gitattributes`:`.gitattributes`,relativePath:t.slice(n).join(`/`)}}),{file:`.git/info/attributes`,relativePath:e}];for(let{file:e,relativePath:t}of r)for(let r of await i(e))r.regex.test(t)&&({lfs:n}=r);if(n)return e}},zJ=[[`MERGE_HEAD`,`merge`],[`CHERRY_PICK_HEAD`,`cherry_pick`],[`REVERT_HEAD`,`revert`],[`rebase-merge`,`rebase`],[`rebase-apply`,`rebase`],[`sequencer`,`cherry_pick`]],nPe=`0`.repeat(40),BJ=e=>e?.name===`NotFoundError`,VJ=e=>e?.name===`TypeMismatchError`,HJ=e=>e.normalize(`NFC`)!==e.normalize(`NFD`),UJ=(e,t)=>{if(e.includes(t))return t;let n=t.normalize();return e.find(e=>e.normalize()===n)},WJ=async(e,t)=>{if(!HJ(t))return t;try{return await e.getFileHandle(t),t}catch(e){if(VJ(e))return t;if(!BJ(e))throw e}return UJ(await Array.fromAsync(e.keys()),t)??t},GJ=async(e,t,n=`file`,{create:r=!0}={})=>{let i=Lc(t??``),a=e;if(!i){if(n===`directory`)return a;throw Error(`Path is required for file handle retrieval`)}let o=i.split(`/`),s=o.length-1;for await(let[e,t]of o.entries()){let i=await WJ(a,t);a=await(e===s&&n===`file`?a.getFileHandle(i,{create:r}):a.getDirectoryHandle(i,{create:r}))}return a},KJ=(e,t)=>GJ(e,t,`file`),qJ=(e,t)=>GJ(e,t,`directory`),JJ=async(e,t)=>(await GJ(e,t,`file`,{create:!1})).getFile(),YJ=async(e,t)=>{try{return await JJ(e,t)}catch(e){if(BJ(e))return;throw e}},XJ=async(e,{create:t=!1}={})=>GJ(e,uu(),`directory`,{create:t}),rPe={NotFoundError:`ENOENT`,TypeMismatchError:`ENOTDIR`,InvalidModificationError:`ENOTEMPTY`},ZJ=(e,t)=>Object.assign(Error(`${e}: ${t}`),{code:e,path:t}),iPe=(e,t)=>{let n=rPe[e?.name];return n?ZJ(n,t):e},QJ=e=>e.split(`/`).filter(e=>e&&e!==`.`),$J=async(e,t)=>{let n=e;for(let e of t)n=await n.getDirectoryHandle(e);return n},eY=async(e,t)=>{if(!t.length)return e;let n=await $J(e,t.slice(0,-1)),r=t.at(-1);try{return await n.getFileHandle(r)}catch(e){if(!VJ(e))throw e;return n.getDirectoryHandle(r)}},aPe=async(e,t,n)=>{let r=await e.createWritable?.(n);if(!r)throw ZJ(`ENOTSUP`,t);return r},oPe=async e=>{let t=e.kind===`directory`,{size:n,lastModified:r}=t?{size:0,lastModified:0}:await e.getFile();return{mode:t?16384:33188,size:n,mtimeMs:r,ctimeMs:r,ino:0,uid:0,gid:0,dev:0,isFile:()=>!t,isDirectory:()=>t,isSymbolicLink:()=>!1}},sPe=(e,{Buffer:t})=>{let n=async(e,t)=>{try{return await t(QJ(e))}catch(t){throw iPe(t,e)}},r=async t=>({parentHandle:await $J(e,t.slice(0,-1)),name:t.at(-1)}),i=async(e,t,n,r)=>{let i=await aPe(e,t,n);try{await r(i),await i.close()}catch(e){throw await i.abort().catch(()=>void 0),e}},a=t=>n(t,async t=>oPe(await eY(e,t)));return{readFile:(r,i)=>n(r,async n=>{let a=await eY(e,n);if(a.kind!==`file`)throw ZJ(`EISDIR`,r);let o=await a.getFile();return(typeof i==`string`?i:i?.encoding)===`utf8`?o.text():t.from(await o.arrayBuffer())}),writeFile:(e,t)=>n(e,async n=>{let{parentHandle:a,name:o}=await r(n),s=await a.getFileHandle(o,{create:!0});await i(s,e,void 0,async e=>{await e.write(t)})}),appendFile:(e,t)=>n(e,async n=>{let{parentHandle:a,name:o}=await r(n),s=await a.getFileHandle(o,{create:!0}),{size:c}=await s.getFile();await i(s,e,{keepExistingData:!0},async e=>{await e.write({type:`write`,position:c,data:t})})}),mkdir:e=>n(e,async e=>{let{parentHandle:t,name:n}=await r(e);await t.getDirectoryHandle(n,{create:!0})}),rmdir:e=>n(e,async e=>{let{parentHandle:t,name:n}=await r(e);await t.getDirectoryHandle(n),await t.removeEntry(n)}),unlink:e=>n(e,async e=>{let{parentHandle:t,name:n}=await r(e);await t.getFileHandle(n),await t.removeEntry(n)}),readdir:t=>n(t,async n=>{let r=await eY(e,n);if(r.kind!==`directory`)throw ZJ(`ENOTDIR`,t);let i=[];for await(let e of r.keys())i.push(e);return i}),stat:a,lstat:a,readlink:async e=>{throw ZJ(`ENOTSUP`,e)},symlink:async(e,t)=>{throw ZJ(`ENOTSUP`,t)}}},tY=e=>[`ENOENT`,`ENOTDIR`].includes(e?.code),nY=async(e,t)=>{try{return await e.stat(t),!0}catch(e){if(tY(e))return!1;throw e}},rY=new TextEncoder,iY=new TextDecoder,aY=(e,t)=>{let n=Math.min(e.length,t.length);for(let r=0;r<n;r+=1)if(e[r]!==t[r])return e[r]-t[r];return e.length-t.length},oY=e=>{let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),n=0;return e.forEach(e=>{t.set(e,n),n+=e.length}),t},sY=e=>Array.from(new Uint8Array(e),e=>e.toString(16).padStart(2,`0`)).join(``),cY=e=>Uint8Array.from(e.match(/../g)??[],e=>Number.parseInt(e,16)),lY=async(e,t)=>{let n=new TextEncoder,r=await crypto.subtle.importKey(`raw`,typeof e==`string`?n.encode(e):e,{name:`HMAC`,hash:`SHA-256`},!1,[`sign`]),i=await crypto.subtle.sign(`HMAC`,r,n.encode(t));return new Uint8Array(i)},uY=62,cPe=e=>{let t=new Map,n=0,r=t=>{let r=e.indexOf(t,n),i=iY.decode(e.subarray(n,r));return n=r+1,i},i=a=>{let o=r(0),s=a?`${a}/${o}`:o,[c,l]=r(10).split(` `).map(Number);c>=0&&(t.set(s,sY(e.subarray(n,n+20))),n+=20);for(let e=0;e<l;e+=1)i(s)};return e.length&&i(void 0),t},lPe=e=>{let t=new DataView(e),n=new Uint8Array(e);if(iY.decode(n.subarray(0,4))!==`DIRC`)throw Error(`Invalid index file`);let r=t.getUint32(4),i=[],a=[];if(r!==2)return{version:r,entries:i,extensions:a};let o=t.getUint32(8),s=12;for(let e=0;e<o;e+=1){let e=t.getUint16(s+60),r=s+uY,a=(e&4095)<4095?e&4095:n.indexOf(0,r)-r,o=s+(uY+a+8&-8);i.push({path:iY.decode(n.subarray(r,r+a)),mode:t.getUint32(s+24),oid:sY(n.subarray(s+40,s+40+20)),stage:e>>12&3,raw:n.subarray(s,o)}),s=o}let c;for(;s<n.length-20;){let e=iY.decode(n.subarray(s,s+4)),r=t.getUint32(s+4);a.push(e),e===`TREE`&&(c=cPe(n.subarray(s+8,s+8+r))),s+=8+r}return{version:r,entries:i,extensions:a,...c?{cacheTree:c}:{}}},uPe=({extensions:e})=>e.some(e=>/^[a-z]/.test(e)),dPe=({path:e,mode:t,oid:n,size:r,mtimeMs:i})=>{let a=rY.encode(e),o=new Uint8Array(uY+a.length+8&-8),s=new DataView(o.buffer),c=Math.floor(i/1e3),l=Math.round((i-c*1e3)*1e6);return[0,8].forEach(e=>{s.setUint32(e,c%2**32),s.setUint32(e+4,l)}),s.setUint32(24,t),s.setUint32(36,r%2**32),o.set(cY(n),40),s.setUint16(60,Math.min(a.length,4095)),o.set(a,uY),{path:e,mode:t,oid:n,stage:0,raw:o}},fPe=(e,t)=>aY(rY.encode(e),rY.encode(t)),dY=(e,t)=>{let n=0,r=e.length;for(;n<r;){let i=n+r>>>1,a=fPe(e[i].path,t);if(!a)return{position:i,found:!0};a<0?n=i+1:r=i}return{position:n,found:!1}},pPe=(e,{removedPaths:t,addedEntries:n})=>{let r=e.filter(({path:e})=>!t.has(e));return n.forEach(e=>{let{position:t,found:n}=dY(r,e.path);r.splice(t,+!!n,e)}),r},mPe=e=>{let t=new Map,n=e=>{let r=e.entries.filter(({type:e})=>e!==`tree`).length;return e.subtrees.forEach(e=>{r+=n(e)}),t.set(e,r),r},r=[],i=(e,n)=>{r.push(rY.encode(`${n}\0${t.get(e)} ${e.subtrees.size}\n`),cY(e.oid)),e.subtrees.forEach((e,t)=>{i(e,t)})};return n(e),i(e,``),oY(r)},hPe=async(e,{tree:t}={})=>{let n=t?mPe(t):void 0,r=e.reduce((e,{raw:t})=>e+t.length,12)+(n?8+n.length:0),i=new Uint8Array(r+20),a=new DataView(i.buffer),o=12;return i.set(rY.encode(`DIRC`)),a.setUint32(4,2),a.setUint32(8,e.length),e.forEach(({raw:e})=>{i.set(e,o),o+=e.length}),n&&(i.set(rY.encode(`TREE`),o),a.setUint32(o+4,n.length),i.set(n,o+8)),i.set(cY(await Pc(i.subarray(0,r))),r),i},fY={1:`commit`,2:`tree`,3:`blob`,4:`tag`},gPe=6,_Pe=7,vPe=1e3,pY=(e,t)=>oY([rY.encode(`${e} ${t.length}\0`),t]),yPe=(e,t)=>Pc(pY(e,t)),mY=async e=>{let t=new Blob([e]).stream().pipeThrough(new DecompressionStream(`deflate`));return new Uint8Array(await new Response(t).arrayBuffer())},bPe=async e=>{let{readable:t,writable:n}=new CompressionStream(`deflate`),r=n.getWriter(),[,,i]=await Promise.all([r.write(e),r.close(),new Response(t).arrayBuffer()]);return new Uint8Array(i)},hY=async(e,t,n)=>{let r=pY(t,n),i=await Pc(r),a=`.git/objects/${i.slice(0,2)}`,o=`${a}/${i.slice(2)}`,s=0;try{({size:s}=await e.stat(o))}catch(e){if(!tY(e))throw e}return s||(await e.mkdir(a),await e.writeFile(o,await bPe(r))),i},xPe=(e,t)=>{let n=0,r=()=>{let e=0,r=1,i;do i=t[n],n+=1,e+=(i&127)*r,r*=128;while(i&128);return e};if(r()!==e.length)throw Error(`Delta base size mismatch`);let i=new Uint8Array(r()),a=0;for(;n<t.length;){let r=t[n];if(n+=1,r&128){let o=0,s=0;for(let e=0;e<4;e+=1)r&1<<e&&(o+=t[n]*2**(8*e),n+=1);for(let e=0;e<3;e+=1)r&16<<e&&(s+=t[n]*2**(8*e),n+=1);s||=65536,i.set(e.subarray(o,o+s),a),a+=s}else if(r)i.set(t.subarray(n,n+r),a),n+=r,a+=r;else throw Error(`Invalid delta instruction`)}if(a!==i.length)throw Error(`Delta result size mismatch`);return i},SPe=e=>{let t=e.indexOf(0),[n,r]=iY.decode(e.subarray(0,t)).split(` `),i=e.subarray(t+1);if(!Object.values(fY).includes(n))throw Error(`Invalid object type: ${n}`);if(Number(r)!==i.length)throw Error(`Object size mismatch`);return{type:n,content:i}},CPe=e=>{let t=new DataView(e);if(t.getUint32(0)!==4285812579||t.getUint32(4)!==2)throw Error(`Unsupported pack index version`);let n=t.getUint32(1028),r=1032,i=r+n*20+n*4,a=i+n*4,o=Array.from({length:256},(e,n)=>t.getUint32(8+n*4)),s=new Float64Array(n);for(let e=0;e<n;e+=1){let n=t.getUint32(i+e*4);s[e]=n&2147483648?t.getUint32(a+(n&2147483647)*8)*2**32+t.getUint32(a+(n&2147483647)*8+4):n}return{fanout:o,oids:new Uint8Array(e,r,n*20),offsets:s}},wPe=({fanout:e,oids:t,offsets:n},r)=>{let i=r[0]?e[r[0]-1]:0,a=e[r[0]];for(;i<a;){let e=i+a>>>1,o=0;for(let n=0;n<20&&!o;n+=1)o=t[e*20+n]-r[n];if(!o)return n[e];o<0?i=e+1:a=e}},TPe=(e,t)=>{e.sortedOffsets??=Float64Array.from(e.index.offsets).sort();let{sortedOffsets:n}=e,r=0,i=n.length;for(;r<i;){let e=r+i>>>1;n[e]<=t?r=e+1:i=e}return r<n.length?n[r]:e.file.size-20},EPe=e=>{let t,n=async()=>{let t=[],n;try{n=await(await e.getDirectoryHandle(`objects`)).getDirectoryHandle(`pack`)}catch{return t}for await(let[e,r]of n.entries()){if(r.kind!==`file`||!e.endsWith(`.idx`))continue;let i=await r.getFile(),a=await n.getFileHandle(e.replace(/\.idx$/,`.pack`));t.push({index:CPe(await i.arrayBuffer()),file:await a.getFile()})}return t},r=async e=>{t??=n();let r=cY(e);for(let e of await t){let t=wPe(e.index,r);if(t!==void 0)return{pack:e,offset:t}}},i=async t=>{let n=await YJ(e,`objects/${t.slice(0,2)}/${t.slice(2)}`);if(n)return SPe(await mY(new Uint8Array(await n.arrayBuffer())))},a=async(e,t,n)=>{if(n>vPe)throw Error(`Delta chain too long`);let r=TPe(e,t),i=new Uint8Array(await e.file.slice(t,r).arrayBuffer()),s=0,c=i[s],l=c>>4&7;for(;c&128;)s+=1,c=i[s];s+=1;let u;if(l===gPe){c=i[s],s+=1;let r=c&127;for(;c&128;)c=i[s],s+=1,r=(r+1)*128+(c&127);u=await a(e,t-r,n+1)}else if(l===_Pe){let e=sY(i.subarray(s,s+20));if(s+=20,u=await o(e,n+1),!u)throw Error(`Delta base not found: ${e}`)}let d=await mY(i.subarray(s));if(u)return{type:u.type,content:xPe(u.content,d)};let f=fY[l];if(!f)throw Error(`Invalid packed object type: ${l}`);return{type:f,content:d}},o=async(e,t)=>{let n=await i(e);if(n)return n;let o=await r(e);return o?a(o.pack,o.offset,t):void 0};return{readObject:e=>o(e,0)}},DPe=e=>{let t=new Map(e.map(e=>[e,rY.encode(e.type===`tree`?`${e.path}/`:e.path)]));return e.toSorted((e,n)=>aY(t.get(e),t.get(n)))},gY=e=>oY(e.flatMap(({mode:e,path:t,oid:n})=>[rY.encode(`${e} ${t}\0`),cY(n)])),OPe=e=>{let t=new Map,n=0;for(;n<e.length;){let r=e.indexOf(32,n),i=e.indexOf(0,r);t.set(iY.decode(e.subarray(r+1,i)),{mode:iY.decode(e.subarray(n,r)),oid:sY(e.subarray(i+1,i+1+20))}),n=i+1+20}return t},kPe=e=>/^tree ([0-9a-f]{40})\n/.exec(iY.decode(e))?.[1],APe=e=>{let t=e.split(`/`).slice(0,-1);return[``,...t.map((e,n)=>t.slice(0,n+1).join(`/`))]},_Y=async(e,{previous:t,changedPaths:n=[],cacheTree:r}={})=>{let i=new Set(n.flatMap(APe)),a={files:[],dirs:new Map};e.forEach(({path:e,mode:t,oid:n})=>{let r=e.split(`/`),i=r.pop(),o=a;r.forEach(e=>{let t=o.dirs.get(e);t||(t={files:[],dirs:new Map},o.dirs.set(e,t)),o=t}),o.files.push({mode:t.toString(8),path:i,oid:n,type:t===57344?`commit`:`blob`})});let o=async({files:e,dirs:t},n,a)=>{if(a&&!i.has(n))return a;let s=new Map(await Promise.all([...t].map(async([e,t])=>[e,await o(t,n?`${n}/${e}`:e,a?.subtrees.get(e))]))),c=DPe([...e,...[...s].map(([e,{oid:t}])=>({mode:`40000`,path:e,oid:t,type:`tree`}))]);return{oid:r?.get(n)??await yPe(`tree`,gY(c)),entries:c,subtrees:s}};return o(a,``,t)},vY=async(e,t,{readObject:n,writeTree:r})=>{if(e.oid===t)return;let i=t?await n(t):void 0,a=i?.type===`tree`?OPe(i.content):new Map;for(let[t,i]of e.subtrees){let e=a.get(t);await vY(i,e?.mode===`40000`?e.oid:void 0,{readObject:n,writeTree:r})}let o=await r(e.entries);if(o!==e.oid)throw Error(`Tree object ID mismatch: expected ${e.oid}, got ${o}`)},yY,bY=()=>{yY=void 0},jPe=e=>{yY=e},xY=e=>sY(e.subarray(-20)),SY=async(e,t,n)=>{try{return await e.resolveRef({fs:t,dir:`/`,ref:n})}catch(e){if(e?.code===`NotFoundError`)return;throw e}},MPe=async(e,t)=>{if(yY?.checksum===t&&yY.tree)return yY.tree;let n=await _Y(e.entries,{cacheTree:e.cacheTree});return yY={checksum:t,index:e,tree:n},n},NPe=async e=>{let t=await(await YJ(e,`index`))?.arrayBuffer(),n=t?xY(new Uint8Array(t)):``;return yY?.checksum===n?{index:yY.index,buffer:t,checksum:n}:{index:t?lPe(t):{version:2,entries:[],extensions:[]},buffer:t,checksum:n}},PPe=async(e,t,n)=>t===`rebase-apply`&&await nY(e,`.git/rebase-apply/applying`)?`am`:t===`sequencer`&&await nY(e,`.git/sequencer/todo`)?(await e.readFile(`.git/sequencer/todo`,{encoding:`utf8`})).trimStart().startsWith(`revert`)?`revert`:`cherry_pick`:n,CY=e=>e===!0||/^(?:true|yes|on|[+-]?0*[1-9]\d*)$/i.test(String(e).trim()),FPe=async(e,t,n)=>{try{return CY(await e.getConfig({fs:t,dir:`/`,path:n}))}catch{return!1}},wY=async(e,{onLock:t}={})=>{let n;try{n=await e.getDirectoryHandle(`.git`)}catch(e){if(VJ(e))return{ready:!1,reason:`unsupported_repository`};throw e}let r=await Zc(`git`),i=sPe(e,{Buffer:r.Buffer}),[[a,o,s,c,l],u]=await Promise.all([Promise.all([`extensions.objectformat`,`extensions.refstorage`,`user.name`,`user.email`,`core.autocrlf`].map(e=>r.getConfig({fs:i,dir:`/`,path:e}))),FPe(r,i,`core.ignorecase`)]);if(a&&a!==`sha1`||o&&o!==`files`)return{ready:!1,reason:`unsupported_repository`};if(!s||!c)return{ready:!1,reason:`missing_identity`};let d={name:s,email:c};if(await nY(i,`.git/index.lock`))return{ready:!1,reason:`locked`,author:d};t&&(await i.writeFile(`.git/index.lock`,``),t(i));let f=await Promise.all(zJ.map(([e])=>nY(i,`.git/${e}`))),p=zJ.find((e,t)=>f[t]);if(p)return{ready:!1,reason:`operation_in_progress`,detail:await PPe(i,...p),author:d};let m=await r.currentBranch({fs:i,dir:`/`,fullname:!0});if(!m)return{ready:!1,reason:`detached_head`,author:d};let{index:h,buffer:g,checksum:_}=await NPe(n);if(h.version!==2||uPe(h))return{ready:!1,reason:`unsupported_repository`,author:d,branch:m};if(h.entries.some(({stage:e})=>e))return{ready:!1,reason:`operation_in_progress`,detail:`conflict`,author:d,branch:m};let v=EPe(n),y=await SY(r,i,m),b;if(y){let e=await v.readObject(y);if(b=e?.type===`commit`?kPe(e.content):void 0,!b)return{ready:!1,reason:`unsupported_repository`,author:d,branch:m}}let x=await MPe(h,_);return(b?x.oid!==b:h.entries.length>0)?{ready:!1,reason:`staged_changes`,author:d,branch:m}:{ready:!0,author:d,branch:m,repository:{git:r,fs:i,gitDirHandle:n,reader:v,branch:m,author:d,headOid:y,headTreeOid:b,index:h,indexBuffer:g,indexTree:x,autocrlf:/^input$/i.test(String(l).trim())||CY(l),ignoreCase:u}}},TY=4,IPe=e=>{let t=new Map;return e.forEach(({path:e})=>{if(e===e.normalize())return;let n=e.split(`/`);n.forEach((e,r)=>{let i=n.slice(0,r+1).join(`/`);i!==i.normalize()&&t.set(i.normalize(),i)})}),e=>{let n=e.split(`/`);for(let e=n.length;e>0;--e){let r=t.get(n.slice(0,e).join(`/`));if(r)return[r,...n.slice(e)].join(`/`)}return e}},LPe=async(e,t,n)=>{if(!HJ(n)||dY(t,n).found||await nY(e,n))return n;let r=[];for(let t of QJ(n)){let i=UJ(await e.readdir(r.join(`/`)),t);if(!i)return n;r.push(i)}return r.join(`/`)},EY=e=>e.filter(({action:e})=>[`create`,`update`,`move`].includes(e)).map(({path:e})=>e),RPe=e=>e.flatMap(({action:e,path:t,previousPath:n})=>e===`delete`?[t]:e===`move`&&n?[n]:[]),zPe=e=>{let t;try{t=new TextDecoder(`utf-8`,{fatal:!0}).decode(e)}catch{return e}return rY.encode(t.replaceAll(`\r
`,`
`))},BPe=async({git:e,fs:t,index:n,autocrlf:r},i)=>(await Dd(i,async i=>{let{position:a,found:o}=dY(n.entries,i);if(!o&&await e.isIgnored({fs:t,dir:`/`,filepath:i}))return;let{size:s,mtimeMs:c}=await t.stat(i),l=await t.readFile(i);return r&&(l=zPe(l)),dPe({path:i,mode:o&&n.entries[a].mode===33261?33261:33188,oid:await hY(t,`blob`,l),size:s,mtimeMs:c})},{concurrency:TY})).filter(Boolean),VPe=e=>{let t=Math.abs(e),n=String(Math.floor(t/60)).padStart(2,`0`);return`${e>0?`-`:`+`}${n}${String(t%60).padStart(2,`0`)}`},HPe=async(e,{branch:t,oldOid:n,newOid:r,signature:i,message:a})=>{let{name:o,email:s,timestamp:c,timezoneOffset:l}=i,u=n?`commit`:`commit (initial)`,d=a.split(`
`)[0],f=`${o} <${s}> ${c} ${VPe(l)}`,p=`${n??nPe} ${r} ${f}\t${u}: ${d}\n`;for(let n of[`.git/logs/HEAD`,`.git/logs/${t}`])await nY(e,n)&&await e.appendFile(n,p)},UPe=async(e,t,n)=>{let{git:r,fs:i,reader:a,branch:o,author:s,headOid:c,headTreeOid:l}=e,{index:u,indexTree:d}=e,f=IPe(u.entries),p=new Set(RPe(t).map(f)),m=await Dd(EY(t),e=>LPe(i,u.entries,f(e)),{concurrency:TY}),h=await BPe(e,m);if(h.length||u.entries.some(({path:e})=>p.has(e))){let e=pPe(u.entries,{removedPaths:p,addedEntries:h});d=await _Y(e,{previous:d,changedPaths:[...p,...m]});let t=await hPe(e,{tree:d});await i.writeFile(`.git/index`,t),u={version:2,entries:e,extensions:[`TREE`]},jPe({checksum:xY(t),index:u,tree:d})}if(l?d.oid===l:!u.entries.length)return;if(await vY(d,l,{readObject:a.readObject,writeTree:e=>hY(i,`tree`,gY(e))}),await SY(r,i,o)!==c)throw Error(`The branch has been updated by another program.`);let g=Math.floor(Date.now()/1e3),_={...s,timestamp:g,timezoneOffset:new Date(g*1e3).getTimezoneOffset()},v=np(t,n);return{oid:await r.commit({fs:i,dir:`/`,ref:o,message:v,tree:d.oid,author:_,committer:_}),signature:_,message:v}},WPe=async(e,t,n)=>{let{fs:r,indexBuffer:i,branch:a,headOid:o}=e,s;try{s=await UPe(e,t,n)}catch(e){throw i?await r.writeFile(`.git/index`,new Uint8Array(i)):await nY(r,`.git/index`)&&await r.unlink(`.git/index`),e}if(!s)return;let{oid:c,signature:l,message:u}=s;try{await HPe(r,{branch:a,oldOid:o,newOid:c,signature:l,message:u})}catch(e){console.error(e)}return{oid:c,date:new Date(l.timestamp*1e3)}},DY=tl(),OY=Qv(1),kY=e=>{let{message:t,data:n}=Object(e);return n?.message??t??String(e)},GPe=e=>OY(async()=>{try{let{repository:t,...n}=await wY(e);return n}catch(e){return{ready:!1,reason:`error`,detail:kY(e)}}}),KPe=({repoRootDirHandle:e,changes:t,options:n,save:r})=>OY(async()=>{let i=mu(t),a;try{let t;try{if(t=await wY(e,{onLock:e=>{a=e}}),t.repository){let{fs:e,ignoreCase:n}=t.repository,r=await tPe(e,EY(i),{ignoreCase:n});r&&(t={ready:!1,reason:`lfs`,detail:r})}}catch(e){t={ready:!1,reason:`error`,detail:kY(e)}}let{repository:o,reason:s=`error`,detail:c}=t,l=await r();if(!o)return DY.current={reason:s,detail:c},l;try{let e=await WPe(o,i,n);return e?{...l,sha:e.oid,date:e.date}:l}catch(e){return console.error(e),DY.current={reason:`error`,detail:kY(e)},l}}finally{try{await a?.unlink(`.git/index.lock`)}catch{}}}),qPe=6e4,JPe=Qv(8),YPe=e=>e?Jl(e,e=>rf(e,`.+?`)):/^.+$/,XPe=e=>{let t=e.split(`/`).map(e=>rf(e,`.+?`)).reduceRight((e,t,n)=>n===0?`${t}${e}`:`(?:\\/${t}${e})?`,``);return RegExp(`^${t}$`)},ZPe=(e,t,n)=>t.some(t=>{let r=n.get(t);return r||(r=XPe(t),n.set(t,r)),r.test(e)}),QPe=async(e,t)=>{try{let{lastModified:n}=await t.getFile();Date.now()-n>=qPe&&await e.removeEntry(t.name)}catch{}},AY=async(e,t,n=``)=>{let{scanningPaths:r,scanningPathsRegEx:i,fileHandles:a,pathRegexCache:o}=t,s=[],c=[];await JPe(async()=>{for await(let[t,a]of e.entries()){if(t.startsWith(`.`)&&!Fp.test(t)&&!(a.kind===`directory`&&r.some(e=>e.split(`/`).includes(t)))){a.kind===`file`&&t.startsWith(`.sveltia-tmp-`)&&await QPe(e,a);continue}let l=n?`${n}/${t}`:t,u=l.normalize(),d=i.some(e=>e.test(u));if(a.kind===`file`&&d&&s.push({handle:a,path:l}),a.kind===`directory`&&(d||ZPe(u,r,o))){let e=[];s.push(e),c.push({handle:a,path:l,fileHandles:e})}}}),await Promise.all(c.map(({handle:e,path:n,fileHandles:r})=>AY(e,{...t,fileHandles:r},n))),s.forEach(e=>{(Array.isArray(e)?e:[e]).forEach(e=>{a.push(e)})})},$Pe=()=>{let{filePaths:e,folderPaths:t}=yb();return Ac([...e,...t].map(e=>Lc(e).normalize()))},eFe=async e=>{let t=[],n=$Pe();return await AY(e,{rootDirHandle:e,scanningPaths:n,scanningPathsRegEx:n.map(YPe),fileHandles:t,pathRegexCache:new Map}),t.map(({handle:e,path:t})=>({handle:e,path:t.normalize(),name:e.name.normalize(),size:0,sha:``}))},tFe=10485760,jY=10,MY=async e=>{let{name:t,handle:n}=e;if(t===`.gitkeep`)return e;try{let r=await n.getFile();if(r.size>tFe)return console.warn(`File ${t} is too large (${r.size} bytes), skipping content read`),e;let i=await hre(r);return{...e,text:i}}catch(t){return console.error(t),e}},nFe=async(e,{cachedHashes:t,newHashes:n}={})=>{let{name:r,path:i,handle:a}=e,o=Ep(r);try{let r=await a.getFile(),{size:s,lastModified:c}=r,l=t?.get(i),u;return l&&l.size===s&&l.lastModified===c?{sha:u}=l:(u=await cu(r),n?.set(i,{sha:u,size:s,lastModified:c})),{...e,kind:o,size:s,sha:u}}catch(t){return console.error(t),{...e,kind:o}}},NY=async(e,{hashCacheDB:t=null}={})=>{let n=Ky(`Loading site data`);n(`Started: local repository ${e.name}`);let r=Cb(t),i=My(await eFe(e)),{entryFiles:a,assetFiles:o,configFiles:s}=i;n(`Scanned the directory: ${Ny(i)}`);let c=new Map,l=op(r.then(e=>Dd(o,t=>nFe(t,{cachedHashes:e,newHashes:c}),{concurrency:jY}))),u=await Dd(a,MY,{concurrency:jY});n(`Read ${u.length} entry files`);let d=await Dd(s,MY,{concurrency:jY});n(`Read ${d.length} config files`);let{entries:f,errors:p}=await ly(u);n(`Parsed ${f.length} entries (${p.length} errors)`);let m=await l,h=await r;n(`Hashed ${c.size} of ${m.length} asset files (${h.size} cached)`),Vp.current=f,Dp.current=m,Ip.current=d,Up.current=p,Rp.current=!0,n(`The site data is ready`);let g=new Set(o.map(({path:e})=>e));await wb(t,c,[...h.keys()].filter(e=>!g.has(e)))},PY=Xi({isLocalHost:!1,isLocalBackendSupported:!1,isTestBackendSupported:!0,isBrave:!1,isMacOS:!1,isSmallScreen:!1,isMediumScreen:!1,isLargeScreen:!1,hasMouse:!0}),rFe=()=>{let{location:{hostname:e},navigator:{userAgentData:t,platform:n},matchMedia:r}=globalThis;PY.isLocalHost=Lu(e),PY.isLocalBackendSupported=`showDirectoryPicker`in globalThis,PY.isTestBackendSupported=!globalThis.FileSystemFileHandle||`createWritable`in globalThis.FileSystemFileHandle.prototype,PY.isBrave=t?.brands.some(({brand:e})=>e===`Brave`)??!1,PY.isMacOS=t?.platform===`macOS`||n.startsWith(`Mac`);let i=r(`(width < 768px)`),a=r(`(768px <= width < 1024px)`),o=r(`(1024px <= width)`),s=r(`(pointer: fine)`),c=()=>{PY.isSmallScreen=i.matches},l=()=>{PY.isMediumScreen=a.matches},u=()=>{PY.isLargeScreen=o.matches},d=()=>{PY.hasMouse=s.matches};c(),l(),u(),d(),i.addEventListener(`change`,c),a.addEventListener(`change`,l),o.addEventListener(`change`,u),s.addEventListener(`change`,d)},FY=e=>PY.isSmallScreen||PY.isMediumScreen||e.detail===0||e.pointerType===`touch`||!PY.hasMouse,iFe=3,aFe=150,IY=()=>`move`in FileSystemFileHandle.prototype&&!PY.isBrave,LY=async(e,t)=>{let n=await e.createWritable?.();try{await n?.write(t)}finally{try{await n?.close()}catch{}}},oFe=async({rootDirHandle:e,previousPath:t,path:n})=>{let{dirname:r,basename:i}=Uc(n),{dirname:a}=Uc(t),o=await KJ(e,t);if(IY()){let t=await qJ(e,r);return await o.move(t,await WJ(t,i)),o}let s=await KJ(e,n),c=await qJ(e,a);return await LY(s,await o.getFile()),await c.removeEntry(o.name),s},sFe=async(e,t,n)=>{for(let r=1;;r+=1)try{await e.move(t,n);return}catch(e){if(r===iFe)throw e;await Iu(aFe*r)}},cFe=async({rootDirHandle:e,fileHandle:t,path:n,data:r})=>{let i;if(!t){if(IY()){let{dirname:r,basename:a}=Uc(Lc(n)),o=await qJ(e,r);t=await o.getFileHandle(`.sveltia-tmp-${crypto.randomUUID()}`,{create:!0}),i={dirHandle:o,basename:a}}else t=await KJ(e,n)}if(!i)return await LY(t,r),t.getFile();let{dirHandle:a,basename:o}=i;try{await LY(t,r),await sFe(t,a,await WJ(a,o))}catch(e){try{await a.removeEntry(t.name)}catch{}throw e}return t.getFile()},lFe=async(e,t)=>{for(let n=t.length;n>0;--n){let r=t[n-1],i=t.slice(0,n-1).join(`/`);try{let t=await GJ(e,i,`directory`,{create:!1}),n=await WJ(t,r),a=await t.getDirectoryHandle(n);for await(let e of a.entries())return;await t.removeEntry(n)}catch(e){if(!BJ(e))throw e}}},uFe=async({rootDirHandle:e,path:t})=>{let{dirname:n=``,basename:r}=Uc(Lc(t)),i=await qJ(e,n);try{await i.removeEntry(await WJ(i,r))}catch(e){if(!BJ(e))throw e}},dFe=async(e,t)=>{for(let n of new Set(t))n&&await lFe(e,n.split(`/`))},fFe=async(e,{action:t,path:n,previousPath:r,data:i})=>{let a;return t===`move`&&r&&(a=await oFe({rootDirHandle:e,previousPath:r,path:n})),[`create`,`update`,`move`].includes(t)&&i!==void 0?cFe({rootDirHandle:e,fileHandle:a,path:n,data:i}):(t===`delete`&&await uFe({rootDirHandle:e,path:n}),null)},RY=({slug:e,data:t})=>e!==void 0||typeof t==`string`,zY=async(e,t)=>Promise.all(t.map(async t=>{let{path:n,data:r}=t,i=e?await fFe(e,t):null;if(!i){if(r===void 0)return null;i=au(r)}return[n,{file:i,sha:await cu(i)}]})),BY=async(e,t)=>{let n=t.filter(e=>!RY(e)),r=t.filter(RY),i=[...await zY(e,n),...await zY(e,r)];return e&&await dFe(e,t.map(({action:e,path:t,previousPath:n})=>{if(e===`delete`)return t;if(e===`move`&&n)return n}).filter(e=>e!==void 0).map(e=>eu(Lc(e)))),{sha:await cu(new Date().toJSON()),files:Object.fromEntries(i.filter(e=>!!e))}},VY=(e,t)=>(e=Lc(e),e===`https://api.github.com`?t===`v3`?e:`${e}/graphql`:t===`graphql`&&e.endsWith(`/graphql`)?e:`${e.replace(/\/api(?:\/v3|\/graphql)?$/,``)}/api/${t}`),pFe=e=>VY(e,`v3`),mFe=e=>VY(e,`graphql`),hFe=e=>Tb(e,`github`,{name:`name`,login:`login`,profileURL:`html_url`}),gFe=e=>{let{origin:t}=new URL(e),n=new URLSearchParams({name:`Sveltia CMS`,contents:`write`});return lx(Dl.current)&&n.set(`pull_requests`,`write`),`${t}/settings/personal-access-tokens/new?${n}`},_Fe=e=>yd({options:e,getUserProfile:hFe}),HY={...wu},UY=Au({tree:`/tree`,blob:`/blob`,commit:`/commit`}),vFe=({status:e,headers:t})=>e===429||t.get(`retry-after`)!==null||t.get(`x-ratelimit-remaining`)===`0`,WY=async e=>{let t=await rd(Eu(HY),{headers:{Accept:`application/json`},responseType:`raw`});if(!t.ok){let n=vFe(t)?void 0:t.status;throw e&&(n===403||n===404)?await e(t):wl(HY,n)}let{permissions:n,private:r,owner:i,allow_forking:a}=await t.json();return{canRead:!!n?.pull,canWrite:!!n?.push,allowForking:a!==!1,isPersonalPrivate:!!r&&i?.type===`User`}},yFe=async()=>{let{canRead:e,canWrite:t}=await WY();if(!t)throw Cl(HY.repo,e)},bFe=`
query($owner: String!, $repo: String!, $qualifiedName: String!) {
repository(owner: $owner, name: $repo) {
ref(qualifiedName: $qualifiedName) {
refUpdateRule {
viewerCanPush
}
}
}
}
`,xFe=async()=>{await fl(HY.branch,async e=>({canPush:(await id(bFe,{qualifiedName:`refs/heads/${e}`})).repository?.ref?.refUpdateRule?.viewerCanPush}))},SFe=`
query($owner: String!, $repo: String!) {
repository(owner: $owner, name: $repo) {
defaultBranchRef {
name
}
}
}
`,GY=async()=>{let e=await id(SFe),t=Mu(HY,{found:!!e.repository,branch:e.repository?.defaultBranchRef?.name,getBaseURLs:UY});return Object.assign(Qu,{branch:t}),t},CFe=()=>ib(`github`),KY=()=>ab(HY),wFe=async()=>{try{return(await rd(`/user/repository_invitations`)).some(({repository:e})=>Ou(e?.full_name,HY))}catch{return!1}},TFe=async e=>{let{owner:t,repo:n}=HY,r=`${t}/${n}`,i=e=>bl(`Not a collaborator of the repository`,e,{repo:r});if(await wFe())return i(`open_authoring.invitation_pending`);let a=e.headers.get(`x-oauth-scopes`);return a!==null&&!a.split(/,\s*/).includes(`repo`)?i(`open_authoring.private_repo_scope_required`):i(`repository_no_access`)},EFe=async()=>{let e=await WY(TFe);return e.isPersonalPrivate&&console.warn(`Open Authoring is enabled, but the ${HY.owner}/${HY.repo} repository is private and owned by a personal account. GitHub does not allow read-only collaborators there, so everyone who can sign in can also write to the repository and no one is treated as a contributor. Transfer the repository to an organization to use Open Authoring with it.`),e},DFe=()=>mb(HY,{headers:{Accept:`application/json`}}),OFe=`
query($owner: String!, $repo: String!) {
repository(owner: $owner, name: $repo) {
forks(ownerAffiliations: [OWNER], first: 1) {
nodes {
nameWithOwner
owner {
login
}
}
}
}
}
`,kFe=async()=>{let e=Fu.account?.login,{repository:t}=await id(OFe),[n]=t?.forks?.nodes??[];if(n?.owner?.login===e)return Du(n.nameWithOwner)},AFe=async()=>await DFe()??kFe(),jFe=async({owner:e,repo:t},n)=>{await sb({repoPath:`${e}/${t}`,attemptsLeft:n,checkFork:async()=>(await rd(Eu({owner:e,repo:t}),{headers:{Accept:`application/json`},responseType:`raw`})).ok?`ready`:`pending`})},MFe=async()=>{let{owner:e,repo:t}=HY,n;try{n=await rd(`${Eu(HY)}/forks`,{method:`POST`})}catch(n){throw ob(`${e}/${t}`,n)}let r=Du(n.full_name);return await jFe(r),r},NFe=e=>pb(e,HY.branch),PFe=async()=>{await lb({repository:HY,fetchAccess:EFe,fetchDefaultBranchName:GY,fetchFork:AFe,prepareFork:NFe,fetchForkingAllowed:({allowForking:e})=>e,createFork:MFe})},FFe=async()=>{await cb(PFe)},IFe=(e,t,{useBranch:n=!1}={})=>{let r=e.map(({index:e,fragment:n})=>`${t}_${e}: ${n}`).join(`
`);return`
query($owner: String!, $repo: String!${n?`, $branch: String!`:``}) {
repository(owner: $owner, name: $repo) {
${r}
}
}
`},qY=async({items:e,alias:t,getFragment:n,chunkSize:r,useBranch:i=!1,variables:a={}})=>{let o=Array(e.length).fill(void 0);return await Ed(Ub(e.map((e,t)=>({index:t,fragment:n(e)})).filter(({fragment:e})=>!!e),r),async e=>{let n=await id(IFe(e,t,{useBranch:i}),{...a});e.forEach(({index:e})=>{o[e]=n?.repository?.[`${t}_${e}`]})}),o},LFe=`
query($owner: String!, $repo: String!, $branch: String!) {
repository(owner: $owner, name: $repo) {
ref(qualifiedName: $branch) {
target {
... on Commit {
history(first: 1) {
nodes {
oid
message
}
}
}
}
}
}
}
`,JY=async e=>{let{owner:t,repo:n}=e?KY():HY,r=e??HY.branch,i=await id(LFe,{owner:t,repo:n,...e?{branch:r}:{}});if(!i.repository)throw ip(`repository_not_found`,{repo:n});if(!i.repository.ref)throw ip(`branch_not_found`,{repo:n,branch:r});let{oid:a,message:o}=i.repository.ref.target.history.nodes[0];return{hash:a,message:o}},YY=10485760,RFe=async({headOid:e,branch:t})=>e||(!t&&sp.current?sp.current:(await JY(t)).hash),zFe=5e3,BFe=(e,t)=>Math.min(16777216,Math.max(262144,Math.floor(e/Math.max(t,1)*zFe))),VFe=e=>{let[t,...n]=e.split(/\r?\n/),r=n.join(`
`).trim();return r?{headline:t,body:r}:{headline:t}},HFe=async({owner:e,repo:t,branch:n,expectedHeadOid:r,additions:i,deletions:a,message:o,onWorkflowBranch:s})=>{let c=`
mutation($input: CreateCommitOnBranchInput!) {
createCommitOnBranch(input: $input) {
commit {
oid
committedDate
${i.map(({index:e,path:t,data:n})=>ou(n??``)<=YY?`file_${e}: file(path: ${JSON.stringify(t)}) { oid }`:``).filter(Boolean).join(` `)}
}
}
}
`,l={branch:{repositoryNameWithOwner:`${e}/${t}`,branchName:n},expectedHeadOid:r,fileChanges:{additions:i.map(({path:e,contents:t})=>({path:e,contents:t})),deletions:a},message:VFe(o)};try{let{createCommitOnBranch:{commit:e}}=await id(c,{input:l},{retryable:!0});return e}catch(e){throw s||await jae(r,JY),e}},XY=async(e,t)=>{db(t);let{owner:n,repo:r}=t.branch?KY():HY,i=t.branch??HY.branch,a=await Promise.all(e.filter(({action:e})=>[`create`,`update`,`move`].includes(e)).map(async({path:e,data:t},n)=>({index:n,path:e,contents:await Gc(t??``),data:t}))),o=e.filter(({action:e})=>[`move`,`delete`].includes(e)).map(({previousPath:e,path:t})=>({path:e??t})),{queue:s,addedAgain:c}=xd(a,new Set(o.map(({path:e})=>e))),l=kae(np(e,t)),u=await RFe(t),d=2097152,f=1/0,p=0,m={},h={};try{do{hl(p,p+wd(s,d));let e=Sd(s,d),a=!s.length,g=Cd(e),_=performance.now();try{m=await HFe({owner:n,repo:r,branch:i,expectedHeadOid:u,additions:a?[...e,...c]:e,deletions:a?o:[],message:l,onWorkflowBranch:!!t.branch})}catch(n){if(e.length>1&&Td(n)&&(await JY(t.branch).catch(()=>void 0))?.hash===u){s.unshift(...e),f=Math.min(f,g),d=Math.floor(g/2);continue}throw p&&!t.branch&&(sp.current=u),n}d=Math.min(BFe(g,performance.now()-_),f-1),p+=1,Object.assign(h,m),u=m.oid}while(s.length)}finally{gl()}return{sha:m.oid,date:new Date(m.committedDate),files:Object.fromEntries(a.map(({index:e,path:t,data:n})=>[t,{sha:h[`file_${e}`]?.oid,...n instanceof Blob&&n.size>YY?{file:n}:{}}]))}},UFe=50,WFe=async e=>Aae((await qY({items:e,alias:`history`,useBranch:!0,getFragment:e=>`
ref(qualifiedName: $branch) {
target {
... on Commit {
history(first: 100, path: ${JSON.stringify(e)}) {
nodes {
oid
messageHeadline
author {
name
email
avatarUrl
user { login }
}
committedDate
}
}
}
}
}
`,chunkSize:UFe})).flatMap(e=>(e?.target?.history?.nodes??[]).map(e=>({sha:e.oid,message:e.messageHeadline??``,authorName:e.author?.name??``,authorEmail:e.author?.email,authorAvatarURL:e.author?.avatarUrl,authorLogin:e.author?.user?.login,date:new Date(e.committedDate)})))),GFe=async()=>rd(`${Eu(HY)}/dispatches`,{method:`POST`,body:{event_type:`sveltia-cms-publish`},responseType:`raw`}),ZY={commits:20,deployments:10,checkSuites:10,checkRuns:20},KFe={SUCCESS:`ready`,PENDING:`pending`,EXPECTED:`pending`,FAILURE:`error`,ERROR:`error`},qFe={SUCCESS:`ready`,PENDING:`pending`,QUEUED:`pending`,IN_PROGRESS:`pending`,WAITING:`pending`,FAILURE:`error`,ERROR:`error`},JFe={SUCCESS:`ready`,NEUTRAL:`ready`,FAILURE:`error`,TIMED_OUT:`error`,STARTUP_FAILURE:`error`,ACTION_REQUIRED:`error`},YFe=/preview/i,XFe=async()=>{if(!HY.branch)return;let{repository:e}=await id(`
query($owner: String!, $repo: String!, $branch: String!) {
repository(owner: $owner, name: $repo) {
ref(qualifiedName: $branch) {
target {
... on Commit {
oid
}
}
}
}
}
`);return e?.ref?.target?.oid??void 0},QY=(e,t)=>qY({items:e,alias:`commit`,getFragment:e=>`object(oid: ${JSON.stringify(e)}) { ... on Commit { ${t} } }`,chunkSize:ZY.commits}),$Y={status:{selection:`status { contexts { context state targetUrl description } }`,parse:(e,t,n)=>{ap(n[t],e?.status?.contexts,({state:e})=>KFe[e],({context:e,targetUrl:t,description:n})=>({name:e??``,url:t,description:n,source:`status`}))}},deployments:{selection:`deployments(
last: ${ZY.deployments}
orderBy: { field: CREATED_AT, direction: ASC }
) {
nodes {
environment
latestStatus {
state
environmentUrl
description
}
}
}`,parse:(e,t,n)=>{ap(n[t],e?.deployments?.nodes,({latestStatus:e})=>qFe[e?.state],({environment:e,latestStatus:t})=>({name:e??``,url:t?.environmentUrl,description:t?.description,source:`deployment`}))}},checks:{selection:`checkSuites(last: ${ZY.checkSuites}) {
nodes {
checkRuns(last: ${ZY.checkRuns}) {
nodes {
name
status
conclusion
detailsUrl
summary
}
}
}
}`,parse:(e,t,n)=>{ap(n[t],e?.checkSuites?.nodes?.flatMap(e=>e?.checkRuns?.nodes??[]),({status:e,conclusion:t})=>e===`COMPLETED`?JFe[t]:`pending`,({name:e,detailsUrl:t,summary:n})=>({name:e??``,url:zae(n,t)??(YFe.test(e)?t:void 0),source:`check`}))}}},eX=!1,ZFe=async(e,t)=>{let n=await QY(e,Object.values($Y).map(({selection:e})=>e).join(`
`));e.forEach((e,r)=>{Object.values($Y).forEach(({parse:i})=>i(n[r],e,t))})},QFe=async(e,t)=>{await Promise.all(Object.values($Y).map(({selection:n,parse:r})=>Gae(async()=>{let i=await QY(e,n);e.forEach((e,n)=>r(i[n],e,t))})))},$Fe=async(e,t)=>{await Ed(Ub(e,ZY.commits),async e=>{if(!eX)try{await ZFe(e,t);return}catch(e){console.warn(`Falling back to a request per deployment source.`,e),eX=!0}await QFe(e,t)})},eIe=async e=>Kae(e,{collect:$Fe,selfURL:HY.repoURL}),tX=async(e,t)=>{let n=t?`?recursive=1`:``;return await rd(`${Eu(HY)}/git/trees/${Kl(e)}${n}`)},tIe=async e=>{let t=e??HY.branch,n=uu(),r=[],i=[n?{sha:`${t}:${n}`,prefix:`${n}/`}:{sha:t,prefix:``}];for(;i.length;){let e=await Dd(i,async({sha:e,prefix:r})=>{let{tree:i,truncated:a}=await tX(e,!0).catch(r=>{throw n&&e===`${t}:${n}`&&r?.cause?.status===404?bl(`Failed to list the files.`,`root_dir_not_found`,{repo:`${HY.owner}/${HY.repo}`,dir:n}):r});if(!a)return{prefix:r,entries:i,subtrees:[]};let{tree:o,truncated:s}=await tX(e,!1);if(s)throw Error(`The directory '${r||`/`}' has too many files to list.`);return{prefix:r,entries:o,subtrees:o.filter(({type:e})=>e===`tree`)}});i=e.flatMap(({prefix:e,subtrees:t})=>t.map(({path:t,sha:n})=>({sha:n,prefix:`${e}${t}/`}))),e.forEach(({prefix:e,entries:t})=>{t.forEach(t=>{t.type===`blob`&&r.push({...t,path:`${e}${t.path}`})})})}return py(r)},nIe=`
query($owner: String!, $repo: String!, $expression: String!) {
repository(owner: $owner, name: $repo) {
object(expression: $expression) {
oid
}
}
}
`,rIe=async(e,t)=>{let{owner:n,repo:r}=HY;return(await id(nIe,{owner:n,repo:r,expression:`${e}:${t}`})).repository?.object?.oid},iIe=250,aIe=({type:e,sha:t})=>e===`asset`?``:`object(oid: ${JSON.stringify(t)}) { ... on Blob { text isTruncated } }`,oIe=({path:e})=>`
ref(qualifiedName: $branch) {
target {
... on Commit {
history(first: 1, path: ${JSON.stringify(e)}) {
nodes {
author {
name
email
user {
id: databaseId
login
}
}
committedDate
}
}
}
}
}
`,nX=async({owner:e,repo:t,sha:n,responseType:r})=>rd(`${Eu({owner:e,repo:t})}/git/blobs/${n}`,{headers:{Accept:`application/vnd.github.raw`},responseType:r}),rX=async({owner:e,repo:t,sha:n})=>nX({owner:e,repo:t,sha:n,responseType:`text`}),sIe=async(e,t)=>{let n=[],r=e.map(({path:e,sha:r,size:i},a)=>{let{text:o,isTruncated:s}=t[a]??{},c={sha:r,size:i,text:o,meta:void 0};return s&&n.push({sha:r,data:c}),[e,c]}),{owner:i,repo:a}=HY;return await Ed(n,async({sha:e,data:t})=>{t.text=await rX({owner:i,repo:a,sha:e})}),Object.fromEntries(r)},cIe=(e,t)=>Object.fromEntries(e.flatMap(({path:e},n)=>{let r=t[n]?.target?.history?.nodes?.[0];if(!r)return[];let{author:i,committedDate:a}=r,o=i?.user;return[[e,{commitAuthor:i?{name:i.name,email:i.email,id:o?.id,login:o?.login}:void 0,commitDate:new Date(a)}]]})),iX=(e,t,n,{useBranch:r=!1}={})=>qY({items:e,alias:t,getFragment:n,chunkSize:iIe,useBranch:r}),lIe=async e=>{let t=bb(e.length),n;try{n=await iX(e,`content`,aIe)}finally{t()}return sIe(e,n)},uIe=async e=>cIe(e,await iX(e,`commit`,oIe,{useBranch:!0})),dIe=async({lastCommit:e}={})=>{await Yy({isOpenAuthoringConfigured:CFe,initOpenAuthoring:FFe,repository:HY,checkAccess:yFe,checkBranchAccess:xFe,fetchDefaultBranchName:GY,fetchLastCommit:JY,lastCommit:e,fetchFileList:tIe,fetchFileContents:lIe,fetchFileMetadata:uIe})},fIe=async e=>{let{owner:t,repo:n}=e.workflow?KY():HY,{sha:r}=e,i=await nX({owner:t,repo:n,sha:r,responseType:`raw`});if(!i.ok)throw Error(`Failed to fetch the blob`,{cause:{status:i.status}});return i.blob()},pIe=xb(`https://www.githubstatus.com/api/v2/status.json`,({status:{indicator:e}})=>e===`critical`?`major`:[`none`,`minor`,`major`].includes(e)?e:void 0),aX=[`PENDING`,`EXPECTED`],mIe=[`REVIEW_REQUIRED`,`CHANGES_REQUESTED`],hIe=[`CLEAN`,`HAS_HOOKS`,`UNSTABLE`],gIe=Xy,_Ie=`
query($owner: String!, $repo: String!, $number: Int!) {
repository(owner: $owner, name: $repo) {
pullRequest(number: $number) {
id
state
merged
mergeStateStatus
reviewDecision
viewerCanEnableAutoMerge
autoMergeRequest {
enabledAt
}
commits(last: 1) {
nodes {
commit {
statusCheckRollup {
state
}
}
}
}
}
}
}
`,vIe=`
mutation($input: EnablePullRequestAutoMergeInput!) {
enablePullRequestAutoMerge(input: $input) {
clientMutationId
}
}
`,yIe=`
mutation($input: DisablePullRequestAutoMergeInput!) {
disablePullRequestAutoMerge(input: $input) {
clientMutationId
}
}
`,oX=async e=>{let{owner:t,repo:n}=HY,{repository:r}=await id(_Ie,{owner:t,repo:n,number:e.number}),i=r?.pullRequest;if(i)return{...i,checkState:i.commits?.nodes?.[0]?.commit?.statusCheckRollup?.state}},sX=e=>e?.state===`OPEN`&&e.mergeStateStatus===`UNKNOWN`,bIe=e=>Zy(()=>oX(e),e=>!sX(e),gIe),xIe=e=>e.state===`OPEN`&&e.mergeStateStatus===`BLOCKED`&&(!!e.viewerCanEnableAutoMerge||!!e.autoMergeRequest)&&aX.includes(e.checkState)&&!mIe.includes(e.reviewDecision),SIe=(e,t)=>Vb({read:()=>oX(e),check:e=>{let{merged:t,state:n,autoMergeRequest:r,checkState:i}=e??{},a=n===`OPEN`&&!!r,o=!aX.includes(i)&&i!==`SUCCESS`;return{merged:t,failure:a&&!o?void 0:`${n}, checks ${i}, auto-merge ${r?`on`:`off`}`,armed:a}},cancel:()=>id(yIe,{input:{pullRequestId:t}}),label:`pull request #${e.number}`}),CIe=async({pullRequest:e,node:t,squash:n,merge:r})=>{if(t.autoMergeRequest)return!0;let{title:i,headSHA:a}=e;try{return await id(vIe,{input:{pullRequestId:t.id,mergeMethod:n?`SQUASH`:`MERGE`,commitHeadline:i,...a?{expectedHeadOid:a}:{}}}),!0}catch{let t=await oX(e);return t?.merged?!1:t?.autoMergeRequest?!0:(await r(),!1)}},wIe=async({pullRequest:e,squash:t,merge:n,refusal:r})=>{let i=await bIe(e);if(!i?.merged){if(sX(i))throw Error(`Timed out waiting for GitHub to check whether pull request #${e.number} can be merged`,{cause:r});if(hIe.includes(i?.mergeStateStatus))await n();else if(i&&xIe(i))await CIe({pullRequest:e,node:i,squash:t,merge:n})&&await SIe(e,i.id);else throw r}},cX={pullRequests:100,files:100,labels:100,branches:100,branchPullRequests:2},lX=e=>e.map(({path:e,changeType:t})=>({path:e,sha:``,size:0,deleted:t===`DELETED`,renamed:t===`RENAMED`})),uX=async e=>{e.files=eb(await rd(`${ku(HY,e.number)}/files?per_page=${cX.files}`),{removedStatus:`removed`})},TIe=100,dX=async e=>{let t=[];if(e.forEach(e=>{e.files.forEach(n=>{n.deleted||t.push({pullRequest:e,file:n})})}),!t.length)return;let n=KY(),r=await qY({items:t,alias:`file`,getFragment:({pullRequest:{headSHA:e,branch:t},file:n})=>`
object(expression: ${JSON.stringify(`${e??t}:${n.path}`)}) {
... on Blob {
oid
byteSize
isBinary
isTruncated
text
}
}
`,chunkSize:TIe,variables:n}),i=[];t.forEach(({file:e},t)=>{let n=r[t];n?(Object.assign(e,{sha:n.oid,size:n.byteSize,text:n.isBinary?void 0:n.text??void 0}),!n.isBinary&&n.isTruncated&&i.push(e)):e.deleted=!0}),await Ed(i,async e=>{e.text=await rX({...n,sha:e.sha})})},EIe=`
query($owner: String!, $repo: String!, $branch: String!) {
repository(owner: $owner, name: $repo) {
branchHead: ref(qualifiedName: $branch) {
target {
oid
}
}
}
}
`,fX=async e=>{let{owner:t,repo:n}=KY(),{repository:r}=await id(EIe,{owner:t,repo:n,branch:`refs/heads/${e}`});return r?.branchHead?.target?.oid},pX=async e=>{await Db({branch:e,path:`${Eu(KY())}/git/refs/heads/${Kl(e)}`,goneStatuses:[404,422]})},DIe=async(e,t)=>{let{labels:n=[]}=await rd(ku(HY,e.number)),r=mx(n.map(({name:e})=>e),t);await rd(`${Eu(HY)}/issues/${e.number}`,{method:`PATCH`,body:{labels:r}})},mX=e=>{let{id:t=e?.databaseId}=e??{};return tb({...e,id:t})},hX=async(e,t)=>{await id(`
mutation($input: ${t?`ConvertPullRequestToDraftInput`:`MarkPullRequestReadyForReviewInput`}!) {
${t?`convertPullRequestToDraft`:`markPullRequestReadyForReview`}(input: $input) {
pullRequest {
isDraft
}
}
}
`,{input:{pullRequestId:e.nodeId}})},gX=async({branch:e,title:t,status:n,description:r})=>{let{branch:i}=HY,a=Eu(HY),o=Jf.current,s=await rd(`${a}/pulls`,{method:`POST`,body:{title:t,head:o?`${o.owner}:${e}`:e,base:i,draft:n===`draft`,body:r}}),c=nb(s,{nodeId:s.node_id,title:s.title,branch:e,status:n,author:mX(s.user),description:r});return o||await rd(`${a}/issues/${s.number}/labels`,{method:`POST`,body:{labels:[fx(n)]}}),c},OIe=()=>`
query($owner: String!, $repo: String!, $prefix: String!) {
repository(owner: $owner, name: $repo) {
refs(refPrefix: $prefix, first: ${cX.branches}) {
nodes {
name
target {
... on Commit {
oid
message
committedDate
author {
name
email
user {
login
databaseId
}
}
}
}
}
}
}
}
`,kIe=50,AIe=e=>`
pullRequests(
headRefName: ${JSON.stringify(e)}
baseRefName: ${JSON.stringify(HY.branch)}
states: [OPEN, CLOSED, MERGED]
first: ${cX.branchPullRequests}
orderBy: { field: CREATED_AT, direction: DESC }
) {
nodes {
id
number
title
url
state
isDraft
createdAt
updatedAt
headRefOid
headRepositoryOwner {
login
}
author {
login
}
files(first: ${cX.files}) {
nodes {
path
changeType
}
}
}
}
`,_X=e=>{let t=Fu.account?.login?.toLowerCase();return e.headRepositoryOwner?.login===Jf.current?.owner&&!!t&&e.author?.login?.toLowerCase()===t},jIe=async e=>{let t=new Map;if(!e.length)return t;let n=await qY({items:e,alias:`pr`,getFragment:AIe,chunkSize:kIe});return e.forEach((e,r)=>{let[i]=(n[r]?.nodes??[]).filter(_X);i&&t.set(e,i)}),t},MIe=(e,t,n)=>{let{message:r,committedDate:i,author:a}=e.target??{},o=n?.state===`MERGED`?void 0:n,{login:s,databaseId:c}=a?.user??{},l=o?.state===`OPEN`,u=l&&!o.isDraft;return{number:o?.number,nodeId:o?.id,title:o?.title??r??``,url:o?.url,branch:t,headSHA:e.target?.oid,status:u?`pending_review`:`draft`,createdDate:new Date(o?.createdAt??i),updatedDate:new Date(o?.updatedAt??i),author:a?.name?{name:a.name,email:a.email??``,id:c,login:s}:void 0,files:l?lX(o.files?.nodes??[]):[]}},NIe=async()=>{let{owner:e,repo:t}=KY(),n=Jb(),{repository:r}=await id(OIe(),{owner:e,repo:t,prefix:`refs/heads/${n}`}),i=r?.refs?.nodes??[];i.length===cX.branches&&console.warn(`Only the first ${cX.branches} Editorial Workflow branches in the fork are listed. Publish or discard some entries to see the rest.`);let a=i.map(({name:e})=>`${n}${e}`),o=await jIe(a);return hb(i,(e,t)=>{let n=a[t],r=o.get(n);return r?.state===`MERGED`&&r.headRefOid===e.target?.oid?{leftover:n}:{pending:MIe(e,n,r)}},pX)},PIe=async e=>{let{branch:t}=HY,{owner:n}=KY(),r=Kl(t),i=`${encodeURIComponent(n)}:${Kl(e.branch)}`,{files:a=[]}=await rd(`${Eu(HY)}/compare/${r}...${i}?per_page=${cX.files}`);e.files=eb(a,{removedStatus:`removed`})},FIe=async()=>{let e=await NIe();await Ed(e.filter(({files:e})=>!e.length),PIe),await Ed(e.filter(({files:e})=>e.some(({renamed:e})=>e)),uX);let t=e.filter(({files:e})=>e.length);return await dX(t),t},IIe=`
query($id: ID!) {
node(id: $id) {
... on PullRequest {
state
isDraft
baseRefName
headRefOid
headRepositoryOwner {
login
}
author {
login
}
}
}
}
`,LIe=async({nodeId:e})=>{let{node:t}=await id(IIe,{id:e});if(t)return{merged:t.state===`MERGED`,isEntryRequest:t.baseRefName===HY.branch&&_X(t),getMergedSHA:async()=>t.headRefOid,state:t.state,draft:t.isDraft}},RIe=e=>zb(e,{repository:HY,updateDraftState:hX}),zIe=async(e,t)=>gb({pullRequest:e,status:t,requestKey:`nodeId`,createRequest:gX,fetchRequest:LIe,applyStatus:RIe,fetchBranchHead:fX,deleteBranch:pX}),BIe=()=>`
id
number
title
url
body
isDraft
isCrossRepository
baseRefName
createdAt
updatedAt
headRefName
headRefOid
author {
login
avatarUrl
... on User {
name
email
databaseId
}
}
labels(first: ${cX.labels}) {
nodes {
name
}
}
files(first: ${cX.files}) {
nodes {
path
changeType
}
}
`,VIe=()=>`
query($owner: String!, $repo: String!) {
repository(owner: $owner, name: $repo) {
pullRequests(
states: OPEN
labels: ${JSON.stringify(px())}
first: ${cX.pullRequests}
orderBy: { field: UPDATED_AT, direction: DESC }
) {
nodes {
${BIe()}
}
}
}
}
`,HIe=(e,t)=>({number:e.number,nodeId:e.id,title:e.title,url:e.url,branch:e.headRefName,headSHA:e.headRefOid,status:t,createdDate:new Date(e.createdAt),updatedDate:new Date(e.updatedAt),author:mX(e.author),files:lX(e.files?.nodes??[]),description:e.body??``}),UIe=e=>{if(e.isCrossRepository||e.baseRefName!==HY.branch)return;let t=hx(e.labels.nodes.map(e=>e.name));if(t)return HIe(e,t)},WIe=async()=>{let{repository:e}=await id(VIe()),t=(e?.pullRequests?.nodes??[]).map(UIe).filter(Boolean);return await Ed(t.filter(({files:e})=>e.some(({renamed:e})=>e)),uX),await dX(t),t},GIe=async()=>Yf.current?FIe():WIe(),KIe=`
query(
$forkOwner: String!
$forkRepo: String!
$owner: String!
$repo: String!
$branch: String!
) {
fork: repository(owner: $forkOwner, name: $forkRepo) {
id
ref(qualifiedName: $branch) {
name
}
defaultBranchRef {
name
}
}
base: repository(owner: $owner, name: $repo) {
ref(qualifiedName: $branch) {
target {
oid
}
}
}
}
`,qIe=`
mutation($input: CreateRefInput!) {
createRef(input: $input) {
ref {
name
}
}
}
`,JIe=()=>`
query($owner: String!, $repo: String!, $branch: String!) {
repository(owner: $owner, name: $repo) {
pullRequests(headRefName: $branch, states: OPEN, first: ${cX.pullRequests}) {
nodes {
number
isCrossRepository
}
}
}
}
`,YIe=async e=>{let{owner:t,repo:n}=HY,{repository:r}=await id(JIe(),{owner:t,repo:n,branch:e});return(r?.pullRequests?.nodes??[]).filter(({isCrossRepository:e})=>!e)},XIe=async(e,t)=>{await rd(`${Eu(HY)}/git/refs/heads/${Kl(e)}`,{method:`PATCH`,body:{sha:t,force:!0}})},vX=e=>e.cause?.message??``,yX=async(e,t,n)=>{try{await id(qIe,{input:{repositoryId:e,name:`refs/heads/${t}`,oid:n}});return}catch(e){return e}},ZIe=async(e,t)=>{let{branch:n}=HY,r=Kl(n),i=`${encodeURIComponent(e)}:${Kl(t)}`;try{let{merge_base_commit:e}=await rd(`${Eu(HY)}/compare/${r}...${i}?per_page=1`);return e?.sha}catch{return}},QIe=async e=>{let{repo:t}=HY,{owner:n,repo:r}=KY(),{fork:i,base:a}=await id(KIe,{forkOwner:n,forkRepo:r});if(!i)throw bl(`Failed to create the branch.`,`repository_not_found`,{repo:r});if(!a)throw bl(`Failed to create the branch.`,`repository_not_found`,{repo:t});if(!a.ref)throw bl(`Failed to create the branch.`,`branch_not_found`,{repo:t,branch:HY.branch});let o=a.ref.target.oid,s=await yX(i.id,e,o);if(s&&Yf.current&&/permission/i.test(vX(s))){let t=i.ref?.name??i.defaultBranchRef?.name,r=t?await ZIe(n,t):void 0;r&&r!==o&&(o=r,s=await yX(i.id,e,o))}if(s){let t=vX(s);if(!t.includes(`already exists`))throw Error(`Failed to create the branch.`,{cause:Error(t||s.message)});if(Yf.current)return{};let[n]=await YIe(e);if(n)throw bl(`The workflow branch is in use by another pull request.`,`workflow.branch_in_use`,{number:`#${n.number}`});await XIe(e,o)}return{headOid:o}},$Ie=(e,t)=>Ab(e,t,{updateForkStatus:zIe,updateLabels:DIe,updateDraftState:hX}),eLe=e=>Ib(HY,e,`APPROVE`),tLe=`The entry is no longer ready to publish.`,nLe=async e=>{let t=`${ku(HY,e.number)}/reviews`,n=await rd(`${t}?per_page=100`);await Promise.all(Lb(n).map(({id:e})=>rd(`${t}/${e}/dismissals`,{method:`PUT`,body:{message:tLe,event:`DISMISS`}})))},rLe=async(e,t)=>{let{headOid:n}=await QIe(t.branch);return XY(e,{...t,headOid:n})},iLe=async(e,t,n)=>{let{branch:r=``}=t;try{return await XY(e,{...t,headOid:n.headSHA})}catch(e){throw await fX(r).then(e=>e===void 0,()=>!1)?kb(r,KY()):e}},aLe=(e,t)=>Fb(HY,e,t),oLe=async e=>Ob(e,{commitToNewBranch:rLe,commitToExistingBranch:iLe,createPullRequest:gX,updateDescription:aLe}),sLe=300,cLe={added:`added`,copied:`added`,removed:`removed`,renamed:`renamed`},lLe=async({headSHA:e,paths:t})=>{let n=jb(t),r=await qY({items:n,alias:`tree`,getFragment:t=>`
object(expression: ${JSON.stringify(`${e}:${t}`)}) {
... on Tree {
entries {
name
mode
}
}
}
`,chunkSize:50}),i=new Map;return n.forEach((e,t)=>{(r[t]?.entries??[]).forEach(({name:t,mode:n})=>{i.set(e?`${e}/${t}`:t,Number(n).toString(8))})}),i},bX={github:By({isGit:!0,name:`github`,label:`GitHub`,repository:HY,statusDashboardURL:`https://www.githubstatus.com/`,checkStatus:pIe,init:()=>{let{backend:e}=Dl.current??{};if(e?.name!==`github`)return;let{repo:t,branch:n,base_url:r=`https://api.netlify.com`,auth_endpoint:i=`auth`,app_id:a=``,api_root:o=`https://api.github.com`,graphql_api_root:s=o,include_credentials:c=!1,auth_scope:l=`repo`}=e,{owner:u,repo:d}=Du(t);return _b(HY,{service:`github`,label:`GitHub`,owner:u,repo:d,branch:n,restApiRoot:o,defaultApiRoot:`https://api.github.com`,getTokenPageURL:gFe,getBaseURLs:UY,authRoot:r,authPath:i,tokenPath:`/access_token`,api:{clientId:a,authScope:[l,`user`].flat().join(`,`),restBaseURL:pFe(o),graphqlBaseURL:mFe(s),includeCredentials:c}}),Object.assign(Qu,{owner:u,repo:d,branch:n}),HY},signIn:_Fe,signOut:bd,fetchFiles:dIe,fetchLastCommit:JY,fetchBlob:fIe,fetchDirSHA:rIe,commitChanges:XY,fetchFileCommits:WFe,triggerDeployment:GFe,fetchBranchHeadSHA:XFe,fetchDeployments:eIe,workflow:{fetchPullRequests:GIe,savePullRequest:oLe,updateStatus:$Ie,approve:eLe,withdrawApproval:nLe,fetchBranchHead:fX,fetchMergeState:async e=>{let{branch:t}=HY,{head:n,base:r}=await rd(ku(HY,e.number)),i=n?.sha;return Pb({pullRequest:e,headSHA:i,onConfiguredBranches:r?.ref===t&&Ou(r?.repo?.full_name,HY)&&Ou(n?.repo?.full_name,HY),listChangedFiles:async e=>{let n=Kl(t),{files:r=[]}=await rd(`${Eu(HY)}/compare/${n}...${e}`);return{files:await Mb(r,{statusMap:cLe,headSHA:e,fetchFileModes:lLe}),complete:r.length<sLe}}})},fetchUnchangedPaths:async({headSHA:e,paths:t})=>{let n=[HY.branch,e],r=await qY({items:t.flatMap(e=>n.map(t=>`${t}:${e}`)),alias:`file`,getFragment:e=>`object(expression: ${JSON.stringify(e)}) { oid }`,chunkSize:100});return t.filter((e,t)=>(r[t*2]?.oid??null)===(r[t*2+1]?.oid??null))},publish:async e=>{ub();let{number:t,title:n,headSHA:r}=e,i=Eb(),a=()=>rd(`${ku(HY,t)}/merge`,{method:`PUT`,body:{merge_method:i?`squash`:`merge`,commit_title:n,sha:r}});try{await a()}catch(t){if(t.cause?.status!==405)throw t;await wIe({pullRequest:e,squash:i,merge:a,refusal:t})}await pX(e.branch)},discard:e=>Rb(HY,e,{deleteBranch:pX})}}),gitlab:void 0,gitea:void 0,forgejo:void 0},xX={gitlab:`gitlab`,gitea:`gitea`,forgejo:`gitea`},uLe=Object.fromEntries([...new Set(Object.values(xX))].map(e=>[e,kH({loader:()=>Zc(e),notLoadedMessage:`The ${e} chunk is not loaded yet.`})])),SX=async e=>{if(!bX[e]&&e in xX){let t=await uLe[xX[e]].load();Object.entries(t).forEach(([e,t])=>{bX[e]??=By(t)})}return bX[e]},CX=`local`,dLe=`Local Repository`,wX=void 0,fLe={service:``,label:``,owner:``,repo:``,branch:``},TX=new Proxy({},{get:(e,t)=>(wX??fLe)[t]}),EX=`root_dir_handle`,DX=void 0,OX=void 0,kX=void 0,AX=void 0,pLe=async({forceReload:e=!1,showPicker:t=!0}={})=>{if(!(`showDirectoryPicker`in window))throw Error(`unsupported`);let n=e?null:await DX?.get(EX)??null;if(n){if(await n.requestPermission({mode:`readwrite`})!==`granted`)n=null;else try{await n.entries().next()}catch(e){n=null,console.error(e)}}if(!n&&t&&(n=await window.showDirectoryPicker(),n)){try{await n.getDirectoryHandle(`.git`)}catch(e){if(VJ(e))await n.getFileHandle(`.git`);else throw e}await DX?.set(EX,n)}return n},mLe=()=>{let{name:e}=Dl.current.backend;return wX=bX[e]?.init?.(),DX=Sb(wX,`file-system-handles`)??null,OX=Sb(wX,`asset-hashes`)??null,TX},hLe=async({auto:e=!1})=>{let t=await pLe({showPicker:!e});if(!t)throw Error(`Directory handle could not be acquired`);try{AX=await XJ(t),kX=t}catch{throw bl(`Failed to open the root directory.`,`root_dir_not_found`,{repo:`${TX.owner}/${TX.repo}`,dir:uu()})}return{backendName:CX}},gLe=async()=>{try{await DX?.delete(EX)}catch{}bY()},_Le=async()=>{await NY(AX,{hashCacheDB:OX})},vLe=async(e,t)=>{let n=()=>BY(AX,e);return yu.localGitCommits&&kX?KPe({repoRootDirHandle:kX,changes:e,options:t,save:n}):(bY(),n())},yLe=async()=>kX?GPe(kX):void 0,bLe={isGit:!1,name:CX,label:dLe,repository:TX,init:mLe,signIn:hLe,signOut:gLe,fetchFiles:_Le,fetchBlob:async({path:e})=>{if(!AX)throw Error(`Root directory handle is not available`);return JJ(AX,e)},commitChanges:vLe},xLe=`link[rel="cms-seed-url"]`,SLe=6,jX=()=>document.querySelector(xLe)?.href||void 0,MX=e=>e===`test-repo`&&!!jX(),CLe=e=>typeof e==`string`&&e.split(`/`).every(e=>!!e&&e!==`.`&&e!==`..`),wLe=async e=>{let t=await fetch(e);if(!t.ok)throw Error(`Failed to fetch the seed manifest: ${t.status}`);let{files:n}=await t.json();if(!Array.isArray(n))throw Error("The seed manifest must have a `files` array");return[...new Set(n)].filter(e=>CLe(e)?!0:(console.warn(`Skipping an invalid path in the seed manifest: ${JSON.stringify(e)}`),!1))},TLe=async(e,t)=>{let n=new URL(t.split(`/`).map(encodeURIComponent).join(`/`),e);try{let e=await fetch(n);if(!e.ok)throw Error(`HTTP ${e.status}`);return await e.blob()}catch(e){console.warn(`Failed to seed ${t}:`,e);return}},ELe=async(e,t,n)=>{try{await LY(await KJ(e,t),n)}catch(e){console.warn(`Failed to seed ${t}:`,e)}},DLe=async(e,t)=>{let n=jX();if(n){try{await e.getDirectoryHandle(t);return}catch{}try{let r=await wLe(n),i=await Dd(r,e=>TLe(n,e),{concurrency:SLe});if(!i.some(Boolean))return;let a=await e.getDirectoryHandle(t,{create:!0});await Promise.all(r.map((e,t)=>{let n=i[t];return n?ELe(a,e,n):void 0}))}catch(e){console.warn(`Failed to seed the test repository:`,e)}}},NX=e=>e?.name===`test-repo`?`test-repo:sveltia-cms-test`:e?.repository?.databaseName,OLe=`Test`,PX=void 0,FX={local:bLe,"test-repo":{isGit:!1,name:`test-repo`,label:OLe,init:()=>void 0,signIn:async()=>{if(!PY.isTestBackendSupported)throw Error(`Unsupported browser`,{cause:{message:Y(`test_repo_unsupported_browser`)}});try{let e=await navigator.storage.getDirectory();await DLe(e,`sveltia-cms-test`),PX=await XJ(await qJ(e,`sveltia-cms-test`),{create:!0})}catch{}return{backendName:`test-repo`}},signOut:async()=>{},fetchFiles:async()=>{PX?await NY(PX):Rp.current=!0},fetchBlob:async({path:e})=>{if(!PX)throw Error(`Root directory handle is not available`);return JJ(PX,e)},commitChanges:async e=>BY(PX,e)}},kLe=e=>FX[e]??bX[e],ALe={azure:{label:`Azure DevOps`},bitbucket:{label:`Bitbucket`},"git-gateway":{label:`Git Gateway`,deprecated:!0}},jLe=[...Object.keys(bX),`test-repo`],IX=tl(),LX=rl(()=>IX.current?kLe(IX.current):void 0),RX=async e=>{if(e===`local`){let e=Dl.current?.backend.name;e&&await SX(e)}return FX[e]??SX(e)},zX=async e=>{let t=e?await RX(e):void 0;return t&&t!==LX.current&&t.init(),IX.current=e,t},BX=`http://www.w3.org/2000/svg`,MLe=e=>new Promise((t,n)=>{let r=new FileReader;r.addEventListener(`load`,()=>{t(r.result)}),r.addEventListener(`error`,()=>{n(r.error)}),r.readAsDataURL(e)}),NLe=e=>!!e?.trim()&&!e.trim().endsWith(`%`),PLe=e=>{let t=(e??``).trim().split(/[\s,]+/).map(Number);if(t.length!==4||t.some(e=>!Number.isFinite(e)))return;let[n,r,i,a]=t;return i>0&&a>0?{x:n,y:r,width:i,height:a}:void 0},FLe=async e=>{let{documentElement:t}=new DOMParser().parseFromString(await e.text(),`image/svg+xml`),n=t.namespaceURI===BX&&t.localName===`svg`,r=document.createElementNS(BX,`svg`),i=document.createElementNS(BX,`image`),a=n&&[`width`,`height`].every(e=>NLe(t.getAttribute(e)))?[`width`,`height`]:[`width`,`height`,`viewBox`,`preserveAspectRatio`];n&&a.forEach(e=>{let n=t.getAttribute(e);n!==null&&r.setAttribute(e,n)});let o=PLe(r.getAttribute(`viewBox`));return Object.entries(o??{width:`100%`,height:`100%`}).forEach(([e,t])=>{i.setAttribute(e,String(t))}),i.setAttribute(`preserveAspectRatio`,`none`),i.setAttribute(`href`,await MLe(new Blob([e],{type:`image/svg+xml`}))),r.append(i),new Blob([new XMLSerializer().serializeToString(r)],{type:`image/svg+xml`})},VX=qc(`pdfjs-dist`),ILe=`${VX}/build/pdf.worker.min.mjs`,LLe={cMapUrl:`${VX}/cmaps/`,iccUrl:`${VX}/iccs/`,standardFontDataUrl:`${VX}/standard_fonts/`,wasmUrl:`${VX}/wasm/`},RLe=e=>(e.GlobalWorkerOptions.workerSrc=ILe,{options:LLe,dispose:()=>{}}),HX,zLe=async(e,t={})=>{let{format:n,quality:r,width:i,height:a,fit:o,nativeOnly:s}=Zq(t);if(!HX)try{HX=await Jc(`pdfjs-dist`,`build/pdf.min.mjs`)}catch{throw Error(`Failed to load PDF.js library`)}let c=URL.createObjectURL(e),l=new OffscreenCanvas(512,512),u=l.getContext(`2d`),d,f;try{f=RLe(HX),d=HX.getDocument({disableAutoFetch:!0,...f.options,url:c});let e=await(await d.promise).getPage(1),t=e.getViewport({scale:1}),{scale:n}=Qq(l,{width:t.width,height:t.height},{width:i,height:a,fit:o});await e.render({canvasContext:u,viewport:n===1?t:e.getViewport({scale:n})}).promise}catch{throw Error(`Failed to render PDF`)}finally{URL.revokeObjectURL(c);try{await d?.destroy()}catch{}f?.dispose()}return Kq(l,{format:n,quality:r,nativeOnly:s})},UX=new Map,WX=new Map,BLe=/[/+]xml$/,GX=async e=>{let t=e.type.split(`;`)[0].trim().toLowerCase();return t===`image/svg+xml`?FLe(e):t===`text/html`||BLe.test(t)?new Blob([e],{type:`text/plain`}):e},KX=async e=>URL.createObjectURL(await GX(e)),qX=async(e,t)=>{if(!e.blobURL){let n=await GX(t);e.blobURL??=URL.createObjectURL(n)}return t},JX=async(e,t)=>(await qX(e,t),e.blobURL&&UX.set(e.blobURL,t),t),YX=(e,t)=>Rl(WX,e,t),XX=async e=>{let{name:t}=e,n=await LX.current?.fetchBlob?.(e);if(!n)throw Error(`Failed to retrieve blob`);return new Blob([n],{type:gp.getType(t)??n.type})},VLe=async e=>JX(e,await XX(e)),ZX=async(e,t=async e=>e)=>{try{return await t(await e.getFile())}catch{throw Error(`Failed to retrieve blob from file handle`)}},QX=async e=>{let{file:t,handle:n,blobURL:r,path:i}=e;return t?qX(e,t):r?UX.get(r)??YX(r,()=>fetch(r).then(e=>e.blob())):n?ZX(n,t=>JX(e,t)):YX(i,()=>VLe(e))},HLe=async e=>{let{file:t,handle:n,blobURL:r,path:i}=e;return t||(r?QX(e):WX.get(i)||(n?ZX(n):XX(e)))},$X=async e=>(e.blobURL||await QX(e),e.blobURL),eZ=void 0,tZ=new Map,ULe=Il(500),nZ=async e=>eZ.get(e),rZ=()=>{eZ??=Sb(LX.current?.repository,`asset-thumbnails`)??ULe},iZ=Qv(4,{lastInFirstOut:!0}),WLe=async e=>{let{sha:t}=e,n=await nZ(t);if(!n){let r=yp(e.name)?zLe:eJ;n=await iZ(async()=>r(await HLe(e),$q),{key:t}),await eZ.set(t,n)}return n},GLe=async e=>{rZ();let t=tZ.get(e);return t?!!await t.catch(()=>void 0):!!await nZ(e)},aZ=async(e,{cacheOnly:t=!1}={})=>{if(!bp(e))return;rZ();let{sha:n}=e;if(t&&!tZ.has(n)){let e=await nZ(n);return e?URL.createObjectURL(e):void 0}!t&&tZ.has(n)&&iZ.prioritize(n);let r=await Rl(tZ,n,()=>WLe(e));return r?URL.createObjectURL(r):void 0},oZ=new Set,sZ=new Set,cZ=[],lZ=[],KLe=()=>{let e=new Set(oZ);oZ.clear(),document.querySelectorAll(`[src^="blob:"]`).forEach(t=>{e.delete(t.getAttribute(`src`))}),sZ.forEach(t=>{e.delete(t)}),e.size&&(e.forEach(e=>{URL.revokeObjectURL(e),UX.delete(e)}),Dp.current.forEach(t=>{t.blobURL!==void 0&&e.has(t.blobURL)&&delete t.blobURL}))},uZ=e=>{if(!e?.startsWith(`blob:`))return;let t=!oZ.size;oZ.add(e),t&&window.requestAnimationFrame(KLe)},dZ=({blobURL:e,unsaved:t})=>{t||uZ(e)},qLe=({path:e,internalPath:t,publicPath:n})=>{let r=new Map,i=Jl(t,e=>`${e.split(Kd).map((e,t)=>{if(t%2==0)return Fc(e);let n=e.trim(),i=r.get(n);if(i)return`\\k<${i}>`;let a=`tag${r.size}`;return r.set(n,a),`(?<${a}>[^/]+?)`}).join(``)}(?=\\/|$)`);return e.replace(i,(...e)=>{let t=e.at(-1);return n.replaceAll(qd,(e,n)=>{let i=r.get(n.trim());return i?t[i]:e})})},JLe=e=>e.folder.collectionName===void 0?e.folder:Dy(e.path).find(({collectionName:e})=>e!==void 0)??Cy.current??e.folder,YLe=(e,t,n,r)=>{let i=eu(e.path),a=t?RJ({entry:t,locale:n,collectionName:r}):void 0;if(a!==void 0){if(i===a)return e.name;let t=a?`${a}/`:``;return e.path.startsWith(t)?e.path.slice(t.length):void 0}let{internalPath:o,internalSubPath:s}=e.folder;if(e.path===$l([o,s,e.name]))return o?e.path.slice(o.length+1):e.path},fZ=(e,{pathOnly:t=!1,allowSpecial:n=!1,entry:r=void 0,locale:i=void 0}={})=>{let{publicPath:a,entryRelative:o,hasTemplateTags:s,collectionName:c}=JLe(e);if(o)return t?YLe(e,r,i,c):void 0;let{_baseURL:l=``,output:{encode_file_path:u=!1}={}}=Dl.current,d=e.folder.internalPath??``,f=a===`/`?``:a??``,p=s?qLe({path:e.path,internalPath:d,publicPath:f}):d?e.path.replace(d,f):`${f}/${e.path}`;if(a===``&&(p=p.replace(/^\//,``)),u&&(p=Yl(p)),p.startsWith(`/`)||n)return t?p:`${l}${p}`},XLe=({folder:e,subfolderPath:t})=>{let{output:{encode_file_path:n=!1}={}}=Dl.current,r=(e.publicPath??``).replace(/\/$/,``),i=(t?`${r}/${t}`:r)||`/`;return n?Yl(i):i},pZ=(e,{keep:t=[]}={})=>{let n=[...e,...t],r=cZ.filter(e=>!n.includes(e)),i=e.filter(e=>!lZ.includes(e));cZ=n,lZ=e,t.forEach(e=>{e.blobURL&&sZ.add(e.blobURL)}),r.forEach(e=>{e.blobURL&&sZ.delete(e.blobURL),dZ(e)}),i.forEach(async e=>{try{let t=await $X(e);if(!t)return;if(!cZ.includes(e)){dZ(e);return}if(sZ.add(t),e.kind===`image`){let e=new Image;e.src=t,await e.decode()}}catch{}})},ZLe=(e,t)=>Jd.includes(e)?t[e]:void 0,QLe=e=>Object.hasOwn(Xd,e)?jc(Xd[e].length):void 0,$Le=(e,t)=>{if(e!==`slug`)return;let{type:n,isIndexFile:r,currentSlug:i,content:a,identifierField:o,collection:s}=t;if(n===`preview_path`&&r)return``;let c=i??vW(a,{identifierField:o});return n===`preview_path`&&s?c===vf(s)?``:yf(s,c):c},eRe=(e,t,n,r=[],i=void 0)=>{if(!t)return``;switch(e){case`dirname`:return $p(t,{basePath:n,fullPathRegEx:i});case`filename`:case`extension`:return Oie(t,r)[e];default:return}},mZ=({randomValues:e},t,n)=>e?Nl(e,t,n):n(),hZ=(e,t)=>{let{type:n,collection:r,collectionFile:i,content:a,entryFilePath:o,locale:s,dateTimeParts:c,basePath:l,fullPathRegEx:u,assetFileName:d}=t,f=ZLe(e,c);if(f!==void 0)return f;let p=$Le(e,t);if(p!==void 0)return p;if(Object.hasOwn(Xd,e))return mZ(t,`${s}:${e}`,()=>QLe(e));if(d!==void 0&&(e===`filename`||e===`extension`))return Uc(d)[e]??``;if(n===`preview_path`&&e===`locale`)return s;if(n===`preview_path`||n===`media_folder`){let t=eRe(e,o,l,kie(i??r),u);if(t!==void 0)return t;if(n===`media_folder`)return}let m=nf(e);return Object.hasOwn(a,m)?a[m]:void 0},gZ=(e,t)=>{let{replaceSubContext:n,getFieldArgs:r}=t,{value:i,transformations:a}=gU(e),o=hZ(i,n),s=SH(a,e=>String(hZ(e,n)??``)),c=a.some(e=>e.args.defaultValue!==void 0),l=a.some(e=>Gd.has(e.method)),u=o==null,{type:d,locale:f}=n,p=()=>{if(d===`preview_path`||d===`library_prefix`)throw Error(`Unresolvable template tag: ${i}`)},m=()=>(p(),mZ(n,`${f}:fallback:${e}`,()=>jc(`short`)));return u&&!c&&!l||(s.length&&(o=_U({fieldConfig:lh({...r,keyPath:nf(i)}),value:o,transformations:s,locale:f})),u&&!c&&o===``)?m():d===`library_prefix`?FH(ru(String(o)),{locale:f,maxLength:1/0,fallback:!1})||m():(o=ru(String(o)),d?o:FH(o,{locale:f,maxLength:1/0,fallback:!1})||mZ(n,`${f}:fallback:${e}`,()=>jc(`short`)))},_Z=e=>ax({cmsConfig:Dl.current,collection:e}),vZ=e=>Yf.current?ex:_Z(e).stages,yZ=(e,t)=>{if(e===`pending_deletion`)return e;let n=$b.indexOf(e);return t.findLast(e=>$b.indexOf(e)<=n)??`draft`},bZ=(e,t)=>yZ(e.workflow.status,vZ(t)),xZ=e=>vZ(Kf(e.workflow.collectionName)),SZ=e=>bZ(e,Kf(e.workflow.collectionName)),CZ=(e,t)=>xZ(e).includes(t),tRe=(e,t)=>{let n=vZ(t),r=yZ(e.workflow.status,n);return r===`pending_deletion`?void 0:n[n.indexOf(r)+1]},nRe=(e,t)=>{let n=vZ(t);return yZ(e.workflow.status,n)===n.at(-1)},wZ=rl(()=>{if(Yf.current)return ex;let e=Dl.current,t=new Set([`draft`]);return cx(e).forEach(n=>{let r=ax({cmsConfig:e,collection:n});sx(r.type)&&r.stages.forEach(e=>t.add(e))}),$b.filter(e=>t.has(e))}),TZ=rl(()=>wZ.current.length===1?`drafts`:`editorial_workflow`),EZ=rl(()=>lx(Dl.current)&&!!LX.current?.workflow),DZ=e=>!!LX.current?.workflow&&(Yf.current||sx(ox({cmsConfig:Dl.current,collection:e}))),OZ=tl([]),kZ=tl(!1),AZ=tl(!1),jZ=tl([]),MZ=rl(()=>!EZ.current||AZ.current),NZ=e=>e?OZ.current.filter(({workflow:t})=>t.collectionName===e):[],PZ=(e,t,n)=>t.flatMap(({workflow:t})=>(t.companions??[]).flatMap(t=>t.collectionName===e&&!!t.edited===n?[t.entry]:[])),FZ=(e,t=OZ.current)=>PZ(e,t,!1),rRe=(e,t=OZ.current)=>PZ(e,t,!0),IZ=e=>{let t=e.flatMap(({entry:e,edited:t})=>t?[e]:[]);return{paths:Ac(t.flatMap(e=>Qp(e))),publishedPaths:new Set(t.flatMap(({id:e})=>{let t=Vp.current.find(t=>t.id===e);return t?Qp(t):[]}))}},LZ=e=>OZ.current.find(({workflow:t})=>(t.companions??[]).some(t=>t.edited&&t.entry.id===e.id)),RZ=e=>[...NZ(e),...FZ(e)],zZ=({collectionName:e,subPath:t})=>OZ.current.find(n=>n.workflow.collectionName===e&&(n.workflow.fileName===void 0?n.subPath===t:n.workflow.fileName===t)),BZ=({collectionName:e,slug:t,entry:n})=>{if(!n)return;let r=new Set(Qp(n));return OZ.current.find(n=>Uue({branch:n.workflow.pullRequest.branch,collectionName:e,slug:t})&&Qp(n,{includePrevious:!0}).some(e=>r.has(e)))},VZ=e=>e?OZ.current.find(t=>t.id===e):void 0,HZ=e=>OZ.current.find(({workflow:t})=>t.pullRequest.branch===e),UZ=({collectionName:e,fileName:t,originalEntry:n})=>{if(!n)return;let r=n.workflow?.pullRequest?.branch;return(r?HZ(r):void 0)??BZ({collectionName:e,slug:t??n.slug,entry:n})},WZ=({collection:e,collectionName:t,fileName:n,originalEntry:r})=>DZ(e)||!!UZ({collectionName:t,fileName:n,originalEntry:r}),GZ=e=>e?.workflow?.status===`pending_deletion`,KZ=e=>{let t=$y(e.workflow.pullRequest);return t?[e,...OZ.current.filter(n=>n.id!==e.id&&GZ(n)&&$y(n.workflow.pullRequest)===t)]:[e]},qZ=e=>e.canMerge!==!1&&!dl.current,JZ=e=>!Yf.current&&e?.publish!==!1,YZ=e=>e.every(({collectionName:e})=>{let t=Kf(e);return!DZ(t)||_Z(t).directPublish}),XZ=(e,t)=>JZ(t)&&qZ(e.workflow.pullRequest)&&(GZ(e)||nRe(e,t)||_Z(t).directPublish&&YZ(e.workflow.companions??[])),iRe=(e,t)=>!!e&&JZ(e)&&_Z(e).directPublish&&(t?qZ(t.workflow.pullRequest):!ul.current),ZZ=(e,t)=>{if(!t.length)return e;let n=new Map;return t.forEach(e=>{Qp(e,{includePrevious:!0}).forEach(t=>n.set(t,e))}),e.map(e=>Object.values(e.locales).map(({path:e})=>n.get(e)).find(Boolean)??e)},QZ=(e,t)=>{let n=ZZ(e,t),r=new Set(n),i=t.filter(e=>!r.has(e));return i.length?[...n,...i]:n},$Z=e=>{let{workflow:t}=e;return t?Hp(new Set(Qp(e,{includePrevious:!0}))):void 0},aRe=e=>e.workflow.fileName?!0:!!$Z(e),eQ=e=>e?(Vp.current,aRe(e)):!1,tQ=e=>!!e&&`workflow`in e&&!eQ(e),oRe=(e,t,n)=>{let r=[...iW(e),...RZ(e)].map(e=>t?e.locales[t]?.slug:e.slug).filter(Boolean);return n===void 0?r:r.flatMap(e=>Bie(e,n)??[])},nQ=(e,t)=>{let{collection:n,collectionFile:r,content:i,currentSlug:a,locale:o,dateTimeParts:s,isIndexFile:c=!1,dirPath:l}=t,{_type:u,name:d}=n,f=dW(u===`entry`?n:void 0),{slug_length:p=void 0,_file:{basePath:m,fullPathRegEx:h}={}}=u===`entry`?n:{},g=Dl.current?.slug,_=p??g?.maxlength,v={replaceSubContext:{...t,dateTimeParts:s??CU({timeZone:PH()}),identifierField:f,basePath:m,fullPathRegEx:h},getFieldArgs:{collectionName:d,fileName:r?.name,keyPath:``,valueMap:i,isIndexFile:c}},y=Qd(e,(e,t)=>gZ(t,v)).trim();if(a)return y;let b=1/0;if(typeof _==`number`){let e=Ic(y,_,{ellipsis:``});y=e===y?y:NH(e)}else b=Vue({collectionName:d,dirPath:l}),Xb(y)>b&&(y=NH(Zb(y,b)));y.endsWith(`.`)&&(y=NH(y));let x=oRe(d,o,l),S=e=>Xl(e,x,{hasExtension:!1}),C=S(y);for(;b!==1/0&&Xb(C)>b;){let e=Xb(C)-Xb(y);y=NH(Zb(y,b-e)),C=S(y)}return C},rQ=({config:e=El.current,collection:t,collectionFile:n}={})=>!!(e?.readonly||t?.readonly||n?.readonly),sRe=e=>!!ul.current&&!!e&&!sx(ox({cmsConfig:El.current,collection:e})),iQ=({collection:e,collectionFile:t}={})=>rQ({collection:e,collectionFile:t})||sRe(e),aQ=e=>!!e&&iQ({collection:e.collection,collectionFile:e.collectionFile}),oQ=e=>!!e?.restorePending||aQ(e),sQ=(e,{collection:t,collectionFile:n,folder:r}={})=>El.current?.readonly?Y(`readonly_cms`):!(e===`asset_folder`?r?.readonly:rQ({collection:t,collectionFile:n}))&&ul.current?Y(`readonly_branch`,{values:{branch:ul.current}}):Y(`readonly_${e}`),cQ=e=>e.includes(`{{media_folder}}`)||e.includes(`{{public_folder}}`),lQ=e=>e.replace(/^\/@/,`@`),cRe=(e,{globalMediaFolder:t,globalPublicFolder:n})=>e.trim().replace(`{{media_folder}}`,`/${t}`).replace(`{{public_folder}}`,`/${n}`).replace(`//`,`/`),uQ=(e,t,{isPublicFolder:n=!1}={})=>{if(!cQ(e))return e;if(!t)return;let r=cRe(e,t);return n?lQ(r):r},dQ=e=>{if(`folder`in e&&typeof e.folder==`string`)return e.folder;if(`file`in e&&typeof e.file==`string`)return Uc(e.file).dirname},lRe=({collectionName:e,fileName:t,componentName:n,typedKeyPath:r,isIndexFile:i=!1,mediaFolder:a,publicFolder:o,baseFolder:s,globalFolders:c,label:l,icon:u,isAssetCollection:d=!1})=>{let f=uQ(a,c),p=o===void 0?f:uQ(o,c,{isPublicFolder:!0});if(f===void 0||p===void 0)return;a=f,o=p,a=a.replace(/^\.(?:\/|$)/,``);let m=!a.startsWith(`/`);return{collectionName:e,fileName:t,componentName:n,typedKeyPath:r,isIndexFile:i,internalPath:m?Lc(s??``).replace(/^\.(?:\/|$)/,``):Lc(a),internalSubPath:m?Lc(a):void 0,publicPath:/^($|[.@])/.test(o)?o.replace(/(?<=.)\/+$/,``):`/${Lc(o)}`,entryRelative:m,hasTemplateTags:tf(a),label:l,icon:u,isAssetCollection:d}},fQ=(e,t)=>{if(t.mediaFolder===void 0)return;let n=lRe(t);if(!n)return;let{globalMediaFolder:r,globalPublicFolder:i}=t.globalFolders??{};(n.entryRelative||n.internalPath!==r||n.publicPath!==i)&&e.push(n)},pQ=(e,{collectionName:t,files:n,globalFolders:r,mediaFolder:i,publicFolder:a})=>{Nd(n).forEach(n=>{let{name:o,file:s,media_folder:c,public_folder:l}=n,u=c===void 0;fQ(e,{collectionName:t,fileName:o,mediaFolder:u?i:c,publicFolder:u?a:l,baseFolder:Uc(s).dirname,globalFolders:r})})},uRe=(e,{fieldMediaFolders:t,validCollections:n,globalFolders:r})=>{t.forEach(({fieldConfig:t,context:i})=>{let{collection:a,collectionFile:o,componentName:s,typedKeyPath:c,isIndexFile:l}=i;(a&&(a.name===`_singletons`||n.some(e=>e.name===a.name))||s)&&fQ(e,{collectionName:a?.name,fileName:o?.name,componentName:s,typedKeyPath:c,isIndexFile:l,mediaFolder:t.media_folder,publicFolder:t.public_folder,baseFolder:o?Uc(o.file).dirname:a?dQ(a):void 0,globalFolders:r})})},dRe=(e,{assetCollections:t,globalFolders:n})=>{t.forEach(t=>{let{name:r,label:i=r,icon:a,media_folder:o,public_folder:s}=t;o!==void 0&&fQ(e,{collectionName:`assets:${r}`,mediaFolder:`/${Lc(o)}`,publicFolder:s,globalFolders:n,label:i,icon:a,isAssetCollection:!0})})},fRe=({config:e,folder:t,validCollections:n})=>{let{collectionName:r,fileName:i,isAssetCollection:a}=t;if(a){let t=e.asset_collections?.find(({name:e})=>`assets:${e}`===r);return rQ({config:e,collection:t})}let o=n.find(({name:e})=>e===r),s=r===`_singletons`?e.singletons:o&&`files`in o?o.files:void 0;return rQ({config:e,collection:o,collectionFile:i&&s?Nd(s).find(({name:e})=>e===i):void 0})},mQ=e=>{let{media_folder:t,public_folder:n}=e;if(t===void 0)return;let r=Lc(t).replace(/^\.$/,``);return{globalMediaFolder:r,globalPublicFolder:n?lQ(`/${Lc(n)}`):`/${r}`}},pRe=(e,{validCollections:t,singletons:n,globalFolders:r})=>{let i=r!==void 0;t.forEach(t=>{let{name:n,files:a,path:o,media_folder:s,public_folder:c}=t,l=i&&s===void 0&&o!==void 0?``:s,u=`files`in t&&typeof l==`string`&&!cQ(l)&&!l.startsWith(`/`);u||fQ(e,{collectionName:n,mediaFolder:l,publicFolder:c,baseFolder:dQ(t),entryPath:o,globalFolders:r}),a?.length&&pQ(e,{collectionName:n,files:a,globalFolders:r,...u?{mediaFolder:l,publicFolder:c}:{}})}),n?.length&&pQ(e,{collectionName:`_singletons`,files:n,globalFolders:r})},mRe=(e,t)=>new Map(t.map(t=>{let n=Lf({cmsConfig:e,collection:t}),r=`folder`in t&&typeof t.folder==`string`&&Cf(t.folder)||!!n?.structure&&nae.includes(n.structure);return[t.name,r?n?.locales??[]:[]]})),hRe=(e,t=[])=>{let n=[],{collections:r,singletons:i,asset_collections:a}=e,o=mQ(e),s={collectionName:void 0,internalPath:void 0,internalSubPath:void 0,publicPath:void 0,entryRelative:!1,hasTemplateTags:!1,label:void 0,icon:void 0,isAssetCollection:!1},c=o?{...s,internalPath:o.globalMediaFolder,publicPath:o.globalPublicFolder}:void 0,l=Gf({collections:r});pRe(n,{validCollections:l,singletons:i,globalFolders:o}),uRe(n,{fieldMediaFolders:t,validCollections:l,globalFolders:o}),n.sort((e,t)=>Bc(e.internalPath,t.internalPath));let u=[];c&&u.push(c),a?.length&&dRe(n,{assetCollections:a,globalFolders:o}),u.push(...n),u.length&&u.unshift(s);let d=mRe(e,l);return u.map(t=>{let n=t.entryRelative?d.get(t.collectionName):void 0;return{...t,...n?.length?{localeFolderNames:n}:{},...fRe({config:e,folder:t,validCollections:l})?{readonly:!0}:{}}})},hQ=e=>YU(e).values().flatMap(t=>{let n=cf(t,e),r=qp(t,e);return r.length?r.map(e=>({collection:t,collectionFile:e,isIndexFile:n})):[{collection:t,isIndexFile:n}]}),gQ=Bl(()=>Dp.current,e=>new Map(e.map(e=>[e.path,e]))),_Q=e=>gQ().get(e),vQ=({unsaved:e,blobURL:t,path:n})=>e&&t?t:n,yQ=(e,{collection:t,entry:n,localeFile:r})=>nQ(e,{type:`media_folder`,collection:t,content:r.content,currentSlug:n.slug,entryFilePath:r.path,isIndexFile:cf(t,n)}),bQ=({internalPath:e,collectionName:t,entry:n,locale:r})=>{if(!tf(e))return e;let i=t?Kf(t):n?YU(n)[0]:void 0;return!n||!i?void 0:yQ(e,{collection:i,entry:n,localeFile:Zp(n,{locale:r,defaultLocale:i._i18n.defaultLocale})})},xQ=(e,t)=>e===void 0||!cQ(e)?e:uQ(e,El.current?mQ(El.current):void 0,t)??e,gRe=({path:e,entry:t,collection:n,file:r,componentName:i,typedKeyPath:a,locale:o})=>{let{_i18n:{defaultLocale:s}}=r??n,c=a?Ey({collectionName:n.name,fileName:r?.name,componentName:i,typedKeyPath:a}):void 0,l=r?.media_folder===void 0?n:r,u=c?c.entryRelative?c.internalSubPath??``:`/${c.internalPath}`:xQ(l.media_folder),d=c?.publicPath===void 0?xQ(l.public_folder,{isPublicFolder:!0}):c.publicPath,f=Zp(t,{locale:o,defaultLocale:s}),{path:p,content:m}=f;if(!p||!m)return;u&&tf(u)&&(u=yQ(u,{collection:n,entry:t,localeFile:f})),d&&tf(d)&&(d=yQ(d,{collection:n,entry:t,localeFile:f}));let h=eu(p),g=LJ({collection:n,entryFilePath:p,internalPath:h}),_=e.replace(/^\.\//,``),v=u?.replace(/^\.\//,``).replace(/\/$/,``),y=nu(_,v),b;if(u?.startsWith(`/`)&&d!==void 0){let e=d.replace(/^\.\//,``);_.startsWith(`${e}/`)&&(y=_.slice(e.length+1)),b=iu($l([u.slice(1),y]))}else if(b=iu($l([g,u,y])),g!==h&&!gQ().has(b)){let e=iu($l([h,u,y]));gQ().has(e)&&(b=e)}return gQ().get(b)},SQ=({collectionName:e,fileName:t,componentName:n,typedKeyPath:r,requireCollectionName:i=!1,skipTemplateFolders:a=!1})=>{let o=!i||!!e;return[n?Ey({componentName:n,typedKeyPath:r}):void 0,o&&r?Ey({collectionName:e,fileName:t,typedKeyPath:r}):void 0,o?Ey({collectionName:e,fileName:t}):void 0,o?Ey({collectionName:e}):void 0,Cy.current].filter(e=>!!e&&!(a&&e.hasTemplateTags))},_Re=({path:e,entry:t,collectionName:n,fileName:r,componentName:i,typedKeyPath:a,locale:o})=>{if(!t)return SQ({collectionName:n,fileName:r,componentName:i,typedKeyPath:a,requireCollectionName:!0,skipTemplateFolders:!0}).values().map(t=>{let n=nu(e,t.publicPath?.replace(/^\//,``));return gQ().get($l([t.internalPath,t.internalSubPath??``,n]))}).find(Boolean)??gQ().get(e);let s=n=>hQ(t).map(({collection:r,collectionFile:o})=>gRe({path:e,entry:t,collection:r,file:o,componentName:i,typedKeyPath:a,locale:n})).find(Boolean);return s(o)??(o?s(void 0):void 0)??gQ().get(e)},vRe=new WeakMap,CQ=e=>Nl(vRe,e,()=>{let t=e.publicPath??``,n=rf(t,`.+?`);return RegExp(`^${n}${t?`(?=\\/|$)`:`$`}`)}),wQ=e=>!/^[/@]/.test(e),yRe=({path:e,entry:t,collectionName:n,fileName:r,componentName:i,typedKeyPath:a,locale:o})=>{let s=gQ().get(Lc(e));if(s)return s;let{dirname:c=``,basename:l}=Uc(e),u=e=>{let{publicPath:n,collectionName:r}=e,{internalPath:i}=e;if(!(i!==void 0&&(i=bQ({internalPath:i,collectionName:r,entry:t,locale:o}),i===void 0))){if(n&&c){if(n===`/`||c.startsWith(`${n}/`))i&&=n===`/`?`${i}${c}`:c.replace(n,i);else if(!wQ(n)&&!CQ(e).test(c))return}return gQ().get($l([i,l]))}},d=SQ({collectionName:n,fileName:r,componentName:i,typedKeyPath:a}),f;if(d.some(e=>(f=u(e),!!f)),f)return f;let p=Sy.current.findLast(e=>CQ(e).test(c));return p?u(p):void 0},TQ=({value:e,...t})=>{let n=e=>{let n=Ul(e);return wQ(n)?_Re({path:n,...t}):yRe({path:n,...t})},[r]=e.split(`#`);return n(e)??(r===e?void 0:n(r))},EQ=({folder:e},t)=>e===t?!0:t.entryRelative?e.collectionName===t.collectionName&&e.fileName===t.fileName&&e.typedKeyPath===t.typedKeyPath&&e.isIndexFile===t.isIndexFile&&e.internalPath===t.internalPath&&e.internalSubPath===t.internalSubPath&&e.publicPath===t.publicPath&&e.entryRelative===t.entryRelative&&e.hasTemplateTags===t.hasTemplateTags:!e.entryRelative&&e.internalPath===t.internalPath,DQ=({entryRelative:e,collectionName:t,fileName:n,typedKeyPath:r,isIndexFile:i,internalPath:a,internalSubPath:o,publicPath:s,hasTemplateTags:c})=>JSON.stringify(e?[t,n,r,i,a,o,s,c]:[a]),bRe=Bl(()=>Dp.current,e=>{let t=new Map;return e.forEach(({folder:e})=>{let n=DQ(e);t.set(n,(t.get(n)??0)+1)}),t}),xRe=e=>bRe().get(DQ(e))??0,OQ=e=>Dp.current.filter(t=>eu(t.path)===e),kQ=e=>[...OQ(e).map(e=>e.name),...bJ(e),...yJ(e)].map(e=>e.normalize());ol(()=>{wy.current,sJ.current,Ap.current=void 0,cJ.current=void 0});var AQ=(e,t)=>{if(!t.length||!e.length)return[];let n=new Set(t.map(({name:e})=>e.normalize().toLowerCase()));return e.filter(e=>n.has(e.name.normalize().toLowerCase()))},jQ=(e,{field:t,pattern:n}={field:``,pattern:``})=>{if(!t)return e;if(t===`fileType`)return e.filter(({path:e})=>Ep(e)===n);let r=XU(n);return e.filter(e=>{let i=e[t];return XW(i,n,r)})},SRe=(e,t)=>YW(e,t,(e,t)=>e[t]),MQ=({prefix:e=``})=>e&&!e.endsWith(`/`)?`${e}/`:e,NQ=(e,t)=>`${MQ(e)}${t}/`,PQ=(e,t)=>`${MQ(e)}${t}`,FQ=(e,t)=>{let n=MQ(e);return n&&t.startsWith(n)?t.slice(n.length):t},IQ=(e,{slugificationEnabled:t=!1,assetNamesInSameFolder:n=[]}={})=>{let r=Zl(e).replace(/^\.+/,``);if(t){let{filename:e,extension:t}=Uc(r);r=`${FH(e)}${t?`.${t.toLowerCase()}`:``}`}return Xl(r,n)},LQ=(e,t)=>IQ(e).normalize().toLowerCase()===IQ(t).normalize().toLowerCase(),CRe=({name:e,fileName:t,otherNames:n,folderNames:r=[],fileNames:i=[]})=>{if(!e)return`empty`;if(e.includes(`/`)||!t)return`character`;if(e.startsWith(`.`))return`leading_dot`;let a=t.normalize().toLowerCase(),o=e=>e.some(e=>e.normalize().toLowerCase()===a);if(o(n))return`duplicate`;if(o(i))return`file_duplicate`;if(o(r))return`folder_duplicate`},wRe=(e,t)=>{let n=t.toLowerCase();return e.filter(({fileName:e,description:t})=>e.toLowerCase().includes(n)||t.toLowerCase().includes(n))},RQ=async(e,{maxPages:t=10}={})=>{let n=[],r;for(let i=1;i<=t;i+=1){let{results:a,next:o}=await e(r);if(n.push(...a),!o||i===t)break;r=o,await Iu(50)}return n},zQ=(e,t,n)=>{if(t.endpoint&&!Ru(t.endpoint))throw Error(`Refusing to send credentials over an insecure connection`);return e.requireCredential(n)},BQ=(e,t)=>t?NQ(e,t):MQ(e),VQ=async(e,t,n,{maxPages:r=10,dirPath:i,delimiter:a}={})=>{let o=zQ(e,t,n),s=BQ(t,i),c=[],l=[],u=!1;return(await RQ(async n=>{let r=await e.listPage({config:t,credential:o,prefix:s,cursor:n,...a&&{delimiter:a}});return u=!!r.cursor,{results:r.items,next:r.cursor}},{maxPages:r})).forEach(n=>{let r=e.getKey(n);if(r.endsWith(`/`)){let e=FQ(t,r).replace(/\/$/,``);e&&l.push(e)}else c.push(n)}),{files:c,folders:l,truncated:u}},HQ=(e,t,{kind:n})=>n?t.filter(t=>Ep(e.getKey(t))===n):t,UQ=async(e,t,n,r={})=>{let{files:i}=await VQ(e,t,n,r);return e.parseResults(HQ(e,i,n),t,n.apiKey)},TRe=async(e,t,n)=>{let{files:r,folders:i,truncated:a}=await VQ(e,t,n);return{assets:e.parseResults(HQ(e,r,n),t,n.apiKey),folders:i,truncated:a}},ERe=async(e,t,n,r)=>{let{files:i,folders:a}=await VQ(e,n,r,{maxPages:1/0,dirPath:t});return{assets:e.parseResults(i,n,r.apiKey),folders:a}},DRe=async(e,t,n,r)=>wRe(await UQ(e,n,r,{maxPages:5}),t),WQ=async(e,t,n,r)=>{let i=BQ(t,r),{files:a}=await VQ(e,t,n,{maxPages:1/0,dirPath:r,delimiter:`/`});return a.map(t=>e.getKey(t).slice(i.length).normalize()).filter(e=>!e.includes(`/`))},ORe=async(e,t,n,r)=>{if(t.length===0)return[];let i=zQ(e,n,r),{dirPath:a=``}=r,o=await WQ(e,n,r,a),s=t.map(e=>{let t=IQ(e.name.split(/[/\\]/).filter(Boolean).at(-1)??``,{assetNamesInSameFolder:o});if(!t)throw Error(`Invalid file name: ${e.name}`);return o.push(t),PQ(n,a?`${a}/${t}`:t)}),c=[];for(let[r,a]of t.entries())c.push(await e.putObject({key:s[r],file:a,config:n,credential:i})),t.length>1&&await Iu(50);return e.parseResults(c,n,i)},kRe=async(e,t,n,r)=>{let i=zQ(e,n,r);for(let{id:r}of t)await e.deleteObject({key:r,config:n,credential:i}),t.length>1&&await Iu(50)},ARe=async(e,t,n,r,i)=>{let a=zQ(e,r,i),o=await e.putObject({key:t.id,file:n,config:r,credential:a});return e.parseResults([o],r,a)[0]},GQ=async(e,t,n,r,i)=>{let a=zQ(e,r,i),o=PQ(r,n),s=await e.copyObject({asset:t,key:o,config:r,credential:a});return await e.deleteObject({key:t.id,config:r,credential:a}),e.parseResults([s],r,a)[0]},jRe=async(e,t,n,r)=>{let i=zQ(e,n,r);await e.putFolderObject({key:NQ(n,t),config:n,credential:i})},MRe=async(e,t,n,r)=>{let i=zQ(e,n,r);await e.deleteObject({key:NQ(n,t),config:n,credential:i,allowNotFound:!0})},NRe=(e,t,n)=>{let r=eu(FQ(e,t.id));return r?`${r}/${n}`:n},PRe=async(e,t,n,r,i)=>{let a=NRe(r,t,n),o=eu(a),s=tu(FQ(r,t.id)).normalize(),c=await WQ(e,r,i,o),l=n.normalize();if(c.some(e=>e!==s&&e===l))throw Error(`A file named “${n}” already exists in the folder.`);return GQ(e,t,a,r,i)},KQ=e=>Object.fromEntries(Object.entries({list:UQ,browse:TRe,listFolder:ERe,search:DRe,upload:ORe,delete:kRe,rename:PRe,replace:ARe,move:GQ,createFolder:jRe,deleteFolder:MRe}).map(([t,n])=>[t,n.bind(null,e)])),qQ=(e,t)=>async(...n)=>{let r=n.pop();return e.operations[t](...n,e.getConfig(r),r)},JQ=class{serviceType=`cloud_storage`;showServiceLink=!0;hotlinking=!0;authType=`api_key`;constructor({serviceId:e,serviceLabel:t,serviceURL:n,developerURL:r,apiKeyURL:i,apiKeyPattern:a,resolveConfig:o=e=>e,isConfigured:s,isConfigURL:c,operations:l}){this.serviceId=e,this.defaultServiceLabel=t,this.serviceURL=n,this.developerURL=r,this.apiKeyURL=i,this.apiKeyPattern=a,this.resolveConfig=o,this.isConfigured=s,this.isConfigURL=c,this.operations=l}get serviceLabel(){return this.getLibraryOptions()?.label||this.defaultServiceLabel}getLibraryOptions(e=El.current){return mq(this.serviceId,e)}getConfig({fieldConfig:e}){let t=gq(this.serviceId,e);if(!t)throw Error(`${this.serviceLabel} configuration is not available`);return this.resolveConfig(t)}isEnabled=e=>{let t=gq(this.serviceId,e);return!!t&&this.isConfigured(this.resolveConfig(t))};isAssetURL=e=>{try{return this.isConfigURL(this.getConfig({}),e)}catch{return!1}};list=qQ(this,`list`);browse=qQ(this,`browse`);listFolder=qQ(this,`listFolder`);search=qQ(this,`search`);upload=qQ(this,`upload`);delete=qQ(this,`delete`);rename=qQ(this,`rename`);replace=qQ(this,`replace`);move=qQ(this,`move`);createFolder=qQ(this,`createFolder`);deleteFolder=qQ(this,`deleteFolder`)},YQ=e=>{let t=new DOMParser().parseFromString(e,`text/xml`),n=e=>{if(e.children.length===0)return e.textContent;let t={};return Array.from(e.children).forEach(e=>{let r=e.tagName,i=n(e);Object.hasOwn(t,r)?Array.isArray(t[r])?t[r].push(i):t[r]=[t[r],i]:t[r]=i}),t};return n(t.documentElement)},XQ=e=>e?Array.isArray(e)?e:[e]:[],FRe=`blob.core.windows.net`,IRe=1e3,ZQ=({account_name:e,container:t,endpoint:n})=>`${n?ql(n):`https://${e}.${FRe}`}/${t}`,QQ=({url:e,token:t,searchParams:n})=>`${e}?${[n?.toString(),t.trim().replace(/^[?&]/,``)].filter(Boolean).join(`&`)}`,$Q=(e,t,n)=>QQ({url:`${ZQ(e)}/${Kl(t)}`,token:n}),e$=new JQ({serviceId:`azure_blob_storage`,serviceLabel:`Azure Blob Storage`,serviceURL:`https://azure.microsoft.com/products/storage/blobs/`,developerURL:`https://learn.microsoft.com/en-us/rest/api/storageservices/blob-service-rest-api`,apiKeyURL:`https://portal.azure.com/#browse/Microsoft.Storage%2FStorageAccounts`,apiKeyPattern:/^\??(?:[\w-]+=[^&]*&)*sig=[^&]+(?:&[\w-]+=[^&]*)*$/,isConfigured:({container:e,account_name:t,endpoint:n})=>!!(e&&(t||n)),isConfigURL:(e,t)=>{let{public_url:n}=e;return[`${ZQ(e)}/`,...n?[`${ql(n)}/`]:[]].some(e=>t.startsWith(e))},operations:KQ({requireCredential:({apiKey:e})=>{if(!e)throw Error(`Azure Blob Storage SAS token is required`);return e},listPage:async({config:e,credential:t,prefix:n,cursor:r,delimiter:i})=>{let a=new URLSearchParams({restype:`container`,comp:`list`,maxresults:String(IRe),...n&&{prefix:n},...i&&{delimiter:i},...r&&{marker:r}}),o=ZQ(e),s=await fetch(QQ({url:o,token:t,searchParams:a}));await Hu(s,`Failed to list blobs`);let c=YQ(await s.text());return{items:XQ(c.Blobs?.Blob),cursor:c.NextMarker||void 0}},getKey:({Name:e})=>e,parseResults:(e,t,n)=>{let{public_url:r}=t,i=ZQ(t);return e.map(({Name:e,Properties:a={}})=>{let o=tu(e)||e,s=FQ(t,e),c=Kl(e),l=`${i}/${c}`,u=r?`${ql(r)}/${c}`:l,d=a[`Last-Modified`],f=a[`Content-Length`];return{id:e,description:s,previewURL:r?u:QQ({url:l,token:n}),downloadURL:u,fileName:o,...d&&{lastModified:new Date(d)},...f&&{size:Number(f)},kind:Ep(e)}})},putObject:async({key:e,file:t,config:n,credential:r})=>(await Hu(await fetch($Q(n,e,r),{method:`PUT`,headers:{"x-ms-blob-type":`BlockBlob`,"Content-Type":t.type||`application/octet-stream`},body:t}),`Failed to upload file ${t.name}`),{Name:e,Properties:{"Last-Modified":new Date().toUTCString(),"Content-Length":String(t.size),"Content-Type":t.type}}),copyObject:async({asset:e,key:t,config:n,credential:r})=>{let{id:i,size:a}=e,o=await fetch($Q(n,t,r),{method:`PUT`,headers:{"x-ms-blob-type":`BlockBlob`,"x-ms-copy-source":$Q(n,i,r)}});if(await Hu(o,`Failed to copy blob ${i}`),o.headers.get(`x-ms-copy-status`)===`pending`)throw Error(`Failed to copy blob ${i}: the copy operation is still pending`);return{Name:t,Properties:{"Last-Modified":new Date().toUTCString(),...a&&{"Content-Length":String(a)}}}},deleteObject:async({key:e,config:t,credential:n,allowNotFound:r=!1})=>{await Hu(await fetch($Q(t,e,n),{method:`DELETE`}),`Failed to delete blob ${e}`,{allowNotFound:r})},putFolderObject:async({key:e,config:t,credential:n})=>{await Hu(await fetch($Q(t,e,n),{method:`PUT`,headers:{"x-ms-blob-type":`BlockBlob`,"Content-Type":`application/x-directory`}}),`Failed to create folder ${e}`)}})}),{isEnabled:LRe,isAssetURL:RRe,list:zRe,browse:BRe,search:VRe,upload:HRe,delete:URe,rename:WRe,replace:GRe,move:KRe,createFolder:qRe,deleteFolder:JRe}=e$,YRe=async({method:e,url:t,headers:n,payloadHash:r,accessKeyId:i,secretAccessKey:a,region:o,service:s,date:c})=>{let l=new URL(t),u=c.toISOString().replace(/[:-]|\.\d{3}/g,``),d=u.slice(0,8),f=l.pathname,p=[...l.searchParams.entries()].sort(([e],[t])=>e<t?-1:+(e>t)).map(([e,t])=>`${Gl(e)}=${Gl(t)}`).join(`&`),m=Object.entries(n).map(([e,t])=>`${e.toLowerCase()}:${t.trim()}`).sort().join(`
`),h=Object.keys(n).map(e=>e.toLowerCase()).sort().join(`;`),g=[e,f,p,`${m}\n`,h,r].join(`
`),_=`AWS4-HMAC-SHA256`,v=`${d}/${o}/${s}/aws4_request`,y=[_,u,v,await Pc(g,{algorithm:`SHA-256`})].join(`
`),b=sY(await lY(await lY(await lY(await lY(await lY(`AWS4${a}`,d),o),s),`aws4_request`),y));return[`${_} Credential=${i}/${v},`,`SignedHeaders=${h}, Signature=${b}`].join(` `)},t$=async({method:e,url:t,config:n,secretAccessKey:r,body:i=``,extraHeaders:a={}})=>{let{access_key_id:o,region:s=`us-east-1`}=n;if(!o)throw Error(`S3 access key ID is required`);let c=new Date,l=new URL(t),u=await Pc(i,{algorithm:`SHA-256`}),d={Host:l.host,"x-amz-date":c.toISOString().replace(/[:-]|\.\d{3}/g,``),"x-amz-content-sha256":u,...a},f=await YRe({method:e,url:t,headers:d,payloadHash:u,accessKeyId:o,secretAccessKey:r,region:s,service:`s3`,date:c});return fetch(t,{method:e,headers:{...d,Authorization:f},...i&&{body:i}})},n$=({bucket:e,key:t,endpoint:n,region:r,forcePathStyle:i,publicUrl:a})=>a?`${ql(a)}/${t}`:n?`${ql(n)}/${e}/${t}`:i?`https://s3.${r}.amazonaws.com/${e}/${t}`:`https://${e}.s3.${r}.amazonaws.com/${t}`,XRe=(e,t)=>{let{bucket:n,region:r,endpoint:i,force_path_style:a,public_url:o}=e;return[n$({bucket:n,key:``,endpoint:i,region:r,forcePathStyle:a,publicUrl:o}),n$({bucket:n,key:``,endpoint:i,region:r,forcePathStyle:a})].some(e=>t.startsWith(e))},r$=e=>Kl(e,Gl),i$=(e,t)=>{let{bucket:n,region:r,endpoint:i,force_path_style:a}=e;return n$({bucket:n,key:r$(t),endpoint:i,region:r,forcePathStyle:a})},a$=({acl:e})=>e?{"x-amz-acl":e}:{},ZRe=KQ({requireCredential:({apiKey:e})=>{if(!e)throw Error(`S3 secret access key is required`);return e},listPage:async({config:e,credential:t,prefix:n,cursor:r,delimiter:i})=>{let{bucket:a,region:o,endpoint:s,force_path_style:c}=e,l=new URLSearchParams({"list-type":`2`,"max-keys":`1000`,...n&&{prefix:n},...i&&{delimiter:i},...r&&{"continuation-token":r}}),u=await t$({method:`GET`,url:s?`${ql(s)}/${a}?${l}`:c?`https://s3.${o}.amazonaws.com/${a}?${l}`:`https://${a}.s3.${o}.amazonaws.com/?${l}`,config:e,secretAccessKey:t});await Hu(u,`Failed to list objects`);let d=YQ(await u.text());return{items:XQ(d.Contents),cursor:d.IsTruncated===`true`&&d.NextContinuationToken||void 0}},getKey:({Key:e})=>e,parseResults:(e,t)=>{let{bucket:n,region:r,endpoint:i,force_path_style:a,public_url:o}=t;return e.map(e=>{let s=e.Key,c=tu(s)||s,l=FQ(t,s),u=n$({bucket:n,key:r$(s),endpoint:i,region:r,forcePathStyle:a,publicUrl:o});return{id:s,description:l,previewURL:u,downloadURL:u,fileName:c,lastModified:new Date(e.LastModified),size:Number(e.Size),kind:Ep(s)}})},putObject:async({key:e,file:t,config:n,credential:r})=>{let i=await t.arrayBuffer();return await Hu(await t$({method:`PUT`,url:i$(n,e),config:n,secretAccessKey:r,body:i,extraHeaders:{"Content-Type":t.type||`application/octet-stream`,...a$(n)}}),`Failed to upload file ${t.name}`),{Key:e,LastModified:new Date().toISOString(),ETag:``,Size:t.size,ContentType:t.type}},copyObject:async({asset:e,key:t,config:n,credential:r})=>{let{bucket:i}=n,{id:a,size:o=0}=e,s=await t$({method:`PUT`,url:i$(n,t),config:n,secretAccessKey:r,extraHeaders:{"x-amz-copy-source":`/${i}/${r$(a)}`,"x-amz-metadata-directive":`COPY`,...a$(n)}});await Hu(s,`Failed to copy object ${a}`);let c=await s.text();if(/^\s*(?:<\?xml[^>]*>\s*)?<Error[\s>]/.test(c))throw Error(`Failed to copy object ${a}: ${c}`);return{Key:t,LastModified:new Date().toISOString(),ETag:``,Size:o}},deleteObject:async({key:e,config:t,credential:n,allowNotFound:r=!1})=>{await Hu(await t$({method:`DELETE`,url:i$(t,e),config:t,secretAccessKey:n}),`Failed to delete object ${e}`,{allowNotFound:r})},putFolderObject:async({key:e,config:t,credential:n})=>{await Hu(await t$({method:`PUT`,url:i$(t,e),config:t,secretAccessKey:n,extraHeaders:{"Content-Type":`application/x-directory`,...a$(t)}}),`Failed to create folder ${e}`)}}),o$=class extends JQ{compatibleAPI=`s3`;constructor({requiredOption:e=`region`,objectAcl:t,regionalHost:n,resolveConfig:r=n?e=>{let t=n(e.region);return{...e,endpoint:`https://${t}`,public_url:e.public_url??`https://${e.bucket}.${t}`}}:e=>e,...i}){super({...i,resolveConfig:e=>({...r(e),acl:t}),isConfigured:t=>!!(t.access_key_id&&t.bucket&&t[e]),isConfigURL:XRe,operations:ZRe}),this.requiredOption=e}},QRe=new o$({serviceId:`aws_s3`,serviceLabel:`Amazon S3`,serviceURL:`https://aws.amazon.com/s3/`,developerURL:`https://docs.aws.amazon.com/s3/`,apiKeyURL:`https://console.aws.amazon.com/iam/home#/security_credentials`,apiKeyPattern:/^[A-Za-z0-9/+=]{40,}$/}),$Re=new o$({serviceId:`backblaze_b2`,serviceLabel:`Backblaze B2`,serviceURL:`https://www.backblaze.com/cloud-storage`,developerURL:`https://www.backblaze.com/docs/cloud-storage-s3-compatible-api`,apiKeyURL:`https://secure.backblaze.com/app_keys.htm`,apiKeyPattern:/^[A-Za-z0-9/+=]{30,}$/,regionalHost:e=>`s3.${e}.backblazeb2.com`}),eze=new o$({serviceId:`bunny_storage`,serviceLabel:`Bunny Storage`,serviceURL:`https://bunny.net/storage/`,developerURL:`https://bunny.net/docs/storage/s3`,apiKeyURL:`https://dash.bunny.net/storage`,apiKeyPattern:/^[0-9a-f]{8}(?:-[0-9a-f]{4,12}){3,7}$/i,resolveConfig:e=>({...e,access_key_id:e.access_key_id??e.bucket,endpoint:`https://${e.region}-s3.storage.bunnycdn.com`})}),tze={default:``,eu:`eu.`,fedramp:`fedramp.`},nze=({account_id:e,jurisdiction:t=`default`})=>`https://${e}.${tze[t]??``}r2.cloudflarestorage.com`,rze=new o$({serviceId:`cloudflare_r2`,serviceLabel:`Cloudflare R2`,serviceURL:`https://www.cloudflare.com/developer-platform/r2/`,developerURL:`https://developers.cloudflare.com/r2/`,apiKeyURL:`https://dash.cloudflare.com/?to=/:account/r2/api-tokens`,apiKeyPattern:/^[A-Za-z0-9/+=]{40,}$/,requiredOption:`account_id`,resolveConfig:e=>({...e,region:`auto`,endpoint:nze(e)})}),ize=new o$({serviceId:`digitalocean_spaces`,serviceLabel:`DigitalOcean Spaces`,serviceURL:`https://www.digitalocean.com/products/spaces`,developerURL:`https://docs.digitalocean.com/products/spaces/`,apiKeyURL:`https://cloud.digitalocean.com/account/api/spaces`,objectAcl:`public-read`,apiKeyPattern:/^[A-Za-z0-9/+=]{43}$/,regionalHost:e=>`${e}.digitaloceanspaces.com`}),aze=/^[a-z0-9-]+\.storage\.(?:[a-z0-9-]+\.)?([a-z]{2}-[a-z]+-\d+)\.aws\.neon\.tech$/,oze=({endpoint:e})=>{let t=URL.parse(e??``);if(t?.protocol!==`https:`||t.port)return;let[,n]=t.hostname.match(aze)??[];return n?{endpoint:t.origin,region:n}:void 0},sze=new o$({serviceId:`neon_object_storage`,serviceLabel:`Neon Object Storage`,serviceURL:`https://neon.com/docs/storage/overview`,developerURL:`https://neon.com/docs/storage/s3-compatibility`,apiKeyURL:`https://neon.com/docs/storage/authentication`,apiKeyPattern:/^nsk_[a-z]+_[0-9a-f]{64}$/,requiredOption:`endpoint`,resolveConfig:e=>{let t=oze(e);return{...e,endpoint:t?.endpoint,region:e.region??t?.region}}}),cze=new o$({serviceId:`scaleway_object_storage`,serviceLabel:`Scaleway Object Storage`,serviceURL:`https://www.scaleway.com/en/object-storage/`,developerURL:`https://www.scaleway.com/en/docs/object-storage/`,apiKeyURL:`https://console.scaleway.com/iam/api-keys`,objectAcl:`public-read`,apiKeyPattern:/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/,regionalHost:e=>`s3.${e}.scw.cloud`}),lze=({project_id:e})=>`https://${e}.storage.supabase.co/storage/v1/s3`,uze=({project_id:e,bucket:t})=>`https://${e}.supabase.co/storage/v1/object/public/${t}`,dze=new o$({serviceId:`supabase_storage`,serviceLabel:`Supabase Storage`,serviceURL:`https://supabase.com/storage`,developerURL:`https://supabase.com/docs/guides/storage`,apiKeyURL:`https://supabase.com/dashboard/project/_/storage/settings`,apiKeyPattern:/^[A-Za-z0-9/+=]{40,}$/,requiredOption:`project_id`,resolveConfig:e=>({...e,endpoint:lze(e),public_url:e.public_url??uze(e)})}),s$=`https://ucarecdn.com`,fze=/^https:\/\/[\w-]+\.ucarecd\.net\//i,pze=(e=El.current)=>mq(`uploadcare`,e),c$=e=>{let t=gq(`uploadcare`,e);return t?t.config?.publicKey:void 0},mze=e=>!!c$(e),l$=({mime_type:e,original_filename:t})=>{let[n]=e.split(`/`);return xp(n)?n:Ep(t)},u$=(e,{fieldConfig:t}={})=>{let{settings:{autoFilename:n=!1,defaultOperations:r=void 0}={},config:{cdnBase:i=void 0}={}}=gq(`uploadcare`,t)||{};return e.map(e=>{let{uuid:t,original_filename:a,original_file_url:o,mime_type:s,datetime_uploaded:c,size:l}=e,u=`${new URL(i??o).origin}/${t}/`,d=s.startsWith(`image/`);return{id:t,description:a,previewURL:`${u}${d?`-/preview/400x400/`:``}`,downloadURL:`${u}${d&&r?`-${r}`:``}${n?Gl(a):``}`,fileName:a,lastModified:new Date(c),size:l,kind:l$(e)}})},d$=({fieldConfig:e,apiKey:t},{secretKeyRequired:n=!0}={})=>{let r=c$(e);if(!r)throw Error(`Uploadcare public key is not configured`);if(n&&!t)throw Error(`Uploadcare secret key is not provided`);return{publicKey:r,secretKey:t}},f$=({publicKey:e,secretKey:t})=>({Accept:`application/vnd.uploadcare-v0.7+json`,Authorization:`Uploadcare.Simple ${e}:${t}`}),hze=async(e,t)=>{try{let n=await fetch(`https://api.uploadcare.com/files/${e}/`,{headers:f$(t)});if(n.ok){let{original_file_url:e}=await n.json();if(e)return new URL(e).origin}}catch{}return s$},p$=async(e,{maxPages:t=10,filter:n}={})=>{let{kind:r,fieldConfig:i}=e,a=f$(d$(e,{secretKeyRequired:!1})),o=new URLSearchParams({limit:`100`,ordering:`-datetime_uploaded`,stored:`true`});return u$(await RQ(async e=>{let t=await fetch(e??`https://api.uploadcare.com/files/?${o}`,{headers:a});await Hu(t,`Failed to fetch files`);let i=await t.json(),{results:s}=i;return r&&(s=s.filter(e=>l$(e)===r)),n&&(s=s.filter(n)),{results:s,next:i.next}},{maxPages:t}),{fieldConfig:i})},gze=async e=>p$(e),_ze=async(e,t)=>{let n=e.toLowerCase();return p$(t,{filter:e=>e.original_filename.toLowerCase().includes(n)})},vze=async(e,t)=>sY(await lY(e,String(t))),m$={aws_s3:QRe,azure_blob_storage:e$,backblaze_b2:$Re,bunny_storage:eze,cloudflare_r2:rze,cloudinary:RMe,digitalocean_spaces:ize,neon_object_storage:sze,scaleway_object_storage:cze,supabase_storage:dze,uploadcare:{serviceType:`cloud_storage`,serviceId:`uploadcare`,serviceLabel:`Uploadcare`,serviceURL:`https://uploadcare.com/`,showServiceLink:!0,hotlinking:!0,authType:`api_key`,developerURL:`https://uploadcare.com/docs/`,apiKeyURL:`https://app.uploadcare.com/projects/-/api-keys/`,apiKeyPattern:/^[a-f0-9]{20}$/,isEnabled:mze,isAssetURL:e=>{let t=pze();if(!t)return!1;let n=t.config?.cdnBase;if(n===void 0)return e.startsWith(`${s$}/`)||fze.test(e);try{return e.startsWith(`${new URL(n).origin}/`)}catch{return!1}},list:gze,search:_ze,upload:async(e,t)=>{if(e.length===0)return[];let{fieldConfig:n}=t,r=d$(t),{publicKey:i,secretKey:a}=r,o=Math.floor(Date.now()/1e3)+1800,s=await vze(a,o),c=new FormData;c.append(`UPLOADCARE_PUB_KEY`,i),c.append(`UPLOADCARE_STORE`,`1`),c.append(`signature`,s),c.append(`expire`,String(o));let l=new Map;e.forEach(e=>{let t=IQ(e.name,{assetNamesInSameFolder:[...l.keys()]});l.set(t,e),c.append(t,e)});let u=await fetch(`https://upload.uploadcare.com/base/`,{method:`POST`,body:c});await Hu(u,`Failed to upload files`);let d=await u.json(),f=Object.entries(d).filter(([e])=>!e.startsWith(`UPLOADCARE_`)),{cdnBase:p}=gq(`uploadcare`,n).config,m=p===void 0&&f.length?await hze(f[0][1],r):s$;return u$(f.map(([e,t])=>{let n=l.get(e),r=n?.type||`application/octet-stream`,i=r.startsWith(`image/`);return{uuid:t,original_filename:e,original_file_url:`${m}/${t}/${e}`,size:n?.size||0,mime_type:r,is_image:i,is_ready:!0,content_info:null,datetime_uploaded:new Date().toISOString(),datetime_stored:new Date().toISOString(),datetime_removed:null}}),{fieldConfig:n})},delete:async(e,t)=>{let n={...f$(d$(t)),"Content-Type":`application/json`},r=Ub(e.map(({id:e})=>e),100);for(let e=0;e<r.length;e+=1)e>0&&await Iu(50),await Hu(await fetch(`https://api.uploadcare.com/files/storage/`,{method:`DELETE`,headers:n,body:JSON.stringify(r[e])}),`Failed to delete files`)}}},h$=Object.keys(m$),yze=/^(?:https?|data|blob):/,bze=e=>{if(m$.cloudinary?.isEnabled?.(e)){let t=Sq(e);if(t.output_filename_only&&t.config?.cloud_name)return`https://res.cloudinary.com/${t.config.cloud_name}`}},g$=({value:e,entry:t,collectionName:n,fileName:r,componentName:i,fieldConfig:a,typedKeyPath:o,locale:s})=>{if(!e)return;if(yze.test(e))return{url:e};if(wQ(e)){let t=bze(a);if(t)return{url:`${t}/${e}`}}let c=TQ({value:e,entry:t,collectionName:n,fileName:r,componentName:i,typedKeyPath:o,locale:s});return c?{asset:c}:void 0},_$=async(e,t=!1)=>{let{url:n,asset:r}=e??{};if(n)return n;if(r)return(t?await aZ(r):await $X(r))??fZ(r)},v$=async({thumbnail:e=!1,...t})=>_$(g$(t),e),y$=({componentNames:e,...t})=>{let n=e.map(Qm).filter(Boolean);return g$(t)??Sy.current.values().filter(({componentName:e,typedKeyPath:t})=>!!t&&n.includes(e)).map(({componentName:e,typedKeyPath:n})=>g$({...t,componentName:e,typedKeyPath:n})).find(Boolean)},xze=async e=>_$(y$(e)),b$=/^.+?:\w+:/,x$=e=>e.replace(b$,``),Sze=[`rich_text`,`raw`],Cze={rich_text:`rich-text`,raw:`plain-text`},S$=[`bold`,`italic`,`strikethrough`,`code`,`link`],C$=[...S$,`heading-one`,`heading-two`,`heading-three`,`heading-four`,`heading-five`,`heading-six`,`bulleted-list`,`numbered-list`,`quote`],wze={bold:`bold`,italic:`italic`,strikethrough:`strikethrough`,code:`code`,link:`link`,"heading-one":`heading-1`,"heading-two":`heading-2`,"heading-three":`heading-3`,"heading-four":`heading-4`,"heading-five":`heading-5`,"heading-six":`heading-6`,"bulleted-list":`bulleted-list`,"numbered-list":`numbered-list`,quote:`blockquote`,align:`align`,"code-block":`code-block`,table:`table`,hr:`horizontal-rule`},w$=[`code-block`,`table`,`hr`],Tze=[`code-block`,`image`],T$=e=>{if(e.widget!==`richtext`)return`markdown`;let{format:t=Dl.current?.field_defaults?.richtext?.format}=e;return t===`html`?`html`:`markdown`},E$=e=>{let t=Dl.current?.field_defaults?.richtext??{},{editor_components:n=t.editor_components??[...Tze,...Bd.keys()],linked_images:r=t.linked_images??!0}=e;return n.map(e=>e===`image`&&r?`linked-image`:e)},D$=e=>E$(e).map(e=>$m(e)).filter(e=>!!e),Eze=(e,t)=>[...e,...w$.filter(e=>t.includes(e))].map(e=>wze[e]).filter(Boolean),Dze=e=>e?.allow_nested_components??Dl.current?.field_defaults?.richtext?.allow_nested_components??!0,Oze=e=>e.match(/^[^:]+/)?.[0],kze=({fieldConfig:e,format:t,allowNestedComponents:n,inEditorComponent:r,parentComponentNames:i})=>r&&!n?[]:D$(e).filter(e=>t!==`html`||Fm(e)).filter(e=>n!==`exclude_self`||!i.includes(e.id)),Aze=(e,t,n)=>Object.keys(e).filter(e=>{let[r]=e.match(b$)??[];return!!r?.startsWith(`${t}:`)&&!n(r)}),O$=e=>{let t=document.createElement(`template`);return t.innerHTML=e,t},jze=e=>O$(e).content.firstElementChild,k$=e=>{let{outerHTML:t}=e,n=`</${e.localName}>`;return t.endsWith(n)?t.slice(0,-n.length):t},Mze=(e,t)=>{let n=e.lastIndexOf(`<`,t-1);return t>0&&n>e.lastIndexOf(`>`,t-1)&&/[a-z]/i.test(e[n+1]??``)},A$={img:[`src`,`srcset`],source:[`src`,`srcset`],video:[`src`,`poster`],audio:[`src`]},j$=Object.keys(A$),Nze=j$.join(`, `),M$=j$.join(`|`),N$=`<(?:${M$})[\\s/>]`,P$=new RegExp(N$,`i`),Pze=new RegExp(N$,`gi`),F$=`data-deferred-`,I$=`:is(${Object.entries(A$).flatMap(([e,t])=>t.flatMap(t=>[`${e}[${t}]`,`${e}[${F$}${t}]`])).join(`, `)}):not([data-processed])`,L$=e=>[...e.content.querySelectorAll(Nze)],Fze=e=>{if(!P$.test(e))return e;let t=O$(e);return L$(t).forEach(e=>{A$[e.localName].forEach(t=>{let n=e.getAttribute(t);e.removeAttribute(`${F$}${t}`),n!==null&&(e.setAttribute(`${F$}${t}`,n),e.removeAttribute(t))})}),t.innerHTML},R$=e=>{let t=[],n=0;for(;;){let r=e.slice(n).search(/[^\s,]/);if(r===-1)break;n+=r;let i=e.slice(n).match(/^\S+/)?.[0];if(n+=i.length,i.endsWith(`,`))t.push({url:i.replace(/,+$/,``),descriptor:``});else{let r=e.indexOf(`,`,n),a=r===-1?e.length:r;t.push({url:i,descriptor:e.slice(n,a).trim()}),n=a}}return t},Ize=e=>e.map(({url:e,descriptor:t})=>[e.replace(/\s/g,encodeURIComponent),t].filter(Boolean).join(` `)).join(`, `),z$=(e,t)=>{let n=!1,r=e.flatMap((e,r)=>{let i=t(e.url,r);return i===null?(n=!0,[]):i!==void 0&&i!==e.url?(n=!0,[{...e,url:i}]):[e]});if(n)return r.length?Ize(r):null},Lze=async(e,t)=>{let n=A$[e.localName]??[],r=async e=>{try{return await t(e)??e}catch{return e}},i=async(e,t)=>{if(!t)return t;if(e!==`srcset`)return r(t);let n=R$(t),i=await Promise.all(n.map(({url:e})=>r(e)));return z$(n,(e,t)=>i[t])??t},a=await Promise.all(n.map(async t=>{let n=`${F$}${t}`,r=e.hasAttribute(n),a=e.getAttribute(r?n:t);return a===null?void 0:{name:t,deferredName:n,deferred:r,value:a,url:await i(t,a)}})),o=!1;a.forEach(t=>{if(!t)return;let{name:n,deferredName:r,deferred:i,value:a,url:s}=t;i&&e.removeAttribute(r),(i||s!==a)&&(e.setAttribute(n,s),o=!0)});let{localName:s,parentElement:c}=e;o&&s===`source`&&/^(?:audio|video)$/.test(c?.localName??``)&&c.load()},Rze=new RegExp(Bm(),`g`),zze=[`<(?:${M$})(?=[\\s/>])`,`(?:[^<>"']|"[^"<]*"|'[^'<]*')*>`].join(``),B$=RegExp(`${Rze.source}|(?<tag>${zze})`,`gi`),V$=(e,t)=>{let n=t===`markdown`&&e.length>2&&e.startsWith(`<`)&&e.endsWith(`>`),r=n?e.slice(1,-1):e,i=r.indexOf(`#`),a=i>0?r.slice(0,i):r;return{url:r,path:a,fragment:r.slice(a.length),syntax:t,bracketed:n}},H$=(e,t)=>{let n=!1;return A$[e.localName].forEach(r=>{let i=e.getAttribute(r);if(!i)return;if(r!==`srcset`){let a=t(i,V$(i,`html`));a===null?(e.removeAttribute(r),n=!0):a!==void 0&&a!==i&&(e.setAttribute(r,a),n=!0);return}let a=z$(R$(i),e=>t(e,V$(e,`html`)));a!==void 0&&(a===null?e.removeAttribute(r):e.setAttribute(r,a),n=!0)}),n},U$=({value:e,tag:t,index:n,callback:r})=>{if(Mze(e,n))return;let i=jze(t);return H$(i,r)?i:void 0},Bze=(e,t)=>e.replace(B$,(n,...r)=>{let{alt:i=``,src:a,tag:o}=r.at(-1),s=r.at(-3);if(o!==void 0){let r=U$({value:e,tag:o,index:s,callback:(e,n)=>t(e,n)??void 0});return r?k$(r):n}let c=a;if(!c)return n;let l=V$(c,`markdown`),u=t(l.url,l);if(typeof u!=`string`)return n;let d=i.length+4,f=l.bracketed?`<${u}>`:u;return`${n.slice(0,d)}${f}${n.slice(d+c.length)}`}),Vze=(e,t)=>{if(!P$.test(e))return e;let n=O$(e),r=!1;return L$(n).forEach(e=>{r=H$(e,t)||r}),r?n.innerHTML:e},W$=(e,t,n)=>t===`html`?Vze(e,n):Bze(e,n),G$=(e,t)=>{let n=new Set;return W$(e,t,e=>{n.add(e)}),[...n]},Hze=(e,t,n)=>[...t.values()].some(e=>e!==void 0)?W$(e,n,e=>t.get(e)):e,K$=e=>{let t=Dl.current?._baseURL;return t&&!e.startsWith(`blob:`)?e.replace(t,``):e},Uze=e=>{let t={targets:e,byURL:new Map,byBlobURL:new Map,byPath:new Map,resolves:!1};return e.forEach(({url:e,asset:n},r)=>{let[i,a]=n?[t.byPath,n.path]:e.startsWith(`blob:`)?[t.byBlobURL,e]:[t.byURL,e];i.set(a,[...i.get(a)??[],r])}),t.resolves=!!(t.byBlobURL.size||t.byPath.size),t},q$=({entry:e,collectionName:t,fileName:n,locale:r,keyPath:i,valueMap:a,isIndexFile:o,fieldConfig:s})=>{let c;return l=>{c??=uh({collectionName:t,fileName:n,keyPath:i,valueMap:a,isIndexFile:o});let u={entry:e,collectionName:t,fileName:n,typedKeyPath:c,locale:r,value:l},{widget:d=`string`}=s;return Ld.includes(d)?g$({...u,fieldConfig:s}):y$({...u,componentNames:E$(s)})}},J$=(e,t)=>{let{url:n,path:r,fragment:i}=typeof e==`string`?V$(e):e,a=i?[[n,``],[r,i]]:[[n,``]];for(let[e,n]of a){if(t(e))return{url:e,fragment:n,decoded:!1};let r=e.includes(`%`)?Ul(e):e;if(r!==e&&t(r))return{url:r,fragment:n,decoded:!0}}},Y$=(e,t)=>{let{byURL:n}=e,r=J$(t,e=>n.has(e));return r&&n.get(r.url)},X$=(e,t,n)=>{let r=Y$(e,t)??[];if(!e.resolves)return r;let{url:i,asset:a}=n(t.url)??{},o=i??a?.blobURL;return[...r,...o!==void 0&&e.byBlobURL.get(o)||[],...a&&e.byPath.get(a.path)||[]]},Z$=(e,t,n)=>{let{url:r,path:i,fragment:a,syntax:o,bracketed:s}=n,c=(e,t,n=!1)=>`${(o===`markdown`?!s:o===`html`?!(t?i:r).includes(` `):n)?e.replaceAll(` `,`%20`):e}${t}`;return t.map(t=>{let{url:o,newURL:s}=e.targets[t];if(typeof s==`function`){let e=s(r);if(e)return c(e,``);let t=a?s(i):void 0;return t?c(t,a):void 0}if(!s)return;let l=o===void 0?void 0:J$(n,e=>e===o);return c(s,l?.fragment??``,l?.decoded)}).find(Boolean)},Wze=(e,t)=>{if(Y$(e,t))return!0;if(!t.includes(`![`)&&!P$.test(t))return!1;let n=t=>t.some(t=>!!Y$(e,t));if(n(G$(t,`markdown`)))return!0;let r=[...t.matchAll(B$)].filter(({groups:e})=>e?.tag).length;return(t.match(Pze)?.length??0)>r&&n(G$(t,`html`))},Gze=({matcher:e,collectionName:t,entry:n,content:r,keyPath:i,value:a,isIndexFile:o,collectionFile:s,locale:c})=>{let l=new Set,u=s?.name,d=lh({collectionName:t,fileName:u,valueMap:r,keyPath:i,isIndexFile:o});if(!d)return{indexes:l};let{widget:f=`string`}=d,p=q$({entry:n,collectionName:t,fileName:u,locale:c,keyPath:i,valueMap:r,isIndexFile:o,fieldConfig:d});if(Ld.includes(f)){let t=V$(a),n=X$(e,t,p),o=Z$(e,n,t);return n.forEach(e=>l.add(e)),o&&(r[i]=o),{indexes:l,field:d}}if(Rd.includes(f)){let t=!1,n=W$(a,T$(d),(n,r)=>{let i=X$(e,r,p);if(!i.length)return;let a=Z$(e,i,r);return i.forEach(e=>l.add(e)),t||=!!a,a||void 0});t&&(r[i]=n)}return{indexes:l,field:d}},Q$=(e,{entries:t,every:n=!1,onMatch:r})=>{let i=Uze(e.map(e=>e.url===void 0?e:{...e,url:K$(e.url)})),a=n||e.some(({newURL:e})=>!!e),o=e.map(()=>[]);return t.forEach(t=>{let{locales:n}=t,s,c=new Set,l=()=>!a&&c.size===e.length;for(let[e,{content:a}]of Object.entries(n)){for(let[n,o]of Object.entries(a))if(typeof o==`string`&&o&&(i.resolves||Wze(i,o))){s??=YU(t).map(e=>{let n=qp(e,t);return{collection:e,isIndexFile:cf(e,t),files:n.length?n:[void 0]}});for(let{collection:u,isIndexFile:d,files:f}of s){let s={matcher:i,collectionName:u.name,entry:t,content:a,keyPath:n,locale:e};if(f.map(e=>Gze({...s,value:o,isIndexFile:d,collectionFile:e})).forEach(({indexes:i,field:a},o)=>{i.forEach(e=>c.add(e)),i.size&&r&&r({entry:t,collection:u,collectionFile:f[o],locale:e,keyPath:n,fieldConfig:a})}),l())break}if(l())break}if(l())break}c.forEach(e=>{o[e].push(t)})}),o},$$=async(e,{entries:t=Vp.current,newURL:n=``}={})=>Q$([{url:e,newURL:n}],{entries:t})[0],e1=(e,{entries:t=Vp.current}={})=>Q$(e,{entries:t}),t1=async(e,t)=>e1(e,t),Kze=async(e,{entries:t=Vp.current}={})=>{let n=[];return Q$(e,{entries:t,every:!0,onMatch:e=>{n.push(e)}}),n},qze=async(e,t)=>{let n=t===`image`?await QX(e):null;if(!n)return{createdDate:void 0,coordinates:void 0};let r={};try{let{parse:e}=await Jc(`exifr`,`dist/lite.esm.mjs`);r=await e(n)??{}}catch{}let{latitude:i,longitude:a,DateTimeOriginal:o,CreateDate:s=o}=r;return{createdDate:s instanceof Date?s:void 0,coordinates:Number.isFinite(i)&&Number.isFinite(a)?{latitude:rh(i,7),longitude:rh(a,7)}:void 0}},n1=({element:e,eventType:t,src:n,getInfo:r})=>new Promise(i=>{e.addEventListener(t,()=>i(r()),{once:!0}),e.addEventListener(`error`,()=>i({}),{once:!0}),e.src=n}),Jze=e=>{let t=new Image;return n1({element:t,eventType:`load`,src:e,getInfo:()=>({dimensions:{width:t.naturalWidth,height:t.naturalHeight}})})},Yze=async(e,t)=>{let n=document.createElement(t);return n1({element:n,eventType:`loadedmetadata`,src:e,getInfo:()=>{let{duration:e}=n;if(t===`audio`)return{duration:e};let{videoWidth:r,videoHeight:i}=n;return{dimensions:{width:r,height:i},duration:e}}})},r1=async(e,t)=>t===`image`?Jze(e):Yze(e,t),Xze=async(e,t,n)=>{let[{dimensions:r,duration:i},{createdDate:a,coordinates:o}]=await Promise.all([r1(t,n),qze(e,n)]);return{dimensions:r,duration:i,createdDate:a,coordinates:o}},Zze=new Map,i1=e=>{let{kind:t,downloadURL:n}=e;return xp(t)?zl(Zze,n,()=>r1(n,t)):Promise.resolve({})},a1=async({downloadURL:e})=>$$(e),Qze=async e=>{if(!e.length)return[];let t=await t1(e.map(({downloadURL:e})=>({url:e})));return[...new Set(t.flat())]},$ze=6,o1=tl({}),s1=new Set,c1=async e=>{try{let{ok:t,status:n}=await fetch(e,{method:`HEAD`});return t?!0:n>=400&&![405,429,501].includes(n)?!1:void 0}catch{try{await fetch(e,{method:`HEAD`,mode:`no-cors`});return}catch{return!1}}},eBe=e=>window.location.protocol===`https:`&&e.startsWith(`http:`),tBe=async e=>{let{kind:t,downloadURL:n}=e;if(!eBe(n)){if(xp(t)){let t=await i1(e);return`dimensions`in t||`duration`in t||await c1(n)===!0}return c1(n)}},nBe=async e=>{let t=e.filter(({id:e})=>!s1.has(e));t.forEach(({id:e})=>s1.add(e)),await Ed(t,async e=>{let t=await tBe(e);t!==void 0&&(o1.current={...o1.current,[e.id]:t})},{concurrency:$ze})},rBe=/^https?:\/\/\S+$/,iBe=e=>{let t=Dl.current?._baseURL;return rBe.test(e)&&!(t&&e.startsWith(t))&&!Object.values(m$).some(({isEnabled:t,isAssetURL:n})=>(t?.()??!0)&&n?.(e))},aBe=(e,t)=>{let n=e;try{n=decodeURIComponent(new URL(e).pathname.split(`/`).filter(Boolean).at(-1)??``)}catch{}n||=e;let r=Ep(n);return{id:e,description:e,previewURL:e,downloadURL:e,fileName:n,kind:r===`other`&&t?`image`:r}},oBe=(e,t,n)=>hQ(e).map(({collection:e,collectionFile:r,isIndexFile:i})=>lh({collectionName:e.name,fileName:r?.name,valueMap:t,keyPath:n,isIndexFile:i})?.widget??`string`).toArray(),sBe=e=>{let t=new Map;return e.forEach(e=>{Object.values(e.locales).forEach(({content:n})=>{Object.entries(n).forEach(([r,i])=>{if(typeof i!=`string`||!iBe(i))return;let a=oBe(e,n,r);a.some(e=>Ld.includes(e))&&!t.has(i)&&t.set(i,aBe(i,a.includes(`image`)))})})}),[...t.values()]},l1=rl(()=>sBe(Vp.current)),u1={serviceType:`cloud_storage`,serviceId:`linked`,get serviceLabel(){return Y(`linked_files`)},serviceURL:``,showServiceLink:!1,hotlinking:!0,authType:`none`,list:async()=>{let e=l1.current;return nBe(e),e}},d1=rl(()=>(Dl.current,Object.values(m$).filter(({isEnabled:e})=>e?.()??!0))),cBe=e=>e===`linked`?u1:d1.current.find(t=>t.serviceId===e),f1=({serviceId:e})=>`/assets/-/${e}`,p1=(e,{id:t})=>`${f1(e)}/${Kl(t)}`,m1=({kind:e,fileName:t})=>Sp(e,t),h1=(e,t)=>{let n=new Set(e.map(({id:e})=>e));return[...e,...t.filter(({id:e})=>!n.has(e))]},g1=tl(),_1=tl(),v1=e=>!!e?.browse,y1=tl([]),b1=tl(``),x1=tl(),S1=tl(!1),C1=tl(),w1=tl(),T1=tl({}),E1=tl(),D1=tl(!1),O1=tl([]),lBe=rl(()=>new Set(O1.current.map(({id:e})=>e))),k1=tl(),A1=e=>{let t=O1.current,n=t.filter(({id:t})=>e(t));n.length!==t.length&&(O1.current=n),k1.current&&!e(k1.current.id)&&(k1.current=void 0)},uBe=rl(()=>O1.current.length?[...O1.current]:k1.current?[k1.current]:[]),j1=tl(),M1=tl(),N1=tl(``),P1=({serviceId:e})=>{let t=yu.apiKeys?.[e]??``,[n=``,r=``]=(yu.logins?.[e]??``).split(` `);return{apiKey:t,userName:n,password:r}},F1=e=>{let{apiKey:t,password:n}=P1(e);return e.authType===`none`||!!t||!!n},dBe=()=>{_1.current=void 0,y1.current=[],E1.current=void 0,D1.current=!1,O1.current=[],b1.current=``,k1.current=void 0,x1.current=void 0,j1.current=void 0,M1.current=void 0,C1.current=void 0,w1.current=void 0,N1.current=``},I1=e=>{b1.current=e,O1.current=[],k1.current=void 0,x1.current=void 0},L1=tl(),fBe={type:`grid`,showInfo:!0,sort:{key:`name`,order:`ascending`}},R1=tl({type:`grid`,showInfo:!0}),z1=()=>{let e=g1.current;return e?`-/${e.serviceId}`:wy.current?.internalPath??`*`},pBe=async({repository:e})=>{await oG(e,`assets-view`,L1),ol(()=>{wy.current,g1.current,eo(()=>{let e=L1.current?.[z1()]??structuredClone(fBe);(0,Qc.default)(e,R1.current)||(R1.current=e)})}),ol(()=>{let e=R1.current;eo(()=>{let t=z1(),n=L1.current?.[t]??{};(0,Qc.default)(e,n)||(L1.current={...L1.current,[t]:e})})})},B1=e=>Uc(e).filename,mBe=(e,t)=>{let{commitAuthor:n,commitDate:r}=e;return t===`commit_author`?hW(n):t===`commit_date`?r:t===`name`?B1(e.name):e[t]??``},hBe=(e,{key:t,order:n}={})=>{if(!t||!n)return e;let r=[...e],i={commit_author:String,commit_date:Date}[t]||r[0]?.[t]?.constructor||String;return QW(r,e=>{let n=mBe(e,t);return i===String?n??``:Number(n??0)},i===String,n),r},V1=tl(!1),H1=tl(!1),U1=tl(!1),gBe=rl(()=>!!Mp.current.files.length),W1=({label:e,collectionName:t,fileName:n,internalPath:r})=>{if(e)return e;if(t===void 0)return Y(r===void 0?`all_assets`:`global_assets`);let i=Kf(t),a=i?qf(i):t;if(!n)return a;let o=i?Wp(i,n):void 0;return`${a} › ${o?Kp(o):n}`},G1=rl(()=>{let{current:e}=Op,{current:t}=wy;return e&&t&&t.internalPath!==void 0?e.filter(e=>EQ(e,t)):e?[...e]:[]}),K1=rl(()=>{let e=G1.current,t=hJ.current;return t===void 0?e:wJ({dirPath:t,assets:e})}),q1=rl(()=>{let e=hJ.current;return e===void 0?[]:CJ({dirPath:e,assets:G1.current})}),J1=rl(()=>{let e=cJ.current;if(e){let{name:t,path:n}=e,r=G1.current;return{name:t,path:n,folderCount:CJ({dirPath:n,assets:r}).length,assetCount:wJ({dirPath:n,assets:r}).length}}let t=wy.current;if(!t)return;let n=hJ.current;return{name:tu(sJ.current)||Ec.current&&W1(t),path:n??t.internalPath,folderCount:n===void 0?void 0:q1.current.length,assetCount:K1.current.length}}),Y1=(e,t,n)=>{let r=Object.values(e).flat(1).filter(e=>t(e)||n(e)),i=r.findIndex(t);return i===-1?{}:{previous:r[i-1],next:r[i+1]}},X1={},_Be=il(()=>R1.current.sort),Z1=il(()=>R1.current.filter),vBe=il(()=>R1.current.group),yBe=rl(()=>hBe(K1.current,_Be.current)),bBe=rl(()=>jQ(yBe.current,Z1.current)),Q1=rl(()=>{let e=SRe(bBe.current,vBe.current);return(0,Qc.default)(X1,e)||(X1=e),X1}),xBe=rl(()=>{let e=q1.current.length;return new Map(Object.values(Q1.current).flat(1).map((t,n)=>[t.path,n+e]))});ol(()=>{let{current:e}=LX;e&&!eo(()=>L1.current)&&pBe(e)}),ol(()=>{let e=K1.current,t=Z1.current,n=eo(()=>Ap.current);kp.current=[],n&&!jQ(e.filter(({path:e})=>e===n.path),t).length&&(Ap.current=void 0),eo(()=>yu.devModeEnabled)&&console.info(`listedAssets`,e)});var $1=tl(!1),e0=tl(!1),t0=tl(0),n0=nl({show:!1,multiple:!1}),r0=nl({id:void 0,show:!1,status:`success`,message:void 0,count:1,sourceLanguage:void 0}),i0=nl({id:0,show:!1,status:`success`,message:``}),a0=tl(null),o0=tl(null),s0=tl(),c0=(e,t)=>Kl(`/collections/${e}/entries/${t}`),l0=rl(()=>$1.current||V1.current),u0=tl(``),d0=tl(``),f0=tl(``),p0=tl(``),m0=(e=window.location.href)=>{let[t,...n]=new URL(e).hash.substring(1).split(`#`)[0].split(`?`),r=new URLSearchParams(n.join(`?`));return{path:Ul(`${t.startsWith(`/`)?``:`/`}${t}`.replace(/(?!^)\/+$/,``)),params:Object.fromEntries([...new Set(r.keys())].map(e=>[e,r.getAll(e).join(`,`)]))}},h0=null,g0=new Set,_0=!1,v0=void 0,SBe=e=>{h0&&g0.add(e)},CBe=async()=>{if(!g0.size||_0){g0.clear();return}let e=Promise.withResolvers();v0=e.resolve,await Promise.race([Promise.allSettled(g0),Iu(300),e.promise]),v0=void 0,g0.clear()};globalThis.addEventListener?.(`keydown`,()=>{h0&&(h0.skipTransition(),_0=!0,v0?.())},{capture:!0});var y0=(e,t)=>{if(!document.startViewTransition||h0){t();return}let n={types:[e],update:async()=>{t(),await Iu(50),await new Promise(e=>{Pi(()=>{e(void 0)})}),await CBe()}};try{let e=document.startViewTransition(n);h0=e,_0=!1,e.ready.catch(()=>void 0),e.finished.catch(e=>{console.error(e)}).finally(()=>{h0=null,g0.clear()})}catch{h0=null,t()}},wBe=e=>{let t=window.navigation?.currentEntry?.index??-1;if(t===-1)return;let[n]=window.navigation.entries().filter(({url:n,index:r})=>n===e&&r!==t).map(({index:e})=>e).sort((e,n)=>Math.abs(e-t)-Math.abs(n-t));if(n!==void 0)return n<t?`forwards`:`backwards`},TBe=(e,t,n)=>{let r=m0(e).path,i=m0(t).path,a=n.test(r)&&n.test(i),o=r.split(`/`).length,s=i.split(`/`).length;return!a||o===s?`unknown`:o<s?`forwards`:`backwards`},b0=(e,t,n)=>{let{isTrusted:r,oldURL:i,newURL:a}=e;r?y0(wBe(i)??TBe(i,a,n),()=>t()):t()},x0=async(e,{state:t={},replaceState:n=!1,notifyChange:r=!0,transitionType:i=`unknown`}={})=>{let{path:a}=m0();if(a===Ul(e)&&!Object.keys(t).length&&!n)return;let{origin:o,pathname:s,hash:c}=window.location,l=`${o}${s}${c}`,u=`${o}${s}#${e}`,d=n?window.history.state?.from:l,f=[{...t,from:d},``,u];n?window.history.replaceState(...f):window.history.pushState(...f),r&&y0(i,()=>{window.dispatchEvent(new HashChangeEvent(`hashchange`,{oldURL:l,newURL:u}))})},EBe=/^\/edit\/(?<collectionName>[^/]+)\/(?<subPath>.+)$/,DBe=()=>{let{path:e,params:t}=m0(),{collectionName:n,subPath:r}=e.match(EBe)?.groups??{};if(!n||!r)return!1;let i=new URLSearchParams(t).toString();return x0(`${c0(n,r)}${i?`?${i}`:``}`,{replaceState:!0}),!0},OBe=[`workflow`,`config`,`menu`],kBe={collections:`contents`,assets:`assets`},ABe=(e,t)=>{let{pageName:n}=e.match(`^\\/(?<pageName>${t.join(`|`)})(?=\\/|$)`)?.groups??{};return n?OBe.includes(n)&&e!==`/${n}`?{notFound:!0}:{pageName:n,searchMode:n===`search`?void 0:kBe[n]??null}:e===`/`?{redirect:`#/collections`}:{notFound:!0}},S0=(e,{returnTo:t,...n}={})=>{let r=`backwards`;if(window.navigation?.currentEntry){let{index:i}=window.navigation.currentEntry,{sameDocument:a,url:o}=window.navigation.entries()[i-1]??{},s=o?m0(o).path:void 0;a&&s!==void 0&&(s===Ul(e)||t?.(s))?y0(r,()=>{window.navigation.back()}):x0(e,{...n,transitionType:r})}else window.history.state?.from?y0(r,()=>{window.history.back()}):x0(e,{...n,transitionType:r})},jBe=({collectionName:e,dirPath:t=``})=>e===`_singletons`?`/collections`:t?Kl(`/collections/${e}/filter/${t}`):`/collections/${e}`,C0=()=>{let{display_url:e,_siteURL:t}=Dl.current;Tq(e||t||`/`)},MBe=`200px 0px`,w0=200,T0=-1/0,E0=!1,NBe=()=>{E0||(E0=!0,globalThis.addEventListener(`scroll`,()=>{T0=performance.now()},{capture:!0,passive:!0}))},D0=(e,t)=>{if(!(`IntersectionObserver`in globalThis))return Bx(e,t);NBe();let n,r=zx(e,i=>{r(),i&&performance.now()-T0>w0?t():n=Bx(e,t,{delay:w0,rootMargin:MBe})});return()=>{r(),n?.()}},PBe=()=>{let e=[],t,n,r=!1,i,a,o=t=>{t&&!e.includes(t)&&e.push(t)},s=t=>{let n=t?e.indexOf(t):-1;n>-1&&(e.splice(n,1),uZ(t))},c=()=>{i?.(),i=void 0};return{get destroyed(){return r},trackAsset:e=>{n=e},ownURL:o,settleLookup:({url:e,failed:n,thumbnail:r})=>{let i=t,a=n?i:e;return t=a,r&&o(a),i!==a&&s(i),a},waitForThumbnail:e=>new Promise(t=>{a?.(),a=D0(e,()=>{a=void 0,t()})}),holdTransition:()=>{c();let{promise:e,resolve:t}=Promise.withResolvers();i=t,SBe(e)},releaseTransition:c,destroy:t=>{r=!0,c(),n&&dZ(n),e.splice(0).forEach(e=>{uZ(e)}),t&&Lx(t),a?.()}}},O0=!1,FBe=()=>{O0=!1,Pi()},IBe=()=>{O0||(O0=!0,queueMicrotask(FBe))},LBe=new Set([`$$slots`,`$$events`,`$$legacy`,`kind`,`loading`,`asset`,`src`,`variant`,`blurBackground`,`cover`,`checkerboard`,`dissolve`,`alt`,`controls`,`holdTransition`,`onError`]),RBe=B(`<img/>`),zBe=B(`<video></video>`,2),BBe=B(`<audio></audio>`),VBe=B(`<div role="none" class="blur svelte-1yaifwd"><div role="status" class="overlay svelte-1yaifwd"><!></div> <img role="none" loading="lazy" alt=""/></div>`),HBe=B(`<div role="none"><!> <!></div>`),UBe={hash:`svelte-1yaifwd`,code:`.preview.svelte-1yaifwd {display:inline-flex;align-items:center;justify-content:center;position:relative;width:100%;height:100%;&.tile {border-width:1px;border-style:solid;border-color:transparent;padding:var(--tile-padding, 12px);.sui.icon {font-size:48px;}}&.icon {border-radius:var(--sui-control-medium-border-radius);width:var(--icon-size, 32px);height:var(--icon-size, 32px);}&:is(.tile:where(.svelte-1yaifwd), .icon:where(.svelte-1yaifwd)) {overflow:hidden;aspect-ratio:1 / 1;img:where(.svelte-1yaifwd) {
/* Prevent the image from being dragged */pointer-events:none;}}.blur:where(.svelte-1yaifwd) {display:contents;& > :where(.svelte-1yaifwd) {position:absolute;inset:0;pointer-events:none;}.overlay:where(.svelte-1yaifwd) {display:flex;justify-content:center;align-items:center;z-index:-1;backdrop-filter:blur(32px) brightness(0.8);}img:where(.svelte-1yaifwd) {width:100%;height:100%;z-index:-2;object-fit:cover;transform:scale(1.2);&.loaded {opacity:1;}}}&.cover {padding:0;& > :is(img, video) {flex:auto;}}& > :is(img, video) {flex:0;max-width:100%;max-height:100%;}&.dissolve {:is(img, video) {opacity:0;transition:opacity 250ms;}&.loaded {:is(img, video) {opacity:1;}}}}
/* prettier-ignore */.checkerboard.svelte-1yaifwd img:where(.svelte-1yaifwd) {
/* hardcoded, the same color as the checkerboard in Photoshop */background-image:linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%),
linear-gradient(45deg, #ccc 25%, #fff 25%, #fff 75%, #ccc 75%);background-size:8px 8px;background-position:0 0, 4px 4px;}.svelte-1yaifwd:not(.checkerboard) img:where(.svelte-1yaifwd) {
/* hardcoded, the same color as the transparent image preview in Chrome and Firefox */background-color:#e5e5e5;}:is(img, video) {object-fit:contain;&:not([src]) {visibility:hidden;}}.cover.svelte-1yaifwd :is(img, video) {object-fit:cover;aspect-ratio:1 / 1;}`};function k0(e,t){O(t,!0),K(e,UBe);let n=J(t,`loading`,3,`lazy`),r=J(t,`asset`,3,void 0),i=J(t,`src`,3,void 0),a=J(t,`variant`,3,void 0),o=J(t,`blurBackground`,3,!1),s=J(t,`cover`,3,!1),c=J(t,`checkerboard`,3,!1),l=J(t,`dissolve`,3,!0),u=J(t,`alt`,3,``),d=J(t,`controls`,3,!1),f=J(t,`holdTransition`,3,!1),p=J(t,`onError`,3,()=>void 0),m=vs(t,LBe),h=j(void 0),g=A(()=>r()??i()),_=j(void 0),v=j(void 0),y=A(()=>!!z(g)&&z(_)===z(g)),b=A(()=>!!z(g)&&z(v)===z(g)),x=j(void 0),S=A(()=>(r(),i())),C=j(void 0),w=A(()=>!!r()&&!!a()&&!d()),T=A(()=>t.kind===`image`||!!r()&&yp(r().name)||z(w)&&vp.includes(t.kind)),ee=Zv(),E=PBe(),te=async()=>{if(!r()||!z(h))return;let e=ee.next(),t=r(),i=z(w);n()===`lazy`&&(i?await E.waitForThumbnail(z(h)):await Vx(z(h)));let a,s=!1;try{a=i?await aZ(t):await $X(t)}catch{s=!0}if(E.destroyed){uZ(a);return}if(!e()){i&&uZ(a);return}s?M(_,t):M(S,a);let c=E.settleLookup({url:a,failed:s,thumbnail:i});o()&&!z(x)&&c&&M(x,c,!0),IBe()},ne=async()=>{if(!z(h)||!z(C))return;let e=z(h).getAttribute(`src`)===z(C)&&(z(T)?z(h).complete:!!z(h).readyState),t=z(g),n=z(C);if(!e){let e=await new Promise(e=>{z(h)?.addEventListener(z(T)?`load`:`loadedmetadata`,()=>e(!1),{once:!0}),z(h)?.addEventListener(`error`,()=>e(!0),{once:!0})});if(z(C)!==n)return;if(e){M(_,t);return}}E.releaseTransition(),z(h)&&(l()&&await Vx(z(h)),M(v,t))};L(()=>{o()&&r()&&!z(x)&&(async()=>{let e=await aZ(r(),{cacheOnly:!0});E.destroyed?uZ(e):e&&(M(x,e,!0),E.ownURL(e))})()}),L(()=>{o()&&!r()&&t.kind===`image`&&z(S)&&M(x,z(S),!0)}),L(()=>{E.trackAsset(r())}),L(()=>{f()&&z(g)&&E.holdTransition()}),L(()=>{z(y)&&(E.releaseTransition(),eo(()=>p()()))}),L(()=>{z(h)&&r()&&te()}),cl(()=>{if(r()||!z(S)||!z(h)||n()!==`lazy`){M(C,z(S),!0);return}M(C,void 0);let e=z(S),t=z(h);return(async()=>(await Vx(t),e))()},e=>{M(C,e,!0)}),L(()=>{z(h)&&z(C)&&ne()}),So(()=>()=>{E.destroy(z(h))});var re=HBe();let ie;var ae=N(re),oe=e=>{gx(e,{name:`draft`})},se=e=>{var t=RBe();fs(t,()=>({loading:n(),src:z(C),alt:u(),...m}),void 0,void 0,void 0,`svelte-1yaifwd`),gs(t,e=>M(h,e),()=>z(h)),pte(t),U(e,t)},ce=e=>{var t=zBe();fs(t,()=>({src:z(C),controls:d()||void 0,playsinline:!0,...m}),void 0,void 0,void 0,`svelte-1yaifwd`),gs(t,e=>M(h,e),()=>z(h)),U(e,t)},le=e=>{var t=H(),n=P(t),r=e=>{var t=BBe();fs(t,()=>({src:z(C),controls:!0,playsinline:!0,...m}),void 0,void 0,void 0,`svelte-1yaifwd`),gs(t,e=>M(h,e),()=>z(h)),U(e,t)},i=e=>{gx(e,{name:`audio_file`})};G(n,e=>{d()?e(r):e(i,-1)}),U(e,t)},ue=e=>{gx(e,{name:`draft`})};G(ae,e=>{z(y)?e(oe):z(T)?e(se,1):t.kind===`video`?e(ce,2):t.kind===`audio`?e(le,3):e(ue,-1)});var de=I(ae,2),fe=e=>{var t=VBe(),n=N(t),r=N(n),i=e=>{var t=V();R(e=>W(t,e),[()=>Y(`loading`)]),U(e,t)};G(r,e=>{!z(w)&&!z(b)&&e(i)}),D(n);var a=I(n,2);let o;D(t),R(()=>{q(a,`src`,z(x)),o=$o(a,1,`svelte-1yaifwd`,null,o,{loaded:!!z(x)})}),U(e,t)};G(de,e=>{o()&&e(fe)}),D(re),R(()=>ie=$o(re,1,`preview ${a()??``}`,`svelte-1yaifwd`,ie,{cover:s(),checkerboard:c(),dissolve:l(),loaded:z(b)})),U(e,re),k()}var WBe=({serviceId:e,compatibleAPI:t,authType:n})=>{let r=Y(`cloud_storage.auth.${n}.key_label`),i=t?Y(`cloud_storage.${t}.auth_key_label`,{default:r}):r;return Y(`cloud_storage.${e}.auth_key_label`,{default:i})},A0=(e,{service:t,developerURL:n,apiKeyURL:r})=>dt(Y(e,{values:{service:t,homeHref:`href="${n}"`,apiKeyHref:`href="${r}"`}}).replace(/[\u2068\u2069]/g,``),qu),j0=(e,t)=>{yu.apiKeys??={},yu.apiKeys[e]=t},M0=(e,t,n)=>{let r=t.trim();if(n?.test(r))return j0(e,r),r},GBe=B(`<p role="alert" class="error svelte-6ieow"> </p>`),KBe=B(`<div role="none" class="input-outer svelte-6ieow"><!></div>`),qBe=B(`<div role="none" class="input-outer svelte-6ieow"><!></div> <div role="none" class="input-outer svelte-6ieow"><!></div> <div role="none" class="input-outer svelte-6ieow"><!></div>`,1),JBe=B(`<!> <p role="alert" class="svelte-6ieow"><!> <!></p> <!> <!>`,1),YBe={hash:`svelte-6ieow`,code:`p.svelte-6ieow {margin:0 0 8px;&.error {color:var(--sui-error-foreground-color);}}.input-outer.svelte-6ieow {width:400px;max-width:100%;text-align:center;}`};function N0(e,t){O(t,!0),K(e,YBe);let n=J(t,`error`,3,void 0),r=J(t,`onAuth`,3,void 0),i=A(()=>Tr(t.serviceProps.serviceType,`stock_assets`)),a=A(()=>Tr(t.serviceProps.serviceId,``)),o=A(()=>Tr(t.serviceProps.serviceLabel,``)),s=A(()=>Tr(t.serviceProps.authType,`api_key`)),c=A(()=>t.serviceProps.compatibleAPI),l=A(()=>Tr(t.serviceProps.developerURL,``)),u=A(()=>Tr(t.serviceProps.apiKeyURL,``)),d=A(()=>t.serviceProps.apiKeyPattern),f=A(()=>t.serviceProps.signIn),p=A(()=>z(i)===`stock_assets`),m=Xi({userName:``,password:``}),h=j(`initial`);dH(e,{children:(e,t)=>{var g=JBe(),_=P(g),v=e=>{var t=GBe(),r=F(t,!0);R(()=>W(r,n())),U(e,t)};G(_,e=>{n()&&e(v)});var y=I(_,2),b=N(y),x=e=>{var t=H();Lo(P(t),()=>A0(`prefs.media.stock_photos.description`,{service:z(o),developerURL:z(l),apiKeyURL:z(u)})),U(e,t)};G(b,e=>{z(p)&&e(x)});var S=I(b,2),C=e=>{var t=H();Lo(P(t),()=>dt(Y(`cloud_storage.${z(a)}.auth.${z(h)}`,{default:Y(`cloud_storage.auth.${z(s)}.${z(h)}`,{values:{service:z(o),key:WBe({serviceId:z(a),compatibleAPI:z(c),authType:z(s)})}})}),qu)),U(e,t)};G(S,e=>{z(i)===`cloud_storage`&&e(C)}),D(y);var w=I(y,2),T=e=>{var t=KBe(),n=N(t);{let e=A(()=>Y(`prefs.media.stock_photos.field_label`,{values:{service:z(o)}}));NS(n,{dir:`ltr`,flex:!0,monospace:!0,spellcheck:`false`,get ariaLabel(){return z(e)},oninput:e=>{let{value:t}=e.target;M0(z(a),t,z(d))!==void 0&&r()?.()}})}D(t),U(e,t)};G(w,e=>{z(s)===`api_key`&&e(T)});var ee=I(w,2),E=e=>{var t=qBe(),n=P(t),i=N(n);{let e=A(()=>Y(`username`)),t=A(()=>z(h)===`requested`);NS(i,{dir:`ltr`,flex:!0,spellcheck:`false`,get ariaLabel(){return z(e)},get disabled(){return z(t)},get value(){return m.userName},set value(e){m.userName=e}})}D(n);var o=I(n,2),s=N(o);{let e=A(()=>Y(`password`)),t=A(()=>z(h)===`requested`);sH(s,{get ariaLabel(){return z(e)},get disabled(){return z(t)},get value(){return m.password},set value(e){m.password=e}})}D(o);var c=I(o,2),l=N(c);{let e=A(()=>Y(`sign_in`)),t=A(()=>!m.userName||!m.password||z(h)===`requested`);Xx(l,{variant:`secondary`,get label(){return z(e)},get disabled(){return z(t)},onclick:async()=>{M(h,`requested`),m.userName=m.userName.trim(),m.password=m.password.trim(),await z(f)?.(m.userName,m.password)?(M(h,`success`),yu.logins??={},yu.logins[z(a)]=[m.userName,m.password].join(` `),r()?.()):M(h,`error`)}})}D(c),U(e,t)};G(ee,e=>{z(s)===`password`&&e(E)}),U(e,g)},$$slots:{default:!0}}),k()}var XBe=new Set([`$$slots`,`$$events`,`$$legacy`]);function P0(e,t){let n=vs(t,XBe);k0(e,ys({kind:`image`},()=>n))}function F0(e,t){O(t,!0);let n=J(t,`variant`,3,void 0),r=J(t,`size`,3,`small`),i=J(t,`disabled`,3,!1),a=J(t,`hidden`,3,!1),o=J(t,`onclick`,3,void 0);{let t=e=>{gx(e,{name:`close`})},s=A(()=>Y(`remove`));Xx(e,{get variant(){return n()},get size(){return r()},iconic:!0,get disabled(){return i()},get hidden(){return a()},get"aria-label"(){return z(s)},get onclick(){return o()},startIcon:t,$$slots:{startIcon:!0}})}k()}var ZBe=new Map,I0=e=>{let t=Ec.current,n=Nl(ZBe,t,()=>new Intl.NumberFormat(t,{maximumFractionDigits:1})),r=1e3,i=r*1e3,a=i*1e3,o=a*1e3;return e<r?Y(`file_size_units.b`,{values:{size:n.format(e)}}):e<i?Y(`file_size_units.kb`,{values:{size:n.format(e/r)}}):e<a?Y(`file_size_units.mb`,{values:{size:n.format(e/i)}}):e<o?Y(`file_size_units.gb`,{values:{size:n.format(e/a)}}):Y(`file_size_units.tb`,{values:{size:n.format(e/o)}})},L0=(e,{fallback:t}={})=>{let n=Uc(e).extension?.toLowerCase()??``;return Y(`file_type_labels.${n}`,{default:t??n.toUpperCase()})},QBe=B(`<span role="none" class="image svelte-lbhi1w"><!></span>`),$Be=B(`<bdi> </bdi> · <bdi> </bdi>`,1),eVe=B(`<div role="listitem" class="file svelte-lbhi1w"><!> <div role="none" class="info svelte-lbhi1w"><div role="none" class="name"><!></div> <div role="none" class="meta svelte-lbhi1w"><!> <!></div></div> <!></div>`),tVe=B(`<div role="list" class="files svelte-lbhi1w"></div>`),nVe={hash:`svelte-lbhi1w`,code:`.files.svelte-lbhi1w {display:flex;flex-direction:column;gap:16px;margin:0 8px;}.file.svelte-lbhi1w {display:flex;align-items:center;gap:16px;overflow:hidden;.preview {flex:none;}.image:where(.svelte-lbhi1w) {flex:none;display:flex;justify-content:center;align-items:center;width:40px;height:40px;aspect-ratio:1 / 1;object-fit:cover;border-radius:var(--sui-control-medium-border-radius);background-color:var(--sui-tertiary-background-color);}.info:where(.svelte-lbhi1w) {flex:auto;display:flex;flex-direction:column;gap:4px;overflow:hidden;text-align:start;.meta:where(.svelte-lbhi1w) {font-size:var(--sui-font-size-small);color:var(--sui-secondary-foreground-color);}}}`};function R0(e,t){O(t,!0),K(e,nVe);let n=J(t,`files`,31,()=>Xi([])),r=J(t,`transformedFileMap`,3,void 0),i=J(t,`removable`,3,!0),a=J(t,`showThumbnail`,3,!0),o=new Map,s=e=>{let t=o.get(e);return t===void 0&&(t=URL.createObjectURL(e),o.set(e,t)),t};L(()=>{let e=new Set(n());o.forEach((t,n)=>{e.has(n)||(URL.revokeObjectURL(t),o.delete(n))})}),Co(()=>{o.forEach(e=>URL.revokeObjectURL(e)),o.clear()});var c=tVe();No(c,23,n,(e,t)=>`${e.name}-${t}`,(e,t,o)=>{var c=H();Do(P(c),Iu,null,e=>{let c=A(()=>z(t)),l=A(()=>r()?.get(z(t)));var u=eVe(),d=N(u),f=e=>{{let n=A(()=>s(z(t)));P0(e,{get src(){return z(n)},variant:`icon`,checkerboard:!0})}},p=A(()=>a()&&Iq.includes(z(c).type)),m=e=>{var t=QBe();gx(N(t),{name:`draft`}),D(t),U(e,t)};G(d,e=>{z(p)?e(f):e(m,-1)});var h=I(d,2),g=N(h);Nx(N(g),{children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>z(c).name.normalize()]),U(e,n)},$$slots:{default:!0}}),D(g);var _=I(g,2),v=N(_);Oo(v,()=>Ec.current,e=>{var t=$Be(),n=P(t),r=F(n,!0),i=F(I(n,2),!0);R((e,t)=>{W(r,e),W(i,t)},[()=>L0(z(c).name),()=>I0(z(c).size)]),U(e,t)});var y=I(v,2),b=e=>{var t=V();R(e=>W(t,e),[()=>Y(`file_meta_converted_from_x`,{values:{type:L0(z(l).name)}})]),U(e,t)};G(y,e=>{z(l)&&z(l).type!==z(t).type&&e(b)}),D(_),D(h);var x=I(h,2);{let e=A(()=>!i()||n().length===1);F0(x,{variant:`ghost`,size:`medium`,get hidden(){return z(e)},onclick:e=>{e.stopPropagation(),n(n().toSpliced(z(o),1))}})}D(u),U(e,u)}),U(e,c)}),D(c),U(e,c),k()}var rVe=B(`<div role="alert"><!></div>`),iVe=B(`<div role="none"><!></div> <div role="none"><!></div> <!>`,1),aVe=B(`<div role="none" class="content svelte-1hhq62q"><!> <!></div>`),oVe=B(`<div role="none" class="drop-indicator svelte-1hhq62q"><div role="none" class="svelte-1hhq62q"><!> <span role="none"> </span></div></div>`),sVe=B(`<div role="none" class="drop-target svelte-1hhq62q"><!> <!></div> <!> <!>`,1),cVe={hash:`svelte-1hhq62q`,code:`.drop-target.svelte-1hhq62q {display:flex;flex-direction:column;position:relative;overflow:hidden;height:100%;pointer-events:auto;& > .group {overflow-y:auto;padding:16px;width:100%;height:100%;}button:not(:disabled) {pointer-events:auto;}}.drop-indicator.svelte-1hhq62q {position:absolute;inset:0;z-index:10;border-radius:var(--sui-control-large-border-radius);background-color:hsl(var(--sui-background-color-4-hsl) / 80%);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);text-align:center;pointer-events:none;div:where(.svelte-1hhq62q) {position:absolute;inset:0;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:4px;border:4px dashed var(--sui-primary-accent-color);border-radius:var(--sui-control-large-border-radius);font-size:var(--sui-font-size-x-large);.icon {color:var(--sui-secondary-foreground-color);font-size:48px;}}}.content.svelte-1hhq62q {display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;overflow:auto;height:100%;min-height:320px;text-align:center;}`};function z0(e,t){O(t,!0),K(e,cVe);let n=e=>{var t=H(),n=P(t),i=e=>{var t=V();R(e=>W(t,e),[()=>Y(`dropped_image_type_mismatch`,{values:{types:x(z(v))}})]),U(e,t)},a=e=>{var t=V();R(e=>W(t,e),[()=>Y(`dropped_file_type_mismatch`,{values:{types:x(r().split(/,\s*/))}})]),U(e,t)};G(n,e=>{z(v)?e(i):e(a,-1)}),U(e,t)},r=J(t,`accept`,3,void 0),i=J(t,`disabled`,3,!1),a=J(t,`multiple`,3,!1),o=J(t,`showUploadButton`,3,!1),s=J(t,`showFilePreview`,3,!1),c=J(t,`filterDroppedFiles`,3,!0),l=J(t,`onDrop`,3,void 0),u=J(t,`children`,3,void 0),d=j(void 0),f=j(!1),p=j(!1),m=j(!1),h=j(void 0),g=j(Xi([])),_=A(()=>o()||s()&&z(g).length),v=A(()=>Rq(r())),y=()=>{z(h)?.open()},b=()=>{z(g).length&&(M(g,[],!0),l()?.({files:z(g)}))},x=e=>kf(Ec.current,{type:`disjunction`}).format(e),S=e=>{M(g,a()?e:e.slice(0,1),!0),l()?.({files:z(g)})},C=e=>{l()?.({files:e.detail.files})};So(()=>(z(d)?.addEventListener(`Select`,C),()=>{z(d)?.removeEventListener(`Select`,C)})),L(()=>{!z(_)&&z(p)&&M(m,!0)});var w={openFilePicker:y,reset:b},T=sVe(),ee=P(T),E=N(ee),te=e=>{var t=aVe(),r=N(t),c=e=>{var t=iVe(),r=P(t),o=N(r),s=e=>{var t=V();R(e=>W(t,e),[()=>Y(`drop_files_or_click_to_browse`,{values:{count:a()?2:1}})]),U(e,t)},c=e=>{var t=V();R(e=>W(t,e),[()=>Y(`tap_to_browse`)]),U(e,t)};G(o,e=>{PY.hasMouse?e(s):e(c,-1)}),D(r);var l=I(r,2),u=N(l);{let e=e=>{gx(e,{name:`cloud_upload`})},t=A(()=>Y(`choose_files`,{values:{count:a()?2:1}}));Xx(u,{variant:`primary`,get label(){return z(t)},get disabled(){return i()},onclick:()=>{y()},startIcon:e,$$slots:{startIcon:!0}})}D(l);var d=I(l,2),f=e=>{var t=rVe(),r=N(t);n(r),D(t),U(e,t)};G(d,e=>{z(p)&&e(f)}),U(e,t)};G(r,e=>{o()&&e(c)});var l=I(r,2),u=e=>{R0(e,{get files(){return z(g)},set files(e){M(g,e,!0)}})};G(l,e=>{s()&&z(g).length&&e(u)}),D(t),U(e,t)},ne=e=>{var t=H();xo(P(t),()=>u()??Cr),U(e,t)};G(E,e=>{z(_)?e(te):e(ne,-1)});var re=I(E,2),ie=e=>{var t=oVe(),n=N(t),r=N(n);gx(r,{name:`download`});var i=F(I(r,2),!0);D(n),D(t),R(e=>W(i,e),[()=>Y(`drop_files_here`,{values:{count:a()?2:1}})]),U(e,t)};G(re,e=>{z(f)&&e(ie)}),D(ee),gs(ee,e=>M(d,e),()=>z(d));var ae=I(ee,2);gs(RS(ae,{get accept(){return r()},get multiple(){return a()},onSelect:({files:e})=>{S(e)}}),e=>M(h,e,!0),()=>z(h));var oe=I(ae,2),se=e=>{{let t=A(()=>Y(`unsupported_file_type`));CS(e,{get title(){return z(t)},get open(){return z(m)},set open(e){M(m,e,!0)},children:(e,t)=>{n(e)},$$slots:{default:!0}})}};return G(oe,e=>{z(_)||e(se)}),oo(`dragover`,ee,e=>{e.preventDefault(),!i()&&e.dataTransfer&&(e.dataTransfer.dropEffect=`copy`,M(f,!0),M(p,!1))}),oo(`dragleave`,ee,e=>{e.preventDefault(),i()||M(f,!1)}),oo(`dragend`,ee,e=>{e.preventDefault(),i()||M(f,!1)}),oo(`drop`,ee,async e=>{if(e.preventDefault(),i()||!e.dataTransfer)return;M(f,!1);let t=Array.from(e.dataTransfer.items).some(({kind:e})=>e===`file`),n=await mre(e.dataTransfer,{accept:c()?r():void 0});n.length?S(n):c()&&r()&&t&&M(p,!0)}),U(e,T),k(w)}var B0=(e,t=Cr)=>{var n=uVe();No(n,23,t,(e,t)=>`${e}-${t}`,(e,t)=>{var n=lVe(),r=F(n,!0);R(()=>W(r,z(t))),U(e,n)}),D(n),U(e,n)},lVe=B(`<li class="svelte-1luofoe"> </li>`),uVe=B(`<ul class="filenames svelte-1luofoe"></ul>`),V0=B(`<div class="svelte-1luofoe"> </div> <!>`,1),dVe=B(`<div class="svelte-1luofoe"><!></div> <!>`,1),fVe=B(`<!> <!> <!>`,1),pVe={hash:`svelte-1luofoe`,code:`div.svelte-1luofoe:not(:first-child) {margin-top:8px;}.filenames.svelte-1luofoe {border-radius:var(--sui-control-medium-border-radius);padding:12px;background-color:var(--sui-tertiary-background-color);font-size:var(--sui-font-size-default);}ul.svelte-1luofoe {margin:8px 0 0;padding:0;list-style:none;}li.svelte-1luofoe {margin:0;padding:0;}`};function H0(e,t){O(t,!0),K(e,pVe);let n=J(t,`accept`,3,void 0),r=j(!1),i=j([]),a=j([]),o=j([]),s=e=>{let{mismatchedFileNames:t=[]}=e;(e.oversizedFileNames.length||e.invalidFileNames.length||t.length)&&(M(i,e.oversizedFileNames),M(a,e.invalidFileNames),M(o,t),M(r,!0))},c=A(()=>[z(i),z(a),z(o)].filter(e=>e.length).length>1?Y(`assets_dialog.rejected_files.title`):z(o).length?Y(`unsupported_file_type`):z(a).length?Y(`assets_dialog.invalid_file.title`):Y(`assets_dialog.large_file.title`)),l=A(()=>Rq(n())),u=e=>kf(Ec.current,{type:`disjunction`}).format(e);var d={report:s};return CS(e,{get title(){return z(c)},get open(){return z(r)},set open(e){M(r,e,!0)},children:(e,r)=>{var s=fVe(),c=P(s),d=e=>{var n=V0(),r=P(n),a=F(r,!0);B0(I(r,2),()=>z(i)),R(e=>W(a,e),[()=>Y(`warning_oversized_files`,{values:{count:z(i).length,size:I0(t.maxSize)}})]),U(e,n)};G(c,e=>{z(i).length&&e(d)});var f=I(c,2),p=e=>{var t=V0(),n=P(t),r=F(n,!0);B0(I(n,2),()=>z(a)),R(e=>W(r,e),[()=>Y(`warning_invalid_files`,{values:{count:z(a).length}})]),U(e,t)};G(f,e=>{z(a).length&&e(p)});var m=I(f,2),h=e=>{var t=dVe(),r=P(t),i=N(r),a=e=>{var t=V();R(e=>W(t,e),[()=>Y(`warning_unsupported_image_files`,{values:{count:z(o).length,types:u(z(l))}})]),U(e,t)},s=e=>{var t=V();R(e=>W(t,e),[()=>Y(`warning_unsupported_files`,{values:{count:z(o).length,types:u(n().split(/,\s*/))}})]),U(e,t)};G(i,e=>{z(l)?e(a):e(s,-1)}),D(r),B0(I(r,2),()=>z(o)),U(e,t)};G(m,e=>{z(o).length&&e(h)}),U(e,s)},$$slots:{default:!0}}),k(d)}var U0=({name:e,serviceLabel:t,url:n})=>`<a href="${Gu(n)}">Photo by ${Ku(e)} on ${t}</a>`,mVe=({name:e,profileURL:t,serviceLabel:n,serviceURL:r})=>`Photo by <a href="${Gu(t)}">${Ku(e)}</a> on <a href="${Gu(r)}">${n}</a>`,hVe=new RegExp([String.raw`\s*(?:`,String.raw`Photo by <a\s[^>]*>[^<]*<\/a> on <a\s[^>]*>[^<]*<\/a>`,String.raw`|<a\s[^>]*>Photo by [^<]* on [^<]*<\/a>`,String.raw`)\s*`].join(``),`g`),gVe=e=>e.replace(hVe,` `).trim(),W0=(e,t)=>{let n=Ec.current.toLowerCase(),[r]=n.split(`-`),i=mG(n);return e.find(e=>e.toLowerCase()===n)??(i?e.find(e=>mG(e)===i):void 0)??e.find(e=>e.split(`-`)[0]===r)??t},G0=async(e,t)=>{let n=t?await fetch(e,t):await fetch(e);if(!n.ok)throw Error(`Failed to fetch ${e}: ${n.status}`);return n.json()},_Ve=async({maxPages:e,fetchPage:t,parsePage:n})=>RQ(async e=>{let r=e??1,{results:i,hasMore:a}=n(await t(r),r);return{results:i,next:a?r+1:void 0}},{maxPages:e}),K0=({listURL:e,searchURL:t,getHeaders:n,getListParams:r,getSearchParams:i,listKey:a,searchKey:o,maxPages:s,hasMore:c,parseResults:l})=>{let u=(e,t,r)=>G0(`${e}?${t}`,n&&{headers:n(r)});return{list:async({apiKey:t})=>{let n=await u(e,new URLSearchParams(r(t)),t);return l(a?n[a]:n)},search:async(e,{apiKey:n})=>{let r=new URLSearchParams(i(e,n));return l(c?await _Ve({maxPages:s,fetchPage:e=>(r.set(`page`,String(e)),u(t,r,n)),parsePage:(e,t)=>({results:e[o],hasMore:c(e,t)})}):(await u(t,r,n))[o])}}},vVe=`en-US,pt-BR,es-ES,ca-ES,de-DE,it-IT,fr-FR,sv-SE,id-ID,pl-PL,ja-JP,zh-TW,zh-CN,ko-KR,th-TH,nl-NL,hu-HU,vi-VN,cs-CZ,da-DK,fi-FI,uk-UA,el-GR,ro-RO,nb-NO,sk-SK,tr-TR,ru-RU`.split(`,`),q0=`https://api.pexels.com/v1`,J0={per_page:80},yVe=/\/photo\/(?<alt>.+?)-\d+\/$/,bVe=()=>W0(vVe,`en-US`),{list:xVe,search:SVe}=K0({listURL:`${q0}/curated`,searchURL:`${q0}/search`,getHeaders:e=>({Authorization:e}),getListParams:()=>J0,getSearchParams:e=>({...J0,query:e,locale:bVe()}),listKey:`photos`,searchKey:`photos`,maxPages:2,hasMore:({next_page:e})=>!!e,parseResults:e=>e.map(({id:e,url:t,alt:n,src:{large2x:r,medium:i},photographer:a})=>({id:String(e),description:t.match(yVe)?.groups?.alt.replace(/-/g,` `)??n,previewURL:i,downloadURL:r,fileName:`pexels-${a.split(/\s+/).join(`-`).toLowerCase()}-${e}.jpg`,kind:`image`,credit:U0({name:a,serviceLabel:`Pexels`,url:t})}))}),CVe={serviceType:`stock_assets`,serviceId:`pexels`,serviceLabel:`Pexels`,serviceURL:`https://www.pexels.com/`,showServiceLink:!0,hotlinking:!1,authType:`api_key`,developerURL:`https://www.pexels.com/api/`,apiKeyURL:`https://www.pexels.com/api/new/`,apiKeyPattern:/^[a-zA-Z\d]{56}$/,list:xVe,search:SVe},wVe=`https://picsum.photos/v2/list`,TVe=100,EVe=10,DVe=3,OVe=e=>e.map(({id:e,width:t,height:n})=>{let r=t>=n,[i,a]=r?[1920,1280]:[1280,1920],[o,s]=r?[480,320]:[320,480];return{id:e,description:``,previewURL:`https://picsum.photos/id/${e}/${o}/${s}.webp`,downloadURL:`https://picsum.photos/id/${e}/${i}/${a}.webp`,fileName:`picsum-${e}.webp`,kind:`image`}}),kVe={serviceType:`stock_assets`,serviceId:`picsum`,serviceLabel:`Lorem Picsum`,serviceURL:`https://picsum.photos/`,showServiceLink:!0,hotlinking:!0,authType:`none`,list:async()=>{let e=Array.from({length:EVe},(e,t)=>t+1).sort(()=>Math.random()-.5).slice(0,DVe);return OVe((await Promise.all(e.map(e=>G0(`${wVe}?page=${e}&limit=${TVe}`)))).flat().sort(()=>Math.random()-.5))}},AVe=`cs,da,de,en,es,fr,id,it,hu,nl,no,pl,pt,ro,sk,fi,sv,tr,vi,th,bg,ru,el,ja,ko,zh`.split(`,`),Y0=`https://pixabay.com/api`,X0={image_type:`photo`,min_width:1280,safesearch:!0,per_page:150},jVe=e=>e.map(({id:e,webformatURL:t,previewURL:n,largeImageURL:r,imageWidth:i,imageHeight:a,pageURL:o,tags:s,user:c})=>({id:String(e),description:s,previewURL:t.replace(`_640.`,i>a?`_180.`:`_340.`),downloadURL:r,fileName:tu(n).replace(`_150.`,`_1280.`),kind:`image`,credit:U0({name:c,serviceLabel:`Pixabay`,url:o})})),Z0=()=>W0(AVe,`en`),{list:MVe,search:NVe}=K0({listURL:`${Y0}/`,searchURL:`${Y0}/`,getListParams:e=>({...X0,key:e,lang:Z0(),editors_choice:`true`}),getSearchParams:(e,t)=>({...X0,key:t,lang:Z0(),q:e}),listKey:`hits`,searchKey:`hits`,parseResults:jVe}),PVe={serviceType:`stock_assets`,serviceId:`pixabay`,serviceLabel:`Pixabay`,serviceURL:`https://pixabay.com/`,showServiceLink:!0,hotlinking:!1,authType:`api_key`,developerURL:`https://pixabay.com/service/about/api/`,apiKeyURL:`https://pixabay.com/api/docs/#api_key`,apiKeyPattern:/^\d+-[a-f\d]{25}$/,list:MVe,search:NVe},FVe=`af,sq,am,ar,hy,as,az,bn,ba,eu,bs,bg,yue,ca,lzh,zh-Hans,zh-Hant,hr,cs,da,prs,dv,nl,en,et,fo,fj,fil,fi,fr,fr-ca,gl,ka,de,el,gu,ht,he,hi,mww,hu,is,id,ikt,iu,iu-Latn,ga,it,ja,kn,kk,km,ko,ku,kmr,ky,lo,lv,lt,mk,mg,ms,ml,mt,mi,mr,mn-Cyrl,mn-Mong,my,ne,nb,or,ps,fa,pl,pt,pt-pt,pa,otq,ro,ru,sm,sr-Cyrl,sr-Latn,sk,sl,so,es,sw,sv,ty,ta,tt,te,th,bo,ti,to,tr,tk,uk,hsb,ur,ug,uz,vi,cy,yua,zu`.split(`,`),Q0=`https://api.unsplash.com`,$0=`utm_source=sveltia-cms&utm_medium=referral`,e2={per_page:30},IVe=()=>W0(FVe,`en`),LVe=e=>e.map(({id:e,description:t,alt_description:n,urls:{regular:r,thumb:i},user:{username:a,name:o},links:s})=>({id:String(e),description:[t,n].filter(Boolean).join(` — `),previewURL:i,downloadURL:r,fileName:`${o.split(/\s+/).join(`-`).toLowerCase()}-${e}-unsplash.jpg`,kind:`image`,credit:mVe({name:o,profileURL:`https://unsplash.com/@${a}?${$0}`,serviceLabel:`Unsplash`,serviceURL:`https://unsplash.com/?${$0}`}),downloadTrackingURL:s?.download_location})),t2=e=>({Authorization:`Client-ID ${e}`}),{list:RVe,search:zVe}=K0({listURL:`${Q0}/photos`,searchURL:`${Q0}/search/photos`,getHeaders:t2,getListParams:()=>e2,getSearchParams:e=>({...e2,query:e,lang:IVe()}),searchKey:`results`,maxPages:5,hasMore:({total_pages:e},t)=>t<e,parseResults:LVe}),n2={pexels:CVe,picsum:kVe,pixabay:PVe,unsplash:{serviceType:`stock_assets`,serviceId:`unsplash`,serviceLabel:`Unsplash`,serviceURL:`https://unsplash.com/`,showServiceLink:!0,hotlinking:!0,authType:`api_key`,developerURL:`https://unsplash.com/developers`,apiKeyURL:`https://unsplash.com/oauth/applications`,apiKeyPattern:/^[a-zA-Z\d_-]{40,}$/,list:RVe,search:zVe,trackDownload:async({downloadTrackingURL:e},{apiKey:t})=>{if(e)try{await G0(e,{headers:t2(t)})}catch(e){console.error(e)}}}},r2=({fieldConfig:e}={})=>{let t=jq({libraryName:`stock_assets`,fieldConfig:e});if(t===!1)return{providers:[]};let n=Object.keys(n2),{providers:r}=t;return{providers:Array.isArray(r)?r:n}},i2=(e,t)=>{let n=e[1].serviceLabel.toLowerCase(),r=t[1].serviceLabel.toLowerCase();return n.localeCompare(r)},a2=({folder:e,enabled:t},n)=>t&&(!n||dJ(e)),BVe=({assetLibraryFolderMap:e,isDefaultLibraryEnabled:t,selectFolder:n})=>{if(!t)return;let r=Object.entries(e).find(([,e])=>a2(e,n))?.[0];return r?`default-${r}`:void 0},VVe=({assetLibraryFolderMap:e,isDefaultLibraryEnabled:t,selectFolder:n,hasPendingFiles:r,cloudServiceEntries:i,externalServiceEntries:a})=>{let o=BVe({assetLibraryFolderMap:e,isDefaultLibraryEnabled:t,selectFolder:n});if(o)return o;let[s]=(r?i[0]:void 0)??a[0]??[``];return s},HVe=({fieldConfig:e,selectFolder:t,isDefaultLibraryEnabled:n})=>{if(t)return[];let{providers:r=[]}=r2({fieldConfig:e});return Object.entries(n2).filter(([e,{hotlinking:t}])=>r.includes(e)&&(t||n)).sort(i2)},UVe=({selectFolder:e,browsingSubfolders:t,folder:n,basePath:r,subfolderPath:i,selectedSubfolderPaths:a})=>{if(!e||!t)return[];let o=a.length?a.map(e=>fJ(e,r)):[i],s=n;return o.map(e=>XLe({folder:s,subfolderPath:e}))},WVe=({path:e},t)=>t===void 0?``:eu(fJ(e,t)),GVe=({resources:e,targetFolderPath:t})=>e.map(e=>{let{asset:n,replace:r}=e;return n?.unsaved?{file:n.file,folder:Yr(n.folder),subfolderPath:WVe(n,t),replace:r}:Yr(e)}),o2=({resources:e,resource:t,isSame:n,multiple:r=!1})=>r?[...e.filter(e=>!n(e)),t]:[t],s2=({libraryName:e,enteredURL:t})=>{let n=e===`enter-url`?t.trim():``;return n?[{url:n}]:[]},KVe=({trackDownload:e,resources:t,assets:n,options:r})=>{e&&t.forEach(({url:t})=>{let i=t?n.get(t):void 0;i&&e(i,r).catch(()=>{})})},c2={saved:!1,moved:!1,renamed:!1,deleted:!1,folderCreated:!1,folderRenamed:!1,folderDeleted:!1,deletionPending:!1,discarded:!1,deletionCancelled:!1,alreadyPublished:!1,published:!1,count:1},l2=nl({...c2}),u2=nl({...c2}),d2=nl({pending:0,progress:``,failed:!1,failure:``}),f2=e=>{[Ap,jp].forEach(t=>{let n=t.current?e(t.current):void 0;n!==void 0&&(t.current=_Q(n))})},p2=`commit_cancelled`,m2=tl(),qVe=``,h2=e=>e?.message===p2,g2=async e=>{try{return{ok:!0,cancelled:!1,result:await e(),error:void 0}}catch(e){let t=h2(e);return t||console.error(e),{ok:!1,cancelled:t,result:void 0,error:e}}},JVe=()=>{let{current:e}=Dl,{current:t}=LX;if(!e||!t||!(t.isGit||t.name===`local`&&yu.localGitCommits))return;let{prompt_commit_messages:n}=e.backend;return n===!0||n===`prefix`||n===`suffix`?n:void 0},YVe=async({mode:e,defaultMessage:t})=>al(m2,{mode:e,defaultMessage:t,initialValue:e===!0?t:qVe},null),_2=async(e,t)=>{let n=JVe();if(!n||t.userMessage!==void 0)return t;let r=Tae(mu(e),t),i=await YVe({mode:n,defaultMessage:r});if(i===null)throw Error(p2);let a=i.trim();return n===!0?a===r&&(a=``):qVe=a,{...t,userMessage:a}},v2=[],y2=async(e,{progress:t,failure:n})=>{t&&(v2.push(t),Object.assign(d2.current,{progress:t,pending:v2.length}));let r=await g2(e);return t&&(v2.splice(v2.indexOf(t),1),d2.current.pending=v2.length,v2.length&&(d2.current.progress=v2.at(-1))),!r.ok&&!r.cancelled&&(d2.current.failed&&(d2.current.failed=!1,await Za()),Object.assign(d2.current,{failure:n,failed:!0})),r},XVe=(e,{slugificationEnabled:t=!1}={})=>({template:e,slugificationEnabled:t,randomValues:new Map,dateTimeParts:CU({timeZone:PH()})}),ZVe=({draft:e,defaultLocaleSlug:t})=>{let{collection:n,fileName:r,defaultLocale:i,currentValues:a,isIndexFile:o}=e;return{collection:n,collectionFileName:r,content:a[i],slug:t,isIndexFile:o}},QVe=({nameTemplate:{template:e,randomValues:t,dateTimeParts:n},originalName:r,collection:i,collectionFileName:a,content:o={},slug:s,isIndexFile:c=!1})=>{let{extension:l}=Uc(r),u={replaceSubContext:{collection:i,content:o,currentSlug:s,dateTimeParts:n,randomValues:t,assetFileName:r,identifierField:dW(i?._type===`entry`?i:void 0),basePath:void 0},getFieldArgs:{collectionName:i?.name??``,fileName:a,keyPath:``,valueMap:o,isIndexFile:c}},d=Qd(e,(e,t)=>gZ(t,u)).trim();return l?`${d}.${l}`:d},b2=({draft:e,item:{file:t,nameTemplate:n},defaultLocaleSlug:r})=>n?IQ(QVe({nameTemplate:n,originalName:t.name,...ZVe({draft:e,defaultLocaleSlug:r})}),{slugificationEnabled:n.slugificationEnabled}):t.name,$Ve=async(e,{convertHEIC:t=!1}={})=>{if(!Nq.includes(e.type))return!0;if(await Wq(e)===`heic`)return t;try{return(await createImageBitmap(e)).close(),!0}catch{return!1}},eHe=async(e,t)=>{if(!Nq.includes(e.type))return!0;if(await Wq(e)!==`heic`)try{if(await GLe(await cu(e)))return!0}catch{}return $Ve(e,{convertHEIC:t})},x2=async(e,{slugify_filename:t=!1,transformations:n,max_file_size:r=1/0}={},{nameTemplate:i,nameContext:a}={})=>{let o=await eHe(e,iJ(n));if(i||t){let{name:n,type:r,lastModified:o}=e,s=i?QVe({nameTemplate:XVe(i),originalName:n,...a}):n;s=IQ(s,{slugificationEnabled:t}),e=new File([e],s,{type:r,lastModified:o})}if(!o)return{file:e,originalFile:void 0,oversized:!1,invalid:!0};let s=e;if(n)try{e=await ANe(e,n)}catch{return{file:e,originalFile:void 0,oversized:!1,invalid:!0}}return{file:e,originalFile:e===s?void 0:s,oversized:e.size>r,invalid:!1}},tHe=e=>({validFiles:e.filter(({oversized:e,invalid:t})=>!e&&!t).map(({file:e})=>e),oversizedFiles:e.filter(({oversized:e,invalid:t})=>e&&!t).map(({file:e})=>e),invalidFiles:e.filter(({invalid:e})=>e).map(({file:e})=>e)}),nHe=Qv(4),S2=()=>({processing:!1,validFiles:[],oversizedFiles:[],invalidFiles:[],transformedFileMap:new WeakMap}),C2=tl(S2());ol(()=>{let e=!1,t=Mp.current.files,{config:n}=nJ();return C2.current=S2(),(async()=>{t.length&&n.transformations&&(C2.current={...S2(),processing:!0});let r=Mp.current.originalAssets?.length?void 0:n.filename_template,i=await Promise.all(t.map(t=>nHe(async()=>e?void 0:x2(t,n,{nameTemplate:r}))));if(e)return;let a=i;C2.current={processing:!1,...tHe(a),transformedFileMap:new WeakMap(a.filter(({originalFile:e})=>e!==void 0).map(({file:e,originalFile:t})=>[e,t]))}})(),()=>{e=!0}});var w2=({slug:e})=>{if(typeof e==`string`)return e;if(X(e)&&typeof e.template==`string`)return e.template},T2=e=>!!e?.includes(`{{fields._slug}}`)||!!e?.includes(`{{fields._slug | localize}}`),rHe=(e=!0)=>typeof e==`boolean`?e?[`create`,`update`]:[]:Array.isArray(e)?e:[],E2=e=>{let{slug:t,file:n}=e,r=dW(e),i=X(t)?t:{},a=w2(e),o=typeof n==`string`?[]:rHe(i.editable),s=o.includes(`update`);if(i.auto_increment===!0&&typeof n!=`string`)return{template:``,editorRequired:!1,editorValueIsSlug:!0,editable:{create:o.includes(`create`),update:s},localized:i.i18n===!0,autoIncrement:!0,hint:i.hint,pattern:i.pattern};let c=!!a?.includes(`{{fields._slug | localize}}`),l=T2(a)||o.includes(`create`),u=c||i.i18n===!0,d=a===void 0&&i.editable!==void 0&&o.includes(`create`),f=a??(d?u?`{{fields._slug | localize}}`:`{{fields._slug}}`:`{{${r}}}`),p=T2(f);return{template:f,editorRequired:p,editorValueIsSlug:!p||[`{{fields._slug}}`,`{{fields._slug | localize}}`].includes(f),editable:{create:l,update:s},localized:u,autoIncrement:!1,hint:i.hint,pattern:i.pattern}},iHe=[...Jd,...Object.keys(Xd),`slug`],aHe=e=>{let{template:t,localized:n}=E2(e),r=new Set;return ef(t).forEach(({content:e})=>{let{value:t,transformations:i}=gU(e),a=nf(t);(i.some(({method:e})=>e===`localize`)||n&&!iHe.includes(a))&&r.add(a)}),[...r]},D2=e=>{let{_i18n:{i18nEnabled:t,structureMap:n}}=e;return t&&!zf(n)&&e._type===`entry`&&(E2(e).localized||!!aHe(e).length)},O2=e=>tu(xf(e)),oHe=e=>gf(e)&&D2(e),sHe=({entries:e,dirPath:t,indexFileNames:n,locale:r})=>{let i=e.find(({subPath:e})=>n.some(n=>e===`${t}/${n}`));if(i){let e=i.locales[r]?.slug;return e&&O2(e)||void 0}let a=e.find(({subPath:e})=>e===t)?.locales[r]?.slug;return a?Uc(a).basename:void 0},k2=e=>{let{name:t}=e;return QZ(rW(t),OZ.current.filter(({workflow:e})=>e.collectionName===t))},A2=({collection:e,dirPath:t,locale:n,entries:r})=>{let i=Lc(t);if(!i||n===e._i18n.defaultLocale||!oHe(e))return i;let a=zie(e),o=a?[a]:Iie,s=r??k2(e),c=``;return i.split(`/`).map(e=>(c=c?`${c}/${e}`:e,sHe({entries:s,dirPath:c,indexFileNames:o,locale:n})??e)).join(`/`)};CH.default.extend(wH.default),CH.default.extend(TH.default),CH.default.extend(EH.default);var cHe=({dateFieldName:e,fields:t,content:n,locale:r,inSlugTimeZone:i})=>{let a=e?t.find(({widget:t,name:n})=>t===`datetime`&&n===e):t.find(({widget:e})=>e===`datetime`),o=a?n[a.name]:void 0;if(!a||!o)return;let s=a,c=aU(o,s,r);if(!qH(c))return;let{format:l,dateOnly:u,utc:d,outputUTC:f,singleCustomTimeZone:p}=BH(s);return CU(i&&!u?{date:c,timeZone:PH()}:{date:c,timeZone:d||f||u&&!l?`UTC`:u?void 0:p})},lHe=({pathTemplate:e,dateFieldName:t,fields:n,collection:r,collectionFile:i,locale:a,slug:o,entryFilePath:s,content:c,isIndexFile:l=!1})=>{let u;if(!(Eie.test(e)&&(u=cHe({dateFieldName:t,fields:n,content:c,locale:a}),!u)))try{return nQ(e,{type:`preview_path`,collection:r,collectionFile:i,content:c,locale:a,currentSlug:o,entryFilePath:s,dateTimeParts:u,isIndexFile:l})}catch{return}},uHe=({collection:e,collectionFile:t,locale:n,slug:r,path:i,content:a,defaultContent:o,isIndexFile:s=!1})=>{let{preview_path:c,preview_path_date_field:l,fields:u=[],_i18n:{defaultLocale:d,omitDefaultLocaleFromPreviewPath:f}}=t??e;if(!i||!a||!c)return;let p=s?of(e):void 0,m=c;return n===d&&f&&(m=wf(m)??m),lHe({pathTemplate:m,dateFieldName:l,fields:p?.fields??u,collection:e,collectionFile:t,locale:n,slug:r,entryFilePath:i,content:VW({getFieldArgs:{collectionName:e.name,fileName:t?.name,isIndexFile:s},locale:n,defaultLocale:d,content:a,defaultContent:o}),isIndexFile:s})},dHe=(e,t,n,r,i={})=>{let{show_preview_links:a=!0,_baseURL:o}=Dl.current??{},s=i.baseURL||o,{slug:c,path:l,content:u}=e.locales[t]??{};if(!a||!s)return;let{preview_path:d}=r??n;if(i.fallbackToRoot&&!d)return`${s.replace(/\/$/,``)}/`;let f=uHe({collection:n,collectionFile:r,locale:t,slug:c,path:l,content:u,defaultContent:e.locales[(r??n)._i18n.defaultLocale]?.content,isIndexFile:cf(n,e)});if(f!==void 0)return`${s.replace(/\/$/,``)}/${f.replace(/^\//,``)}`},fHe=(e,t)=>{let n=e.locales[t]?.path;return`${LX.current?.repository?.blobBaseURL}/${n?Kl(n):``}?plain=1`},pHe=(e,t)=>{let n={...e};return Object.entries(n).forEach(([e,r])=>{typeof r==`string`&&r.startsWith(`blob:`)&&t[r]&&(n[e]=t[r].file.name.replace(/\.[^.]+$/,``))}),n},mHe=new WeakMap,hHe=e=>Nl(mHe,e,()=>new Map),j2=({collection:e,currentPath:t},n)=>A2({collection:e,dirPath:Lc(t??``),locale:n??e._i18n.defaultLocale}),M2=(e,t)=>{let{collection:n,isNew:r,originalLocales:i}=e;if((r||t&&!i?.[t])&&bf(e)&&!vf(n))return j2(e,t)},gHe=[`date`,`publishDate`,`publish_date`],_He=e=>{let{collection:t,collectionFile:n,currentValues:r}=e,{fields:i=[],_i18n:{defaultLocale:a}}=n??t,o=i.find(({widget:e,name:t})=>e===`datetime`&&gHe.includes(t))?.name;if(o)return cHe({dateFieldName:o,fields:i,content:r[a]??{},locale:a,inSlugTimeZone:!0})},N2=({currentSlugs:e},t)=>e?.[t]??e?._,P2=({draft:e})=>{let{collection:t,collectionFile:n,currentValues:r,files:i,isIndexFile:a}=e,{_i18n:{defaultLocale:o}}=n??t;return{collection:t,content:{...pHe(r[o],i),_slug:N2(e,o)},locale:o,dateTimeParts:_He(e),isIndexFile:a,randomValues:hHe(e)}},vHe=({draft:e,locale:t})=>{let n=N2(e,t);return!!e.slugEditor[t]&&!!n?.trim()},yHe=({draft:e,locale:t,templateOnly:n=!1})=>{let{collection:r}=e;if(r._type!==`entry`)return``;let{template:i,editorRequired:a}=E2(r);return!n&&!a&&vHe({draft:e,locale:t})?`{{fields._slug}}`:i},bHe=({draft:e,locale:t,templateOnly:n=!1})=>{let{collection:r}=e;return r._type!==`entry`||!E2(r).autoIncrement?!1:n||!vHe({draft:e,locale:t})},xHe=({draft:e,pendingEntries:t=e.pendingEntries})=>{let{collection:n,collectionName:r}=e,i=[...iW(r),...RZ(r),...t.filter(e=>e.collectionName===r).map(({entry:e})=>e)].flatMap(({slug:e,locales:t})=>[e,...Object.values(t).map(e=>e.slug)]).reduce((e,t)=>{let r=yf(n,t).split(`/`).pop();return eh(r)?Math.max(e,Number(r)):e},0);return String(i+1)},SHe=({draft:e,locale:t,localizingKeyPaths:n,defaultLocaleSlug:r,templateOnly:i=!1})=>{let{isNew:a,originalLocales:o,currentValues:s,files:c}=e,l=N2(e,t);if(a||!o[t]){if(bHe({draft:e,locale:t,templateOnly:i}))return r.split(`/`).pop();let a=P2({draft:e});return nQ(yHe({draft:e,locale:t,templateOnly:i}),{...a,locale:t,dirPath:M2(e,t),content:{...a.content,...pHe(Object.fromEntries(n.map(e=>[e,s[t]?.[e]]).filter(([,e])=>e!==void 0)),c),_slug:l}})}return l},CHe=({draft:e,defaultLocaleSlug:t,templateOnly:n=!1})=>{let{collection:r,collectionFile:i,currentLocales:a}=e,{_i18n:{defaultLocale:o}}=i??r;if(i||!D2(r))return;let s=aHe(r);return Object.fromEntries(Object.entries(a).map(([r])=>[r,r===o?t:SHe({draft:e,locale:r,localizingKeyPaths:s,defaultLocaleSlug:t,templateOnly:n})]))},F2=({draft:e,defaultLocaleSlug:t,localizedSlugs:n,fillSlugOptions:r})=>{if(!n)return;let{collection:i,collectionFile:a}=e,{_i18n:{canonicalSlug:{value:o}}}=a??i;return o===`{{slug}}`?t:nQ(o,{...r,currentSlug:t})},I2=({draft:e,templateOnly:t=!1,pendingEntries:n=void 0})=>{let{isNew:r,collection:i,collectionFile:a,fileName:o,isIndexFile:s}=e;if(s)return{defaultLocaleSlug:of(i)?.name,localizedSlugs:void 0,canonicalSlug:void 0};let{_i18n:{defaultLocale:c}}=a??i,l=P2({draft:e}),u=o??(r?bHe({draft:e,locale:c,templateOnly:t})?xHe({draft:e,pendingEntries:n}):nQ(yHe({draft:e,locale:c,templateOnly:t}),{...l,dirPath:M2(e)}):N2(e,c)),d=CHe({draft:e,defaultLocaleSlug:u,templateOnly:t});return{defaultLocaleSlug:u,localizedSlugs:d,canonicalSlug:F2({draft:e,defaultLocaleSlug:u,localizedSlugs:d,fillSlugOptions:l})}},L2=nl({show:!1,status:`info`,message:``}),R2=tl({files:[]}),z2=e=>({...Dl.current?.media_libraries?.all,...e?.media_libraries?.all}),B2=(e,t)=>{L2.current={show:!0,status:`error`,message:e},console.error(t)},V2=(e,t=1)=>{L2.current.show=!1,u2.current={...c2,[e]:!0,count:t}},H2=e=>{let t=g1.current;_1.current=e,e&&t&&(T1.current={...T1.current,[t.serviceId]:e.length})},wHe=e=>{let t=new Set(e.map(({id:e})=>e));H2(_1.current?.filter(({id:e})=>!t.has(e))),A1(e=>!t.has(e))},THe=(e,t)=>{let n=n=>n.id===e.id?t:n;H2(_1.current?.map(n)),O1.current=O1.current.map(n),k1.current?.id===e.id&&(k1.current=t)},EHe=(e,t=[])=>{let n=new Set(e.map(({id:e})=>e));A1(e=>n.has(e));let r=x1.current?.path;r!==void 0&&!e.some(({description:e})=>e.startsWith(`${r}/`))&&!t.some(e=>e===r||e.startsWith(`${r}/`))&&(x1.current=void 0)},U2=0,W2=async({downloadURL:e})=>{let t=await fetch(e);if(!t.ok)throw Error(`The response returned with HTTP status ${t.status}.`);return t.blob()},G2=async e=>{U2+=1;let t=U2;H2(void 0),E1.current=void 0,D1.current=!1;try{let n=P1(e),{assets:r,folders:i,truncated:a=!1}=e.browse?await e.browse(n):{assets:await e.list?.(n)??[],folders:[]};g1.current===e&&t===U2&&(H2(r),y1.current=i,D1.current=a,EHe(r,i))}catch(n){g1.current===e&&t===U2&&(H2([]),y1.current=[],E1.current=`search_fetch_failed`,EHe([])),console.error(n)}},DHe=async(e,t,{replacing:n=!1,draft:r}={})=>{let i=n?void 0:tJ(t.filename_template),a=i&&r?ZVe({draft:r,defaultLocaleSlug:I2({draft:r}).defaultLocaleSlug}):void 0,{validFiles:o,oversizedFiles:s,invalidFiles:c}=tHe(await Promise.all(e.map(e=>x2(e,t,{nameTemplate:i,nameContext:a}))));return{validFiles:o,oversizedFileNames:s.map(({name:e})=>e),invalidFileNames:c.map(({name:e})=>e)}},OHe=async(e,{originalAsset:t}={})=>{let n=g1.current,{validFiles:r,oversizedFileNames:i,invalidFileNames:a}=await DHe(e,z2(),{replacing:!!t});if(n&&r.length){L2.current={show:!0,status:`info`,message:`uploading_files_progress`};try{let e={...P1(n),dirPath:b1.current};if(t)n.replace&&(THe(t,await n.replace(t,r[0],e)),V2(`saved`,1));else if(n.upload){let t=await n.upload(r,e);H2(h1(t,_1.current??[])),V2(`saved`,t.length)}}catch(e){B2(`uploading_files_failed`,e),await G2(n)}}return{oversizedFileNames:i,invalidFileNames:a}},kHe=async e=>{let t=g1.current;if(!t?.delete||!e.length)return!1;try{await t.delete(e,P1(t))}catch(e){return B2(`deleting_assets_failed`,e),await G2(t),!1}return wHe(e),V2(`deleted`,e.length),!0},AHe=async(e,t)=>{let n=g1.current;if(n?.rename)try{let r=await n.rename(e,t,P1(n));return THe(e,r),V2(`renamed`,1),r}catch(e){B2(`renaming_asset_failed`,e);return}},K2=e=>(_1.current??[]).filter(({description:t})=>t.startsWith(`${e}/`)),jHe=e=>y1.current.filter(t=>t===e||t.startsWith(`${e}/`)),q2=async(e,t,n)=>e.listFolder?e.listFolder(t,n):{assets:K2(t),folders:jHe(t)},MHe=async e=>{let t=g1.current;if(!t?.createFolder)return!1;let n=$l([b1.current,e]);try{await t.createFolder(n,P1(t))}catch(e){return B2(`creating_folder_failed`,e),!1}return y1.current=[...y1.current,n],V2(`folderCreated`),!0},NHe=async({path:e},t)=>{let n=g1.current;if(!n?.move||!n.createFolder||!n.deleteFolder)return!1;let r=$l([eu(e),t]),i=t=>`${r}${t.slice(e.length)}`,a=P1(n),o=x1.current?.path===e;L2.current={show:!0,status:`info`,message:`renaming_folder`};try{let{assets:o,folders:s}=await q2(n,e,a),c=await q2(n,r,a);if(c.assets.length||c.folders.length)throw Error(`A folder named “${t}” already exists in the folder.`);for(let e of o)await n.move(e,i(e.description),a);for(let e of s)await n.createFolder(i(e),a),await n.deleteFolder(e,a)}catch(e){return B2(`renaming_folder_failed`,e),await G2(n),!1}return await G2(n),o&&(x1.current={name:t,path:r}),V2(`folderRenamed`),!0},PHe=async({path:e})=>{let t=g1.current;if(!t?.delete||!t.deleteFolder)return!1;let n=P1(t),r=[],i=[];L2.current={show:!0,status:`info`,message:`deleting_folder`};try{({assets:r,folders:i}=await q2(t,e,n)),await t.delete(r,n);for(let e of i)await t.deleteFolder(e,n)}catch(e){return B2(`deleting_folder_failed`,e),await G2(t),!1}return wHe(r),y1.current=y1.current.filter(e=>!i.includes(e)),x1.current?.path===e&&(x1.current=void 0),V2(`folderDeleted`),!0},FHe=new WeakMap,J2=e=>Nl(FHe,e,()=>new Map),IHe=RegExp(`([${[`Latin`,`Greek`,`Hebrew`,`Arabic`].map(e=>`\\p{Script=${e}}`).join(``)}])\\p{M}+|(\\p{Script=Cyrillic})(\\p{M}+)`,`gv`),LHe=RegExp(`[\\p{M}--[\\u0306]]`,`gv`),RHe=(e,t,n,r)=>t??`${n}${r.replace(LHe,``)}`,zHe=/^[\x00-\x7F]*$/,Y2=e=>(e=e.trim(),e?zHe.test(e)?e.toLowerCase():e.normalize(`NFD`).replace(IHe,RHe).toLowerCase().normalize(`NFC`):``),BHe=(e,t=void 0)=>{if(!t)return Y2(e);let n=t.get(e);if(n!==void 0)return n;let r=Y2(e);return t.set(e,r),r},X2=({value:e,terms:t,normalizedValueCache:n=void 0})=>BHe(e,n).includes(t),VHe=e=>[...new Set(Y2(e).split(/\s+/).filter(Boolean))],HHe=({value:e,tokens:t,normalizedValueCache:n=void 0})=>{let r=BHe(e,n);return t.every(e=>r.includes(e))},UHe={name:void 0,last_modified:`date`,size:`number`},WHe=Object.keys(UHe),GHe=rl(()=>Object.entries(UHe).map(([e,t])=>({key:e,label:Y(`sort_keys.${e}`),type:t}))),KHe=(e,t)=>t===`last_modified`?e.lastModified?.getTime()??0:t===`size`?e.size??0:B1(e.fileName),qHe=(e,{key:t,order:n}={})=>!t||!n||!WHe.includes(t)?e:QW([...e],e=>KHe(e,t),t===`name`,n),JHe=(e,{field:t,pattern:n}={field:``,pattern:``})=>t===`fileType`?e.filter(({kind:e})=>e===n):e,YHe=(e,t)=>{if(t===`domain`)try{return new URL(e.downloadURL).hostname}catch{return}},XHe=(e,t)=>YW(e,t,YHe),ZHe=rl(()=>g1.current?.serviceId===`linked`?[{label:Y(`domain`),field:`domain`}]:[]),QHe=(e,t)=>{let n=Y2(t);return n?e.filter(e=>{let t=J2(e);return X2({value:e.fileName,terms:n,normalizedValueCache:t})||X2({value:e.description,terms:n,normalizedValueCache:t})}):e},Z2=({dirPath:e,assets:t,folders:n})=>_J({dirPath:e,paths:[...t.map(({description:e})=>e),...n.map(e=>`${e}/`)]}),Q2=({dirPath:e,assets:t})=>t.filter(({description:t})=>eu(t)===e),$He=({dirPath:e,serviceLabel:t})=>e?`/${e}`:t,$2=rl(()=>v1(g1.current)&&!N1.current),e4=rl(()=>$2.current?Z2({dirPath:b1.current,assets:_1.current??[],folders:y1.current}):[]),eUe=il(()=>R1.current.sort),tUe=il(()=>R1.current.filter),nUe=rl(()=>{let e=_1.current??[];return $2.current&&(e=Q2({dirPath:b1.current,assets:e})),JHe(qHe(e,eUe.current),tUe.current)}),t4=rl(()=>QHe(nUe.current,N1.current)),rUe=rl(()=>{let e=x1.current;if(e){let{name:t,path:n}=e,r=_1.current??[];return{name:t,path:n,folderCount:Z2({dirPath:n,assets:r,folders:y1.current}).length,assetCount:Q2({dirPath:n,assets:r}).length}}let t=g1.current;if(!t)return;let n=$2.current,r=n?b1.current:``;return{name:tu(r)||t.serviceLabel,path:r||void 0,folderCount:n?e4.current.length:void 0,assetCount:t4.current.length}}),n4=rl(()=>XHe(t4.current,R1.current.group)),iUe=rl(()=>{let e=e4.current.length;return new Map(Object.values(n4.current).flat(1).map(({id:t},n)=>[t,n+e]))});ol(()=>{let e=new Set(t4.current.map(({id:e})=>e));eo(()=>A1(t=>e.has(t)))});var r4=B(`<span role="alert"> </span>`),aUe=B(`<!> <!>`,1),oUe=B(`<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>`,1),sUe=B(`<!> <!> <div role="none" class="grid-wrapper svelte-mqll9n"><!></div>`,1),cUe=B(`<!> <!> <!>`,1),lUe={hash:`svelte-mqll9n`,code:`.grid-wrapper.svelte-mqll9n {overflow-y:auto;height:100%;}`};function uUe(e,t){O(t,!0),K(e,lUe);let n=e=>{var t=H(),n=P(t),r=e=>{DJ(e,{get rootLabel(){return z(f)},get path(){return z(oe)},onNavigate:e=>{M(oe,e,!0)}})};G(n,e=>{z(pe)&&e(r)}),U(e,t)},r=e=>{var r=H(),i=P(r),a=e=>{dH(e,{children:(e,t)=>{var n=r4(),r=F(n,!0);R(e=>W(r,e),[()=>Y(z(fe)?`searching`:`loading`)]),U(e,n)},$$slots:{default:!0}})},s=e=>{var t=aUe(),r=P(t);n(r),dH(I(r,2),{children:(e,t)=>{var n=r4(),r=F(n,!0);R(e=>W(r,e),[()=>Y(`no_files_found`)]),U(e,n)},$$slots:{default:!0}}),U(e,t)},l=e=>{var r=sUe(),i=P(r);n(i);var a=I(i,2),s=e=>{var t=oUe(),n=P(t);ko(n,()=>({"--sui-infobar-border-width":`0 0 1px`,"--sui-infobar-message-justify-content":`center`})),Zx(n.lastChild,{status:`warning`,dismissible:!1,children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(`external_assets_truncated`)]),U(e,n)},$$slots:{default:!0}}),D(n),U(e,t)};G(a,e=>{z(se)&&e(s)});var l=I(a,2);NJ(N(l),{get viewType(){return z(S)},get gridId(){return c()},get multiple(){return o()},get kind(){return t.kind},get subfolders(){return z(he)},onOpenSubfolder:({path:e})=>{M(oe,e,!0)},get items(){return z(me)},itemKey:`id`,renderItem:(e,t=Cr)=>{let n=A(()=>{let{id:e,previewURL:n,description:r,kind:i}=t();return{id:e,previewURL:n,description:r,_kind:i}});{let r=A(()=>De(t()));OJ(e,{get value(){return z(n).id},get ariaLabel(){return z(n).description},get viewType(){return z(S)},get multiple(){return o()},get selected(){return z(r)},onChange:({detail:{selected:e}})=>{je(t(),e)},children:(e,t)=>{var r=aUe(),i=P(r);k0(i,{get kind(){return z(n)._kind},get src(){return z(n).previewURL},get alt(){return z(n).description},variant:`tile`,crossorigin:`anonymous`});var a=I(i,2),o=e=>{{let t=A(()=>z(C)?{caption:z(n).description}:{path:z(pe)?fJ(z(n).description,z(oe)):z(n).description});Dq(e,ys(()=>z(t)))}};G(a,e=>{(z(S)===`list`||!PY.isSmallScreen&&!z(C))&&e(o)}),U(e,r)},$$slots:{default:!0}})}},$$slots:{renderItem:!0}}),D(l),U(e,r)};G(i,e=>{z(ie)?!z(me).length&&!z(he).length?e(s,1):e(l,-1):e(a)}),U(e,r)},i=J(t,`fieldConfig`,3,void 0),a=J(t,`draft`,3,void 0),o=J(t,`multiple`,3,!1),s=J(t,`searchTerms`,3,``),c=J(t,`gridId`,3,void 0),l=J(t,`selectedResources`,31,()=>Xi([])),u=A(()=>Tr(t.serviceProps.serviceType,`stock_assets`)),d=A(()=>Tr(t.serviceProps.serviceId,``)),f=A(()=>Tr(t.serviceProps.serviceLabel,``)),p=A(()=>Tr(t.serviceProps.hotlinking,!1)),m=A(()=>Tr(t.serviceProps.authType,`api_key`)),h=A(()=>t.serviceProps.init),g=A(()=>t.serviceProps.list),_=A(()=>t.serviceProps.browse),v=A(()=>t.serviceProps.search),y=A(()=>t.serviceProps.upload),b=A(()=>t.serviceProps.createFolder),x=A(()=>t.serviceProps.trackDownload),S=A(()=>z(d)===`picsum`?`grid`:s0.current?.type),C=A(()=>z(u)===`stock_assets`),w=A(()=>z2(i())),T=A(()=>z(w).max_file_size??1/0),ee=j(!0),E=j(!1),te=j(``),ne=j(``),re=j(``),ie=j(null),ae=j(Xi([])),oe=j(``),se=j(!1),ce=j(!1),le=j(void 0),ue=j(void 0),de=A(()=>({kind:t.kind,fieldConfig:i(),apiKey:z(te),userName:z(ne),password:z(re)})),fe=A(()=>z(v)?s().trim():``),pe=A(()=>!!z(_)&&!z(fe)),me=A(()=>{let e=z(ie)??[];return z(pe)?Q2({dirPath:z(oe),assets:e}):e}),he=A(()=>z(pe)?Z2({dirPath:z(oe),assets:z(ie)??[],folders:z(ae)}):[]),ge=A(()=>vJ({subfolders:z(he),fileNames:z(me).map(({fileName:e})=>e)})),_e=A(()=>$He({dirPath:z(oe),serviceLabel:z(f)})),ve=Zv(),ye=async e=>{let t=ve.next();M(ie,null),M(le,void 0),M(se,!1);try{let n,r,i=!1;if(e?n=await z(v)(e,z(de)):z(_)?{assets:n,folders:r,truncated:i=!1}=await z(_)(z(de)):n=await z(g)?.(z(de))??[],!t())return;M(ie,n),M(se,i,!0),r&&M(ae,r,!0)}catch(e){if(!t())return;M(le,`search_fetch_failed`),console.error(e)}},be=async e=>{let{downloadURL:t,fileName:n,credit:r}=e;if(z(p))return{url:t,credit:r};try{let i=await W2(e);return{url:t,credit:r,file:new File([i],n,{type:i.type})}}catch(e){M(le,`image_fetch_failed`),console.error(e)}},xe=()=>z(E)&&!!z(y),Se=async e=>{if(!xe())return;let t=await DHe(e,z(w),{draft:a()});if(e=t.validFiles,z(ue)?.report(t),!e.length)return;let{ok:n}=await y2(async()=>{let t=await z(y)(e,{...z(de),dirPath:z(oe)}),n=await Promise.all(t.map(e=>be(e)));l(n.filter(e=>!!e).slice(0,o()?void 0:1)),M(ie,h1(t,z(ie)??[]))},{progress:`uploading_files_progress`,failure:`uploading_files_failed`});n||ye(z(fe))},Ce=()=>z(pe)&&!!z(b),we=()=>{M(ce,!0)},Te=e=>{let t=z(oe)?`${z(oe)}/${e}`:e;y2(async()=>{await z(b)(t,z(de)),M(ae,[...z(ae),t],!0)},{failure:`creating_folder_failed`})},Ee=A(()=>new Set(l().map(({url:e})=>e))),De=e=>z(Ee).has(e.downloadURL),Oe=new Map,ke=new Map,Ae=()=>{KVe({trackDownload:z(x),resources:l(),assets:ke,options:z(de)})},je=async(e,t)=>{let{downloadURL:n}=e;if(t&&!o()&&[...Oe.keys()].forEach(e=>{Oe.set(e,!1)}),Oe.set(n,t),t){let t=await be(e);t&&Oe.get(n)&&(ke.set(n,e),l(o2({resources:l(),resource:t,isSame:e=>e.url===n,multiple:o()})))}else l(l().filter(e=>e.url!==n))},Me=()=>{let e=P1(t.serviceProps);M(te,e.apiKey,!0),M(ne,e.userName,!0),M(re,e.password,!0),M(E,z(m)===`none`||!!z(te)||!!z(re),!0)};So(()=>{(async()=>{typeof z(h)==`function`&&(M(ee,!1),M(ee,await z(h)(),!0)),z(ee)&&(Me(),M(ie,null))})()}),sl(()=>[z(fe),z(E)],()=>{z(E)&&ye(z(fe))});var Ne={canUpload:xe,uploadFiles:Se,canCreateFolder:Ce,showNewFolderDialog:we,trackDownloads:Ae},Pe=cUe(),Fe=P(Pe),Ie=e=>{var t=H(),n=P(t),a=e=>{dH(e,{children:(e,t)=>{var n=r4(),r=F(n,!0);R(e=>W(r,e),[()=>Y(`assets_dialog.error.${z(le)}`)]),U(e,n)},$$slots:{default:!0}})},o=e=>{{let t=A(()=>i()?.accept);z0(e,{get accept(){return z(t)},multiple:!0,onDrop:({files:e})=>Se(e),children:(e,t)=>{r(e)},$$slots:{default:!0}})}},s=e=>{r(e)};G(n,e=>{z(le)?e(a):z(y)?e(o,1):e(s,-1)}),U(e,t)},Le=e=>{N0(e,{get serviceProps(){return t.serviceProps},onAuth:Me})},Re=e=>{dH(e,{children:(e,t)=>{var n=r4(),r=F(n,!0);R(e=>W(r,e),[()=>Y(`cloud_storage.invalid`)]),U(e,n)},$$slots:{default:!0}})};G(Fe,e=>{z(E)?e(Ie):z(ee)?e(Le,1):e(Re,-1)});var ze=I(Fe,2);gs(H0(ze,{get maxSize(){return z(T)}}),e=>M(ue,e,!0),()=>z(ue));var Be=I(ze,2),Ve=e=>{{let t=A(()=>Y(`new_folder`)),n=A(()=>Y(`new_folder_create`)),r=A(()=>Y(`new_folder_description`,{values:{folder:z(_e)}}));FJ(e,{get title(){return z(t)},get okLabel(){return z(n)},get description(){return z(r)},get takenNames(){return z(ge)},onSubmit:e=>{Te(e)},get open(){return z(ce)},set open(e){M(ce,e,!0)}})}};return G(Be,e=>{z(b)&&e(Ve)}),U(e,Pe),k(Ne)}var dUe=B(`<div role="none" class="unsaved svelte-1ong0f1"> </div>`),fUe=B(`<!> <!> <!>`,1),pUe=B(`<div role="none" class="grid-wrapper svelte-1ong0f1"><!></div>`),mUe=B(`<span role="none"> </span>`),hUe={hash:`svelte-1ong0f1`,code:".grid-wrapper.svelte-1ong0f1 {overflow-y:auto;height:100%;[role='listbox'] {background-color:transparent;&.grid {.unsaved {position:absolute;inset-block-start:8px;inset-inline-end:8px;z-index:1;}}&.list {.name {display:flex;gap:8px;align-items:center;justify-content:space-between;\n\n /* `Option` pins button descendants to `flex: none`, so a long name can’t shrink */.truncated-text {flex:auto;min-width:0;}}}}}.unsaved.svelte-1ong0f1 {display:flex;justify-content:center;align-items:center;border-color:var(--sui-info-border-color);border-radius:4px;padding:2px 6px;color:var(--sui-info-foreground-color);background-color:var(--sui-info-background-color);font-size:var(--sui-font-size-small);}"};function gUe(e,t){O(t,!0),K(e,hUe);let n=J(t,`multiple`,3,!1),r=J(t,`kind`,3,void 0),i=J(t,`assets`,19,()=>[]),a=J(t,`viewType`,3,`grid`),o=J(t,`searchTerms`,3,``),s=J(t,`basePath`,3,void 0),c=J(t,`gridId`,3,void 0),l=J(t,`checkerboard`,3,!1),u=J(t,`emptyMessage`,3,void 0),d=J(t,`selectedResources`,31,()=>Xi([])),f=J(t,`subfolders`,19,()=>[]),p=J(t,`onSelect`,3,void 0),m=J(t,`onOpenSubfolder`,3,void 0),h=J(t,`selectedSubfolderPaths`,19,()=>[]),g=J(t,`onSelectSubfolder`,3,void 0),_=A(()=>VHe(o())),v=A(()=>i().map(e=>{let{folder:t,name:n,path:r}=e;return{asset:e,relPath:s()&&!t.entryRelative?Lc(r.replace(s(),``)):n,key:vQ(e)}})),y=A(()=>z(_).length?z(v).filter(e=>HHe({value:e.relPath,tokens:z(_),normalizedValueCache:J2(e)})):z(v)),b=A(()=>new Set(d().flatMap(({asset:e})=>e?[vQ(e)]:[]))),x=e=>z(b).has(vQ(e)),S=(e,t)=>{let r=vQ(e),i=e=>!!e.asset&&vQ(e.asset)===r;t?(d(o2({resources:d(),resource:{asset:e},isSame:i,multiple:n()})),p()?.({asset:e})):d(d().filter(e=>!i(e)))};var C=H(),w=P(C),T=e=>{var t=pUe();NJ(N(t),{get multiple(){return n()},get gridId(){return c()},get viewType(){return a()},get kind(){return r()},get subfolders(){return f()},get onOpenSubfolder(){return m()},get selectedSubfolderPaths(){return h()},get onSelectSubfolder(){return g()},get items(){return z(y)},itemKey:`key`,renderItem:(e,t=Cr)=>{let r=A(()=>t()),i=A(()=>{let{kind:e,unsaved:t}=z(r).asset;return{assetKind:e,unsaved:t}});{let t=A(()=>x(z(r).asset));OJ(e,{get value(){return z(r).key},get ariaLabel(){return z(r).relPath},get viewType(){return a()},get multiple(){return n()},get selected(){return z(t)},onChange:({detail:{selected:e}})=>{S(z(r).asset,e)},children:(e,t)=>{var n=fUe(),o=P(n),s=e=>{var t=dUe(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`assets_dialog.unsaved`)]),U(e,t)};G(o,e=>{a()===`grid`&&z(i).unsaved&&e(s)});var c=I(o,2);k0(c,{get kind(){return z(i).assetKind},get asset(){return z(r).asset},get alt(){return z(r).relPath},variant:`tile`,get checkerboard(){return l()}});var u=I(c,2),d=e=>{Dq(e,{get path(){return z(r).relPath},children:(e,t)=>{var n=H(),r=P(n),o=e=>{var t=dUe(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`assets_dialog.unsaved`)]),U(e,t)};G(r,e=>{a()===`list`&&z(i).unsaved&&e(o)}),U(e,n)},$$slots:{default:!0}})};G(u,e=>{PY.isSmallScreen&&a()!==`list`||e(d)}),U(e,n)},$$slots:{default:!0}})}},$$slots:{renderItem:!0}}),D(t),U(e,t)},ee=e=>{dH(e,{children:(e,t)=>{var n=mUe(),r=F(n,!0);R(e=>W(r,e),[()=>u()??Y(`no_files_found`)]),U(e,n)},$$slots:{default:!0}})};G(w,e=>{z(y).length||f().length?e(T):e(ee,-1)}),U(e,C),k()}var _Ue=B(`<div role="none" class="wrapper svelte-x4ewel"><!> <div role="none" class="panel svelte-x4ewel"><!></div></div>`),vUe={hash:`svelte-x4ewel`,code:`.wrapper.svelte-x4ewel {display:flex;flex-direction:column;height:100%;}.panel.svelte-x4ewel {flex:auto;overflow:hidden;}`};function yUe(e,t){O(t,!0),K(e,vUe);let n=J(t,`multiple`,3,!1),r=J(t,`kind`,3,void 0),i=J(t,`selectFolder`,3,!1),a=J(t,`uploadDisabled`,3,!1),o=J(t,`accept`,3,void 0),s=J(t,`assets`,19,()=>[]),c=J(t,`searchTerms`,3,``),l=J(t,`basePath`,3,void 0),u=J(t,`folderLabel`,3,``),d=J(t,`subfolderPath`,3,``),f=J(t,`subfolders`,19,()=>[]),p=J(t,`selectedResources`,31,()=>Xi([])),m=J(t,`onNavigate`,3,void 0),h=J(t,`onOpenSubfolder`,3,void 0),g=J(t,`selectedSubfolderPaths`,19,()=>[]),_=J(t,`onSelectSubfolder`,3,void 0),v=j(void 0);L(()=>{p().length||eo(()=>{z(v)?.reset()})});{let y=A(()=>i()||a());gs(z0(e,{get disabled(){return z(y)},get multiple(){return n()},get accept(){return o()},filterDroppedFiles:!1,get onDrop(){return t.onDrop},children:(e,t)=>{var a=_Ue(),o=N(a);DJ(o,{get rootLabel(){return u()},get path(){return d()},get onNavigate(){return m()}});var v=I(o,2),y=N(v);{let e=A(()=>s0.current?.type),t=A(()=>i()?Y(`assets_dialog.no_subfolders`):void 0);gUe(y,{get multiple(){return n()},get kind(){return r()},get assets(){return s()},get viewType(){return z(e)},get searchTerms(){return c()},get basePath(){return l()},get subfolders(){return f()},gridId:`select-assets-grid`,checkerboard:!0,get emptyMessage(){return z(t)},get onOpenSubfolder(){return h()},get selectedSubfolderPaths(){return g()},get onSelectSubfolder(){return _()},get selectedResources(){return p()},set selectedResources(e){p(e)}})}D(v),D(a),U(e,a)},$$slots:{default:!0}}),e=>M(v,e,!0),()=>z(v))}k()}var bUe=B(`<!> <!>`,1),xUe=B(`<!> <!> <!>`,1);function SUe(e,t){O(t,!0);let n=(e,n)=>{let r=()=>(n?.()).name,i=()=>(n?.()).label,a=()=>(n?.()).icon,o=()=>(n?.()).onclick;{let n=e=>{gx(e,{get name(){return a()}})},s=A(()=>t.libraryName===r());KS(e,{get name(){return r()},get label(){return i()},get selected(){return z(s)},get onclick(){return o()},startIcon:n,$$slots:{startIcon:!0}})}},r=A(()=>PY.isSmallScreen?iC:WS);var i=H(),a=P(i);{let e=A(()=>Y(`assets_dialog.locations`));Ro(a,()=>z(r),(r,i)=>{i(r,{class:`tabs`,get ariaLabel(){return z(e)},get"aria-controls"(){return t.controlsId},filterThreshold:-1,onChange:e=>{t.onChange(e.detail.name)},children:(e,r)=>{var i=xUe(),a=P(i),o=e=>{{let r=A(()=>Y(`asset_location.repository`));GS(e,{get label(){return z(r)},children:(e,r)=>{var i=H();No(P(i),17,()=>Object.entries(t.assetLibraryFolderMap),([e,t])=>e,(e,r)=>{var i=A(()=>Er(z(r),2));let a=()=>z(i)[0],o=()=>z(i)[1];var s=H(),c=P(s),l=e=>{{let t=A(()=>({name:`default-${a()}`,label:o().folder?.label||Y(`assets_dialog.folder.${a()}`),icon:`folder`}));n(e,()=>z(t))}},u=A(()=>a2(o(),t.selectFolder));G(c,e=>{z(u)&&e(l)}),U(e,s)}),U(e,i)},$$slots:{default:!0}})}};G(a,e=>{t.showRepository&&e(o)});var s=I(a,2),c=e=>{{let r=A(()=>Y(`asset_location.external`));GS(e,{get label(){return z(r)},children:(e,r)=>{var i=bUe(),a=P(i);No(a,17,()=>t.cloudServiceEntries,([,{serviceId:e,serviceLabel:t}])=>e,(e,t)=>{var r=A(()=>Er(z(t),2));let i=()=>z(r)[1].serviceId,a=()=>z(r)[1].serviceLabel;n(e,()=>({name:i(),label:a(),icon:`cloud`,onclick:()=>{i()===`cloudinary`&&_q.current&&(yq.current=!0)}}))});var o=I(a,2),s=e=>{{let t=A(()=>({name:`enter-url`,label:Y(`assets_dialog.enter_url`),icon:`link_2`}));n(e,()=>z(t))}};G(o,e=>{t.showURLInput&&e(s)}),U(e,i)},$$slots:{default:!0}})}};G(s,e=>{(t.showURLInput||t.cloudServiceEntries.length)&&e(c)});var l=I(s,2),u=e=>{{let r=A(()=>Y(`asset_location.stock_photos`));GS(e,{get label(){return z(r)},children:(e,r)=>{var i=H();No(P(i),17,()=>t.stockAssetProviderEntries,([e,{serviceLabel:t}])=>e,(e,t)=>{var r=A(()=>Er(z(t),2));let i=()=>z(r)[0],a=()=>z(r)[1].serviceLabel;n(e,()=>({name:i(),label:a(),icon:`photo_camera_back`}))}),U(e,i)},$$slots:{default:!0}})}};G(l,e=>{t.stockAssetProviderEntries.length&&e(u)}),U(e,i)},$$slots:{default:!0}})})}U(e,i),k()}var CUe=e=>{let t=e.folder.entryRelative?void 0:fZ(e,{allowSpecial:!0,pathOnly:!0});return t===void 0||!/^(?:[/@]|[a-z][\d+.a-z-]*:\/\/)/i.test(t)?{asset:e}:{url:t}},wUe=({field:e,keyPath:t,keyPathList:n})=>{let{widget:r}=e;if(n.push(t),r===`list`||r===`object`){let{field:i,fields:a,types:o,typeKey:s=`type`}=e,c=r===`list`?`${t}.*`:t;o&&!a?n.push(`${c}.${s}`):r===`list`&&!a&&!i&&n.push(c),yh(e,t,(e,t)=>{wUe({field:e,keyPath:t,keyPathList:n})})}else r&&zd.includes(r)&&oh(e)&&n.push(`${t}.*`)},TUe=e=>{let t=[];return e.forEach(e=>{wUe({field:e,keyPath:e.name,keyPathList:t})}),t},EUe=({collection:e,fields:t=[],option:n,defaultKey:r})=>{if(e?._type!==`entry`)return;let i=n===!0?r:n||void 0;if(i&&!t.some(({name:e})=>e===i))return i},i4=({collection:e,fields:t})=>{let{aliases_field:n=`aliases`}=e??{};return EUe({collection:e,fields:t,option:n,defaultKey:`aliases`})},a4=(e,t)=>{let n=`${t}.`;return Object.keys(e).filter(e=>e.startsWith(n)&&eh(e.slice(n.length))).sort((e,t)=>Number(e.slice(n.length))-Number(t.slice(n.length)))},DUe=(e,t)=>{t&&(a4(e,t).forEach(t=>{delete e[t]}),delete e[t])},OUe=(e,t)=>({...e,locales:Object.fromEntries(Object.entries(e.locales).map(([e,n])=>[e,n.content?{...n,content:t({locale:e,localizedEntry:n})}:n]))}),o4=e=>{let t=uHe(e);return t===void 0?void 0:`/${t.replace(/^\//,``)}`},s4=({collection:e,fields:t})=>EUe({collection:e,fields:t,option:e?.permalink_field,defaultKey:`permalink`}),kUe=({collection:e,fields:t,isIndexFile:n=!1,locale:r,content:i,defaultContent:a,slug:o,path:s})=>{let c=s4({collection:e,fields:t});if(!c||n||!e.preview_path||typeof(i[c]??``)!=`string`||Object.keys(i).some(e=>e.startsWith(`${c}.`)))return;let l=o4({collection:e,locale:r,slug:o,path:s,content:i,defaultContent:a});l===void 0?delete i[c]:i[c]=l},c4=({collection:e,isIndexFile:t=!1,entry:n})=>{let{fields:r}=e;if(t||!s4({collection:e,fields:r}))return n;let i=n.locales[e._i18n.defaultLocale]?.content;return OUe(n,({locale:t,localizedEntry:{slug:n,path:a,content:o}})=>{let s={...o};return kUe({collection:e,fields:r,locale:t,content:s,defaultContent:i,slug:n,path:a}),s})},AUe=new Map,jUe=e=>Nl(AUe,e,()=>RegExp(`^(${em(e)})(?:\\.|$)`)),MUe=/^(.+)\.\d+$/,NUe=(e,t)=>{let[,n]=e.match(MUe)??[];return n!==void 0&&!hm(t[n])},PUe=(e,t)=>{let n=e.split(`.`);for(let e=n.length-1;e>0;--e){let r=n.slice(0,e).join(`.`);if(NUe(r,t)){!Object.hasOwn(t,r)&&!Object.keys(t).some(e=>e.startsWith(`${r}.`))&&(t[r]={});return}}},l4=({key:e,field:t,locale:n,unsortedMap:r,sortedMap:i,isTomlOutput:a,omitEmptyOptionalFields:o})=>{if(dK.test(e)){delete r[e];return}let s=r[e];if(a&&t?.widget===`datetime`&&!BH(t).format){if(Cm(s))s=void 0;else{let e=new Dv(s);e.isValid()&&(s=e)}}if(o&&t&&!fh({fieldConfig:t,locale:n})&&Cm(s)&&!NUe(e,i)){let t=Object.keys(r).filter(t=>t.startsWith(`${e}.`));t.some(e=>!dK.test(e)&&!Cm(r[e]))?i[e]=s:(t.forEach(e=>{delete r[e]}),PUe(e,i))}else i[e]=s;delete r[e]},FUe=[`code`,`hidden`],IUe=e=>FUe.includes(String(e.widget))||dh(e)===`custom`,LUe=(e,t,n)=>{let{unsortedMap:r,sortedMap:i,copyArgs:a}=e,o=`${t}.`,s=Object.keys(r).filter(e=>e.startsWith(o)?!e.slice(o.length).trim()&&!r[e]?(delete r[e],!1):!0:!1);s.length?(i[t]={},delete r[t],s.forEach(e=>{l4({...a,key:e,field:n})})):(Object.hasOwn(r,t)||BW({...e,keyPath:t}))&&(r[t]??={},l4({...a,key:t,field:n}))},RUe=({unsortedMap:e,copyArgs:t},n,r)=>{Object.hasOwn(e,n)&&l4({...t,key:n,field:r});let i=`${n}.`;Object.keys(e).filter(e=>e.startsWith(i)).forEach(e=>{l4({...t,key:e})})},zUe=({unsortedMap:e,sortedMap:t},n,r)=>{r?.widget===`object`&&voe(e,n)&&(t[n]={})},BUe=(e,t,n)=>{let r=!t.includes(`*`);if(n?.widget===`keyvalue`&&r)LUe(e,t,n);else if(n&&r&&IUe(n))RUe(e,t,n);else if(Object.hasOwn(e.unsortedMap,t))l4({...e.copyArgs,key:t,field:n});else return!1;return!0},VUe=(e,t,n)=>{let r=jUe(t);[...new Set(Object.keys(e.unsortedMap).map(e=>e.match(r)?.[1]).filter(e=>e!==void 0))].sort((e,t)=>Bc(e,t)).forEach(t=>{let r=n??lh({...e.getFieldArgs,keyPath:t});BUe(e,t,r)||zUe(e,t,r)})},HUe=({collectionName:e,fileName:t,fields:n,locale:r,defaultLocale:i,valueMap:a,canonicalSlugKey:o,permalinkKey:s,aliasesKey:c,orderKey:l,isIndexFile:u=!1,isTomlOutput:d=!1})=>{let f=Oc(a),p={},{omit_empty_optional_fields:m=!1}=Dl.current?.output??{},h={collectionName:e,fileName:t,valueMap:a,isIndexFile:u},g={locale:r,unsortedMap:f,sortedMap:p,isTomlOutput:d,omitEmptyOptionalFields:m},_={locale:r,defaultLocale:i,getFieldArgs:h,unsortedMap:f,sortedMap:p,copyArgs:g};return[o,s,c,...c?a4(f,c):[],l].forEach(e=>{e&&Object.hasOwn(f,e)&&l4({...g,key:e})}),TUe(n).forEach(e=>{let t=lh({...h,keyPath:e});BUe(_,e,t)||VUe(_,e,t)}),Object.keys(f).sort((e,t)=>Bc(e,t)).forEach(e=>{l4({...g,key:e})}),xm(p)},u4=e=>Array.isArray(e)?e.filter(e=>e!=null).map(u4):hm(e)?Object.fromEntries(Object.entries(e).filter(([,e])=>e!=null).map(([e,t])=>[e,u4(t)])):e,d4=({draft:e,locale:t,valueMap:n,format:r})=>{let{collection:i,collectionName:a,collectionFile:o,fields:s,isIndexFile:c}=e,{_i18n:{defaultLocale:l,canonicalSlug:{key:u}}}=o??i,d=Pie.includes(r??Pf({collection:i,collectionFile:o,isIndexFile:c}).format),f=Ch(HUe({collectionName:a,fileName:o?.name,fields:s,locale:t,defaultLocale:l,valueMap:n,canonicalSlugKey:u,permalinkKey:s4({collection:i,fields:s}),aliasesKey:i4({collection:i,fields:s}),orderKey:sW(i),isIndexFile:c,isTomlOutput:d}),s,!1),p=d?u4(f):f;if(ah(s,`list`)){let e=!!xh(s[0]);if(e||!d)return p[s[0].name]??(e?{}:[])}return ah(s,`keyvalue`)?p[s[0].name]??{}:p},UUe=(e,t)=>Object.fromEntries(e.flatMap(e=>{let{name:n,widget:r=`string`,comment:i}=e,a=`${t}${n}`,o=Uu(i)?[[a,i]]:[];return r===`object`&&`fields`in e&&Array.isArray(e.fields)&&o.push(...Object.entries(UUe(e.fields,`${a}.`))),o})),f4=(e=[],t=``)=>ah(e,`list`)||ah(e,`keyvalue`)?{}:UUe(e,t),WUe=({config:e,fields:t})=>{let{_i18n:{i18nEnabled:n,allLocales:r,defaultLocale:i,structureMap:{i18nSingleFileDefaultRoot:a}={}}}=e;return n?Object.assign({},...r.map(e=>f4(t,a&&e===i?``:`${e}.`))):f4(t)},GUe=({config:e,entry:t,draft:n,format:r})=>{let{_i18n:{i18nEnabled:i,defaultLocale:a,structureMap:{i18nSingleFileDefaultRoot:o}={}}}=e;if(!i)return d4({draft:n,locale:`_default`,valueMap:t.locales[a].content,format:r});let s=Object.fromEntries(Object.entries(t.locales).filter(([,e])=>!!e.content).map(([e,t])=>[e,d4({draft:n,locale:e,valueMap:t.content,format:r})]));if(o){let{lang:e,...t}=s[a]??{},n=Object.fromEntries(Object.entries(s).filter(([e])=>e!==a));return{lang:[a,...Object.keys(n)],...t,...n}}return s},KUe=()=>JSON.rawJSON,qUe=e=>function(t,n){let r=this[t],i=r instanceof pv?jce(r):Cv(n);return i===void 0?n:e(i)},JUe=(e,t=Dl.current?.output?.json??{})=>{let{indent_style:n=`space`,indent_size:r=n===`tab`?1:2}=t,i=KUe();return JSON.stringify(e,i?qUe(i):void 0,n===`tab`?` `.repeat(r):r).trim()},YUe=e=>Xce(Pce()?wv(e):e).trim(),XUe=(e,t,n=``)=>{Fh(e)&&e.items.forEach(({key:e,value:r})=>{let i=e,a=`${n}${i.value}`,o=Object.hasOwn(t,a)?t[a]:void 0;o&&(i.commentBefore=o.split(/\\n|\n/).map(e=>` ${e}`).join(`
`)),XUe(r,t,`${a}.`)})},ZUe=/^(?:y|Y|yes|Yes|YES|n|N|no|No|NO|true|True|TRUE|false|False|FALSE|on|On|ON|off|Off|OFF)$/,QUe=RegExp(`^[-+]?(?:0b[01_,]+|0[0-7_,]+|0x[\\da-fA-F_,]+|(?:\\d[\\d_,]*)?\\.[\\d_,]*(?:[eE][-+]?\\d+)?|\\d[\\d_,]*|\\d[\\d_]*(?::[0-5]?\\d)+(?:\\.[\\d_]*)?)$`),$Ue=e=>ZUe.test(e)||QUe.test(e),eWe=(e,t=Dl.current?.output?.yaml??{},n={},r={})=>{let{indent_size:i=2,indent_sequences:a=!0,quote:o=`none`,block_quote:s=!0}=t,{quote:c=!1}=n,l={indent:i,indentSeq:a,blockQuote:s,lineWidth:0,defaultKeyType:`PLAIN`,defaultStringType:c||o===`double`?`QUOTE_DOUBLE`:o===`single`?`QUOTE_SINGLE`:`PLAIN`,singleQuote:!(c||o===`double`)},u=new S_(e,{customTags:[Mce]});return Wh(u,{Scalar:(e,t)=>{typeof t.value==`string`&&$Ue(t.value)&&(t.type=l.singleQuote?`QUOTE_SINGLE`:`QUOTE_DOUBLE`);let n=Cv(t.value);n!==void 0&&(t.value=BigInt(n))}}),XUe(u.contents,r),u.toString(l).trim()},tWe={yaml:(e,{yamlQuote:t=!1},n)=>eWe(e,void 0,{quote:t},n),toml:e=>YUe(e),json:e=>JUe(e)},nWe=({syntax:e,content:t,_file:n,comments:r,leadingComment:i})=>{let a=tWe[e](t,n,r);return e===`json`?a:ele(a,i)},rWe=e=>e===`frontmatter`||ff.includes(e),iWe=({content:e,_file:t,comments:n,leadingComment:r})=>{let{format:i,fmDelimiters:a,bodyField:{key:o=`body`,inline:s=!1}={}}=t,[c,l]=a??df[`yaml-frontmatter`],u=``;if(!s&&Object.hasOwn(e,o)){let t=e[o];(typeof t==`string`||t==null)&&(u=t??``,delete e[o])}if(!Object.keys(e).length){if(r)return`${c}\n${r}\n${l}\n${u?`\n${u}\n`:``}`;let e=u.trimStart().split(`
`,1)[0].trimEnd();return[c,...Object.values(df).map(([e])=>e)].includes(e)?`${c}\n\n${l}\n\n${u}\n`:`${u}\n`}let d=rWe(i)?pf(i):void 0;if(!d)throw Error(`Unsupported front matter format: ${i}`);let f=nWe({syntax:d,content:e,_file:t,comments:n,leadingComment:r});return d===`json`&&c===`{`&&l===`}`&&(f=f.slice(1,-1).replace(/^\n/,``).replace(/\n$/,``)),`${c}\n${f}\n${l}\n${!s&&u?`\n${u}\n`:``}`},aWe=({content:e,_file:t,comments:n,state:r={}})=>{let{valueSources:i,leadingComment:a}=r,{format:o}=t;if(o===`raw`)return typeof e.body==`string`?`${e.body}\n`:``;i&&(e=Pie.includes(o)?ple(e,i):hv(e,i));try{return rWe(o)?iWe({content:e,_file:t,comments:n,leadingComment:a}):`${nWe({syntax:pf(o),content:e,_file:t,comments:n,leadingComment:a})}\n`}catch(e){throw Error(`The entry could not be formatted due to ${e.name}: ${e.message}`,{cause:e})}},oWe=async({content:e,_file:t,comments:n,state:r})=>{let{format:i,configuredFormat:a=i}=t,o=Ud.get(a)?.formatter,s=o?a:i,c=o??Ud.get(s)?.formatter,l=Nie.includes(i);if(!c){if(!l)throw Error(Ud.has(i)?`Entries in the custom “${i}” format can’t be saved, as no \`toFile\` method was registered for it with \`CMS.registerCustomFormat()\``:`Entries in the unknown “${i}” format can’t be saved`);return aWe({content:e,_file:t,comments:n,state:r})}let u=await c(e,{serialize:async e=>{if(typeof e!=`object`||!e)throw TypeError("The `serialize` function must be given the entry content");if(!l)throw Error(`Entries in the custom “${i}” format can’t be serialized, as there’s no built-in formatter for it`);return aWe({content:Array.isArray(e)?[...e]:{...e},_file:t,comments:n,state:r})}});if(typeof u!=`string`)throw TypeError(`The \`toFile\` method registered for the custom “${s}” format must return a string`);return`${u.trim()}\n`},sWe=({draft:e,config:t,_file:n,entry:r,locale:i,state:a})=>oWe(i===void 0?{content:GUe({config:t,entry:r,draft:e,format:n.format}),_file:n,comments:WUe({config:t,fields:e.fields}),state:a}:{content:d4({draft:e,locale:i,valueMap:r.locales[i].content,format:n.format}),_file:n,comments:f4(e.fields),state:a}),cWe=({_file:e,format:t})=>e.format!==`frontmatter`||!t?e:{...e,format:t,configuredFormat:e.format,fmDelimiters:e.fmDelimiters??df[t]},p4=e=>e||Sb(LX.current?.repository,`file-cache`),m4=async({previousPath:e,cacheDB:t})=>{if(e)return(await t?.get(e))?.sha},lWe=({i18nEnabled:e,structureMap:t={}})=>!e||zf(t),h4=async({draft:e,config:t,_file:n,entry:r,cacheDB:i,planChange:a})=>{let o=lWe(t._i18n)?[void 0]:t._i18n.allLocales;return(await Promise.all(o.map(async o=>{let s=a(o);if(!s)return;let{currentPath:c,...l}=s;if(l.action===`delete`)return{...l,previousSha:await m4({cacheDB:i,previousPath:c})};let u=n.arrayFile?{}:xce({previousPath:c,path:l.path}),[d,f]=await Promise.all([m4({cacheDB:i,previousPath:c}),sWe({draft:e,config:t,_file:cWe({_file:n,format:u.format}),entry:r,locale:o,state:u})]);return{...l,previousSha:d,data:f}}))).filter(Boolean)},g4=kH({loader:()=>Jc(`immutable`,`dist/immutable.es.js`),notLoadedMessage:"Immutable.js is not loaded yet. Call `loadImmutable()` first."}),_4=g4.loaded,v4=g4.load,y4=g4.preload,b4=g4.get;g4.reset;var x4=tl(0),uWe=new WeakMap,dWe=async e=>uWe.get(e)??!1,fWe=class{#e;constructor(e){this.#e=e,this.path=fZ(e,{pathOnly:!0})??``,this.url=e.blobURL??this.path,this.field=void 0,this.fileObj=e.file,uWe.set(this,(async()=>{try{let t=await $X(e);if(t&&t!==this.url)return this.url=t,x4.current+=1,!0}catch{}return!1})())}toString(){return this.url}async toBase64(){try{return Gc(await QX(this.#e))}catch(e){throw Error(`Failed to encode asset as base64: ${e.message}`)}}},pWe=class{constructor(e){this.path=e,this.url=e,this.field=void 0,this.fileObj=void 0}toString(){return this.url}async toBase64(){try{return Gc(await(await Bu(this.url)).blob())}catch(e){throw Error(`Failed to encode asset as base64: ${e.message}`)}}},mWe=class{#e;constructor(e,t){this.#e=t,this.path=e,this.url=e,this.field=void 0,this.fileObj=t}toString(){return this.url}async toBase64(){return Gc(this.#e)}},hWe={slug_length:!1,slug_editor_tag:!1,yaml_quote:!1,save_all_locales:!1,automatic_deployments:!1,multiple_folders_i18n_root:!1,omit_default_locale_from_filename:!1,logo_url:!1,flat_metadata_keys:!1},gWe={slug_length:"The `slug_length` collection option is deprecated and will be removed in Sveltia CMS 1.0. Use the global `slug.maxlength` option instead. https://sveltiacms.app/en/docs/collections/entries/slugs#global-slug-options",slug_editor_tag:"The `{{fields._slug}}` and `{{fields._slug | localize}}` slug template tags are deprecated and will be removed in Sveltia CMS 1.0. Use the `slug` collection option’s object form instead: `{{fields._slug}}` is equivalent to `slug: { editable: true }`, and `{{fields._slug | localize}}` is equivalent to `slug: { editable: true, i18n: true }`. https://sveltiacms.app/en/docs/collections/entries/slugs#making-slugs-editable",yaml_quote:"The `yaml_quote` collection option is deprecated and will be removed in Sveltia CMS 1.0. Use the global `output.yaml.quote` option instead. `yaml_quote: true` is equivalent to `quote: double`. https://sveltiacms.app/en/docs/data-output#controlling-data-output",save_all_locales:"The `save_all_locales` i18n option is deprecated and will be removed in Sveltia CMS 1.0. Use the `initial_locales` option instead. `save_all_locales: false` is equivalent to `initial_locales: all`. https://sveltiacms.app/en/docs/i18n/options#disabling-non-default-locale-content",automatic_deployments:"The `automatic_deployments` backend option is deprecated and will be removed in Sveltia CMS 1.0. Use the `skip_ci` option instead. `automatic_deployments: false` is equivalent to `skip_ci: true`, and `automatic_deployments: true` is equivalent to `skip_ci: false`. https://sveltiacms.app/en/docs/deployments#disabling-automatic-deployments",multiple_folders_i18n_root:"The `multiple_folders_i18n_root` i18n structure is deprecated and will be removed in Sveltia CMS 1.0. Use the `multiple_root_folders` structure instead. https://sveltiacms.app/en/docs/i18n/structures#multiple-root-folders",omit_default_locale_from_filename:"The `omit_default_locale_from_filename` i18n option is deprecated and will be removed in Sveltia CMS 1.0. Use the `omit_default_locale_from_file_path` option instead. https://sveltiacms.app/en/docs/i18n/options",logo_url:"The `logo_url` option is deprecated and will be removed in a future version of Sveltia CMS. Use the `logo.src` option instead. https://sveltiacms.app/en/docs/customization#custom-logo",flat_metadata_keys:"Reading the `fieldsMetaData` of a nested field with its flat key path, like `details.author` or `books.0.author`, or the metadata of a List field’s single `field` under the List field’s name is deprecated and will be removed in a future version of Sveltia CMS. Use the nested path instead, like `fieldsMetaData.getIn(['books', 'author'])` or `fieldsMetaData.getIn(['tags', 'tag'])`. https://sveltiacms.app/en/docs/api/preview-templates"},S4=(e,t)=>{hWe[e]||(console.warn(t??gWe[e]),hWe[e]=!0)},_We=({content:e,otherLocales:t,locales:n,slug:r,path:i,isNew:a,collectionName:o,associatedAssets:s})=>b4().fromJS({data:Sm(e),i18n:Object.fromEntries(t.map(e=>[e,{data:Sm(n[e].content)}])),slug:r,path:i,newRecord:a,collection:o,mediaFiles:s.map(({sha:e,file:t,size:n,blobURL:r,...i})=>({id:e,name:i.name,path:i.path,file:t,size:n,url:r,displayURL:r})),meta:{path:i},isModification:null,label:null,partial:!1,author:``,raw:``,status:``,updatedOn:``}),vWe=({entry:e,locale:t,collectionName:n,associatedAssets:r,content:i})=>_We({content:i??e?.locales?.[t]?.content??{},otherLocales:Object.keys(e?.locales??{}).filter(e=>e!==t),locales:e?.locales??{},slug:e?.slug??``,path:e?.locales?.[t]?.path??``,isNew:!1,collectionName:n,associatedAssets:r}),yWe=({entry:e,collectionName:t,fileName:n,files:r,typedKeyPath:i,componentNames:a,locale:o})=>s=>{let c=r?.[s]?.file;if(c)return new mWe(s,c);let l={value:s,entry:e,collectionName:t,fileName:n,typedKeyPath:i,locale:o},{asset:u,url:d}=(a?y$({...l,componentNames:a}):g$(l))??{};if(u)return new fWe(u);if(d)return new pWe(d)},bWe=new WeakMap,xWe=(e,t,n)=>Nl(Nl(Nl(bWe,e,()=>new WeakMap),n,()=>new Map),t,()=>{let r=new Map;return e.forEach(e=>{FG({locale:t,fieldConfig:n,refEntry:e}).forEach(({value:t})=>{r.has(t)||r.set(t,e)})}),r}),SWe=({getFieldArgs:e,keyPath:t})=>{let n=t.split(`.`);return n.flatMap((t,r)=>{if(!r||!eh(t))return[t];let i=lh({...e,keyPath:n.slice(0,r).join(`.`)});if(i?.widget===`object`)return[t];let{field:a}=i??{};return i?.widget===`list`&&a?[a.name]:[]})},CWe=(e,t)=>{let{get:n}=e;e.get=(r,i)=>(t.has(r)&&S4(`flat_metadata_keys`),n.call(e,r,i))},wWe=({locale:e,getFieldArgs:t})=>{let{valueMap:n={}}=t,r=Object.create(null),i=new Map,a=new Set,o=new Map;Object.entries(n).forEach(([n,s])=>{let c=n,l=lh({...t,keyPath:c});if(l?.widget===`relation`){let{collection:u,file:d}=l,f=xWe((()=>{let e=`${u}:${d??``}`,t=i.get(e);if(t)return t;let n=d?[Jp(u,d)].filter(e=>!!e):rW(u);return i.set(e,n),n})(),e,l).get(String(s)),p=Kf(u)?._i18n.defaultLocale,m=(f?.locales[e]??(p?f?.locales[p]:void 0)??f?.locales._default)?.content,h=m?Sm(m):void 0,g=SWe({getFieldArgs:t,keyPath:c}),_=g.at(-1)===n.split(`.`).at(-1)?n:n.replace(im,``),v=g.length===1&&g[0]===_?[g]:[g,[_]];v.length>1&&(_.includes(`.`)?a.add(_):g[1]!==u&&Nl(o,_,()=>new Set).add(u)),v.forEach(e=>{let t=[...e,u].reduce((e,t)=>(e[t]??=Object.create(null),e[t]),r);t[s]=h})}});let s=b4().fromJS(r);return a.size&&CWe(s,a),o.forEach((e,t)=>{CWe(s.get(t),e)}),s},TWe=({originalEntry:e,currentValues:t})=>({...e,locales:Object.fromEntries(Object.entries(t).map(([t,n])=>[t,{slug:e?.locales[t]?.slug??e?.slug,path:e?.locales[t]?.path??e?.subPath,content:_K(n)}]))}),EWe=Bl(()=>Dp.current,()=>new WeakMap),DWe=({collectionName:e,fileName:t})=>{let n=Ey({collectionName:e,fileName:t});return n?Nl(EWe(),n,()=>Dp.current.filter(e=>EQ(e,n))):[]},OWe=({draft:e,locale:t})=>{let{collectionName:n,fileName:r,isIndexFile:i,originalEntry:a,currentValues:o,files:s}=e,c=TWe({originalEntry:a,currentValues:o}),l=c.locales[t].content??{},u={collectionName:n,fileName:r,valueMap:l,isIndexFile:i},d;return{entryMap:vWe({entry:c,locale:t,collectionName:n,associatedAssets:DWe({collectionName:n,fileName:r}),content:l}),valueMap:l,getFieldArgs:u,get fieldsMetaData(){return d??=wWe({locale:t,getFieldArgs:u}),d},getAsset:yWe({entry:c,collectionName:n,fileName:r,files:s,locale:t})}},kWe=new WeakMap,C4=e=>{let t=kWe.get(e);if(t)return t;let n=b4().fromJS(e);return kWe.set(e,n),n},w4=new Map,T4=!1,AWe=({draft:e,locale:t})=>{let n=w4.get(e)??new Map,r=n.get(t);if(r)return r;let i=OWe({draft:{...e,currentValues:AK(e)},locale:t});return n.set(t,i),w4.set(e,n),T4||(T4=!0,queueMicrotask(()=>{w4.clear(),T4=!1})),i},E4=new Map,D4=new Map,O4=new Map,k4=new Map,A4=(e,t)=>`${e}:${t}`,jWe=({locale:e,keyPath:t,instance:n})=>{n&&typeof n==`object`&&E4.set(A4(e,t),n)},j4=({locale:e,keyPath:t,instance:n})=>{let r=A4(e,t);E4.has(r)&&E4.get(r)!==n||(E4.delete(r),D4.delete(r),O4.delete(r),k4.set(r,(k4.get(r)??0)+1))},MWe=()=>{E4.clear(),D4.clear(),O4.clear(),k4.clear()},NWe=e=>{if(e===!1)return{valid:!1};if(typeof e==`object`&&e){let{error:t}=e;if(typeof t==`object`&&t&&typeof t.message==`string`)return{valid:!1,message:t.message}}return{valid:!0}},PWe=async({locale:e,keyPath:t,value:n,fieldConfig:r})=>{let i=A4(e,t),a=E4.get(i);if(typeof a?.isValid!=`function`){D4.set(i,{valid:!0,pending:!1});return}let o=(k4.get(i)??0)+1;k4.set(i,o);let s=D4.get(i);D4.set(i,{valid:s?.valid??!0,message:s?.message,pending:!0});let c=(async()=>{await v4();let e=C4(r),t;try{t=NWe(await a.isValid(n,e))}catch(e){t={valid:!1,message:e instanceof Error?e.message:Y(`validation.unexpected_error`)}}k4.get(i)===o&&D4.set(i,{...t,pending:!1})})();O4.set(i,c);try{await c}finally{O4.get(i)===c&&O4.delete(i)}},FWe=async()=>{for(;O4.size;)await Promise.all(O4.values())},IWe=({locale:e,keyPath:t,validity:n})=>{let r=A4(e,t);if(typeof E4.get(r)?.isValid!=`function`)return;let i=D4.get(r);i&&(n.customError=!i.valid,!i.valid&&i.message?n.customErrorMessage=i.message:delete n.customErrorMessage)},LWe=({fieldConfig:e,value:t,locale:n})=>{let r=e,{type:i,min:a,max:o,singleCustomTimeZone:s}=BH(r),c=typeof a==`string`&&!!a,l=typeof o==`string`&&!!o,u=!1,d=!1;if(t&&(c||l)){let e=NU({currentValue:t,fieldConfig:r,timeZone:s,locale:n});if(e){let t=document.createElement(`input`);t.type=i,c&&(t.min=a),l&&(t.max=o),t.value=e,{rangeUnderflow:u,rangeOverflow:d}=t.validity}}return{validity:{rangeUnderflow:u,rangeOverflow:d},detail:{hasMin:c,hasMax:l,invalid:u||d}}},RWe=new Intl.DateTimeFormat(`en-GB`,{hour12:!0,timeZone:`UTC`,hour:`2-digit`,minute:`2-digit`}),zWe=e=>RWe.format(new Date(`1970-01-01T${e}Z`)).toUpperCase(),BWe=(e,t)=>{if(e===`date`)return t;if(e===`time`)return zWe(t);let[n,r]=t.split(`T`);return`${n}, ${zWe(r)}`},VWe=({direction:e,limitKey:t,limitValue:n,fieldType:r,type:i,canAddMultiValue:a})=>r===`datetime`&&typeof n==`string`?Y(`validation.range_${e}.${i}`,{values:{[t]:BWe(i,n)}}):Y(r===`number`?`validation.range_${e}.number`:a?`validation.range_${e}.add`:`validation.range_${e}.select`,{values:{[t]:n}}),M4=({validity:e,fieldConfig:t})=>{let n=[],{widget:r=`string`}=t,{pattern:i=[]}=t,a=r===`datetime`,o=a?BH(t):{},s=r===`string`?t.type??`text`:a?o.type:r===`number`?`number`:void 0,{min:c,max:l}=a?o:t,u=r===`list`||r===`keyvalue`||Ld.includes(r)&&oh(t);if(e.valueMissing&&n.push(Y(`validation.value_missing`)),e.tooShort){let{minlength:e}=t;n.push(Y(`validation.too_short`,{values:{min:e}}))}if(e.tooLong){let{maxlength:e}=t;n.push(Y(`validation.too_long`,{values:{max:e}}))}return e.rangeUnderflow&&n.push(VWe({direction:`underflow`,limitKey:`min`,limitValue:c,fieldType:r,type:s,canAddMultiValue:u})),e.rangeOverflow&&n.push(VWe({direction:`overflow`,limitKey:`max`,limitValue:l,fieldType:r,type:s,canAddMultiValue:u})),e.patternMismatch&&n.push(i[1]),e.typeMismatch&&n.push(Y(`validation.type_mismatch.${s}`)),e.duplicateError&&n.push(Y(`validation.value_not_unique`)),e.mapKeyDuplicate&&n.push(Y(`validation.key_not_unique`)),e.mapKeyNumeric&&n.push(Y(`validation.key_numeric`)),e.customError&&n.push(e.customErrorMessage??Y(`validation.invalid_value`)),n},HWe=e=>{let t=[];return e?.patternMismatch&&t.push(Y(`edit_path_error.invalid`)),e?.customError&&t.push(Y(`edit_path_error.recursive`)),e?.duplicateError&&t.push(Y(`edit_path_error.duplicate`)),t},UWe=({draft:e,locale:t})=>{let{currentValues:n,extraValues:r}=e,i=n[t]??{},a=r[t]??{};return Object.entries(e.validationMessages[t]??{}).filter(([,e])=>!!e.length).map(([e,t])=>{let[n]=e.match(b$)??[];return{keyPath:e,messages:t,prefix:n,valueMap:n?a:i}}).filter(({keyPath:e,valueMap:t})=>e in t||Object.keys(t).some(t=>t.startsWith(`${e}.`))).map(({keyPath:n,messages:r,prefix:i,valueMap:o})=>{let s=lh(ch(e,{keyPath:x$(n),valueMap:o,componentName:i?a[`${i}__sc_component_name`]:void 0}));return{keyPath:n,label:s?vG({config:s,locale:t}):``,messages:r}})},WWe=({fieldConfig:e,locale:t,value:n})=>{let r=e,{value_type:i=`int`,min:a,max:o}=r,s=n===null||typeof n==`string`&&!n.trim()?NaN:Number(n),c=WU(n,r),l=!c&&Number.isFinite(s),u=l&&typeof a==`number`&&s<a;return{validity:{rangeUnderflow:u,rangeOverflow:!u&&l&&typeof o==`number`&&s>o,typeMismatch:c||(i===`int`||i===`float`)&&fh({fieldConfig:e,locale:t})&&n===null}}},N4=({fieldConfig:e,value:t})=>{let n=e,{widget:r=`string`,minlength:i,maxlength:a}=n,o=Number.isInteger(i)&&i<=(a??1/0),s=Number.isInteger(a)&&(i??0)<=a,{type:c=`text`,prefix:l,suffix:u}=n,d=typeof t==`string`?t:String(t??``);r===`string`&&(l&&d.startsWith(l)&&(d=d.slice(l.length)),u&&d.endsWith(u)&&(d=d.slice(0,-u.length)));let f=[...d.trim()].length,p=o&&f<i,m=s&&f>a,h=!1;if(r===`string`&&d){if(c!==`text`){let e=document.createElement(`input`);e.type=c,e.value=d,{typeMismatch:h}=e.validity}c===`email`&&!h&&!d.split(`@`)[1]?.includes(`.`)&&(h=!0)}return{validity:{tooShort:p,tooLong:m,typeMismatch:h},detail:{count:f,hasMin:o,hasMax:s,invalid:p||m||h}}},GWe={datetime:LWe,number:WWe,string:N4,text:N4},KWe=({value:e,validation:t,validity:n})=>{if(Array.isArray(t)){let r=XU(t[0]);r&&!r.test(String(e))&&(n.patternMismatch=!0)}},qWe=({value:e,required:t,validation:n,validity:r,selected:i=!1})=>{let a=typeof e==`string`?e.trim():e,o=!i&&(a==null||a===``);return t&&o&&(r.valueMissing=!0),KWe({value:a,validation:n,validity:r}),{empty:o}},JWe=e=>{let{keyPath:t}=e,n=t.lastIndexOf(`.`);if(n===-1)return;let r=lh({...e,keyPath:t.slice(0,n)});if(r?.widget===`code`)return bH(r,t.slice(n+1))?r:void 0},YWe=({keyPath:e,value:t,valueMap:n,fieldConfig:r,validities:i,locale:a})=>{let o=yH(r);return e in i[a]?{skip:!0,keyPath:e,value:t}:{skip:!1,keyPath:e,value:o?n[`${e}.${o.code}`]:t}},XWe={valueMissing:!1,tooShort:!1,tooLong:!1,rangeUnderflow:!1,rangeOverflow:!1,patternMismatch:!1,typeMismatch:!1,customError:!1,duplicateError:!1,mapKeyDuplicate:!1,mapKeyNumeric:!1},ZWe=e=>{let t={...e};return t.valid=!Object.values(e).some(Boolean),t},QWe=(e,{count:t,required:n,min:r,max:i})=>{n&&!t?e.valueMissing=!0:typeof r==`number`&&t<r?e.rangeUnderflow=!0:typeof i==`number`&&t>i&&(e.rangeOverflow=!0)},$We=/(.+?)(?:\.[^.]*)?$/,eGe=({keyPath:e,getFieldArgs:t,validity:n,validities:r,locale:i,required:a,min:o,max:s})=>{let c=e=>lh({...t,keyPath:x$(e)})?.widget===`keyvalue`,l=e.match($We)?.[1],u=c(l);if(!u&&c(e)&&(l=e,u=!0),l in r[i]||!u)return{skip:!0,keyPath:e};let d=cK(t.valueMap??{},l).filter(([e,t])=>e.trim()||t);return QWe(n,{count:d.length,required:a,min:o,max:s}),{skip:!1,keyPath:l,empty:!d.length}},tGe=/^\d+/,nGe=({keyPath:e,value:t,valueMap:n,validity:r,validities:i,locale:a,required:o,min:s,max:c})=>{if(e in i[a])return{skip:!0};let l=Array.isArray(t)&&t.length?t.length:(()=>{let t=`${e}.`,r=new Set;return Object.keys(n).forEach(e=>{if(e.startsWith(t)){let n=e.slice(t.length).match(tGe)?.[0];n!==void 0&&r.add(n)}}),r.size})();return QWe(r,{count:l,required:o,min:s,max:c}),{skip:!1,empty:!l}},rGe=({keyPath:e,value:t,valueMap:n})=>{if(Array.isArray(t)&&t.length)return t;let r=`${e}.`;return Object.keys(n).flatMap(e=>{let t=e.startsWith(r)?e.slice(r.length):void 0;return t!==void 0&&eh(t)?[[Number(t),n[e]]]:[]}).sort(([e],[t])=>e-t).map(([,e])=>e)},iGe=({fieldType:e,value:t,files:n})=>Ld.includes(e)&&typeof t==`string`&&t.startsWith(`blob:`)?n[t]?.file?.name:t,aGe=({keyPath:e,value:t,valueMap:n,fieldConfig:r,files:i,validity:a,validities:o,locale:s,required:c,min:l,max:u})=>{let{skip:d,empty:f}=nGe({keyPath:e,value:t,valueMap:n,validity:a,validities:o,locale:s,required:c,min:l,max:u}),{widget:p=`string`,pattern:m}=r;return!d&&!f&&Array.isArray(m)&&(p===`list`?!$G(r).hasSubFields:zd.includes(p))&&KWe({value:rGe({keyPath:e,value:t,valueMap:n}).map(e=>iGe({fieldType:p,value:e,files:i})).join(`,`),validation:m,validity:a}),{skip:d,keyPath:e,value:t,empty:!!f}},oGe={object:({keyPath:e,value:t,valueMap:n,validity:r,required:i})=>{let a=t===void 0?!Object.keys(n).some(t=>t.startsWith(`${e}.`)):!t;return i&&a&&(r.valueMissing=!0),{skip:!1,keyPath:e,value:t,empty:a}},keyvalue:({keyPath:e,value:t,getFieldArgs:n,validity:r,validities:i,locale:a,required:o,min:s,max:c})=>{let l=eGe({keyPath:e,getFieldArgs:n,validity:r,validities:i,locale:a,required:o,min:s,max:c});return{skip:l.skip,keyPath:l.keyPath,value:t,empty:!!l.empty}},code:({keyPath:e,value:t,valueMap:n,fieldConfig:r,validities:i,locale:a})=>{let o=YWe({keyPath:e,value:t,valueMap:n,fieldConfig:r,validities:i,locale:a});return{skip:o.skip,keyPath:o.keyPath,value:o.value,empty:!1}}},sGe=(e,t)=>{Object.assign(e,{patternMismatch:!1,tooShort:!1,rangeUnderflow:!1,typeMismatch:!1}),t||(e.valueMissing=!1)},cGe=e=>{let t=UZ(e)??e.originalEntry;return t?.workflow?bZ(t,e.collection):`draft`},lGe=e=>!WZ(e)||!_Z(e.collection).allowIncompleteDrafts||cGe(e)!==`draft`,P4=(e,{inFolder:t=!0}={})=>{let{collectionName:n,originalEntry:r}=e,i=new Set(r?Qp(r,{includePrevious:!0}):[]);return[...(t?iW:rW)(n),...RZ(n)].filter(e=>!Object.values(e.locales).some(({path:e})=>i.has(e)))},F4=(e,t=Object.keys(e.currentSlugs))=>{let{originalSlugs:n}=e,r=P4(e);return Object.fromEntries(t.map(t=>{let i=n[t]??n._,a=M2(e,t===`_`?void 0:t);return[t,r.flatMap(e=>t===`_`?Object.values(e.locales).map(({slug:e})=>e):[e.locales[t]?.slug]).flatMap(e=>{if(typeof e!=`string`||e===i)return[];let t=a===void 0?e:Bie(e,a);return t===void 0?[]:[t]})]}))},uGe=()=>Dl.current?.slug?.sanitize_replacement?.includes(` `)??!1,I4=({slug:e,required:t=!0,pattern:n,allowSpaces:r=uGe(),takenSlugs:i=[],locale:a})=>{let o=e?.trim()??``;if(!o)return t?`empty`:void 0;if((r?/[/]|[^\S ]/:/[/\s]/).test(e)||o.startsWith(`.`))return`invalid`;if(Array.isArray(n)){let e=XU(n[0]);if(e&&!e.test(o))return`pattern`}if(i.includes(FH(o,{locale:a})))return`duplicate`},L4=({error:e,pattern:t})=>e===`pattern`&&t?.[1]?t[1]:Y(`edit_slug_error.${e}`),dGe=({draft:e,locale:t})=>{let{collection:n,isNew:r,currentLocales:i,currentSlugs:a,originalSlugs:o,slugEditor:s}=e;return n._type!==`entry`||t!==`_`&&!i?.[t]?!1:r?!!s[t]:a[t]!==o[t]&&!vf(n)},fGe=e=>{let{collection:t,isNew:n,currentSlugs:r,slugEditor:i}=e,a={},o=!0,s,{editorRequired:c,editorValueIsSlug:l,pattern:u}=E2(t),d=!n||l,f=uGe();return new Set([...Object.keys(r),...Object.keys(i)]).forEach(t=>{let i=r[t],l=dGe({draft:e,locale:t})?I4({slug:i,required:!n||c,pattern:u,allowSpaces:f,takenSlugs:d&&i?.trim()?(s??=F4(e))[t]:[],locale:t}):void 0,p={valueMissing:l===`empty`,patternMismatch:l===`invalid`,customError:l===`pattern`,duplicateError:l===`duplicate`,valid:!l};l&&(o=!1,p.customErrorMessage=L4({error:l,pattern:u})),a[t]={_slug:p}}),{valid:o,validities:a}},pGe=/\.\d+(?=\.|$)/,mGe=({collection:e,isIndexFile:t=!1,keyPath:n,inEditorComponent:r=!1})=>e._type===`entry`&&!t&&!r&&!pGe.test(n),hGe=[`color`,`datetime`,`file`,`image`,`markdown`,`number`,`relation`,`richtext`,`select`,`string`,`text`],R4=(e,t)=>{if(e==null||typeof e==`object`)return;let n=String(e).trim();if(n){if(t===`number`){let e=Number(n);return Number.isFinite(e)?e:void 0}if(t===`color`)return n.toLowerCase();if(!(Ld.includes(t)&&n.startsWith(`blob:`)))return n}},gGe=({draft:e,fieldConfig:t,keyPath:n,componentName:r})=>{let{widget:i=`string`}=t;return hGe.includes(i)&&t.unique===!0&&!oh(t)&&mGe({collection:e.collection,isIndexFile:e.isIndexFile,keyPath:n,inEditorComponent:!!r})},_Ge=({draft:e,locale:t,keyPath:n,value:r,fieldType:i})=>{let a=R4(r,i);if(a===void 0)return!1;let{collection:o}=e;return P4(e,{inFolder:!1}).some(e=>!cf(o,e)&&R4(e.locales[t]?.content[n],i)===a)},vGe=e=>{if(e.widget!==`datetime`)return[];let{auto_now:t=!1}=e;return typeof t==`boolean`?t?[`create`,`update`]:[]:Array.isArray(t)?t:[]},z4=e=>vGe(e).length>0,yGe=({stages:e,isNew:t,value:n})=>e.includes(`create`)&&(t||Cm(n))||e.includes(`update`)&&!t,bGe=e=>{let{isNew:t,collectionName:n,fileName:r,isIndexFile:i,currentValues:a}=e,o=new Date;Object.entries(a).forEach(([e,a])=>{let s=new Map;Object.entries(a).forEach(([c,l])=>{let u=lh({collectionName:n,fileName:r,keyPath:c,valueMap:a,isIndexFile:i});u&&yGe({stages:vGe(u),isNew:t,value:l})&&(a[c]=Nl(s,u,()=>MU(u,{date:o,includeSeconds:!0,locale:e})))})})},xGe=({collectionName:e,keyPath:t,locale:n})=>[...rW(e),...RZ(e)].reduce((e,r)=>{let i=r.locales[n]?.content?.[t],a=Cm(i)?NaN:Number(i);return Number.isFinite(a)&&(e===void 0||a>e)?a:e},void 0),SGe=(e,t=0)=>{let{collection:n,currentValues:r}=e,i=sW(n);if(!i)return;let{defaultLocale:a}=Rf(e),o=xGe({collectionName:n.name,keyPath:i,locale:a}),s=Math.max(o??0,0)+t+1;Object.values(r).forEach(e=>{e[i]=s})},B4=({fieldConfig:e,...t})=>e.widget===`number`&&e.auto_increment===!0&&mGe(t),CGe=({fieldConfig:e,collection:t,keyPath:n,offset:r})=>{let{min:i}=e,a=xGe({collectionName:t.name,keyPath:n,locale:t._i18n.defaultLocale}),o=typeof i==`number`&&Number.isFinite(i)?Math.ceil(i):1,s=(a===void 0?o:Math.max(Math.floor(a)+1,o))+r;return zU(e)?String(s):s},wGe=(e,t=0)=>{let{isNew:n,collection:r,collectionName:i,isIndexFile:a,currentValues:o,originalValues:s}=e;if(r._type!==`entry`||a)return;let{defaultLocale:c}=r._i18n,l=o[c]??{};Object.keys(l).forEach(e=>{let u=lh({collectionName:i,keyPath:e,valueMap:l,isIndexFile:a});if(!u||!B4({fieldConfig:u,collection:r,isIndexFile:a,keyPath:e})||!(n||Cm(s[c]?.[e])))return;let d=CGe({fieldConfig:u,collection:r,keyPath:e,offset:t});Object.values(o).forEach(t=>{e in t&&(t[e]=d)})})},TGe=/\.\d+(?=\.)/g,EGe=/\.\d+(?=\.|$)/g,DGe=/^\.\d+$/,V4=({validities:e,validationMessages:t,locale:n,keyPath:r,fieldConfig:i})=>{let a=e[n][r];a&&(t[n][r]=M4({validity:a,fieldConfig:i}))},H4=e=>{let{draft:t,locale:n,valueMap:r,componentName:i,validities:a,enforceRequired:o=!0}=e,{collection:s,files:c,isIndexFile:l}=t,{keyPath:u,value:d}=e,f=ch(t,{keyPath:x$(u),valueMap:r,componentName:i}),p=lh({...f})??sK({...f});if(!p)return;let{widget:m=`string`,i18n:h=!1,pattern:g}=p,_=oh(p)||dh(p)===`custom`&&Array.isArray(d),{min:v=0,max:y=1/0}=vie.includes(m)?p:{},{i18nEnabled:b,defaultLocale:x}=Rf(t);if(!i&&n!==x&&(!b||IW(h)||h===`duplicate`)&&!zW({fieldConfig:p,getFieldArgs:f})||!i&&z4(p)||B4({fieldConfig:p,collection:s,isIndexFile:l,keyPath:u,inEditorComponent:!!i}))return;let S=fh({fieldConfig:p,locale:n}),C=wh(f),w={...XWe},T=!1,ee=m===`list`||_?aGe:oGe[m];if(ee){let e=ee({keyPath:u,value:d,valueMap:r,fieldConfig:p,getFieldArgs:f,files:c,validity:w,validities:a,locale:n,required:S,min:v,max:y});if(e.skip)return;({keyPath:u,value:d,empty:T}=e)}let E=d;if(d=iGe({fieldType:m,value:d,files:c}),!([`object`,`list`,`hidden`,`compute`,`keyvalue`].includes(m)||_)){let e=m===`select`&&RG({fieldConfig:p,value:d});({empty:T}=qWe({value:d,required:S,validation:g,validity:w,selected:e}))}let te=GWe[m];return te&&Object.assign(w,te({fieldConfig:p,locale:n,value:d}).validity),!T&&gGe({draft:t,fieldConfig:p,keyPath:u,componentName:i})&&(w.duplicateError=_Ge({draft:t,locale:n,keyPath:u,value:E,fieldType:m})),!T&&C&&(w.mapKeyDuplicate=lse({...C,valueMap:r,keyPath:u,value:d}),w.mapKeyNumeric=ise(String(d))),IWe({locale:n,keyPath:u,validity:w}),T&&sGe(w,o||!!C),ZWe(w)},U4=e=>{let{validities:t,locale:n,keyPath:r}=e,i=H4(e),a=!0;return i&&(t[n][r]=i,i.valid||(a=!1)),a},W4=({draft:e,locale:t,keyPath:n,value:r,valueMap:i})=>{let{validities:a,validationMessages:o}=e,s=ch(e,{keyPath:n,valueMap:i}),c=lh(s)?void 0:sK(s),l=c?n.replace(oK,``):n;if(!a?.[t]?.[l])return;let u=H4({draft:e,locale:t,keyPath:n,value:r,valueMap:i,enforceRequired:lGe(e),validities:{[t]:{}}});u&&(a[t][l]=u,V4({validities:a,validationMessages:o,locale:t,keyPath:l,fieldConfig:c??lh(s)}))},OGe=({draft:e,locale:t,keyPath:n,value:r,valueMap:i,keyAdded:a=!0})=>{W4({draft:e,locale:t,keyPath:n,value:r,valueMap:i});let o=wh(ch(e,{keyPath:n,valueMap:i}));o&&Th({...o,valueMap:i}).forEach(a=>{a!==n&&(e.validities?.[t]?.[a]?.mapKeyDuplicate||String(i[a])===String(r))&&W4({draft:e,locale:t,keyPath:a,value:i[a],valueMap:i})}),[...n.matchAll(EGe)].forEach(({index:r})=>{let o=n.slice(0,r);if(!a&&!DGe.test(n.slice(r)))return;let s=lh(ch(e,{keyPath:o,valueMap:i}));s&&(s.widget===`list`||oh(s))&&W4({draft:e,locale:t,keyPath:o,value:i[o],valueMap:i})})},kGe=({fieldConfig:e,validateArgs:t})=>{let{validities:n,locale:r,keyPath:i}=t,a=n[r][i]?.valid??U4(t),{widget:o=`string`}=e;return o===`list`&&!$G(e).hasSubFields||oh(e)?{valid:a,validateItems:!1}:{valid:a,validateItems:!0}},G4=({getFieldArgs:e},t)=>lh({...e,keyPath:x$(t)}),AGe=(e,{listKeyPath:t,fieldConfig:n,listFieldConfig:r})=>{let{validateArgs:i,validationMessages:a}=e,{validities:o,locale:s}=i,c=kGe({fieldConfig:n,validateArgs:{...i,keyPath:t,value:``}});return t in a[s]||V4({validities:o,validationMessages:a,locale:s,keyPath:t,fieldConfig:r}),c},jGe=(e,{keyPath:t,value:n,getParentField:r,viaSubKey:i})=>{let{validateArgs:a,validationMessages:o,getFieldArgs:s}=e,{validities:c,locale:l,valueMap:u}=a,d=r({...s}),f=t.replace(oK,``);if(!d||f in c[l])return!0;let p=i?t:f,m=U4({...a,keyPath:p,value:i?n:u[f]}),h=c[l][p];return i&&h&&(delete c[l][t],c[l][f]=h),V4({validities:c,validationMessages:o,locale:l,keyPath:f,fieldConfig:d}),m},MGe=({draft:e,locale:t,valueMap:n,keyPath:r,value:i,validities:a,validationMessages:o,enforceRequired:s})=>{let[c]=r.match(b$)??[],l=c?n[`${c}__sc_component_name`]:void 0;if(c&&!l)return!0;let u=!0,d={validateArgs:{draft:e,locale:t,valueMap:n,validities:a,enforceRequired:s,componentName:l},validationMessages:o,getFieldArgs:ch(e,{keyPath:x$(r),valueMap:n,componentName:l})};[...r.matchAll(TGe)].forEach(({index:e})=>{let t=r.slice(0,e),n=G4(d,t);n?.widget===`list`&&!AGe(d,{listKeyPath:t,fieldConfig:n,listFieldConfig:n}).valid&&(u=!1)});let f=im.test(r)?r.replace(im,``):void 0,p=f===void 0?void 0:G4(d,f),m=G4(d,r)??(p?.widget===`list`&&!$G(p).hasSubFields?p:void 0);if(!m){let e=jGe(d,{keyPath:r,value:i,getParentField:sK,viaSubKey:!0}),t=jGe(d,{keyPath:r,value:i,getParentField:JWe,viaSubKey:!1});return e&&t||(u=!1),u}if(dh(m)===`unknown`)return u;if(f!==void 0){let{valid:e,validateItems:t}=AGe(d,{listKeyPath:f,fieldConfig:m,listFieldConfig:p});if(e||(u=!1),!t)return u}return U4({...d.validateArgs,keyPath:r,value:i})||(u=!1),V4({validities:a,validationMessages:o,locale:t,keyPath:r,fieldConfig:m}),u},K4=(e,{draft:t,enforceRequired:n=!0})=>{let{currentLocales:r}=t,i={},a={},o=!0;return Object.entries(t[e]).forEach(([e,s])=>{let c=Object.entries(s);r[e]?(i[e]={},a[e]={},c.forEach(([r,c])=>{MGe({draft:t,locale:e,valueMap:s,keyPath:r,value:c,validities:i,validationMessages:a,enforceRequired:n})||(o=!1)})):(i[e]=Object.fromEntries(c.map(([e])=>[e,{valid:!0}])),a[e]=Object.fromEntries(c.map(([e])=>[e,[]])))}),{valid:o,validities:i,validationMessages:a}},q4=(e,t)=>{let n=e?.workflow?.branch;return!n||n===t?.workflow?.pullRequest.branch?e:e.workflow?.replacedAsset},J4=(e,t,n)=>{if(!n.length)return new Set;let r=e1(n.map(e=>({asset:{path:e}})),{entries:[e,...t.map(({entry:e})=>e)]});return new Set(n.filter((e,t)=>r[t].length))},Y4=e=>{if(!e.length)return;let t=new Map(Dp.current.map(e=>[e.path,e]));e.forEach(e=>{let n=t.get(e.path);t.set(e.path,{...e,workflow:{branch:e.workflow?.branch,replacedAsset:n?.workflow?n.workflow.replacedAsset:n}})}),Dp.current=[...t.values()]},NGe=(e,t)=>{Dp.current=Dp.current.flatMap(n=>n.workflow?.branch===e&&t(n)?n.workflow.replacedAsset??[]:n)},X4=e=>{NGe(e,()=>!0)},PGe=(e,t)=>{NGe(e,({path:e})=>t.has(e))},FGe=e=>{Dp.current=Dp.current.map(t=>{if(t.workflow?.branch!==e)return t;let{workflow:n,...r}=t;return r})},IGe=new Map,LGe=e=>e.startsWith(`/`),RGe=async(e,t)=>{let{name:n,fields:r=[],preview_path_date_field:i,_i18n:{defaultLocale:a},_thumbnailFieldNames:o}=e,{locales:s}=t,c=Xp(s,a),{content:l,slug:u,path:d}=s[c]??{};if(!l)return;let f=o.some(e=>e.includes(`*`))?Object.keys(l):void 0,p=o.flatMap(n=>{if(LGe(n))return[{value:lHe({pathTemplate:n,dateFieldName:i,fields:r,collection:e,locale:c,slug:u,entryFilePath:d,content:l,isIndexFile:cf(e,t)})}];if(n.includes(`*`)){let e=Nl(IGe,n,()=>RegExp(`^${Fc(n).replaceAll(`\\*`,`.+`)}$`));return f.filter(t=>e.test(t)).map(e=>({value:l[e],keyPath:e}))}return[{value:l[n],keyPath:n}]});for(let{value:e,keyPath:r}of p){let i={value:e,entry:t,collectionName:n,typedKeyPath:r,locale:c},{asset:a}=e&&g$(i)||{},o=e&&(!a||bp(a))?await v$({...i,thumbnail:!0}):void 0;if(o)return{src:o,owned:!!a&&o.startsWith(`blob:`)}}},zGe=(e,t,n)=>{let r=!1,i;return RGe(e,t).then(e=>{r?e?.owned&&uZ(e.src):(i=e,e&&n(e.src))},()=>{}),()=>{r=!0,i?.owned&&uZ(i.src)}},BGe=new WeakMap,VGe=e=>{let t=rW(e);return Nl(BGe,t,()=>{let e=new Map;return t.forEach(({id:t,locales:n})=>{Object.values(n).forEach(({path:n})=>{let r=Uc(n).dirname;r!==void 0&&Nl(e,r,()=>new Set).add(t)})}),e})},HGe=Bl(()=>Dp.current,e=>{let t=new Map;return e.forEach(e=>{let n=Uc(e.path).dirname;if(n===void 0)return;let r={asset:e,dirPath:n};for(let e=n;Nl(t,e,()=>[]).push(r),e.includes(`/`);e=e.slice(0,e.lastIndexOf(`/`)));}),t}),UGe=e=>HGe().get(e)??[],WGe=({locales:e},t)=>Object.values(e).flatMap(({path:e})=>t(e)??[]),GGe=(e,t)=>WGe(t,t=>IJ(e,t)),KGe=e=>WGe(e,e=>Uc(e).dirname),qGe=({entry:e,collectionName:t,fileName:n,relative:r=!1})=>{let{locales:i}=e,a=Kf(t);if(!a)return[];let o=cf(a,e),s=Ac(Object.entries(i).flatMap(([i,{content:a}])=>Object.entries(a??{}).map(([a,s])=>{if(typeof s==`string`&&(!r||wQ(s))){let c=lh({collectionName:t,fileName:n,keyPath:a,isIndexFile:o})?.widget??`string`;if(!Ld.includes(c))return;let l=TQ({value:s,entry:e,collectionName:t,fileName:n,locale:i});if(l&&Dy(l.path).some(e=>e.collectionName===t&&e.fileName===n&&(!r||e.entryRelative)))return l}})).filter(Boolean));if(r&&Ey({collectionName:t,fileName:n})?.entryRelative){let n=new Set(GGe(a,e)),r=new Set(s.map(({path:e})=>e)),i=VGe(t);n.forEach(t=>{let n=n=>{let r=n;for(;r.length>t.length;){let t=i.get(r);if(t&&(t.size>1||!t.has(e.id)))return!0;r=r.slice(0,r.lastIndexOf(`/`))}return!1};UGe(t).forEach(({asset:e,dirPath:t})=>{!n(t)&&!r.has(e.path)&&(s.push(e),r.add(e.path))})})}return s},JGe=({entry:e,collectionName:t,fileName:n})=>[...new Set(qGe({entry:e,collectionName:t,fileName:n,relative:!0}).map(t=>q4(t,e)).filter(Boolean))],YGe=(e,t,n)=>{let r=new Map;return t.forEach((t,i)=>{let a=GGe(e,t);n[i].forEach(e=>{a.some(t=>e.path.startsWith(`${t}/`))||r.set(e.path,e)})}),[...r.values()]},XGe=(e,t,n)=>{let r=new Set(t.flatMap(KGe)),i=e1(e.map(e=>({asset:e})),{entries:[...new Set([...rW(n),...Vp.current.filter(e=>KGe(e).some(e=>r.has(e)))])]});return new Map(e.map((e,t)=>[e.path,i[t].map(({id:e})=>e)]))},ZGe=({entries:e,collectionName:t,fileName:n})=>{let r=Ey({collectionName:t,fileName:n})?.entryRelative?Kf(t):void 0;if(!r||jd(r))return e.map(()=>[]);let i=e.map(e=>JGe({entry:e,collectionName:t,fileName:n})),a=YGe(r,e,i);if(!a.length)return i;let o=XGe(a,e,t);return i.map((t,n)=>t.filter(t=>(o.get(t.path)??[]).every(t=>t===e[n].id)))},QGe=({entry:e,collectionName:t,fileName:n})=>ZGe({entries:[e],collectionName:t,fileName:n})[0],$Ge=[`preSave`,`postSave`,`prePublish`,`postPublish`,`preUnpublish`,`postUnpublish`],eKe=[`preSave`],Z4=async({type:e,entry:t,collection:n,collectionFile:r,isNew:i=!1})=>{let{login:a,name:o}=Fu.account,s=a??``,c=o??``,l=n.name,u=r?.name,{_i18n:{defaultLocale:d}}=r??n,f=[...Tie].filter(t=>t.name===e);if(!f.length)return;let p;try{({isMap:p}=await v4())}catch(t){console.error(`Skipping the ${e} event hooks: Immutable.js could not be loaded`,t);return}let{slug:m,locales:h}=t,g=Xp(h,d),_=Object.keys(h).filter(e=>e!==g),v=qGe({entry:t,collectionName:l,fileName:u});for(let n of f){let{content:r,path:a}=Zp(t,{locale:g})??{},o;try{o=await n.handler({author:{login:s,name:c},entry:_We({content:r,otherLocales:_,locales:h,slug:m,path:a,isNew:i,collectionName:l,associatedAssets:v})})}catch(t){if(!e.startsWith(`post`))throw t;console.error(`The ${e} event hook failed`,t)}if(eKe.includes(e)&&p(o)){let e=o.toJS();X(e.data)&&X(e.i18n)?(h[g].content=bm(e.data),_.forEach(t=>{X(e.i18n[t]?.data)&&(h[t].content=bm(e.i18n[t].data))})):h[g].content=bm(e)}}},tKe=({draft:e,locale:t,content:n,slug:r,path:i})=>{let{isNew:a,isIndexFile:o,collection:s,fields:c,originalEntry:l}=e;if(a||o||!l)return;let{preview_path:u}=s,d=i4({collection:s,fields:c});if(!u||!d)return;let{slug:f,path:p,content:m}=l.locales[t]??{};if(f===void 0||f===r)return;let{defaultLocale:h}=s._i18n,g=o4({collection:s,locale:t,slug:f,path:p,content:m,defaultContent:l.locales[h]?.content}),_=o4({collection:s,locale:t,slug:r,path:i,content:n,defaultContent:kK(e,h)});if(g===void 0||g===_)return;let v=a4(n,d);if(!v.length&&!Cm(n[d]))return;let y=v.map(e=>n[e]).filter(Uu).filter(e=>e!==g&&e!==_);DUe(n,d),[...y,g].forEach((e,t)=>{n[`${d}.${t}`]=e})},nKe=({basePath:e,path:t,extension:n,locale:r,omitLocale:i,structure:a})=>{if(Cf(e))return`${Kie({path:e,locale:r,omitLocale:i})}/${t}.${n}`;switch(a){case`multiple_folders`:return i?`${e}/${t}.${n}`:`${e}/${r}/${t}.${n}`;case`multiple_folders_i18n_root`:case`multiple_root_folders`:return i?`${e}/${t}.${n}`:`${r}/${e}/${t}.${n}`;case`multiple_files`:return i?`${e}/${t}.${n}`:`${e}/${t}.${r}.${n}`;default:return`${e}/${t}.${n}`}},rKe=({draft:e,slug:t,indexFileName:n,locale:r})=>{let{collection:i,isNew:a,originalEntry:o,currentPath:s}=e,c=Lc(s??``),l=r!==i._i18n.defaultLocale&&D2(i);if(n)return $l(a?[j2(e,r),t,n]:[A2({collection:i,dirPath:xf(c),locale:r}),l?O2(t)||t:tu(c),n]);let u=o?.locales[r]?.slug??(l?void 0:o?.subPath),d=u?Uc(u).basename:t;return $l([j2(e,r),d])},iKe=({draft:e,locale:t,slug:n})=>{let{originalEntry:r,originalPath:i,currentPath:a}=e;return r?.locales?.[t]?.slug===n?!bf(e)||Lc(i??``)===Lc(a):!1},Q4=({draft:e,locale:t,slug:n})=>{let{collection:r,collectionFile:i,originalEntry:a,currentValues:o,isIndexFile:s}=e,{_i18n:{defaultLocale:c,structure:l,omitDefaultLocaleFromFilePath:u}}=i??r;if(i){let{_i18n:e,file:n}=i;return Af({_i18n:e,locale:t,path:Lc(n)})}if(jd(r))return r._file.fullPath;let d=r,f=vf(d),p=bf(e);if(iKe({draft:e,locale:t,slug:n}))return a.locales[t].path;let{basePath:m,subPath:h,extension:g}=Pf({collection:d,isIndexFile:s}),_=s?of(d)?.name:p?rKe({draft:e,slug:n,indexFileName:f,locale:t}):h?nQ(h,{collection:d,locale:c,content:o[c],currentSlug:n,dateTimeParts:_He(e),randomValues:hHe(e)}):n;return s&&_?.endsWith(`.${g}`)&&(_=_.slice(0,-g.length-1)),$l(nKe({basePath:m,path:_,extension:g,locale:t,omitLocale:u&&t===c,structure:l}).split(`/`))},aKe=(e,t)=>e.includes(`{{`)?nQ(e,t):e,oKe=({internalSubPath:e,assetFolderPath:t,fillSlugOptions:n})=>iu(aKe($l([t,e]),n)),sKe=({publicPath:e,fillSlugOptions:t})=>/^\.?$/.test(e)?e:iu(aKe(e,t)),cKe=({folder:e,fillSlugOptions:t})=>{let{entryRelative:n,internalPath:r,internalSubPath:i,publicPath:a}=e;if(r===void 0||a===void 0)return{resolvedInternalPath:``,resolvedPublicPath:``};if(!n)return{resolvedInternalPath:nQ(r,t),resolvedPublicPath:nQ(a,t)};let{collection:o,entryFilePath:s}=t;return{resolvedInternalPath:oKe({internalSubPath:i,assetFolderPath:LJ({collection:o,entryFilePath:s??``,internalPath:r}),fillSlugOptions:t}),resolvedPublicPath:sKe({publicPath:a,fillSlugOptions:t})}},lKe=({draft:e,locale:t,slug:n,defaultLocaleSlug:r,folder:i})=>{let{collection:a,collectionFile:o,isIndexFile:s}=e,{_i18n:{defaultLocale:c}}=o??a;return cKe({folder:i,fillSlugOptions:{...P2({draft:e}),type:`media_folder`,dateTimeParts:void 0,currentSlug:r,entryFilePath:Q4({draft:e,locale:t??c,slug:n??r}),isIndexFile:s}})},$4=(e,t)=>e?`${e===`/`?``:e}/${t}`:t,uKe=({draft:e,locale:t,entryFilePath:n,folderPath:r})=>{let{collection:i,isNew:a,originalEntry:o}=e,s=a?void 0:o?.locales[t]?.path;if(!s)return;let c=IJ(i,s),l=IJ(i,n);if(c&&l&&c!==l&&(r===l||r.startsWith(`${l}/`)))return`${c}${r.slice(l.length)}`},dKe=({draft:e,locale:t,slug:n,defaultLocaleSlug:r,folder:i,subfolderPath:a=``})=>{let{collectionName:o}=e,s=lKe({draft:e,locale:t,slug:n,defaultLocaleSlug:r,folder:i});if(a){let{resolvedInternalPath:e,resolvedPublicPath:t}=s;s={...s,resolvedInternalPath:$l([e,a]),resolvedPublicPath:$4(t,a)}}let{resolvedInternalPath:c}=s,l=t??Rf(e).defaultLocale,u=i.entryRelative?uKe({draft:e,locale:l,entryFilePath:Q4({draft:e,locale:l,slug:n??r}),folderPath:c}):void 0,d=e=>OQ(e).map(e=>e.name.normalize());return{assetFolderPaths:s,assetNamesInSameFolder:d(c),takenNamesInSameFolder:kQ(c),assetNamesMovingIn:u?d(u):[],savingAssetProps:{collectionName:o,folder:i}}},fKe=async({file:e,folder:t,subfolderPath:n,replace:r,nameTemplate:i,blobURL:a,draft:o,locale:s,slug:c,defaultLocaleSlug:l,keyPath:u,content:d,changes:f,savingAssets:p,encodingEnabled:m})=>{let h=await cu(e);Pre();let{savingAssetProps:g,assetNamesInSameFolder:_,takenNamesInSameFolder:v,assetNamesMovingIn:y,assetFolderPaths:{resolvedInternalPath:b,resolvedPublicPath:x}}=dKe({draft:o,locale:s,slug:c,defaultLocaleSlug:l,folder:t,subfolderPath:n}),S=p.filter(e=>eu(e.path)===b),C=S.find(n=>n.sha===h&&(!t.entryRelative||(0,Qc.default)(n.folder,t))&&(!r||LQ(n.name,e.name))),w=``;if(C)w=C.name;else{let n=b2({draft:o,item:{file:e,folder:t,replace:r,nameTemplate:i},defaultLocaleSlug:l}),s=S.map(e=>e.name.normalize()),c=r?IQ(n):void 0,u=(e,t)=>e.some(e=>e.toLowerCase()===t.toLowerCase()),d=c!==void 0&&!u(s,c)&&(u(_,c)||!u(v,c));w=d?c:IQ(n,{assetNamesInSameFolder:[...v,...y,...s]});let m=d?_.find(e=>e.toLowerCase()===w.toLowerCase()):void 0,x=!!m;m&&(w=m);let C=b?`${b}/${w}`:w;xy([C]),f.push({action:x?`update`:`create`,path:C,data:e}),p.push({...g,blobURL:a,name:w,path:C,sha:h,size:e.size,kind:Ep(w)})}let T=$4(x,w);m&&(T=Yl(T)),d[u]=d[u].replaceAll(a,()=>T)},pKe=({draft:e,locale:t,content:n,slug:r,path:i})=>{let{collection:a,fields:o,isIndexFile:s}=e;s4({collection:a,fields:o})&&kUe({collection:a,fields:o,isIndexFile:s,locale:t,content:n,defaultContent:kK(e,a._i18n.defaultLocale),slug:r,path:i})},e3=({collection:{_file:e},path:t,fallback:n})=>e.fullPathRegEx?t.match(e.fullPathRegEx)?.groups?.subPath??n:n,mKe=({draft:e,slugs:{defaultLocaleSlug:t,localizedSlugs:n}})=>{let{collection:r,defaultLocale:i}=e;return!n||!gf(r)?void 0:F2({draft:e,defaultLocaleSlug:e3({collection:r,path:Q4({draft:e,locale:i,slug:t}),fallback:t}),localizedSlugs:n,fillSlugOptions:P2({draft:e})})},hKe=async({draft:e,files:t,defaultLocaleSlug:n,changes:r,savingAssets:i,getFieldArgs:a,encodingEnabled:o,globalAssetFolder:s,locale:c,slug:l,content:u,keyPath:d,matches:f})=>{let p={...a,valueMap:u,keyPath:d},m=lh(p),{defaultLocale:h}=Rf(e),g=c!==h&&!!m&&RW({fieldConfig:m,getFieldArgs:p}),_={draft:e,defaultLocaleSlug:n,changes:r,savingAssets:i,locale:g?h:c,slug:g?void 0:l,keyPath:d,content:u,encodingEnabled:Rd.includes(m?.widget??``)||o};await Promise.all(f.map(async([e])=>{let{file:n,folder:r=s,replace:i,subfolderPath:a,nameTemplate:o}=t[e]??{};if(!n)throw Error(`The file referenced in the "${m?.label??d}" field is no longer available. Select the file again.`);if(!r)throw Error(`There is no asset folder to save the file "${n.name}" to`);await fKe({..._,file:n,folder:r,replace:i,subfolderPath:a,nameTemplate:o,blobURL:e})}))},gKe=[`text`,...Rd],_Ke=({getFieldArgs:e,content:t,keyPath:n,value:r})=>{let i={...e,valueMap:t},a=lh({...i,keyPath:n}),o=n.split(`.`).slice(0,-1).join(`.`),s=a?a.widget??`string`:o&&lh({...i,keyPath:o})?.widget;return s===`code`?r:gKe.includes(String(s))?r.trimEnd():r.trim()},vKe=async({keyPath:e,value:t,...n})=>{let{content:r}=n;if(t===void 0){delete r[e];return}if(typeof t!=`string`)return;r[e]=_Ke({getFieldArgs:n.getFieldArgs,content:r,keyPath:e,value:t});let i=[...t.matchAll(Vc(`g`))];i.length&&await hKe({...n,keyPath:e,matches:i})},yKe=async({path:e,canonicalSlug:t,canonicalSlugKey:n,...r})=>{let{draft:i,locale:a,slug:o,content:s}=r;t!==void 0&&(s[n]=t),tKe({draft:i,locale:a,content:s,slug:o,path:e}),await Promise.all(Object.entries(s).map(([e,t])=>vKe({...r,keyPath:e,value:t}))),pKe({draft:i,locale:a,content:s,slug:o,path:e})},bKe=async({draft:e,slugs:t})=>{let{defaultLocaleSlug:n,localizedSlugs:r}=t,i=Cy.current,{collection:a,collectionFile:o,currentLocales:s,currentValues:c,files:l}=e,{_i18n:{canonicalSlug:{key:u}}}=o??a,d=[],f=[],{encode_file_path:p=!1}=Dl.current?.output??{},m=ch(e,{keyPath:``,valueMap:{}}),h=mKe({draft:e,slugs:t})??t.canonicalSlug,g={draft:e,files:l,defaultLocaleSlug:n,changes:d,savingAssets:f,getFieldArgs:m,encodingEnabled:p,globalAssetFolder:i};return{localizedEntryMap:Object.fromEntries(await Promise.all(Object.entries(c).map(async([t,i])=>{let a=_K(i),o=r?.[t]??n,c=Q4({draft:e,locale:t,slug:o});return s[t]?(await yKe({...g,locale:t,slug:o,path:c,content:a,canonicalSlug:h,canonicalSlugKey:u}),[t,{slug:o,path:c,content:Oc(a)}]):[t,{path:c}]}))),changes:d,savingAssets:f}},xKe=e=>({...e,locales:Object.fromEntries(Object.entries(e.locales).filter(([,{content:e}])=>e!==void 0))}),t3=e=>{if(e?.arrayIndex===void 0)return{};let{locales:t}=Vp.current.find(({id:t})=>t===e.id)??e;return{arrayItem:{index:e.arrayIndex,locales:t}}},SKe=({draft:e,savingEntry:t,recreate:n=!1})=>{let{collection:r,originalEntry:i,collectionFile:a}=e,o=e.isNew||n,{_i18n:{defaultLocale:s}}=a??r,{slug:c,path:l}=t.locales[s],u=o?void 0:i?.locales[s]?.path,d=!o&&!!u&&u!==l;return{action:o?`create`:d?`move`:`update`,slug:c,path:l,previousPath:d?u:void 0,currentPath:u,...jd(r)&&!o?t3(i):{}}},CKe=({draft:e,savingEntry:t,locale:n,recreate:r=!1})=>{let{originalLocales:i,currentLocales:a,originalEntry:o}=e,s=e.isNew||r,{slug:c,path:l}=t.locales[n]??{},u=s?void 0:o?.locales[n]?.path;if(a[n]){let e=!s&&!!i[n]&&!!u&&u!==l;return{action:s||!i[n]?`create`:e?`move`:`update`,slug:c,path:l,previousPath:e?u:void 0,currentPath:u}}if(!s&&i[n])return{action:`delete`,slug:o?.locales[n]?.slug??c,path:u,currentPath:u}},n3=async({draft:e,slugs:t,recreate:n=!1,runPreSave:r=!0})=>{let{id:i,collection:a,collectionFile:o}=e,{defaultLocaleSlug:s}=t,c=o??a,{defaultLocale:l}=c._i18n,{localizedEntryMap:u,changes:d,savingAssets:f}=await bKe({draft:e,slugs:t}),{path:p}=u[l]??Object.values(u).find(({content:e})=>e)??Object.values(u)[0],m=e3({collection:c,path:p,fallback:s}),h=gf(a),g={id:i,slug:h?m:s,subPath:m,...e.isNew||e.originalEntry?.arrayIndex===void 0?{}:{arrayIndex:e.originalEntry.arrayIndex},locales:Object.fromEntries(Object.entries(u).map(([e,t])=>[e,h?{...t,slug:e3({collection:c,path:t.path,fallback:s})}:t]))};return r&&await Z4({type:`preSave`,entry:g,collection:a,collectionFile:o,isNew:e.isNew}),d.push(...await h4({draft:e,config:c,_file:Pf({collection:a,collectionFile:o,isIndexFile:e.isIndexFile}),entry:g,cacheDB:p4(),planChange:t=>t===void 0?SKe({draft:e,savingEntry:g,recreate:n}):CKe({draft:e,savingEntry:g,locale:t,recreate:n})})),{savingEntry:g,savingAssets:f,changes:d}},wKe=async e=>{let{collectionName:t,entry:n,changes:r,baseEntry:i}=e,a=!i,o=Kf(t),s={...n,locales:Object.fromEntries(Object.entries(n.locales).map(([e,t])=>[e,{...t}]))};if(await Z4({type:`preSave`,entry:s,collection:o,isNew:a}),!Object.entries(s.locales).some(([e,{content:t}])=>t!==n.locales[e].content))return e;let{defaultLocale:c}=o._i18n,l=new Set(Object.values(n.locales).map(({path:e})=>e)),u=await h4({draft:{collection:o,collectionName:t,fields:o.fields,isIndexFile:!1},config:o,_file:Pf({collection:o}),entry:s,cacheDB:p4(),planChange:e=>{let t=s.locales[e??c];if(!t)return;let{slug:n,path:i}=t,{action:o}=a?{action:`create`}:r.find(e=>e.path===i);return{action:o,slug:n,path:i,currentPath:o===`create`?void 0:i}}});return{...e,entry:s,changes:[...r.filter(({path:e})=>!l.has(e)),...u]}},r3=({collection:e,collectionFile:t,isIndexFile:n=!1})=>({collection:e,collectionName:e.name,collectionFile:t,fileName:t?.name,fields:t?.fields??e.fields,isIndexFile:n}),i3=async({collection:e,collectionFile:t,entry:n,draft:r,cacheDB:i})=>{let a=t??e;return h4({draft:r,config:a,_file:Pf({collection:e,collectionFile:t,isIndexFile:r.isIndexFile}),entry:n,cacheDB:i,planChange:e=>{if(e===void 0){let{slug:e,path:t}=Zp(n,{defaultLocale:a._i18n.defaultLocale});return{action:`update`,slug:e,path:t,currentPath:t,...t3(n)}}let{slug:t,path:r,content:i}=n.locales[e]??{};return i?{action:`update`,slug:t,path:r,currentPath:r}:void 0}})},a3=e=>rQ()||YU(e).some(t=>rQ({collection:t})||qp(t,e).some(e=>rQ({collection:t,collectionFile:e}))),o3=(e,t=YU(e)[0])=>t?`${qf(t)} › ${wW(t,e)}`:e.slug,TKe=({content:e,listKeyPath:t,isStale:n})=>{let r=sm(e,t,{live:!0}),i=r.filter(t=>!n(t,e[t])).map(t=>e[t]);r.forEach(t=>{delete e[t]}),i.length?i.forEach((n,r)=>{e[`${t}.${r}`]=n}):e[t]=[]},EKe=({draft:e,entry:t,collection:n,collectionFile:r,locale:i,content:a,fields:o})=>{let s=rQ({collection:n,collectionFile:r})||a3(t);return[...o].flatMap(([r,o])=>{let c;if(s)c=[Y(`readonly_reference`)];else{let t=H4({draft:e,locale:i,keyPath:r,value:a[r],valueMap:a,validities:{[i]:{}}});if(!t||t.valid)return[];c=M4({validity:t,fieldConfig:o})}let l=n.name;return[{collectionName:l,collectionLabel:n.label||l,fieldLabel:vG({config:o}),entry:t,summary:wW(n,t),locale:i,keyPath:r,messages:c}]})},DKe=e=>{let t=new Set;return e.filter(({entry:e,keyPath:n})=>{let r=`${e.id}\0${n}`;return!t.has(r)&&(t.add(r),!0)})},s3=async({targets:e,cacheDB:t})=>{if(!e.length)return{changes:[],savingEntries:[]};let n=p4(t),r=e.map(({entry:e,collection:t,collectionFile:n})=>{let r=cf(t,e);return{collection:t,collectionFile:n,isIndexFile:r,entry:c4({collection:t,isIndexFile:r,entry:e})}});return{changes:(await Promise.all(r.map(({entry:e,collection:t,collectionFile:r,isIndexFile:i})=>i3({collection:t,collectionFile:r,entry:e,draft:r3({collection:t,collectionFile:r,isIndexFile:i}),cacheDB:n})))).flat(),savingEntries:r.map(({entry:e})=>e)}},OKe=e=>{let t=[],n=new Set;return e.forEach(e=>{let{url:r,asset:i}=CUe(e);if(r===void 0){t.push({asset:i});return}let a=K$(r);n.has(a)||(n.add(a),t.push({url:a}))}),t},c3=(e,t,n)=>{let r=t+n,i=e.lastIndexOf(`
`,t-1)+1,a=e.indexOf(`
`,r),o=a===-1?e.length:a;if(e.slice(i,t).trim()||e.slice(r,o).trim())return e.slice(0,t)+e.slice(r);let s=e.slice(0,i),c=e.slice(o),l=!s||/\n[ \t]*\n$/.test(s),u=!c||/^\n[ \t]*\n/.test(c);return l&&u?c?s+c.replace(/^\n[ \t]*\n/,``):s.replace(/\n[ \t]*\n$/,`
`):c?s+c.slice(1):s.replace(/\n$/,``)},kKe=[`a`,`div`,`figure`,`p`,`picture`,`span`],AKe=e=>[`img`,`source`].includes(e.localName)?!e.hasAttribute(`src`)&&!e.hasAttribute(`srcset`):!e.hasAttribute(`src`)&&!e.querySelector(`:scope > source`),jKe=e=>{let t=e;for(e.localName===`img`&&e.parentElement?.localName===`picture`&&(t=e.parentElement);;){let e=t.parentElement;if(t.remove(),!e||!kKe.includes(e.localName)||e.childElementCount||e.textContent.trim())break;t=e}},MKe=(e,t)=>{let n=O$(e),r=L$(n),i=new Set(r.filter(e=>H$(e,(e,n)=>t(n)?null:void 0)));return i.size?(r.reverse().forEach(e=>{if(!i.has(e)||!AKe(e))return;let{parentElement:t}=e;e.localName===`source`&&t&&[`audio`,`video`].includes(t.localName)&&i.add(t),jKe(e)}),n.innerHTML):e},NKe=new RegExp(Hm.source,`y`),PKe=(e,t,n)=>{if(e[t-1]!==`[`)return;NKe.lastIndex=t-1;let[r]=NKe.exec(e)??[];return r?.startsWith(`[${n}](`)?r.length:void 0},FKe=(e,t)=>[...e.matchAll(B$)].reduceRight((n,r)=>{let{index:i,0:a,groups:{src:o=``,tag:s=void 0}={}}=r;if(s===void 0){if(!t(V$(o,`markdown`)))return n;let r=PKe(e,i,a);return r===void 0?c3(n,i,a.length):c3(n,i-1,r)}let c=U$({value:e,tag:s,index:i,callback:(e,n)=>t(n)?null:void 0});return c?[`img`,`source`].includes(c.localName)&&AKe(c)?c3(n,i,a.length):n.slice(0,i)+k$(c)+n.slice(i+a.length):n},e),IKe=({value:e,format:t,urls:n,paths:r=new Set,entry:i,collectionName:a,fileName:o,locale:s,keyPath:c,valueMap:l,isIndexFile:u,fieldConfig:d})=>{let f=q$({entry:i,collectionName:a,fileName:o,locale:s,keyPath:c,valueMap:l,isIndexFile:u,fieldConfig:d}),p=e=>{if(J$(e,e=>n.has(e)))return!0;if(!r.size)return!1;let t=f(e.url)?.asset?.path;return t!==void 0&&r.has(t)};return t===`html`?MKe(e,p):FKe(e,p)},LKe=({content:e,references:t,urls:n,paths:r=new Set})=>{let i={...e},a=new Map,o=new Map;return t.forEach(({entry:t,collection:s,collectionFile:c,locale:l,keyPath:u,fieldConfig:d})=>{let{widget:f=`string`}=d;if(!Ld.includes(f)){let o=d;i[u]=IKe({value:e[u],format:T$(o),urls:n,paths:r,entry:t,collectionName:s.name,fileName:c?.name,locale:l,keyPath:u,valueMap:e,isIndexFile:cf(s,t),fieldConfig:o}),a.set(u,d)}else if(oh(d)){let e=u.replace(im,``);o.set(e,(o.get(e)??new Set).add(u)),a.set(e,d)}else i[u]=``,a.set(u,d)}),o.forEach((e,t)=>{TKe({content:i,listKeyPath:t,isStale:t=>e.has(t)})}),{content:i,fields:a}},RKe=async e=>{let t=OKe(e),n=new Set,r=new Set;t.forEach(({url:e,asset:t})=>{t?r.add(t.path):n.add(e)});let i=await Kze(t),a=[...Map.groupBy(i,({entry:e})=>e.id).values()].map(e=>{let[{entry:t,collection:i,collectionFile:a}]=e,o=r3({collection:i,collectionFile:a,isIndexFile:cf(i,t)}),s=Map.groupBy(e.filter(e=>e.collection===i&&e.collectionFile===a),({locale:e})=>e),c={},l=[];return s.forEach((e,s)=>{let u=t.locales[s],{content:d,fields:f}=LKe({content:u.content,references:e,urls:n,paths:r});c[s]={...u,content:d},l.push(...EKe({draft:o,entry:t,collection:i,collectionFile:a,locale:s,content:d,fields:f}))}),{target:{entry:{...t,locales:{...t.locales,...c}},collection:i,collectionFile:a},blockers:l}});return{targets:a.map(({target:e})=>e),blockers:DKe(a.flatMap(({blockers:e})=>e))}},l3=void 0,u3=e=>{let t=e.map(({path:e})=>e).join(`
`),{current:n}=Vp,{current:r}=Dp,{current:i}=Dl;if(l3?.key===t&&l3.entries===n&&l3.assets===r&&l3.config===i)return l3.plan;let a=RKe(e);return l3={key:t,entries:n,assets:r,config:i,plan:a},a.catch(()=>{l3?.plan===a&&(l3=void 0)}),a},d3,zKe=0,f3=0,BKe=Promise.resolve(),VKe=({entriesBefore:e,assetsBefore:t})=>{let n=new Map(e.map(e=>[e.id,e])),r=new Map(t.map(e=>[e.path,e])),i=Vp.current,a=Dp.current,o=new Set(i.map(({id:e})=>e)),s=new Set(a.map(({path:e})=>e));return{addedEntries:i.filter(({id:e})=>!n.has(e)),modifiedEntries:i.filter(e=>{let t=n.get(e.id);return!!t&&t!==e}),deletedEntries:e.filter(({id:e})=>!o.has(e)),addedAssets:a.filter(({path:e})=>!r.has(e)),modifiedAssets:a.filter(e=>{let t=r.get(e.path);return!!t&&t!==e}),deletedAssets:t.filter(({path:e})=>!s.has(e))}},HKe=e=>Object.values(e).some(e=>e.length>0),p3,UKe=async({fetchDirSHA:e},t,n)=>{let r=uu();if(!r||!e)return!1;try{let[i,a]=await Promise.all([p3?.rootDir===r&&p3.commit===t?p3.sha:e(t,r),e(n,r)]);return p3={rootDir:r,commit:n,sha:a},!!i&&i===a}catch(e){return console.error(`Failed to look up the root directory.`,e),!1}},WKe=async e=>{let{fetchLastCommit:t,fetchFiles:n}=e,r=lp(),i=await t();if(r()||i.hash===sp.current)return;if(await UKe(e,sp.current,i.hash)){if(r())return;await eue(e.repository,sp.current,i.hash);return}let a=Vp.current,o=Dp.current;if(await n({lastCommit:i}),r())return;Hy.current=sp.current;let s=VKe({entriesBefore:a,assetsBefore:o});return HKe(s)?s:void 0},m3=async({maxAge:e=0}={})=>{let t=LX.current;if(t?.fetchLastCommit&&sp.current&&!f3&&!(e&&!d3&&Date.now()-zKe<e))return d3||=(zKe=Date.now(),WKe(t).finally(()=>{d3=void 0})),d3},GKe=async e=>{let t=BKe,{promise:n,resolve:r}=Promise.withResolvers();BKe=n,f3+=1;try{return await t,await d3?.catch(()=>void 0),await e()}finally{--f3,r(void 0)}},KKe=e=>{let t=jy(e).find(({fileName:e,filePathMap:t})=>!e&&!!t),n=t?Kf(t.collectionName):void 0;return jd(n)?n:void 0},qKe=e=>{let t=new Map;return e.forEach(e=>{let{path:n}=e,r=t.get(n);if(r){r.changes.push(e);return}let i=KKe(n);i&&t.set(n,{collection:i,changes:[e]})}),t},JKe=({collection:e,path:t,items:n,changes:r})=>{let i=n.map((e,t)=>({item:e,from:t})),a=new Set,o=({index:r,locales:i})=>{let a=r<n.length?cy({collection:e,item:n[r],index:r,path:t}):void 0;if(r>=n.length||i&&!(0,Qc.default)(a?.locales,i))throw bl(`The item at ${r} in ${t} has been changed since it was loaded.`,`save_conflict.array_item_changed`)};return r.forEach(e=>{let{action:t,data:n,arrayItem:r,arrayOrder:s}=e;if(s){s.forEach(o);let e=s.map(({index:e})=>e).sort((e,t)=>e-t),t=s.map(({index:e})=>i[e]);e.forEach((e,n)=>{i[e]=t[n]});return}if(r&&o(r),t===`delete`){r&&a.add(r.index);return}let c=JSON.parse(n);if(r){let e=i.find(({from:e})=>e===r.index);e.item=c}else i.push({item:c})}),i.filter(({from:e})=>e===void 0||!a.has(e))},YKe=({collection:e,path:t,items:n,change:r})=>{let{data:i,arrayItem:a,arrayOrder:o}=r,s=(o?.[0]??a)?.index??n.length,c=cy({collection:e,item:i?JSON.parse(i):n[s],index:s,path:t})?.locales[e._i18n.defaultLocale]?.content;return c&&vW(c,{identifierField:e.identifier_field,useBody:!1})||void 0},XKe=async e=>{let t=qKe(e);if(!t.size)return{changes:e,arrayFileUpdates:[]};let n=p4(),r=await Promise.all([...t].map(async([e,{collection:t,changes:r}])=>{let i=sy.get(e);if(i===null)throw bl(`${e} can’t be updated, as it doesn’t contain a valid array.`,`save_conflict.array_file_invalid`,{path:e});let a=JKe({collection:t,path:e,items:i??[],changes:r}),o=await n?.get(e),s=iv.get(e)??{},c=s.valueSources?kce(s.valueSources,a.map(({from:e})=>e)):void 0;return{collection:t,path:e,slots:a,change:{action:i?`update`:`create`,slug:YKe({collection:t,path:e,items:i??[],change:r[0]})??r[0].slug,path:e,previousSha:o?.sha,data:await oWe({content:a.map(({item:e})=>e),_file:t._file,state:{...s,valueSources:c}})},sourceMap:c}}));return{changes:[...e.filter(({path:e})=>!t.has(e)),...r.map(({change:e})=>e)],arrayFileUpdates:r}},ZKe=({arrayFileUpdates:e,savingEntries:t,meta:n})=>{let r=[],i=new Map;return e.forEach(({collection:e,path:a,slots:o,sourceMap:s})=>{let{defaultLocale:c}=e._i18n,l=e=>e.arrayIndex!==void 0&&e.locales[c]?.path===a,u=new Map(Vp.current.filter(l).map(e=>[e.arrayIndex,e]));sy.set(a,o.map(({item:e})=>e)),s&&ov(a,{valueSources:s});let d=new Map(t.filter(l).map(e=>[e.arrayIndex,e])),f=t.filter(e=>e.arrayIndex===void 0&&e.locales[c]?.path===a),p=0;o.forEach(({item:t,from:o},s)=>{let c=o===void 0?f[p]:d.get(o),l=o===void 0?void 0:u.get(o);o===void 0&&(p+=1);let m=cy({collection:e,item:t,index:s,path:a,meta:n});m&&(m.id=c?.id??l?.id??jc(),r.push(m),c&&i.set(c,m))})}),{entries:r,savedEntries:i}},QKe=()=>{let e=Fu.account;if(!e)return;let{name:t,email:n,id:r,login:i}=e;if(t&&n)return{name:t,email:n,id:r,login:i}},$Ke=async({changes:e,commit:t})=>{let n=Sb(LX.current?.repository,`file-cache`);if(!n)return;let{files:r,author:i,date:a}=t,o={commitAuthor:i,commitDate:a};await Promise.all(e.map(async e=>{let{action:t,path:i,previousPath:a,data:s}=e;if(t===`delete`){await n.delete(i);return}t===`move`&&await n.delete(a);let c={sha:r[i]?.sha,size:ou(s),text:typeof s==`string`?s:void 0,meta:o};await n.set(i,c)}))},eqe=({changes:e,savedEntries:t,savedAssets:n,arrayFileEntries:r=[]})=>{let i=new Set([...t,...r].map(e=>e.id)),a=new Set(r.flatMap(e=>Qp(e)));Vp.current=[...Vp.current.filter(e=>!i.has(e.id)&&!(e.arrayIndex!==void 0&&Object.values(e.locales).some(({path:e})=>a.has(e)))),...t.filter(e=>!r.includes(e)),...r];let o=new Set(n.map(e=>e.path));e.forEach(e=>{e.action===`move`&&e.previousPath?o.add(e.previousPath):e.action===`delete`&&o.add(e.path)}),Dp.current=[...Dp.current.filter(e=>!o.has(e.path)),...n]},h3=async({changes:e,savingEntries:t=[],savingAssets:n=[],options:r})=>{let{commitChanges:i,fetchLastCommit:a}=LX.current,o=await _2(e,r);try{await m3()}catch(e){console.error(`Failed to check the repository for changes.`,e)}let s=!1,c=await GKe(async()=>{let r=sp.current,{changes:c,arrayFileUpdates:l}=await XKe(e),u={...await i(c,o),author:QKe()};yu.devModeEnabled&&(console.debug(`Commit changes:`,c),console.debug(`Commit results:`,u));let{files:d,author:f,date:p}=u,{entries:m,savedEntries:h}=ZKe({arrayFileUpdates:l,savingEntries:t,meta:{commitAuthor:f,commitDate:p}}),g=t.map(e=>h.get(e)??{...e,commitAuthor:f,commitDate:p}),_=await Promise.all(n.map(async e=>{let{sha:t,file:n}=d[e.path]??{},r={...e,sha:t,blobURL:void 0,commitAuthor:f,commitDate:p};if(n)try{await JX(r,n)}catch(e){console.error(`Failed to cache the saved asset.`,e)}return r}));try{await $Ke({changes:c,commit:u})}catch(e){console.error(`Failed to update the file cache.`,e)}return eqe({changes:c,savedEntries:g,savedAssets:_,arrayFileEntries:m}),Hy.current=u.sha,Gy(tp(o)),a&&(u.parentSha===void 0||u.parentSha===r?sp.current=u.sha:s=!0),{commit:u,savedEntries:g,savedAssets:_}});return s&&m3().catch(e=>{console.error(`Failed to check the repository for changes.`,e)}),c},tqe=({assets:e,notify:t=!0})=>{e.some(({path:e})=>Ap.current?.path===e)&&(Ap.current=void 0),t&&(u2.current={...c2,deleted:!0,count:e.length})},nqe=async(e,{extraChanges:t=[],notify:n=!0}={})=>{xy([...e,...t].map(({path:e})=>e));let{targets:r,blockers:i}=await u3(e);if(i.length)throw Error(`Cannot delete assets that entries require`,{cause:i});let{changes:a,savingEntries:o}=await s3({targets:r});await h3({changes:[...e.map(({path:e,sha:t})=>({action:`delete`,path:e,previousSha:t})),...a,...t],savingEntries:o,options:{commitType:`deleteMedia`}}),tqe({assets:e,notify:n})},rqe=async(e,t,n=e.name)=>{let r=e.file??await QX(e);return{action:`move`,path:t,previousPath:e.path,previousSha:e.sha,data:new File([await r.arrayBuffer()],n,{type:r.type})}},iqe=({entry:e})=>{let{locales:t}=e,n=Object.entries(t),r=Object.fromEntries(n.map(([e])=>[e,!0])),i=Object.fromEntries(n.map(([e,{slug:t}])=>[e,t])),a=Object.fromEntries(n.map(([e,{content:t}])=>[e,t]));return{createdAt:Date.now(),isNew:!1,canPreview:!0,originalEntry:e,originalLocales:r,currentLocales:structuredClone(r),originalSlugs:i,currentSlugs:structuredClone(i),originalValues:a,currentValues:structuredClone(a),files:{},validities:{},validationMessages:{},expanderStates:{}}},aqe=async({draftProps:e,indexFile:t,savingEntries:n,changes:r})=>{let{collection:i,collectionFile:a}=e,{fields:o=[]}=a??i,s={...e,fields:t?.fields??o},{savingEntry:c,changes:l}=await n3({draft:s,slugs:I2({draft:s})});n.push(c),r.push(...l)},oqe=async({entry:e,savingEntries:t,changes:n})=>{let r=iqe({entry:e});await Promise.all(hQ(e).map(({collection:e,collectionFile:i,isIndexFile:a})=>aqe({draftProps:{...r,collection:e,collectionName:e.name,isIndexFile:a,...i?{collectionFile:i,fileName:i.name}:{}},indexFile:a?of(e):void 0,savingEntries:t,changes:n})))},sqe=({_globalAssetFolder:e,newPath:t,asset:n})=>{let{publicPath:r}=Dy(n.path).find(({collectionName:e})=>e!==void 0)??e??n.folder;return t.replace(n.folder.internalPath??``,r??``)},cqe=(e,t)=>n=>{let[r,i]=[[e,t],[Yl(e),Yl(t)],[encodeURI(e),encodeURI(t)]].find(([e])=>n===e||n.endsWith(`/${e}`))??[];return r===void 0?void 0:`${n.slice(0,-r.length)}${i}`},lqe=async({_globalAssetFolder:e,movingAssets:t,updatingEntryMap:n})=>{let r=t.map(({asset:e})=>{let t=fZ(e);return t?{url:t}:{asset:e}});if(!r.length)return;let i=await t1(r),a=[],o=new Set;if(t.forEach(({asset:t,path:n},s)=>{if(!i[s].length)return;let c=tu(n),l=fZ({...t,path:n,name:c},{pathOnly:!0,allowSpecial:!0})??(t.folder.entryRelative&&n.slice(0,-c.length)===t.path.slice(0,-t.name.length)?cqe(t.name,c):sqe({_globalAssetFolder:e,newPath:n,asset:t}));a.push({...r[s],newURL:l}),i[s].forEach(e=>o.add(e))}),!a.length)return;let s=[...o].filter(e=>a3(e));if(s.length)throw Error(Y(`cannot_move_referenced_asset`,{values:{entries:s.map(e=>o3(e)).join(`, `)}}));await t1(a,{entries:[...o].map(e=>Nl(n,e.id,()=>structuredClone(e)))})},uqe=({action:e,movedAssets:t,notify:n=!0})=>{f2(({path:e})=>t.find(t=>t.asset.path===e)?.path),n&&(u2.current={...c2,moved:e===`move`,renamed:e===`rename`,count:t.length})},dqe=async(e,t,{extraChanges:n=[],notify:r=!0}={})=>{xy([...t.flatMap(({asset:e,path:t})=>[e.path,t]),...n.flatMap(({path:e,previousPath:t})=>[e,...t?[t]:[]])]);let i=Cy.current,a=[],o=[],s=[],c=new Map;await Promise.all(t.map(async({asset:e,path:t})=>{let n=Uc(t).basename;s.push({...e,path:t,name:n}),a.push(await rqe(e,t,n))})),await lqe({_globalAssetFolder:i,movingAssets:t,updatingEntryMap:c}),await Promise.all([...c.values()].map(e=>oqe({entry:e,savingEntries:o,changes:a}))),await h3({changes:[...a,...n],savingEntries:o,savingAssets:s,options:{commitType:`uploadMedia`}}),uqe({action:e,movedAssets:t,notify:r})},fqe=e=>{let t=`${e}/`,n=Sy.current.map(({internalPath:e})=>e).filter(n=>n!==void 0&&(n===e||n.startsWith(t))).map(e=>`${e}/`);return e=>e.startsWith(t)&&!n.some(t=>e.startsWith(t))},g3=e=>{let t=fqe(e);return Op.current.filter(({path:e})=>t(e))},pqe=e=>{let t=fqe(e);return Ip.current.filter(({path:e})=>t(e))},mqe=async e=>{let t=`${e}/.gitkeep`;xy([t]);let{commit:n}=await h3({changes:[{action:`create`,path:t,data:new File([],`.gitkeep`)}],options:{commitType:`uploadMedia`}}),r={type:`config`,path:t,name:`.gitkeep`,sha:n.files[t]?.sha??``,size:0,text:``};Ip.current=[...Ip.current,r],u2.current={...c2,folderCreated:!0}},hqe=async({dirPath:e,newDirPath:t})=>{let n=pqe(e),r=n=>`${t}${n.slice(e.length)}`;await dqe(`move`,g3(e).map(e=>({asset:e,path:r(e.path)})),{extraChanges:n.map(({path:e,sha:t,name:n,text:i})=>({action:`move`,path:r(e),previousPath:e,previousSha:t,data:new File([i??``],n)})),notify:!1}),Ip.current=Ip.current.map(e=>n.includes(e)?{...e,path:r(e.path)}:e),cJ.current?.path===e&&(cJ.current={name:Uc(t).basename,path:t}),u2.current={...c2,folderRenamed:!0}},gqe=async e=>{let t=pqe(e);await nqe(g3(e),{extraChanges:t.map(({path:e,sha:t})=>({action:`delete`,path:e,previousSha:t})),notify:!1}),Ip.current=Ip.current.filter(e=>!t.includes(e)),cJ.current?.path===e&&(cJ.current=void 0),u2.current={...c2,folderDeleted:!0}};function _qe(e,t){O(t,!0);let n=J(t,`open`,15,!1);{let r=A(()=>Y(`new_folder`)),i=A(()=>Y(`new_folder_create`)),a=A(()=>Y(`new_folder_description`,{values:{folder:`/${t.dirPath}`}}));FJ(e,{get title(){return z(r)},get okLabel(){return z(i)},get description(){return z(a)},get takenNames(){return t.takenNames},onSubmit:e=>{y2(()=>mqe($l([t.dirPath,e])),{progress:`creating_folder`,failure:`creating_folder_failed`})},get open(){return n()},set open(e){n(e)}})}k()}function _3(e,t){O(t,!0);let n=J(t,`disabled`,3,!1),r=J(t,`floating`,3,!0);{let i=e=>{gx(e,{name:`create_new_folder`})},a=A(()=>r()&&PY.isSmallScreen?`secondary`:`ghost`),o=A(()=>Y(`new_folder`));Xx(e,{get variant(){return z(a)},iconic:!0,get disabled(){return n()},get"aria-label"(){return z(o)},get onclick(){return t.onclick},startIcon:i,$$slots:{startIcon:!0}})}k()}var v3=e=>e.match(sje)?.[1],vqe=e=>!!fG(e)?.length,yqe=(e,t)=>{if(typeof t!=`string`||!t)return;if(t===`_summary`||uG.includes(t)||dG(t))return{};let n=lh({collectionName:e.name,keyPath:t});if(n)return{fieldConfig:n};let{i18nEnabled:r,canonicalSlug:i}=e._i18n;return r&&t===i.key?{}:void 0},bqe=(e,t)=>{let{i18nEnabled:n,canonicalSlug:r}=e._i18n,i=[`_summary`,`_manual`,dW(e)];return n&&i.push(r.key),[{key:`_summary`},...t.filter(e=>!i.includes(e)).map(e=>({key:e}))]},xqe=(e,t)=>{if(t===`_summary`){let{summary:t}=e,n=dW(e);return _G({config:t?void 0:lh({collectionName:e.name,keyPath:n}),option:`label`})||Y(`sort_keys._summary`)}if(dG(t)){let n=v3(t);return n?oje.includes(n)?Y(`table_column_keys.${n}`):TG({collection:e,key:n}):t}return TG({collection:e,key:t})},Sqe=(e,t)=>{let n=new Set;return t.flatMap(({key:t,label:r})=>{let i=yqe(e,t);return!i||n.has(t)?[]:(n.add(t),[{key:t,label:r||xqe(e,t),...i}])})},Cqe=({collection:e,sortKeys:t})=>{let n=fG(e),r=n?Sqe(e,n):[];return r.length?r:Sqe(e,bqe(e,t))},wqe=new WeakMap,Tqe=({collection:e,entry:t,column:n})=>{let{fieldConfig:r}=n,i=dG(n.key)?v3(n.key):void 0,a=i&&uG.includes(i)?i:n.key;if(a===`_summary`)return{type:`text`,value:wW(e,t,{useTemplate:!0})};if(dG(a))return{type:`text`,value:wW(e,t,{useTemplate:!0,template:a,useIndexFileLabel:!1})};if(a===`slug`)return{type:`text`,value:t.slug};if(a===`commit_author`)return{type:`text`,value:hW(t.commitAuthor)||``};if(a===`commit_date`){let{commitDate:e}=t;return{type:`text`,value:e?bU(e,Ec.current):``}}let{defaultLocale:o}=e._i18n,s=Xp(t.locales,o),c=t.locales[s]?.content??{};if(r?.widget===`boolean`)return{type:`boolean`,value:c[a]===!0};let l=()=>({type:`text`,value:VG({collectionName:e.name,valueMap:c,keyPath:a,locale:s,plainText:!0,isIndexFile:cf(e,t)})});if(r?.widget===`relation`){let{current:e}=Vp,n=`${a}\0${s}`,r=Nl(wqe,t,()=>new Map),i=r.get(n);if(i&&i.entries===e)return i.value;let o=l();return r.set(n,{entries:e,value:o}),o}return l()},Eqe=({collection:e,column:{key:t},sortKeys:n})=>{if(t===`_summary`&&!n.includes(t)){let t=dW(e);return n.includes(t)?t:void 0}let r=dG(t)?v3(t):t;return r&&n.includes(r)?r:void 0},y3=tl(),b3=tl({}),Dqe=e=>[...e&&vqe(e)?[`table`]:[],`list`,...e?._thumbnailFieldNames.length?[`grid`]:[]],Oqe=(e,t)=>e&&t.includes(e)?e:t[0],kqe=({type:e,types:t,isLargeScreen:n,reordering:r=!1})=>{if(r)return`list`;let i=Oqe(e,t);return i===`table`&&!n?`list`:i},x3={current:void 0},Aqe=({sort:e,filter:t,filters:n,group:r})=>JSON.stringify([e,t,n,r]),jqe=async({repository:e})=>{await oG(e,`contents-view`,y3),ol(()=>{let e=b3.current;eo(()=>{let{name:t}=Uf.current??{},n=x3.current,r=n&&n.collectionName===t?n.view:e,i=y3.current?.[t??``]??{};t&&!(0,Qc.default)(r,i)&&(y3.current={...y3.current,[t]:r})})})},Mqe=new Set([`$$slots`,`$$events`,`$$legacy`,`disabled`,`currentView`,`types`]),Nqe=B(`<div role="none" class="wrapper svelte-8v3idr"><!></div>`),Pqe={hash:`svelte-8v3idr`,code:`.wrapper.svelte-8v3idr {display:contents;.select-button-group button {border-radius:var(--sui-button-medium-border-radius) !important;}}`};function S3(e,t){O(t,!0),K(e,Pqe);let n=J(t,`disabled`,3,!1),r=J(t,`currentView`,7),i=J(t,`types`,19,()=>[`list`,`grid`]),a=vs(t,Mqe),o={table:`table`,list:`format_list_bulleted`,grid:`grid_view`},s=A(()=>Oqe(r().current.type,i())),c=A(()=>z(s)===`grid`),l=A(()=>i().includes(`list`)&&i().includes(`grid`)),u=e=>{r().current={...r().current,type:e}};var d=Nqe(),f=N(d),p=e=>{var t=H(),r=P(t),c=e=>{{let t=A(()=>Y(`switch_view`));pS(e,ys({get disabled(){return n()},get ariaLabel(){return z(t)}},()=>a,{children:(e,t)=>{var r=H();No(P(r),16,i,e=>e,(e,t)=>{{let r=e=>{gx(e,{get name(){return o[t]}})},i=A(()=>z(s)===t),a=A(()=>Y(`${t}_view`));mS(e,{get disabled(){return n()},get selected(){return z(i)},variant:`ghost`,iconic:!0,get"aria-label"(){return z(a)},onSelect:()=>{u(t)},startIcon:r,$$slots:{startIcon:!0}})}}),U(e,r)},$$slots:{default:!0}}))}};G(r,e=>{i().length>1&&e(c)}),U(e,t)},m=e=>{{let t=e=>{{let t=A(()=>z(c)?o.list:o.grid);gx(e,{get name(){return z(t)}})}},r=A(()=>Y(z(c)?`switch_to_list_view`:`switch_to_grid_view`));Xx(e,{get disabled(){return n()},variant:`ghost`,iconic:!0,get"aria-label"(){return z(r)},onclick:()=>{u(z(c)?`list`:`grid`)},startIcon:t,$$slots:{startIcon:!0}})}};G(f,e=>{PY.isLargeScreen?e(p):z(l)&&e(m,1)}),D(d),U(e,d),k()}var Fqe=({open:e,pendingFileCount:t,libraryName:n,cloudServiceEntries:r,canUpload:i})=>{if(!t)return{type:`wait`};let a=r.find(([e])=>e===n)?.[1];if(a&&i)return{type:`upload`};if(!e||a?.upload)return{type:`wait`};let[o]=r.find(([,{upload:e}])=>!!e)??[];return o?{type:`switch`,serviceId:o}:{type:`reject`}},Iqe=(e,t,n)=>{let{collection:r,fileName:i,currentValues:a,isIndexFile:o,originalEntry:s}=t,c=P2({draft:t}),l={...c.content,...n?a[n]:void 0},u=dW(r._type===`entry`?r:void 0),d={replaceSubContext:{...c,type:`library_prefix`,content:l,currentSlug:c.content._slug??s?.slug,locale:n??c.locale,identifierField:u,basePath:void 0},getFieldArgs:{collectionName:r.name,fileName:i,keyPath:``,valueMap:l,isIndexFile:o}};return Qd(e,(e,t)=>gZ(t,d)).trim()},Lqe=({serviceId:e,fieldConfig:t,draft:n,locale:r})=>{let i=mq(e,t),a=X(i)?i.prefix:void 0;if(typeof a!=`string`||!tf(a))return{fieldConfig:t,unresolved:!1};if(!n)return{fieldConfig:t,unresolved:!0};try{return{fieldConfig:{...t,media_libraries:{...t.media_libraries,[e]:{...i,prefix:Iqe(a,n,r)}}},unresolved:!1}}catch{return{fieldConfig:t,unresolved:!0}}},C3=tl(),Rqe=async({files:e,listedAssets:t})=>{let n=AQ(e,t),r=n.length;return r?al(C3,{count:r,name:n[0].name},void 0):!1},zqe=/(?<=.)\/(?=\/|$)/g,Bqe=({collectionName:e,fileName:t,componentName:n,typedKeyPath:r,isIndexFile:i})=>{let a=Ey({collectionName:e,fileName:t,componentName:n,typedKeyPath:r,isIndexFile:i}),o=t?Ey({collectionName:e,fileName:t}):void 0,s=Ey({collectionName:e}),c=o??s,l=Cy.current,u={field:{folder:a,enabled:a!==void 0},entry:{folder:c,enabled:!!c&&(c.entryRelative||c.hasTemplateTags)},file:{folder:o,enabled:!!o&&!o.entryRelative&&!o.hasTemplateTags},collection:{folder:s,enabled:!!s&&!s.entryRelative&&!s.hasTemplateTags},global:{folder:l,enabled:l!==void 0}};return Sy.current.forEach(e=>{e.isAssetCollection&&e.collectionName&&(u[e.collectionName]={folder:e,enabled:!0})}),u},Vqe=e=>Object.values(e).find(({enabled:e})=>e)?.folder,w3=e=>Vqe(Bqe(e)),Hqe=({entry:e,folder:t,locale:n})=>{let{collectionName:r,entryRelative:i,internalPath:a,internalSubPath:o}=t??{};if(!i)return a===void 0?void 0:bQ({internalPath:a,collectionName:r,entry:e,locale:n})??a.replaceAll(qd,`-`);let s=o||void 0;return e?$l([RJ({entry:e,locale:n,collectionName:r}),s]):s?`${a}/${s}/-`:`${a}/-`},Uqe=({draft:e,blobURL:t})=>{let n=e.files[t];if(n)return b2({draft:e,item:n,defaultLocaleSlug:n.nameTemplate?I2({draft:e}).defaultLocaleSlug:``})},Wqe=({draft:e,blobURL:t,fileName:n})=>{let{folder:r,subfolderPath:i}=e.files[t]??{},{entryRelative:a,publicPath:o=``}=r??{},s=$l([i,n]);if(!r||!a&&!tf(o))return $4(o,s);let{defaultLocaleSlug:c}=I2({draft:e}),{resolvedPublicPath:l}=lKe({draft:e,defaultLocaleSlug:c,folder:r});return $4(l.replace(zqe,``),s)},Gqe=({draft:e,value:t,unsavedFileName:n})=>{if(!t||typeof t!=`string`)return``;if(n)return Wqe({draft:e,blobURL:t,fileName:Hl(n.normalize())});if(t.startsWith(`blob:`))return``;let r=Hl(t);if(zc(r)){let e=new URL(r);if(e.search)return e.search=``,`${e}…`}return r},Kqe=({path:e,folderPath:t})=>t!==void 0&&(t===``||e===t||`${e}/-`===t||e.startsWith(`${t}/`)),qqe=({asset:e,folder:t,folderPath:n})=>t===void 0?!1:t.entryRelative?Kqe({path:eu(e.path),folderPath:n}):e.folder?.internalPath===t.internalPath&&!e.folder?.entryRelative&&Kqe({path:e.path,folderPath:n}),Jqe=({savedAssets:e,unsavedAssets:t,slugificationEnabled:n})=>{if(!t.length)return{savedAssets:e,unsavedAssets:t};let r=new Map,i=new Set;e.forEach(({path:e,name:t})=>{Nl(r,eu(e),()=>[]).push(t.normalize())});let a=t.map(e=>{let{name:t,path:a,replace:o}=e,s=eu(a),c=r.get(s)??[],l=IQ(t,{slugificationEnabled:n,assetNamesInSameFolder:o?[]:c}),u=s?`${s}/${l}`:l;return o?i.add(u):(c.push(l.normalize()),r.set(s,c)),u===a?e:{...e,name:l,path:u}});return{savedAssets:i.size?e.filter(({path:e})=>!i.has(e)):e,unsavedAssets:a}},Yqe=({kind:e,accept:t,folder:n,folderPath:r,unsavedAssets:i,uncheckedFiles:a=[],slugificationEnabled:o=!1})=>{let s=e=>qqe({asset:e,folder:n,folderPath:r}),c=Jqe({savedAssets:Dp.current.filter(s),unsavedAssets:i.filter(s),slugificationEnabled:o});return[...c.unsavedAssets,...c.savedAssets].filter(n=>!!n.file&&a.includes(n.file)||(!e||e===n.kind)&&oJ({name:n.name},t)).sort((e,t)=>e.name.localeCompare(t.name)).sort((e,t)=>Number(!!t.unsaved)-Number(!!e.unsaved))},Xqe=({sha:e,folder:t,unsavedAssets:n})=>n.some(n=>!!n.file&&n.sha===e&&(0,Qc.default)(n.folder,t)),T3=async({draft:e,file:t,folder:n,subfolderPath:r=``,replace:i=!1})=>{let a=await cu(t),o;return await Promise.all(Object.entries(e.files??{}).map(async([e,s])=>{!o&&await cu(s.file)===a&&(!n?.entryRelative||(0,Qc.default)(s.folder,n))&&(s.subfolderPath??``)===r&&(!i||s.replace&&LQ(s.file.name,t.name))&&(o=e)})),o},Zqe=async({file:e,name:t=e.name,blobURL:n,folder:r,targetFolderPath:i,subfolderPath:a,replace:o})=>{let{size:s}=e;return{unsaved:!0,replace:!!o,file:e,blobURL:n??await KX(e),name:t,path:$l([i,a,t]),sha:await cu(e),size:s,kind:Ep(t),folder:r}},Qqe=async({draft:e,targetFolderPath:t})=>{let n=Object.entries(e.files),r=n.some(([,{nameTemplate:e}])=>e)?I2({draft:e}).defaultLocaleSlug:``;return Promise.all(n.map(async([n,i])=>{let{file:a,folder:o,replace:s,subfolderPath:c}=i;return Zqe({file:a,name:b2({draft:e,item:i,defaultLocaleSlug:r}),blobURL:n,folder:o,targetFolderPath:t,subfolderPath:c,replace:s})}))},$qe=(e,t,n)=>{let r=Dp.current;if(!t?.entryRelative)return r;let{originalEntry:i,defaultLocale:a,collection:o}=e,s=((n?i?.locales[n]:void 0)??i?.locales[a])?.path;if(!s)return[];let c=$l([LJ({collection:o,entryFilePath:s,internalPath:t.internalPath}),t.internalSubPath]);return r.filter(e=>e.path.startsWith(`${c}/`))},eJe=e=>({value:void 0,credit:``,oversizedFileName:void 0,invalidFileName:void 0,mismatchedFileName:e.name}),E3=async({draft:e,resource:t,libraryConfig:n,accept:r,locale:i})=>{let{url:a,folderPath:o,credit:s,replace:c=!1,subfolderPath:l}=t,{asset:u,file:d}=t,f=``;if(d){let{folder:a}=t;if(!a)return{value:void 0,credit:``,oversizedFileName:void 0,invalidFileName:void 0};let o;try{o=await T3({draft:e,file:d,folder:a,subfolderPath:l,replace:c})}catch{return{value:void 0,credit:``,oversizedFileName:void 0,invalidFileName:d.name}}if(o){if(!oJ(d,r))return eJe(d);f=o}else{let{file:o,oversized:s,invalid:p}=await x2(d,n??{});if(d=o,p)return{value:void 0,credit:``,oversizedFileName:void 0,invalidFileName:d.name};if(!oJ(d,r))return eJe(t.file);let m=await cu(d),{name:h}=d,g=[...$qe(e,a,i),...await Qqe({draft:e})].find(e=>e.sha===m&&(0,Qc.default)(e.folder,a)&&(!c||(!e.unsaved||e.replace)&&LQ(e.name,h)));if(g)u=g,d=void 0;else if(s)return{value:void 0,credit:``,oversizedFileName:d.name,invalidFileName:void 0};else{f=await KX(d);let t=c?void 0:n?.filename_template;e.files[f]={file:d,folder:a,replace:c,subfolderPath:l,...t?{nameTemplate:XVe(t,{slugificationEnabled:n.slugify_filename})}:{}}}}}return u&&(u.unsaved?u.blobURL?f=u.blobURL:u.file&&(f=await T3({draft:e,file:u.file,folder:u.folder})):f=fZ(u,{pathOnly:!0,allowSpecial:!0,entry:e.originalEntry,locale:i})),a&&!d&&!u&&(f=a),o&&(f=o),{value:f,credit:s?dt(s,qu):``,oversizedFileName:void 0,invalidFileName:void 0}},tJe=[],nJe=e=>{let t=A(e),n=A(()=>z(t).draft),r=A(()=>z(t).droppedAssets??tJe),i=j(Xi([])),a=A(()=>Hqe({entry:z(n)?.originalEntry,folder:z(t).folder,locale:z(t).locale})),o=A(()=>Yqe({kind:z(t).kind,accept:z(t).accept,folder:z(t).folder,folderPath:z(a),unsavedAssets:z(i),uncheckedFiles:z(r).map(({file:e})=>e),slugificationEnabled:z(t).slugificationEnabled}));return cl(async()=>{let e=[...z(r)];return[...z(n)?await Qqe({draft:z(n),targetFolderPath:z(a)}):[],...e]},e=>{M(i,e,!0)}),{get targetFolderPath(){return z(a)},get listedAssets(){return z(o)},get unsavedAssets(){return z(i)},reset:()=>{M(i,[],!0)}}},rJe=B(`<!> <!>`,1),iJe=B(`<!> <!> <!>`,1),aJe=B(`<div role="status" class="selected-folder svelte-5b1zbe" dir="auto"><!></div>`),oJe=B(`<a class="service-link svelte-5b1zbe"> </a>`),sJe=B(`<div role="none" class="filter-tools svelte-5b1zbe"><!></div>`),cJe=B(`<div role="none"> </div> <!>`,1),lJe=B(`<span role="alert"> </span>`),uJe=B(`<div role="none" class="wrapper svelte-5b1zbe"><div role="none" class="nav svelte-5b1zbe"><!> <!></div> <div role="none" class="content-pane svelte-5b1zbe" data-focus-scope=""><!> <!> <!></div></div>`),dJe=B(`<!> <!> <!> <!>`,1),fJe={hash:`svelte-5b1zbe`,code:`.wrapper.svelte-5b1zbe {display:flex;gap:16px;height:60dvh;max-height:800px;--tile-padding: 4px;
@media (width < 768px) {flex-direction:column;overflow:hidden;height:72dvh;
}.nav:where(.svelte-5b1zbe) {flex:none;display:flex;gap:4px;
@media (width < 768px) {flex-direction:column;
}}.listbox {flex:none;background-color:transparent;.option button .icon:not(.check) {display:block;}}.content-pane:where(.svelte-5b1zbe) {overflow:auto;flex:auto;}}.service-link.svelte-5b1zbe,
.selected-folder.svelte-5b1zbe {font-size:var(--sui-font-size-small);}.selected-folder.svelte-5b1zbe {overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.filter-tools.svelte-5b1zbe {display:flex;gap:8px;}`};function pJe(e,t){let n=mo();O(t,!0),K(e,fJe);let r=e=>{var n=iJe(),r=P(n),i=e=>{var n=rJe(),r=P(n),i=e=>{S3(e,{get currentView(){return w},"aria-controls":`select-assets-grid`})};G(r,e=>{s0.current&&e(i)});var a=I(r,2),o=e=>{{let n=A(()=>!z(oe)),r=A(()=>z(x).some(e=>e.file)),i=A(()=>Y(`assets_dialog.search_for_${t.kind??`file`}`));rC(e,{dir:`auto`,get flex(){return PY.isSmallScreen},get debounce(){return z(n)},get disabled(){return z(r)},get ariaLabel(){return z(i)},get value(){return z(h)},set value(e){M(h,e,!0)}})}};G(a,e=>{c()||e(o)}),U(e,n)};G(r,e=>{(z(oe)||z(Ce)||z(we)&&z(ae)!==`picsum`)&&e(i)});var a=I(r,2),o=e=>{{let t=A(()=>ky.current||z(me));_3(e,{floating:!1,get disabled(){return z(t)},onclick:()=>{M(v,!0)}})}},s=e=>{_3(e,{floating:!1,onclick:()=>{z(S)?.showNewFolderDialog()}})},l=A(()=>z(xe)&&z(S)?.canCreateFolder());G(a,e=>{z(de)?e(o):z(l)&&e(s,1)});var u=I(a,2),d=e=>{{let t=e=>{gx(e,{name:`cloud_upload`})},n=A(()=>Y(`upload`)),r=A(()=>z(me)||z(xe)&&!z(S)?.canUpload());Xx(e,{variant:`primary`,get label(){return z(n)},get disabled(){return z(r)},onclick:()=>{z(b)?.open()},startIcon:t,$$slots:{startIcon:!0}})}};G(u,e=>{!c()&&(z(oe)||z(Ce))&&e(d)}),U(e,n)},i=J(t,`open`,15,!1),a=J(t,`multiple`,3,!1),o=J(t,`accept`,19,()=>t.kind===`image`?Iq.join(`,`):void 0),s=J(t,`canEnterURL`,3,!0),c=J(t,`selectFolder`,3,!1),l=J(t,`draft`,3,void 0),u=J(t,`locale`,3,void 0),d=J(t,`onSelect`,3,void 0),f=J(t,`onClose`,3,void 0),p=J(t,`pendingFiles`,31,()=>Xi([])),m=j(``),h=j(``),g=j(``),_=j(Xi([])),v=j(!1),y=j(Xi([])),b=j(void 0),x=j(Xi([])),S=j(void 0),C=j(!1),w=s0,T=A(()=>c()?Y(`assets_dialog.title.folder`):t.kind===`image`?Y(`assets_dialog.title.image`):Y(`assets_dialog.title.file`)),ee=A(()=>Y2(z(h))),E=A(()=>jq({fieldConfig:t.fieldConfig})!==!1&&Object.values(t.assetLibraryFolderMap).some(e=>a2(e,c()))),te=A(()=>s()&&!c()),ne=A(()=>c()?[]:t.enabledCloudServiceEntries),re=A(()=>HVe({fieldConfig:t.fieldConfig,selectFolder:c(),isDefaultLibraryEnabled:z(E)})),ie=A(()=>[...z(ne),...z(re)].sort(i2)),ae=A(()=>VVe({assetLibraryFolderMap:t.assetLibraryFolderMap,isDefaultLibraryEnabled:z(E),selectFolder:c(),hasPendingFiles:eo(()=>!!p().length),cloudServiceEntries:z(ne),externalServiceEntries:z(ie)})),oe=A(()=>z(ae).startsWith(`default-`)),se=A(()=>{if(!z(oe))return;let e=z(ae).replace(`default-`,``),{folder:n}=t.assetLibraryFolderMap[e];return n}),ce=nJe(()=>({draft:l(),folder:z(se),locale:u(),kind:t.kind,accept:o(),slugificationEnabled:nJ({fieldConfig:t.fieldConfig}).config.slugify_filename,droppedAssets:z(y)})),le=A(()=>ce.targetFolderPath),ue=A(()=>ce.listedAssets),de=A(()=>dJ(z(se))&&z(le)!==void 0&&!z(ee)),fe=A(()=>$l([z(le),z(g)])),pe=A(()=>z(oe)&&yy(z(fe))),me=A(()=>z(pe)||!!z(se)?.readonly),he=A(()=>z(ue).filter(({path:e})=>eu(e)===z(fe))),ge=A(()=>z(de)?z(he):z(ue)),_e=A(()=>z(de)?CJ({dirPath:z(fe),assets:z(ue)}):[]),ve=A(()=>vJ({subfolders:z(_e),fileNames:z(ge).map(({name:e})=>e),dirPath:z(fe)})),ye=A(()=>z(se)?.label||Y(`assets_dialog.folder.${z(ae).replace(`default-`,``)}`)),be=A(()=>z(re).some(([e,{authType:t}])=>e===z(ae)&&(t===`none`||!!yu.apiKeys?.[z(ae)]))),xe=A(()=>z(ne).map(([e])=>e).includes(z(ae))),Se=A(()=>Lqe({serviceId:z(ae),fieldConfig:t.fieldConfig,draft:l(),locale:u()})),Ce=A(()=>z(xe)&&z(ae)!==`cloudinary`&&!z(Se).unresolved),we=A(()=>z(re).map(([e])=>e).includes(z(ae))),Te=A(()=>UVe({selectFolder:c(),browsingSubfolders:z(de),folder:z(se),basePath:z(le),subfolderPath:z(g),selectedSubfolderPaths:z(_)})),Ee=({path:e},t)=>{let n=z(_).filter(t=>t!==e);M(_,t?[...a()?n:[],e]:n,!0)},De=e=>{M(g,e,!0),a()||M(_,[],!0)},Oe=async(e,t)=>{let n=await cu(e),r=z(se);if(Xqe({sha:n,folder:r,unsavedAssets:ce.unsavedAssets}))return;let i=await Zqe({file:e,folder:r,targetFolderPath:z(le),subfolderPath:z(g),replace:t});return z(y).push(i),i},ke=async e=>{if(z(me))return;let t=await Rqe({files:e,listedAssets:z(he)});t!==void 0&&M(x,(await Promise.all(e.map(e=>Oe(e,t)))).filter(e=>!!e).map(e=>({asset:e,replace:t})),!0)},Ae=()=>{M(m,``),M(h,``),M(g,``),M(_,[],!0),z(y).forEach(e=>uZ(e.blobURL)),M(y,[],!0),ce.reset(),M(x,[],!0),p([])},je=()=>{if(c()){if(!z(Te).length)return;d()?.(z(Te).map(e=>({folderPath:e})))}else z(x).length&&(z(S)?.trackDownloads(),d()?.(GVe({resources:z(x),targetFolderPath:z(le)})))};L(()=>{$1.current||i(!1)}),L(()=>{let e=Fqe({open:i(),pendingFileCount:p().length,libraryName:z(ae),cloudServiceEntries:z(ne),canUpload:!!z(S)?.canUpload()});e.type===`upload`?(z(S).uploadFiles(p()),p([])):e.type===`switch`?M(ae,e.serviceId):e.type===`reject`&&(p([]),M(C,!0))});var Me=dJe(),Ne=P(Me);{let e=e=>{var t=H(),n=P(t),i=e=>{r(e)};G(n,e=>{PY.isSmallScreen||e(i)}),U(e,t)},s=e=>{var t=rJe(),n=P(t),r=e=>{var t=aJe(),n=N(t),r=e=>{var t=V();R(e=>W(t,e),[()=>Y(`assets_dialog.selected_folder`,{values:{path:z(Te)[0]}})]),U(e,t)},i=e=>{var t=V();R(e=>W(t,e),[()=>Y(`assets_dialog.selected_folders`,{values:{count:z(Te).length}})]),U(e,t)};G(n,e=>{z(Te).length===1?e(r):e(i,-1)}),D(t),R(()=>t.dir=t.dir),U(e,t)};G(n,e=>{z(Te).length&&e(r)});var i=I(n,2),a=e=>{let t=A(()=>n2[z(ae)]);var n=H(),r=P(n),i=e=>{var n=oJe(),r=F(n,!0);R(e=>{q(n,`href`,z(t).serviceURL),W(r,e)},[()=>Y(`prefs.media.stock_photos.credit`,{values:{service:z(t).serviceLabel}})]),U(e,n)};G(r,e=>{z(t).showServiceLink&&e(i)}),U(e,n)};G(i,e=>{z(be)&&e(a)}),U(e,t)},u=A(()=>c()?Y(`select`):Y(`insert`)),d=A(()=>c()?!z(Te).length:!z(x).length);SS(Ne,{get title(){return z(T)},size:`x-large`,get okLabel(){return z(u)},get okDisabled(){return z(d)},focusInput:!1,onOk:je,onClose:()=>{Ae(),f()?.()},get open(){return i()},set open(e){i(e)},headerExtra:e,footerExtra:s,children:(e,s)=>{var u=uJe(),d=N(u),f=N(d);SUe(f,{get libraryName(){return z(ae)},get assetLibraryFolderMap(){return t.assetLibraryFolderMap},get showRepository(){return z(E)},get selectFolder(){return c()},get cloudServiceEntries(){return z(ne)},get showURLInput(){return z(te)},get stockAssetProviderEntries(){return z(re)},get controlsId(){return`${n}-content-pane`},onChange:e=>{M(ae,e),p([]),M(g,``),M(_,[],!0),M(x,s2({libraryName:z(ae),enteredURL:z(m)}),!0)}});var h=I(f,2),v=e=>{var t=sJe(),n=N(t);r(n),D(t),U(e,t)};G(h,e=>{PY.isSmallScreen&&e(v)}),D(d);var y=I(d,2),b=N(y),C=e=>{{let n=A(()=>c()?[]:z(ge)),r=A(()=>z(de)?z(fe):z(se).internalPath),i=A(()=>z(de)?z(g):``),s=A(()=>c()?Ee:void 0);yUe(e,{get accept(){return o()},get multiple(){return a()},get kind(){return t.kind},get selectFolder(){return c()},get uploadDisabled(){return z(me)},get assets(){return z(n)},get searchTerms(){return z(ee)},get basePath(){return z(r)},get folderLabel(){return z(ye)},get subfolderPath(){return z(i)},get subfolders(){return z(_e)},onDrop:({files:e})=>{ke(e)},get selectedSubfolderPaths(){return z(_)},get onSelectSubfolder(){return z(s)},onNavigate:De,onOpenSubfolder:({path:e})=>{De(fJ(e,z(le)))},get selectedResources(){return z(x)},set selectedResources(e){M(x,e,!0)}})}};G(b,e=>{z(oe)&&z(se)&&e(C)});var w=I(b,2),T=e=>{dH(e,{children:(e,r)=>{var i=cJe(),a=P(i),o=F(a,!0);NS(I(a,2),{dir:`ltr`,flex:!0,get"aria-labelledby"(){return`${n}-url-label`},oninput:()=>{M(x,s2({libraryName:z(ae),enteredURL:z(m)}),!0)},get value(){return z(m)},set value(e){M(m,e,!0)}}),R(e=>{q(a,`id`,`${n}-url-label`),W(o,e)},[()=>t.kind===`image`?Y(`assets_dialog.enter_image_url`):Y(`assets_dialog.enter_file_url`)]),U(e,i)},$$slots:{default:!0}})};G(w,e=>{z(te)&&z(ae)===`enter-url`&&e(T)}),No(I(w,2),17,()=>z(ie),([e,t])=>e,(e,n)=>{var r=A(()=>Er(z(n),2));let o=()=>z(r)[0],s=()=>z(r)[1];var c=H(),u=P(c),d=e=>{{let n=A(()=>z(ae)!==`cloudinary`);Eq(e,{get kind(){return t.kind},get fieldConfig(){return t.fieldConfig},get multiple(){return a()},get hidden(){return z(n)},onSelect:e=>{M(x,e,!0),je(),i(!1)}})}},f=e=>{dH(e,{children:(e,t)=>{var n=lJe(),r=F(n,!0);R(e=>W(r,e),[()=>Y(`assets_dialog.prefix_unresolved`)]),U(e,n)},$$slots:{default:!0}})},p=e=>{gs(uUe(e,{get kind(){return t.kind},get fieldConfig(){return z(Se).fieldConfig},get draft(){return l()},get multiple(){return a()},get searchTerms(){return z(ee)},get serviceProps(){return s()},gridId:`select-assets-grid`,get selectedResources(){return z(x)},set selectedResources(e){M(x,e,!0)}}),e=>M(S,e,!0),()=>z(S))};G(u,e=>{o()===`cloudinary`?e(d):z(ae)===o()&&z(Se).unresolved?e(f,1):z(ae)===o()&&e(p,2)}),U(e,c)}),D(y),D(u),R(()=>q(y,`id`,`${n}-content-pane`)),U(e,u)},$$slots:{headerExtra:!0,footerExtra:!0,default:!0}})}var Pe=I(Ne,2),Fe=e=>{_qe(e,{get dirPath(){return z(fe)},get takenNames(){return z(ve)},get open(){return z(v)},set open(e){M(v,e,!0)}})};G(Pe,e=>{z(de)&&e(Fe)});var Ie=I(Pe,2);fC(Ie,{get show(){return z(C)},set show(e){M(C,e,!0)},children:(e,t)=>{bx(e,{status:`error`,children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(`uploading_files_failed`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),gs(RS(I(Ie,2),{get accept(){return o()},get multiple(){return a()},onSelect:({files:e})=>{z(xe)?z(S)?.uploadFiles(e):ke(e)}}),e=>M(b,e,!0),()=>z(b)),U(e,Me),k()}var mJe=B(`<!> <!> <!> <!>`,1);function hJe(e,t){O(t,!0);let n=A(()=>C3.current??{count:0,name:``}),r=A(()=>z(n).count),i=A(()=>z(n).name),a=e=>{C3.current?.respond(e)};{let t=e=>{var t=mJe(),n=P(t);yS(n,{flex:!0});var r=I(n,2);Xx(r,{variant:`primary`,onclick:()=>a(!0),children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(`replace`)]),U(e,n)},$$slots:{default:!0}});var i=I(r,2);Xx(i,{variant:`primary`,onclick:()=>a(!1),children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(`keep_both`)]),U(e,n)},$$slots:{default:!0}}),Xx(I(i,2),{variant:`secondary`,onclick:()=>a(void 0),children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(`cancel`)]),U(e,n)},$$slots:{default:!0}}),U(e,t)},n=A(()=>!!C3.current),o=A(()=>Y(`file_name_conflict_resolution`));wS(e,{get open(){return z(n)},get title(){return z(o)},onCancel:()=>a(void 0),footer:t,children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(`file_name_conflict_confirmation_with_name`,{values:{count:z(r),name:z(i)}})]),U(e,n)},$$slots:{footer:!0,default:!0}})}k()}var gJe=({collectionName:e,fileName:t,isIndexFile:n,componentName:r,typedKeyPath:i,fieldConfig:a})=>{let o=Bqe({collectionName:e,fileName:t,componentName:r,typedKeyPath:i,isIndexFile:n}),{enabled:s,config:c}=nJ({fieldConfig:a}),l=Object.entries(m$).filter(([,{isEnabled:e}])=>e?.(a)??!0);return{folderMap:o,folder:Vqe(o),enabled:s,libraryConfig:c,cloudServiceEntries:l}},_Je=({draft:e,resources:t,folder:n,libraryConfig:r,accept:i,locale:a})=>Promise.all(t.map(t=>(t.file&&!t.folder&&(t.folder=n),E3({draft:e,resource:t,libraryConfig:r,accept:i,locale:a})))),vJe=e=>({oversizedFileNames:e.flatMap(({oversizedFileName:e})=>e??[]),invalidFileNames:e.flatMap(({invalidFileName:e})=>e??[]),mismatchedFileNames:e.flatMap(({mismatchedFileName:e})=>e??[])}),yJe=(e,t)=>t?e.replaceAll(` `,`%20`):e,bJe=({resources:e,multiple:t,previousValue:n,inEditorComponent:r})=>{let i=e.flatMap(({value:e})=>e??[]),a;return t||(a=i.length?yJe(i.at(-1),r):n??``),{values:i,value:a,credit:e.flatMap(({credit:e})=>e||[]).join(`
`),rejected:vJe(e)}},D3=({draft:e,fieldConfig:t,typedKeyPath:n,componentName:r})=>{let{collectionName:i,fileName:a,isIndexFile:o}=e;return gJe({collectionName:i,fileName:a,isIndexFile:o,componentName:r,typedKeyPath:n,fieldConfig:t})},xJe=async({draft:e,fieldConfig:t,typedKeyPath:n,componentName:r,locale:i,file:a,options:o={}})=>{let s=o.name??(a instanceof File?a.name:``);if(!(a instanceof Blob)||!s)throw TypeError("addFile() expects a File, or a Blob along with the `name` option");let c=a instanceof File&&a.name===s?a:new File([a],s,{type:a.type}),{folder:l,libraryConfig:u}=D3({draft:e,fieldConfig:t,typedKeyPath:n,componentName:r});if(!l)throw Error(`There is no asset folder to upload the file "${s}" to`);let{value:d,oversizedFileName:f,invalidFileName:p}=await E3({draft:e,resource:{file:c,folder:l,replace:!!o.replace},libraryConfig:u,locale:i});if(p)throw Error(`The file "${p}" is corrupt or mislabeled and cannot be used`);if(f){let{max_file_size:e}=u;throw Error(`The file "${f}" exceeds the maximum size of ${e} bytes`)}return d},SJe=({kind:e,accept:t})=>{if(e)return e===`image`?`image`:void 0;let n=(t??``).split(`,`).map(e=>e.trim()).filter(Boolean);return n.length&&n.every(e=>e.startsWith(`image/`))?`image`:void 0},CJe=async({draft:e,typedKeyPath:t,componentName:n,locale:r,resource:i,value:a})=>{if(a.startsWith(`blob:`))return e.files[a]?.file;let{collectionName:o,fileName:s,originalEntry:c}=e,l=i.asset??(i.file?TQ({value:a,entry:c,collectionName:o,fileName:s,componentName:n,typedKeyPath:t,locale:r}):void 0);return l?QX(l):void 0},wJe=async({draft:e,fieldConfig:t,typedKeyPath:n,componentName:r,locale:i,inEditorComponent:a=!1,resources:o,accept:s})=>{let{folder:c,libraryConfig:l}=D3({draft:e,fieldConfig:t,typedKeyPath:n,componentName:r}),u=await _Je({draft:e,resources:o,folder:c,libraryConfig:l,accept:s,locale:i});return{files:(await Promise.all(u.map(async({value:s,credit:c},l)=>s?{value:yJe(s,a),file:await CJe({draft:e,fieldConfig:t,typedKeyPath:n,componentName:r,locale:i,resource:o[l],value:s}),credit:c||void 0}:void 0))).filter(Boolean),...vJe(u)}},TJe=B(`<!> <!> <!>`,1);function EJe(e,t){O(t,!0);let n=J(t,`componentName`,3,void 0),r=J(t,`inEditorComponent`,3,!1),i=J(t,`locale`,3,void 0),a=LK(),o=j(!1),s=j({}),c=j(void 0),l,u=A(()=>a.current?D3({draft:a.current,fieldConfig:t.fieldConfig,typedKeyPath:t.typedKeyPath,componentName:n()}):void 0),d=A(()=>SJe(z(s))),f=A(()=>aJ({accept:z(s).accept,image:z(d)===`image`,transformations:z(u)?.libraryConfig.transformations})),p=A(()=>z(u)?.libraryConfig.max_file_size??1/0),m=A(()=>t.fieldConfig),h=async(e={})=>{if(!a.current)throw Error(`pickFile() can only be called while an entry is being edited`);return l||(l=Promise.withResolvers(),M(s,e),M(o,!0)),l.promise},g=async e=>{let o=a.current,{resolve:u,reject:d}=l??{},{multiple:p=!1}=z(s);if(l=void 0,u&&d){if(!o)u(null);else try{let{files:a,...s}=await wJe({draft:o,fieldConfig:t.fieldConfig,typedKeyPath:t.typedKeyPath,componentName:n(),locale:i(),inEditorComponent:r(),resources:e,accept:z(f)});z(c)?.report(s),a.length?u(p?a:a[0]):u(null)}catch(e){d(e)}}},_=()=>{l?.resolve(null),l=void 0};Co(_);var v={pick:h},y=H(),b=P(y),x=e=>{var t=TJe(),n=P(t);{let e=A(()=>!!z(s).multiple),t=A(()=>z(s).allowURL??!0);pJe(n,{get kind(){return z(d)},get accept(){return z(f)},get multiple(){return z(e)},get canEnterURL(){return z(t)},get draft(){return a.current},get locale(){return i()},get fieldConfig(){return z(m)},get assetLibraryFolderMap(){return z(u).folderMap},get enabledCloudServiceEntries(){return z(u).cloudServiceEntries},onSelect:g,onClose:_,get open(){return z(o)},set open(e){M(o,e,!0)}})}var r=I(n,2);hJe(r,{}),gs(H0(I(r,2),{get maxSize(){return z(p)},get accept(){return z(f)}}),e=>M(c,e,!0),()=>z(c)),U(e,t)};return G(b,e=>{z(u)&&e(x)}),U(e,y),k(v)}var O3=(0,mr.createContext)({}),k3=kH({loader:()=>Zc(`react-dom`),notLoadedMessage:"react-dom is not loaded yet. Call `loadReactDom()` first."}),DJe=k3.loaded,A3=k3.load,j3=k3.preload;k3.get,k3.reset;var M3=e=>{let t;return{render:n=>{t??=k3.get().createRoot(e),t.render(n)},unmount:()=>{t?.unmount(),t=void 0}}},OJe=(e,t)=>{let n,r=!1;return k3.load().then(()=>{r||(n=M3(e),n.render(t))},e=>{console.error(e)}),()=>{r=!0,n?.unmount()}},kJe=e=>{let t;return L(()=>eo(()=>(Promise.all([v4(),A3()]).catch(e=>{console.error(e)}),()=>{t?.unmount()}))),{get ready(){return _4.current&&DJe.current&&!!e()},render:n=>{t??=M3(e()),t.render(n)}}},AJe=/(?<path>.+?)\.[^.]*$/,N3=({fieldConfig:e,getFieldArgs:t})=>{let{keyPath:n}=t,r=n.split(`.`),i=r.map((e,n)=>{if(n===0||!eh(e))return;let i=r.slice(0,n).join(`.`),a={...t,keyPath:i},o=lh(a);if(!(o?.widget!==`list`||RW({fieldConfig:o,getFieldArgs:a})))return`${i}.${e}`}).filter(e=>e!==void 0);return i.length?r=>{let a=e=>n in r||e in r||Object.keys(r).some(t=>t.startsWith(`${e}.`));return lh({...t,valueMap:r})===e&&i.every(a)}:()=>!0},jJe=({getFieldArgs:e,content:t})=>{let{keyPath:n}=e;if(!n.includes(`.`))return!0;let r=n.match(AJe)?.groups?.path;return!!lh({...e,keyPath:r})||Object.keys(t).some(e=>e.startsWith(`${r}.`))},P3=({draft:e,getFieldArgs:t,sourceLanguage:n,matchesListItems:r},i)=>{Object.entries(e.currentValues).forEach(([e,a])=>{e!==n&&jJe({getFieldArgs:t,content:a})&&r(a)&&i(a,e)})},MJe=({draft:e,getFieldArgs:t,fieldConfig:n,fieldKeyPath:r=t.keyPath,sourceLanguage:i,value:a})=>{let{keyPath:o}=t;P3({draft:e,getFieldArgs:t,sourceLanguage:i,matchesListItems:N3({fieldConfig:n,getFieldArgs:{...t,keyPath:r}})},(e,t)=>{let r=JG({fieldConfig:n,value:a,sourceLocale:i,targetLocale:t});e[o]!==r&&(e[o]=r)})},NJe=({draft:e,getFieldArgs:t,fieldConfig:n,fieldKeyPath:r,sourceLanguage:i,value:a,previousValue:o,deleted:s=!1})=>{let{keyPath:c,valueMap:l}=t,u=XG(n,r),d=c===u?o:l[u];P3({draft:e,getFieldArgs:t,sourceLanguage:i,matchesListItems:N3({fieldConfig:n,getFieldArgs:{...t,keyPath:r}})},(e,t)=>{let r=e[u],o=QG({fieldConfig:n,targetValue:r,previousValue:d,sourceLocale:i,targetLocale:t});if(s){o&&c in e&&delete e[c];return}let l=JG({fieldConfig:n,value:a,sourceLocale:i,targetLocale:t});o&&!(X(a)&&X(e[c]))&&e[c]!==l&&(e[c]=l)})},F3=({draft:e,locale:t,target:n={},getValueMap:r})=>{let{collectionName:i,fileName:a,isIndexFile:o}=e,s={collectionName:i,fileName:a,isIndexFile:o},c=Gp(i,a);if(!c)return;let{collection:l,collectionFile:u}=c,{defaultLocale:d,canonicalSlug:{key:f}}=(u??l)._i18n,p=()=>mK()&&t===d,m=(e,n)=>mK()&&(t===d?RW({fieldConfig:e,getFieldArgs:n}):zW({fieldConfig:e,getFieldArgs:n})),h=(e,t)=>{let n=typeof r==`function`?r():e,i=ch(s,{keyPath:t,valueMap:n});return{valueMap:n,getFieldArgs:i,fieldConfig:lh({...i})}},g=(e,t)=>{let n=e?{keyPath:t.keyPath,fieldConfig:e}:aK(t);return n&&m(n.fieldConfig,{...t,keyPath:n.keyPath})?n:void 0},_=({fieldConfig:n,getFieldArgs:r,value:i,previousValue:a,deleted:o})=>{if(!p())return;let{keyPath:s}=r,c=Ije(s,e=>e===s?n:lh({...r,keyPath:e}));c&&NJe({draft:e,getFieldArgs:r,...c,sourceLanguage:t,value:i,previousValue:a,deleted:o})};return DK(n,{onSet:(n,r,i,a,o)=>{if([f].includes(r))return;let{fieldConfig:s,getFieldArgs:c,valueMap:l}=h(n,r);OGe({draft:e,locale:t,keyPath:r,value:i,valueMap:l,keyAdded:o});let u=g(s,c);u&&hK(()=>{MJe({draft:e,getFieldArgs:c,fieldConfig:u.fieldConfig,fieldKeyPath:u.keyPath,sourceLanguage:t,value:i})}),_({fieldConfig:s,getFieldArgs:c,value:i,previousValue:a})},onDelete:(n,r,i)=>{let{fieldConfig:a,getFieldArgs:o,valueMap:s}=h(n,r);r!==f&&OGe({draft:e,locale:t,keyPath:r,value:void 0,valueMap:s});let c=g(a,o);if(c){let n=N3({fieldConfig:c.fieldConfig,getFieldArgs:{...o,keyPath:c.keyPath}});hK(()=>{P3({draft:e,getFieldArgs:o,sourceLanguage:t,matchesListItems:n},e=>{r in e&&delete e[r]})})}_({fieldConfig:a,getFieldArgs:o,previousValue:i,deleted:!0})}})},PJe=(e,{locale:t,account:{email:n=``,login:r=``,name:i=``}})=>e===`locale`?t:e===`datetime`?new Date().toJSON().replace(/\d+\.\d+Z$/,`00.000Z`):e===`uuid`?jc():e===`uuid_short`?jc(`short`):e===`uuid_shorter`?jc(`shorter`):e===`author-email`?n:e===`author-login`?r:e===`author-name`?i:``,FJe=({fieldConfig:e,locale:t,dynamicValue:n})=>{let{default:r}=e,i=n??r;if(typeof i!=`string`)return i;let a={locale:t,account:Fu.account},o=e=>{let{value:n,transformations:r}=gU(e),i=PJe(n,a),s=SH(r,o);return s.length?_U({value:i,transformations:s,locale:t}):i};return Qd(i,(e,t)=>o(t))},IJe=e=>({[e.keyPath]:FJe(e)}),I3=e=>{let{prefix:t,use_b32_encoding:n}=e,r=n?Nc():jc();return t?`${t}${r}`:r},LJe=[`uuid`,`compute`,`hidden`],L3=({fieldConfig:e,keyPath:t,value:n,locale:r,defaultLocale:i})=>{let{widget:a}=e;return a===`uuid`?n&&I3(e):a===`compute`?xMe(e.value)?``:n:a===`hidden`?IJe({fieldConfig:e,keyPath:t,locale:r,defaultLocale:i})[t]:n},RJe=/^.*\.\d+(?=\.)/,zJe=({contentMap:e,defaultLocale:t,getFieldArgs:n})=>{let r=e[t],i=(e,t)=>{let r=lh({...n,keyPath:t,valueMap:e});return r?.widget===`uuid`?r:void 0};r&&Object.keys(r).forEach(e=>{let t=i(r,e);t&&!r[e]&&(r[e]=I3(t))}),Object.entries(e).forEach(([e,a])=>{e!==t&&(Object.keys(a).forEach(e=>{let t=i(a,e);t&&!a[e]&&NW(t.i18n)&&(a[e]=I3(t))}),r&&Object.entries(r).forEach(([e,t])=>{let o=i(r,e),s=e.match(RJe)?.[0];o&&!a[e]&&RW({fieldConfig:o,getFieldArgs:{...n,keyPath:e,valueMap:r}})&&(!s||Object.keys(a).some(e=>e.startsWith(`${s}.`)))&&(a[e]=t)}))})},BJe=({fieldConfig:e,dynamicValue:t})=>{if(t!==void 0)return t===`true`;let{default:n}=e;return typeof n==`boolean`&&n},VJe=e=>({[e.keyPath]:BJe(e)}),HJe=({fieldConfig:e,keyPath:t,dynamicValue:n})=>{let{default:r}=e,i=yH(e),a=n===void 0?r:n;if(!i)return{[t]:typeof a==`string`?a:``};let o=X(a)?a:void 0,s=o?.[i.code]??a,c=o?.[i.lang]??``;return Tm(t,{[i.code]:typeof s==`string`?s:``,[i.lang]:typeof c==`string`?c:``})},UJe=({fieldConfig:e,dynamicValue:t,locale:n})=>{let r=e,i=r.default,a=t??i;return typeof a==`string`?a===`{{now}}`?MU(r,{locale:n}):a:``},WJe=e=>({[e.keyPath]:UJe(e)}),GJe=({fieldConfig:e,keyPath:t,dynamicValue:n})=>{let r=e,i=r.default,a=Hf(r),o=``;o=n===void 0?a?Array.isArray(i)?i:[]:typeof i==`string`?i:``:a?n.split(/,\s*/):n;let s={};return a&&Array.isArray(o)&&(o=o.map(e=>e.trim()).filter(e=>e!==``),Object.assign(s,Tm(t,o))),!a&&typeof o==`string`&&(s[t]=o.trim()),s},KJe=({fieldConfig:e,locale:t})=>{let{default:n}=e,r=fh({fieldConfig:e,locale:t});return X(n)?n:r?{"":``}:{}},qJe=e=>{let{keyPath:t,dynamicValue:n}=e,r;if(n!==void 0)try{let e=JSON.parse(n);X(e)&&(r=e)}catch{}return r??=KJe(e),Object.fromEntries(Object.entries(r).filter(([,e])=>typeof e==`string`).map(([e,n])=>[`${t}.${_m(e)}`,n]))},JJe=[`int`,`float`,`int/string`,`float/string`],YJe=({fieldConfig:e,keyPath:t,dynamicValue:n})=>{let r=e,i=n??r.default;if(i===void 0)return{[t]:zU(r)?``:null};if(!JJe.includes(LU(r)))return{};let a=HU(i);return WU(a,r)?{}:{[t]:GU({inputValue:a,fieldConfig:r})}},XJe=e=>e.replaceAll(/<(?=[!/?a-z])/gi,`&lt;`),ZJe=e=>{try{return XJe(dre(e))}catch{return XJe(e.replace(/<[^>]*>/g,``))}},R3=({fieldConfig:e,keyPath:t,dynamicValue:n})=>{let{default:r=Dl.current?.field_defaults?.richtext?.default}=e,i=n===void 0?r||``:ZJe(n);return{[t]:i}},z3=({fieldConfig:e,keyPath:t,dynamicValue:n})=>{let r=e,{default:i,multiple:a=!1}=r,o=r.options??[],[s]=o,c=e=>{let t=o.findIndex(t=>String(LG(t))===e);return t>-1?LG(o[t]):e};if(n!==void 0&&!a){let e=n.trim();return{[t]:e?c(e):BG(LG(s))}}let l=n===void 0?Array.isArray(i)?i.map(LG):LG(i):n.split(/,\s*/).map(e=>e.trim()).filter(e=>e!==``).map(c);return a?Array.isArray(l)&&l.length?Object.fromEntries(l.map((e,n)=>[`${t}.${n}`,e])):{[t]:[]}:{[t]:l===void 0?BG(LG(s)):l}},B3=({content:e,itemKeyPath:t,fields:n,funcArgs:r})=>{let{locale:i,defaultLocale:a,populateDefault:o}=r,s=Object.keys(e);n.forEach(n=>{let r=`${t}.${n.name}`;s.some(e=>tm(e,r))||o?.({content:e,keyPath:r,fieldConfig:n,locale:i,defaultLocale:a,dynamicValues:{}})})},QJe=({fieldConfig:e,locale:t})=>e.max===1&&(`fields`in e||`field`in e)&&fh({fieldConfig:e,locale:t}),$Je=e=>z3({...e,fieldConfig:{...e.fieldConfig,multiple:!1}}),eYe={boolean:VJe,number:YJe,markdown:R3,richtext:R3,relation:$Je,select:$Je},tYe=(e,t,n)=>{let r=eYe[t?.widget??`string`];if(!r)return e;let i=t,a=r({...n,fieldConfig:i,keyPath:`_`,dynamicValue:e})._;return typeof a==`string`?a.trim():a},nYe={boolean:VJe,code:HJe,datetime:WJe,file:GJe,hidden:IJe,image:GJe,keyvalue:qJe,list:e=>{let{fieldConfig:t,keyPath:n,dynamicValue:r,locale:i,defaultLocale:a,populateDefault:o}=e,{default:s}=t,{field:c}=t,{fields:l}=t,{types:u,typeKey:d=`type`}=t,f;if(f=r===void 0?Array.isArray(s)?s:[]:r.split(/,\s*/).map(e=>e.trim()).filter(e=>e!==``).map(e=>tYe(e,c,{locale:i,defaultLocale:a})).filter(e=>e!==``&&e!==void 0),!(Array.isArray(f)&&f.length)){let r=Tm(n,[]);if(QJe({fieldConfig:t,locale:i})){let t=`${n}.0`;c?o?.({content:r,keyPath:t,fieldConfig:c,locale:i,defaultLocale:a,dynamicValues:{}}):B3({content:r,itemKeyPath:t,fields:l,funcArgs:e})}return r}let p=c||l||u?f:f.filter(e=>!X(e)),m=Tm(n,p);return(l||u)&&p.forEach((t,r)=>{if(!X(t))return;let i=l??u.find(({name:e})=>e===t[d])?.fields;i&&B3({content:m,itemKeyPath:`${n}.${r}`,fields:i,funcArgs:e})}),m},markdown:R3,number:YJe,object:e=>{let{fieldConfig:t,keyPath:n,locale:r,defaultLocale:i,dynamicValues:a={},populateDefault:o}=e,{default:s}=t,{fields:c}=t,{types:l,typeKey:u=`type`}=t,d=fh({fieldConfig:t,locale:r}),f={};if(X(s)){Object.entries(bm(s)).forEach(([e,t])=>{f[`${n}.${e}`]=t});let t=Array.isArray(l)?l.find(({name:e})=>e===s[u])?.fields:c;return t&&B3({content:f,itemKeyPath:n,fields:t,funcArgs:e}),f}let p=Object.keys(a).some(e=>e.startsWith(`${n}.`));return!d&&!p||Array.isArray(l)?(f[n]=null,f):(c&&c.length>0&&c.forEach(e=>{o?.({content:f,keyPath:[n,e.name].join(`.`),fieldConfig:e,locale:r,defaultLocale:i,dynamicValues:{}})}),f)},relation:z3,richtext:R3,select:z3},V3=({content:e,keyPath:t,fieldConfig:n,locale:r,defaultLocale:i,dynamicValues:a})=>{let o=yG({fieldConfig:n,locale:r,defaultLocale:i}),{widget:s=`string`,default:c,i18n:l=!1}=o;if(r!==i&&IW(l))return;if(s===`compute`){e[t]=``;return}let u=Object.hasOwn(a,t)&&!/\.\d+(?:\.|$)/.test(t)&&a[t].trim()||void 0,d=nYe[s];d?Object.assign(e,d({fieldConfig:o,keyPath:t,locale:r,defaultLocale:i,dynamicValue:u,dynamicValues:a,populateDefault:e=>V3({...e,dynamicValues:a})})):e[t]=u??c??``},H3=({fields:e,locale:t,defaultLocale:n,dynamicValues:r={}})=>{let i={};return e.forEach(e=>{V3({content:i,keyPath:e.name,fieldConfig:e,locale:t,defaultLocale:n,dynamicValues:r})}),i},rYe=(e,t)=>{let n=e.map(([e])=>e);return e.map(([e],r)=>{let i=t.find(([t])=>t===e);if(i)return i;let a=t[r];return a&&!n.includes(a[0])?[e,a[1]]:[e,``]})},U3=({valueStore:e,defaultLocale:t,keyPath:n})=>{let r=cK(e[t]??{},n);Object.entries(e).forEach(([i,a])=>{if(i===t)return;let o=cK(a,n),s=rYe(r,o);(s.length!==o.length||s.some(([e,t],n)=>{let[r,i]=o[n];return e!==r||t!==i}))&&lK(a,n,s),!s.length&&e[t]?.[n]===null&&a[n]!==null&&(a[n]=null)})},iYe=({valueStore:e,getFieldArgs:t})=>{let n=new Set;return Object.values(e).forEach(e=>{Object.keys(e).forEach(r=>{sK({...t,keyPath:r,valueMap:e})?.i18n===`duplicate_keys`&&n.add(r.replace(oK,``))})}),[...n]},W3=({valueStore:e,defaultLocale:t,getFieldArgs:n})=>{iYe({valueStore:e,getFieldArgs:n}).forEach(n=>{U3({valueStore:e,defaultLocale:t,keyPath:n})})},G3=({valueStore:e,locale:t,i18n:n,draft:r,keyPath:i},a)=>{let o=r&&i&&e===r.currentValues?ch(r,{keyPath:i,valueMap:e[t]}):void 0,s=o?lh(o):void 0,c=PW(n)||!!o&&RW({fieldConfig:s??{i18n:n},getFieldArgs:o}),l=c&&o?N3({fieldConfig:s,getFieldArgs:o}):()=>!0;hK(()=>{Object.entries(e??{}).forEach(([e,n])=>{(e===t||c&&l(n))&&a(n,e)})})},aYe=e=>{let{widget:t,default:n}=e;return t===`hidden`&&typeof n==`string`&&tf(n)},oYe=({draft:e,content:t,targetLanguage:n,keyPathPrefix:r})=>{let{currentValues:i}=e,{defaultLocale:a}=Rf(e),o=Oc(i[a]),s={...Oc(t),...o},c=ch(e,{valueMap:s}),l=[];return Object.keys(s).forEach(e=>{let r=lh({...c,keyPath:e});if(!r)return;let{widget:i=`text`}=r,u=r.i18n??(RW({fieldConfig:r,getFieldArgs:{...c,keyPath:e}})?`duplicate`:!1);_ie.includes(i)&&NW(u)&&u!==`duplicate_if_empty`&&(s[e]=t[e]??``),NW(u)&&(i===`uuid`?s[e]=t[e]||I3(r):(i===`compute`||aYe(r))&&(s[e]=L3({fieldConfig:r,keyPath:e,value:s[e],locale:n,defaultLocale:a}))),e in o&&(s[e]=JG({fieldConfig:r,value:s[e],sourceLocale:a,targetLocale:n})),i===`object`&&FW(u)&&o[e]!==null&&delete s[e],(IW(u)||l.some(t=>tm(e,t)))&&(delete s[e],l.push(e))}),iYe({valueStore:{[n]:s},getFieldArgs:c}).forEach(e=>{lK(s,e,cK(o,e).map(([n])=>[n,t[`${e}.${n}`]??``]))}),r===void 0?s:Object.fromEntries(Object.entries(s).filter(([e])=>e.startsWith(`${r}.`)))},sYe=({draft:e,locale:t})=>{let{fields:n,defaultLocale:r,currentLocales:i,currentValues:a,validities:o,validationMessages:s}=e,c=!i[t];if(i[t]=c,c&&!a[t]){let i=H3({fields:n,locale:t,defaultLocale:r});e.originalValues[t]=i,a[t]=F3({draft:e,locale:t,target:oYe({draft:e,content:i,targetLanguage:t})})}else o[t]={},s[t]={}},cYe=({draft:e,valueStoreKey:t,locale:n,keyPath:r,i18n:i,value:a})=>{G3({valueStore:e[t],locale:n,i18n:i,draft:e,keyPath:r},e=>{xoe(e,r,a)})},lYe=({draft:e,valueStoreKey:t,locale:n,keyPath:r,i18n:i,value:a})=>{Array.isArray(a)||X(a)?cYe({draft:e,valueStoreKey:t,locale:n,keyPath:r,i18n:i,value:a}):G3({valueStore:e[t],locale:n,i18n:i,draft:e,keyPath:r},e=>{rm(e,`${r}.`,{live:!0}).forEach(t=>{delete e[t]}),e[r]=a})},uYe=[Symbol.for(`react.forward_ref`),Symbol.for(`react.memo`)],K3=e=>typeof e==`function`||uYe.includes(e?.$$typeof),dYe=(e,t=new Set)=>{if(K3(e))return e;if(typeof e==`string`){if(t.has(e)){console.warn(`Custom field type "${e}" references itself through its control.`);return}t.add(e);let n=Hd.get(e);if(n?.control)return K3(n.control)?n.control:dYe(n.control,t);if(Pd.includes(e)){console.warn(`Custom field references built-in editor "${e}" which is not a React component.`);return}}},fYe=({fieldId:e,fieldClassName:t,fieldConfig:n,currentValue:r,draft:i,locale:a,onChange:o,addFile:s,pickFile:c,handleRef:l})=>{let u=i?AWe({draft:i,locale:a}):void 0;return{value:r,field:C4(n),forID:e??``,classNameWrapper:t??``,entry:u?.entryMap,getAsset:u?.getAsset,onChange:o,addFile:s,pickFile:c,ref:l}},q3=void 0,pYe=()=>{if(q3===void 0){let e=document.createElement(`div`);go(NS,{target:e}),q3=e.querySelector(`input`).className}return q3},mYe=B(`<div role="none"></div> <!>`,1);function hYe(e,t){O(t,!0);let n=LK(),{valueStoreKey:r=`currentValues`,parentComponentNames:i=[]}=UK(),a=HK(r),o=J(t,`required`,3,!0),s=J(t,`readonly`,3,!1),c=J(t,`invalid`,3,!1),l=j(void 0),u=kJe(()=>z(l)),d=j(void 0),f=j(void 0),p={locale:t.locale,keyPath:t.keyPath},m=A(()=>Tr(t.fieldConfig.i18n,!1)),h=A(()=>dYe(t.control)),g=i.at(-1),_=e=>{let i=n.current;i&&lYe({draft:i,valueStoreKey:r,locale:t.locale,keyPath:t.keyPath,i18n:z(m),value:e})},v=async(e,r)=>{if(!n.current)throw Error(`addFile() can only be called while an entry is being edited`);return xJe({draft:n.current,fieldConfig:t.fieldConfig,typedKeyPath:t.typedKeyPath,componentName:g,locale:t.locale,file:e,options:r})},y=async e=>{if(!z(f))throw Error(`pickFile() can only be called while an entry is being edited`);return z(f).pick(e)},b=e=>{let t=z(d);M(d,e),e?jWe({...p,instance:e}):j4({...p,instance:t})},x=()=>{if(!u.ready||!z(h))return;let e=fYe({fieldId:t.fieldId,fieldClassName:pYe(),fieldConfig:t.fieldConfig,currentValue:t.currentValue,draft:n.current,locale:t.locale,onChange:_,addFile:v,pickFile:y,handleRef:b});u.render((0,mr.createElement)(O3.Provider,{value:{locale:t.locale,keyPath:t.keyPath,required:o(),readonly:s(),invalid:c()}},(0,mr.createElement)(z(h),e))),z(l)?.querySelector(`input`)?.setAttribute(`aria-invalid`,String(c()))};So(()=>()=>{j4({...p,instance:z(d)})}),L(()=>{let e={locale:t.locale,keyPath:t.keyPath};eo(()=>{z(d)&&(j4({...p,instance:z(d)}),jWe({...e,instance:z(d)}))}),p=e}),L(()=>{kK(n.current,t.locale,r),x4.current,u.ready&&z(h)&&x()}),L(()=>{kK(n.current,t.locale,r),typeof z(d)?.isValid==`function`&&PWe({locale:t.locale,keyPath:t.keyPath,value:t.currentValue,fieldConfig:t.fieldConfig})});var S=mYe(),C=P(S);gs(C,e=>M(l,e),()=>z(l)),gs(EJe(I(C,2),{get fieldConfig(){return t.fieldConfig},get typedKeyPath(){return t.typedKeyPath},get componentName(){return g},get inEditorComponent(){return a},get locale(){return t.locale}}),e=>M(f,e,!0),()=>z(f)),U(e,S),k()}var gYe=e=>{let{widget:t}=e??{};return t?Hd.get(t)?.summary:void 0},_Ye=({locale:e,keyPath:t,fieldConfig:n,currentValue:r,draft:i,preview:a})=>{if(!K3(a)||!i)return;let{entryMap:o,getFieldArgs:s,fieldsMetaData:c,getAsset:l}=AWe({draft:i,locale:e});return{value:r,field:C4(n),metadata:c.getIn(SWe({getFieldArgs:s,keyPath:t}))??b4().fromJS({}),getAsset:l,entry:o,fieldsMetaData:c}},vYe=B(`<div class="svelte-7ynvbs"></div>`),yYe={hash:`svelte-7ynvbs`,code:`div.svelte-7ynvbs {
/* Allow the React component to use the full width, but let it shrink beside a list item
thumbnail rather than overflow */width:100%;min-width:0;}`};function bYe(e,t){O(t,!0),K(e,yYe);let n=LK(),r=j(void 0),i=kJe(()=>z(r)),a=()=>{if(!i.ready)return;let e=_Ye({locale:t.locale,keyPath:t.keyPath,fieldConfig:t.fieldConfig,currentValue:t.currentValue,draft:n.current,preview:t.preview});e&&i.render((0,mr.createElement)(O3.Provider,{value:{locale:t.locale,keyPath:t.keyPath}},(0,mr.createElement)(t.preview,e)))};L(()=>{kK(n.current,t.locale),x4.current,i.ready&&a()});var o=vYe();gs(o,e=>M(r,e),()=>z(r)),U(e,o),k()}var xYe=B(`<p> <!></p>`);function SYe(e,t){O(t,!0);let n=A(()=>BH(t.fieldConfig)),r=A(()=>z(n).utc),i=A(()=>z(n).singleCustomTimeZone),a=A(()=>FU({locale:t.locale,fieldConfig:t.fieldConfig,currentValue:t.currentValue}));var o=H(),s=P(o),c=e=>{var n=xYe(),o=N(n),s=I(o),c=e=>{var n=V();R(e=>W(n,`— ${e??``}`),[()=>EU(z(i),aU(t.currentValue,t.fieldConfig,t.locale))]),U(e,n)},l=e=>{U(e,V(`— UTC`))};G(s,e=>{z(i)?e(c):z(r)&&e(l,1)}),D(n),R((e,t)=>{q(n,`lang`,e),q(n,`dir`,t),W(o,`${z(a)??``} `),n.dir=n.dir},[()=>Ef(t.locale),()=>Df(t.locale)]),U(e,n)};G(s,e=>{z(a)&&e(c)}),U(e,o),k()}var CYe=B(`<div role="none" class="timezone svelte-1dnhck7"> </div>`),wYe=B(`<div role="none" class="timezone svelte-1dnhck7">UTC</div>`),TYe=B(`<div role="none" class="svelte-1dnhck7"><!> <!> <!></div> <!>`,1),EYe={hash:`svelte-1dnhck7`,code:`div.svelte-1dnhck7 {display:flex;align-items:center;}.timezone.svelte-1dnhck7 {margin:4px 8px 0;color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);white-space:nowrap;}`};function DYe(e,t){O(t,!0),K(e,EYe);let n=J(t,`currentValue`,15),r=J(t,`required`,3,!0),i=J(t,`readonly`,3,!1),a=J(t,`invalid`,3,!1),o=j(``),s=j(!1),c=A(()=>BH(t.fieldConfig)),l=A(()=>z(c).type),u=A(()=>z(c).min),d=A(()=>z(c).max),f=A(()=>z(c).step),p=A(()=>z(c).dateOnly),m=A(()=>z(c).utc),h=A(()=>z(c).singleCustomTimeZone),g=A(()=>nAe(n(),t.fieldConfig)),_=``,v=()=>{if(z(s))return;let e=NU({currentValue:n(),fieldConfig:t.fieldConfig,timeZone:z(g),locale:t.locale});e!==void 0&&e!==z(o)&&M(o,e,!0),_=z(o)},y=()=>{if(z(o)===_)return;_=z(o);let e=jU({inputValue:z(o),currentValue:n(),fieldConfig:t.fieldConfig,timeZone:z(g),locale:t.locale});oAe({newValue:e,currentValue:n(),fieldConfig:t.fieldConfig,locale:t.locale})&&n(e)};sl(()=>n(),()=>{v()}),sl(()=>z(o),()=>{y()});let b=()=>{M(s,!0)},x=()=>{M(s,!1),v()};var S=H(),C=P(S),w=e=>{SYe(e,{get locale(){return t.locale},get keyPath(){return t.keyPath},get typedKeyPath(){return t.typedKeyPath},get fieldConfig(){return t.fieldConfig},get currentValue(){return n()}})},T=A(()=>i()&&z4(t.fieldConfig)),ee=e=>{var s=TYe(),c=P(s),_=N(c);uOe(_,{get type(){return z(l)},get min(){return z(u)},get max(){return z(d)},get step(){return z(f)},get readonly(){return i()},get required(){return r()},get invalid(){return a()},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`},onfocus:b,onblur:x,get value(){return z(o)},set value(e){M(o,e,!0)}});var v=I(_,2),y=e=>{{let n=A(()=>Y(z(p)?`today`:`now`));Xx(e,{variant:`tertiary`,get label(){return z(n)},onclick:()=>{M(o,OU(t.fieldConfig,z(g)),!0)}})}};G(v,e=>{i()||e(y)});var S=I(v,2),C=e=>{{let t=A(()=>Y(`clear`)),r=A(()=>!n());Xx(e,{variant:`tertiary`,get label(){return z(t)},get disabled(){return z(r)},onclick:()=>{n(``)}})}};G(S,e=>{!i()&&!r()&&e(C)}),D(c);var w=I(c,2),T=e=>{var r=CYe(),i=F(r,!0);R(e=>W(i,e),[()=>EU(z(h),aU(n(),t.fieldConfig,t.locale))]),U(e,r)},ee=e=>{U(e,wYe())};G(w,e=>{z(h)?e(T):z(m)&&e(ee,1)}),U(e,s)};G(C,e=>{z(T)?e(w):e(ee,-1)}),U(e,S),k()}var OYe=new Set([`$$slots`,`$$events`,`$$legacy`,`open`,`oldExtension`,`newExtension`,`okLabel`,`onOk`,`onCancel`]),kYe=B(`<p class="svelte-8pzyo8"> </p> <p class="svelte-8pzyo8"> </p>`,1),AYe={hash:`svelte-8pzyo8`,code:`p.svelte-8pzyo8 {margin:0 0 8px;}p.svelte-8pzyo8:last-child {margin:0;}`};function jYe(e,t){O(t,!0),K(e,AYe);let n=J(t,`open`,15,!1),r=J(t,`oldExtension`,3,void 0),i=J(t,`newExtension`,3,void 0),a=J(t,`okLabel`,3,``),o=J(t,`onOk`,3,void 0),s=J(t,`onCancel`,3,void 0),c=vs(t,OYe),l=A(()=>r()?i()?`change`:`remove`:`add`);{let t=A(()=>Y(`change_file_extension`));wS(e,ys(()=>c,{get title(){return z(t)},get okLabel(){return a()},get onOk(){return o()},get onCancel(){return s()},get open(){return n()},set open(e){n(e)},children:(e,t)=>{var n=kYe(),a=P(n),o=F(a,!0),s=F(I(a,2),!0);R((e,t)=>{W(o,e),W(s,t)},[()=>Y(`confirm_file_extension_change.${z(l)}`,{values:{oldExtension:r(),newExtension:i()}}),()=>Y(`file_extension_change_warning`)]),U(e,n)},$$slots:{default:!0}}))}k()}var MYe=B(`<!> <!> <!>`,1),NYe=B(`<div role="textbox" tabindex="0" class="value svelte-15viu92"> </div> <!>`,1),PYe=B(`<div role="none" class="editable-text svelte-15viu92"><!></div>`),FYe={hash:`svelte-15viu92`,code:`.editable-text.svelte-15viu92 {display:flex;align-items:center;gap:4px;}.value.svelte-15viu92 {flex:auto;margin:var(--sui-focus-ring-width);padding:4px;word-break:break-all;&:empty {margin:0;padding:0;}}`};function J3(e,t){O(t,!0),K(e,FYe);let n=J(t,`initialText`,3,void 0),r=J(t,`editing`,15),i=J(t,`text`,15),a=J(t,`inputElement`,15),o=J(t,`canEdit`,3,!0),s=J(t,`editLabel`,3,void 0),c=J(t,`placeholder`,3,void 0),l=J(t,`readonly`,3,!0),u=J(t,`invalid`,3,!1),d=J(t,`required`,3,!1),f=J(t,`applyDisabled`,3,!1),p=J(t,`dir`,3,`auto`),m=J(t,`ariaLabelledby`,3,void 0),h=J(t,`ariaErrormessage`,3,void 0),g=J(t,`getSelectionEnd`,3,void 0),_=J(t,`onApply`,3,void 0),v=j(void 0),y=j(void 0),b=async()=>{let e=n()??t.value;i(e),r(!0),await Za(),a()?.focus(),a()?.setSelectionRange(0,g()?.(e)??e.length)},x=async()=>{r(!1),await Za(),(z(v)??z(y))?.focus()},S=()=>{_()(i())!==!1&&x()};L(()=>{if(r())return eo(()=>{t0.current+=1}),()=>{--t0.current}});var C=PYe(),w=N(C),T=e=>{var n=MYe(),r=P(n);NS(r,{get id(){return t.id},dir:`auto`,flex:!0,get placeholder(){return c()},get invalid(){return u()},get required(){return d()},get"aria-labelledby"(){return m()},get"aria-errormessage"(){return h()},onkeydown:e=>{let{key:t,isComposing:n}=e;n||t!==`Enter`&&t!==`Escape`||(e.preventDefault(),e.stopPropagation(),t===`Escape`?x():S())},get value(){return i()},set value(e){i(e)},get element(){return a()},set element(e){a(e)}});var o=I(r,2);{let e=e=>{gx(e,{name:`check`})},n=A(()=>Y(`done`));Xx(o,{size:`small`,iconic:!0,get disabled(){return f()},get"aria-label"(){return z(n)},get"aria-controls"(){return t.id},onclick:()=>{S()},startIcon:e,$$slots:{startIcon:!0}})}var s=I(o,2);{let e=e=>{gx(e,{name:`close`})},n=A(()=>Y(`cancel`));Xx(s,{size:`small`,iconic:!0,get"aria-label"(){return z(n)},get"aria-controls"(){return t.id},onclick:()=>{x()},startIcon:e,$$slots:{startIcon:!0}})}U(e,n)},ee=e=>{var n=NYe(),r=P(n),i=F(r,!0);gs(r,e=>M(y,e),()=>z(y));var a=I(r,2),c=e=>{Xx(e,{size:`small`,iconic:!0,get"aria-label"(){return s()},get"aria-controls"(){return t.id},onclick:()=>{b()},get element(){return z(v)},set element(e){M(v,e,!0)},startIcon:e=>{gx(e,{name:`edit`})},$$slots:{startIcon:!0}})};G(a,e=>{o()&&e(c)}),R(()=>{q(r,`id`,t.id),q(r,`dir`,p()),q(r,`aria-readonly`,l()),q(r,`aria-invalid`,u()),q(r,`aria-required`,d()),q(r,`aria-labelledby`,m()),q(r,`aria-errormessage`,h()),W(i,t.value),r.dir=r.dir}),U(e,n)};G(w,e=>{r()?e(T):e(ee,-1)}),D(C),U(e,C),k()}var IYe=({index:e,clientY:t,rect:n})=>t<n.top+n.height/2?e:e+1,Y3=(e,t,n)=>{let r=[...e];return r.splice(n,0,...r.splice(t,1)),r},LYe=({dragIndex:e,dropIndex:t})=>{if(e!==void 0&&t!==void 0&&t!==e&&t!==e+1)return t>e?t-1:t},RYe=({key:e,index:t,itemCount:n})=>{if(e===`ArrowUp`||e===`Home`){let n=e===`ArrowUp`?t-1:0;return t>0?n:void 0}if(e===`ArrowDown`||e===`End`){let r=e===`ArrowDown`?t+1:n-1;return t<n-1?r:void 0}},zYe=e=>e>=3,BYe=({position:e,itemCount:t})=>{if(e!==void 0&&Number.isInteger(e))return e>=1&&e<=t?e-1:void 0},VYe=({target:e,listElement:t})=>{if(!t||!(e instanceof Element)||e===t||!t.contains(e))return;let n=e;for(;n.parentElement!==t;)n=n.parentElement;return{element:n,index:[...t.children].indexOf(n)}},HYe=[`move-up`,`move-down`,`reorder`,`move-options`],UYe=({item:e,action:t=`reorder`})=>{[t,...HYe].map(t=>e?.querySelector(`button[data-action="${t}"]`)).find(e=>e&&!e.disabled)?.focus()},WYe=({listElement:e,index:t,action:n})=>{UYe({item:e?.children[t],action:n})},X3=({index:e,getTarget:t,fallback:n})=>{let r=t(e)??t(e-1);r?r.focus():n?.()},Z3=64,GYe=16,Q3=void 0,KYe=e=>{let t=e.parentElement;for(;t;){let{overflowY:e}=globalThis.getComputedStyle(t);if([`auto`,`scroll`].includes(e)&&t.scrollHeight>t.clientHeight)return t;t=t.parentElement}},qYe=({clientY:e,rect:t})=>{let n=e-t.top,r=t.bottom-e;return n<Z3?-16*(1-Math.max(n,0)/Z3):r<Z3?GYe*(1-Math.max(r,0)/Z3):0},JYe=()=>{if(!Q3)return;let{container:e,speed:t}=Q3,{scrollTop:n,scrollHeight:r,clientHeight:i}=e,a=Math.min(Math.max(n+t,0),r-i);!t||a===n?Q3.frame=void 0:(e.scrollTop=a,Q3.frame=requestAnimationFrame(JYe))},YYe=e=>{let t=Q3;t.speed=qYe({clientY:e.clientY,rect:t.container.getBoundingClientRect()}),t.speed&&t.frame===void 0&&(t.frame=requestAnimationFrame(JYe))},XYe=e=>{let t=e?KYe(e):void 0;t&&(Q3={container:t,speed:0,frame:void 0},globalThis.addEventListener(`dragover`,YYe,!0))},ZYe=()=>{Q3&&=(globalThis.removeEventListener(`dragover`,YYe,!0),void 0)};function QYe(e,t){O(t,!0);let n=J(t,`open`,15,!1),r=j(void 0),i=A(()=>BYe({position:z(r),itemCount:t.itemCount})),a=j(!1);L(()=>{n()&&(M(a,!0),M(r,t.index+1))});let o=()=>z(i)!==void 0&&(t.onMove(z(i)),!0);var s=H(),c=P(s),l=e=>{{let a=e=>{{let i=A(()=>Y(`move_to_position`));iH(e,{flex:!0,autofocus:!0,min:1,get max(){return t.itemCount},required:!0,get ariaLabel(){return z(i)},onkeydown:e=>{e.key===`Enter`&&!e.isComposing&&(e.preventDefault(),o()&&n(!1))},get value(){return z(r)},set value(e){M(r,e,!0)}})}},s=A(()=>Y(`move_to`)),c=A(()=>z(i)===void 0);PS(e,{size:`x-small`,get title(){return z(s)},get okDisabled(){return z(c)},onOk:()=>{o()},get open(){return n()},set open(e){n(e)},input:a,children:(e,n)=>{Ur();var r=V();R(e=>W(r,e),[()=>Y(`move_to_description`,{values:{count:t.itemCount}})]),U(e,r)},$$slots:{input:!0,default:!0}})}};G(c,e=>{z(a)&&e(l)}),U(e,s),k()}var $Ye=B(`<!> <!> <!>`,1);function eXe(e,t){O(t,!0);var n=$Ye(),r=P(n);{let e=A(()=>Y(`move_to_top`)),n=A(()=>t.index===0);JS(r,{get label(){return z(e)},get disabled(){return z(n)},onclick:()=>t.onMove(0,`move-options`)})}var i=I(r,2);{let e=A(()=>Y(`move_to_bottom`)),n=A(()=>t.index===t.itemCount-1);JS(i,{get label(){return z(e)},get disabled(){return z(n)},onclick:()=>t.onMove(t.itemCount-1,`move-options`)})}var a=I(i,2);{let e=A(()=>Y(`move_to`));JS(a,{get label(){return z(e)},get onclick(){return t.onMoveTo}})}U(e,n),k()}var tXe=B(`<!> <!> <!>`,1),nXe=B(`<!> <!>`,1),rXe={hash:`svelte-1djdbgy`,code:`button.drag-handle:not(:disabled) {cursor:grab;&:active {cursor:grabbing;}}`};function $3(e,t){O(t,!0),K(e,rXe);let n=J(t,`disabled`,3,!1),r=J(t,`size`,3,`small`),i=J(t,`icon`,3,`drag_indicator`),a=J(t,`part`,3,`auto`),o=J(t,`menu`,3,!0),s=J(t,`onGrab`,3,void 0),c=J(t,`onRelease`,3,void 0),l=J(t,`onMove`,3,void 0),u=()=>{globalThis.removeEventListener(`pointerup`,u),globalThis.removeEventListener(`pointercancel`,u),c()?.()},d=A(()=>PY.hasMouse&&a()!==`buttons`),f=j(!1),p=A(()=>a()===`buttons`||a()===`auto`&&!PY.hasMouse),m=A(()=>o()&&a()!==`handle`&&zYe(t.itemCount));var h=tXe(),g=P(h),_=e=>{{let a=e=>{gx(e,{get name(){return i()}})},o=A(()=>Y(`reorder_item`));Xx(e,{get size(){return r()},get disabled(){return n()},iconic:!0,class:`drag-handle`,"data-action":`reorder`,get"aria-label"(){return z(o)},"aria-keyshortcuts":`ArrowUp ArrowDown Home End`,onpointerdown:()=>{s()?.(),globalThis.addEventListener(`pointerup`,u),globalThis.addEventListener(`pointercancel`,u)},onkeydown:e=>{let n=RYe({key:e.key,index:t.index,itemCount:t.itemCount});n!==void 0&&(e.preventDefault(),l()?.(n,`reorder`))},startIcon:a,$$slots:{startIcon:!0}})}};G(g,e=>{z(d)&&e(_)});var v=I(g,2),y=e=>{var i=tXe(),o=P(i);{let e=e=>{gx(e,{name:`arrow_upward`})},i=A(()=>n()||t.index===0),a=A(()=>Y(`move_up`));Xx(o,{get size(){return r()},iconic:!0,get disabled(){return z(i)},"data-action":`move-up`,get"aria-label"(){return z(a)},onclick:()=>l()?.(t.index-1,`move-up`),startIcon:e,$$slots:{startIcon:!0}})}var s=I(o,2),c=e=>{yS(e,{})};G(s,e=>{a()!==`buttons`&&e(c)});var u=I(s,2);{let e=e=>{gx(e,{name:`arrow_downward`})},i=A(()=>n()||t.index===t.itemCount-1),a=A(()=>Y(`move_down`));Xx(u,{get size(){return r()},iconic:!0,get disabled(){return z(i)},"data-action":`move-down`,get"aria-label"(){return z(a)},onclick:()=>l()?.(t.index+1,`move-down`),startIcon:e,$$slots:{startIcon:!0}})}U(e,i)};G(v,e=>{z(p)&&e(y)});var b=I(v,2),x=e=>{var i=nXe(),a=P(i);{let e=e=>{{let n=A(()=>Y(`reorder_options`));qS(e,{get ariaLabel(){return z(n)},children:(e,n)=>{eXe(e,{get index(){return t.index},get itemCount(){return t.itemCount},onMove:(e,t)=>l()?.(e,t),onMoveTo:()=>{M(f,!0)}})},$$slots:{default:!0}})}},i=A(()=>Y(`reorder_options`));hS(a,{variant:`ghost`,get size(){return r()},iconic:!0,get disabled(){return n()},popupPosition:`bottom-right`,"data-action":`move-options`,get"aria-label"(){return z(i)},popup:e,$$slots:{popup:!0}})}QYe(I(a,2),{get index(){return t.index},get itemCount(){return t.itemCount},onMove:e=>l()?.(e,`move-options`),get open(){return z(f)},set open(e){M(f,e,!0)}}),U(e,i)};G(b,e=>{z(m)&&e(x)}),U(e,h),k()}var iXe=async({kind:e,...t})=>{let n=e??await eoe(t.value);return{kind:n,src:n?await v$(t):void 0}},aXe=B(`<div role="none" class="reorder-controls svelte-1yfgkx5"><!></div>`),oXe=B(`<span role="none" class="preview no-thumbnail"><!></span>`),sXe=B(`<div role="status" class="note svelte-1yfgkx5"> </div>`),cXe=B(`<div role="none"><!> <!> <div role="none" class="svelte-1yfgkx5"><div role="none" class="path svelte-1yfgkx5"><!></div> <!> <div role="none"><!> <!></div></div></div> <!>`,1),lXe={hash:`svelte-1yfgkx5`,code:`.filled.svelte-1yfgkx5 {display:flex !important;align-items:center;position:relative;gap:12px;margin:var(--sui-focus-ring-width);background-color:var(--sui-primary-background-color); /* for dragging opacity */.preview {flex:none;width:120px !important;height:120px !important;border-color:var(--sui-control-border-color) !important;border-radius:var(--sui-control-medium-border-radius);padding:8px !important;&.no-thumbnail {display:flex;align-items:center;justify-content:center;background-color:var(--sui-secondary-background-color);.icon {font-size:64px;}}}.sui.button.tertiary.small {margin:var(--sui-focus-ring-width);}& > div:where(.svelte-1yfgkx5) {flex:auto;overflow:hidden;.note:where(.svelte-1yfgkx5) {margin:4px 0;color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);}.path:where(.svelte-1yfgkx5) {
@media (width < 768px) {font-size:var(--sui-font-size-small);
}}}&.sortable {gap:0;border-width:1px;border-style:solid;border-color:var(--sui-control-border-color) !important;border-radius:var(--sui-control-medium-border-radius);.preview {margin-inline-end:12px;border-radius:0;border-width:0 1px 0 0;}}}.reorder-controls.svelte-1yfgkx5 {flex:none !important;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:4px;align-self:stretch;width:28px;background-color:var(--sui-secondary-border-color);}`};function uXe(e,t){O(t,!0),K(e,lXe);let n=LK(),r=J(t,`groupFieldId`,19,()=>t.fieldId),i=J(t,`readonly`,3,!1),a=J(t,`invalid`,3,!1),o=J(t,`required`,3,!1),s=J(t,`collectionName`,3,``),c=J(t,`fileName`,3,void 0),l=J(t,`typedKeyPath`,3,void 0),u=J(t,`componentName`,3,void 0),d=J(t,`entry`,3,void 0),f=J(t,`locale`,3,void 0),p=J(t,`index`,3,0),m=J(t,`itemCount`,3,1),h=J(t,`dragging`,3,!1),g=j(void 0),_=j(void 0),v=j(void 0),y=j(void 0),b=j(!1),x=j(``),S=j(void 0),C=j(!1),w=j(!1),T=A(()=>t.fieldConfig.widget),ee=A(()=>z(T)===`image`),E=A(()=>z(T)===`file`&&t.fieldConfig.select_folder===!0),te=A(()=>!!t.onMove&&!i()),ne=A(()=>!!z(_)&&!!t.value?.startsWith(`blob:`)),re=A(()=>z(ne)&&!i()),ie=A(()=>z(_)?Uqe({draft:n.current,blobURL:t.value}):void 0),ae=A(()=>z(_)?Uc(z(_).name).extension:void 0),oe=A(()=>{let e=z(x).trim();return e?IQ(e,{slugificationEnabled:nJ({fieldConfig:t.fieldConfig}).config.slugify_filename}):``}),se=A(()=>Uc(z(oe)).extension),ce=A(()=>({value:t.value,entry:d(),collectionName:s(),fileName:c(),componentName:u(),typedKeyPath:l(),fieldConfig:t.fieldConfig,locale:f()})),le=A(()=>Gqe({draft:n.current,value:t.value,unsavedFileName:z(ie)})),ue=()=>{if(!z(_)||!n.current?.files[t.value])return;let e=new File([z(_)],z(oe),{type:z(_).type,lastModified:z(_).lastModified});n.current.files[t.value].file=e,delete n.current.files[t.value].nameTemplate,M(_,e,!0),M(b,!1)},de=()=>!z(_)||!z(oe)||z(oe)===z(ie)?!0:Ql(z(ae),z(se))?(ue(),!0):(M(C,!0),!1),fe=async e=>{if(M(_,t.value?.startsWith(`blob:`)?n.current?.files[t.value]?.file:void 0,!0),M(g,void 0),M(v,void 0),M(y,void 0),!z(E)&&t.value){if(z(ee)&&/^https?:/.test(t.value))M(v,`image`),M(y,t.value,!0);else if(t.value.startsWith(`blob:`)||M(g,TQ({...z(ce)}),!0),!z(g)){let t=await iXe({...z(ce),thumbnail:!0});e()||(M(v,t.kind,!0),M(y,t.src,!0))}}};sl(()=>t.value,()=>{let e=!1;return fe(()=>e),()=>{e=!0}});var pe=cXe(),me=P(pe);let he;var ge=N(me),_e=e=>{var n=aXe(),r=N(n);{let e=A(()=>m()<2);$3(r,{get index(){return p()},get itemCount(){return m()},get disabled(){return z(e)},onGrab:()=>{M(w,!0)},onRelease:()=>{M(w,!1)},get onMove(){return t.onMove}})}D(n),U(e,n)};G(ge,e=>{z(te)&&e(_e)});var ve=I(ge,2),ye=e=>{k0(e,{get kind(){return z(v)},get src(){return z(y)},variant:`tile`,checkerboard:!0})},be=e=>{k0(e,{get kind(){return z(g).kind},get asset(){return z(g)},variant:`tile`,checkerboard:!0})},xe=e=>{var t=oXe(),n=N(t);{let e=A(()=>z(E)?`folder`:`draft`);gx(n,{get name(){return z(e)}})}D(t),U(e,t)};G(ve,e=>{z(v)&&z(y)?e(ye):z(g)?e(be,1):e(xe,-1)});var Se=I(ve,2),Ce=N(Se),we=N(Ce);{let e=A(()=>Y(`rename`)),n=A(()=>!z(oe));J3(we,{get id(){return`${t.fieldId??``}-value`},get value(){return z(le)},get initialText(){return z(ie)},get canEdit(){return z(re)},get editLabel(){return z(e)},get readonly(){return i()},get invalid(){return a()},get required(){return o()},get applyDisabled(){return z(n)},dir:`ltr`,get ariaLabelledby(){return`${r()??``}-label`},get ariaErrormessage(){return`${r()??``}-error`},getSelectionEnd:e=>Uc(e).filename.length,onApply:de,get editing(){return z(b)},set editing(e){M(b,e,!0)},get text(){return z(x)},set text(e){M(x,e,!0)},get inputElement(){return z(S)},set inputElement(e){M(S,e,!0)}})}D(Ce);var Te=I(Ce,2),Ee=e=>{var t=sXe(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`file_will_be_saved_as`,{values:{name:z(oe)}})]),U(e,t)},De=A(()=>z(b)&&z(oe)!==z(x).trim());G(Te,e=>{z(De)&&e(Ee)});var Oe=I(Te,2),ke=N(Oe),Ae=e=>{{let n=A(()=>Y(`replace`)),r=A(()=>Y(`replace_${z(T)}`));Xx(e,{get disabled(){return i()},variant:`tertiary`,size:`small`,get label(){return z(n)},get"aria-label"(){return z(r)},get"aria-controls"(){return`${t.fieldId??``}-value`},onclick:()=>{t.onReplace()}})}};G(ke,e=>{t.onReplace&&e(Ae)});var je=I(ke,2),Me=e=>{{let n=A(()=>Y(`remove`)),r=A(()=>Y(`remove_${z(T)}`));Xx(e,{get disabled(){return i()},variant:`tertiary`,size:`small`,get label(){return z(n)},get"aria-label"(){return z(r)},get"aria-controls"(){return`${t.fieldId??``}-value`},onclick:()=>{t.onRemove()}})}};G(je,e=>{t.onRemove&&e(Me)}),D(Oe),D(Se),D(me);var Ne=I(me,2);{let e=A(()=>Y(`rename`));jYe(Ne,{get oldExtension(){return z(ae)},get newExtension(){return z(se)},get okLabel(){return z(e)},onOk:()=>{ue()},onCancel:()=>{z(S)?.focus()},get open(){return z(C)},set open(e){M(C,e,!0)}})}R(()=>{he=$o(me,1,`filled svelte-1yfgkx5`,null,he,{sortable:z(te),"drag-placeholder":h()}),q(me,`draggable`,z(w))}),oo(`dragstart`,me,e=>{t.onDragStart?.(),e.dataTransfer&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,z(le)))}),oo(`dragend`,me,()=>{M(w,!1),t.onDragEnd?.()}),U(e,pe),k()}var e6=({draft:e,fieldConfig:t,keyPath:n,locale:r,valueMap:i,inEditorComponent:a=!1})=>{let{i18n:o=!1}=t,{i18nEnabled:s,defaultLocale:c}=Rf(e),l=s&&r!==c,u=s&&NW(o),d=e,f=l?a?o:LW({fieldConfig:t,getFieldArgs:{collectionName:d.collectionName,fileName:d.fileName,isIndexFile:d.isIndexFile,keyPath:n,valueMap:i}}):void 0,p=f===`duplicate`,m=!a&&f===`sync`,h=l&&o===`duplicate_keys`;return{canTranslate:u,isDuplicated:p,isSynced:m,areKeysDuplicated:h,isShown:a||r===c||u||p||m||h}},dXe=({draft:e,locale:t})=>{if(!e)return;let n=e.currentValues[t]??{},r=e.fields.find(r=>{let{name:i,widget:a=`string`}=r;if(!Rd.includes(a))return!1;let{readonly:o,multiline:s}=r;if(o===!0||s===!1)return!1;let{isShown:c,isDuplicated:l}=e6({draft:e,fieldConfig:r,keyPath:i,locale:t,valueMap:n});return c&&!l});if(r)return{keyPath:r.name,fieldConfig:r,format:T$(r)}},t6=e=>e.split(`
`).map(e=>e.trim()).filter(Boolean),fXe=e=>e.replace(/[\\`*_[\]<>!]/g,`\\$&`),pXe=e=>{let{body:t}=new DOMParser().parseFromString(e,`text/html`);return[...t.childNodes].map(e=>{let t=fXe(e.textContent);return e instanceof HTMLAnchorElement?`[${t}](${(e.getAttribute(`href`)??``).replace(/[ ()<>]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)})`:t}).join(``).trim()},mXe=e=>t6(e).map(pXe).filter(Boolean).join(`
`),hXe=(e,t)=>t===`html`?t6(e).map(e=>`<p>${e}</p>`).join(`
`):mXe(e),gXe=({draft:e,locale:t,target:n,credit:r})=>{let{keyPath:i,fieldConfig:a,format:o}=n,s=hXe(r,o);if(!s)return;let c=e.currentValues[t]?.[i],l=typeof c==`string`?c.trimEnd():``;lYe({draft:e,valueStoreKey:`currentValues`,locale:t,keyPath:i,i18n:a.i18n,value:l?`${l}\n\n${s}`:s})},_Xe=[`string`,`text`],vXe=({valueStoreKey:e,componentName:t,keyPath:n})=>{if(e!==`extraValues`||!t)return;let{fields:r=[]}=$m(t)??{},{prefix:i,name:a}=n.match(/^(?<prefix>.+:)(?<name>[^:.]+)$/)?.groups??{},o=r.some(({name:e,widget:t})=>e===a&&(t===`image`||t===`file`)),s=r.some(e=>e.name===`caption`&&_Xe.includes(e.widget??`string`)&&e.readonly!==!0);return o&&s?`${i}caption`:void 0},yXe=({draft:e,locale:t,keyPath:n,credit:r})=>{let i=t6(r).join(` `);if(!i)return;let a=e.extraValues[t]??(e.extraValues[t]={}),o=a[n],s=typeof o==`string`?gVe(o):``;a[n]=s?`${s} ${i}`:i},bXe=B(`<!> <!> <!> <!>`,1),xXe=B(`<div role="none"> </div> <div role="none"><!></div>`,1);function SXe(e,t){O(t,!0);let n=J(t,`open`,15,!1),r=J(t,`componentName`,3,void 0),i=LK(),a=A(()=>n()?vXe({valueStoreKey:t.valueStoreKey,componentName:r(),keyPath:t.keyPath}):void 0),o=A(()=>n()&&!HK(t.valueStoreKey)?dXe({draft:i.current,locale:t.locale}):void 0),s=A(()=>!!z(a)||!!z(o)),c=()=>{n(!1)},l=()=>{let e=i.current,n=z(a),r=z(o);c(),e&&(n?yXe({draft:e,locale:t.locale,keyPath:n,credit:t.credit}):gXe({draft:e,locale:t.locale,target:r,credit:t.credit}))},u=e=>{navigator.clipboard.writeText(e),c()};{let r=e=>{var n=bXe(),r=P(n);yS(r,{flex:!0});var i=I(r,2),a=e=>{{let n=A(()=>z(o)?Y(`assets_dialog.photo_credit.insert_to_field`,{values:{field:vG({config:z(o).fieldConfig,locale:t.locale})}}):Y(`insert`));Xx(e,{variant:`primary`,get label(){return z(n)},onclick:l})}};G(i,e=>{z(s)&&e(a)});var d=I(i,2);{let e=e=>{qS(e,{children:(e,n)=>{{let n=A(()=>Y(`assets_dialog.photo_credit.copy_as_markdown`));JS(e,{get label(){return z(n)},onclick:()=>{u(mXe(t.credit))}})}},$$slots:{default:!0}})},n=A(()=>z(s)?`secondary`:`primary`),r=A(()=>Y(`copy`));gS(d,{get variant(){return z(n)},get label(){return z(r)},onclick:()=>{u(t.credit)},popup:e,$$slots:{popup:!0}})}var f=I(d,2);{let e=A(()=>Y(`cancel`));Xx(f,{variant:`secondary`,get label(){return z(e)},onclick:c})}U(e,n)},i=A(()=>Y(`assets_dialog.photo_credit.title`));SS(e,{role:`alertdialog`,get title(){return z(i)},get open(){return n()},set open(e){n(e)},footer:r,children:(e,n)=>{var r=xXe(),i=P(r),a=F(i,!0),o=I(i,2);RV(N(o),{dir:`auto`,flex:!0,readonly:!0,get value(){return t.credit},onclick:e=>{e.target.focus(),e.target.select()}}),D(o),R(e=>W(a,e),[()=>Y(`assets_dialog.photo_credit.description`)]),U(e,r)},$$slots:{footer:!0,default:!0}})}k()}var CXe=B(`<div role="none" class="buttons"><!> <!></div>`),wXe=B(`<div role="status"> </div>`),TXe=B(`<!> <!>`,1),EXe=B(`<div role="none"><!> <div role="none" class="label svelte-1jvz1op"><!></div></div> <!>`,1),DXe={hash:`svelte-1jvz1op`,code:`.empty.svelte-1jvz1op {display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;height:120px;margin:var(--sui-focus-ring-width);border-width:1px;border-style:solid;border-color:var(--sui-button-tertiary-border-color, var(--sui-button-border-color));border-radius:var(--sui-button-medium-border-radius);color:var(--sui-button-tertiary-foreground-color, var(--sui-highlight-foreground-color));background-color:var(
--sui-button-tertiary-background-color,
var(--sui-button-background-color)
);font-family:var(--sui-control-font-family);font-size:var(--sui-font-size-small);cursor:pointer;transition:all 200ms;&:not(.disabled):hover {background-color:var(
--sui-button-tertiary-background-color-focus,
var(--sui-hover-background-color)
);}&:not(.disabled):active {background-color:var(
--sui-button-tertiary-background-color-active,
var(--sui-active-background-color)
);}.icon {color:var(--sui-secondary-foreground-color);font-size:48px;}&.disabled {pointer-events:none !important;* {opacity:0.5;}}
@media (pointer: coarse) {cursor:default;&:active {
/* Reset the style because the element is non-interactive on touch devices */background-color:var(--sui-button-background-color) !important;}
}&.invalid {border-color:var(--sui-error-border-color);}}.label.svelte-1jvz1op {display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:0 4px;white-space:nowrap;.button {margin-block:0;}}`};function OXe(e,t){O(t,!0),K(e,DXe);let n=e=>{var n=CXe(),r=N(n);{let e=A(()=>Y(`browse`));Xx(r,{get label(){return z(e)},variant:`tertiary`,size:`small`,get disabled(){return z(c)},onclick:e=>{e.stopPropagation(),a(!1),i(!0)},get element(){return z(l)},set element(e){M(l,e,!0)}})}var s=I(r,2),u=e=>{{let n=A(()=>Y(t.isImageField?`paste_image`:`paste`));Xx(e,{get label(){return z(n)},variant:`tertiary`,size:`small`,get disabled(){return z(c)},onclick:e=>{e.stopPropagation(),d()}})}};G(s,e=>{o()&&e(u)}),D(n),U(e,n)},r=J(t,`selectFolder`,3,!1),i=J(t,`showSelectAssetsDialog`,15,!1),a=J(t,`replaceMode`,15,!1),o=J(t,`onFilePaste`,3,void 0),s=Xi({show:!1,message:``}),c=A(()=>t.readonly||t.processing),l=j(void 0),u=()=>{z(l)?.focus()},d=async()=>{if(!z(c)&&o())try{let e=await navigator.clipboard.read(),t,n=e.find(e=>e.types.some(e=>{let n=e.startsWith(`image/`);return n&&(t=e),n}));if(n&&t){let e=await n.getType(t),r=t.split(`/`)[1].replace(`+xml`,``),i=new File([e],`pasted-image-${Date.now()}.${r}`,{type:t});o()(i);return}Object.assign(s,{message:Y(`no_image_in_clipboard`),show:!0})}catch{Object.assign(s,{message:Y(`clipboard_access_denied`),show:!0})}};var f={focus:u},p=EXe(),m=P(p);let h;var g=N(m);{let e=A(()=>r()?`folder`:`cloud_upload`);gx(g,{get name(){return z(e)}})}var _=I(g,2),v=N(_),y=e=>{var n=wXe(),r=F(n,!0);R(e=>W(r,e),[()=>Y(`processing_files`,{values:{count:t.multiple?2:1}})]),U(e,n)},b=e=>{var r=TXe(),i=P(r),a=e=>{var t=V();R(e=>W(t,e),[()=>Y(`click_to_browse`)]),U(e,t)},o=e=>{var n=V();R(e=>W(n,e),[()=>Y(`drop_image_files_or`,{values:{count:t.multiple?2:1}})]),U(e,n)},s=e=>{var n=V();R(e=>W(n,e),[()=>Y(`drop_files_or`,{values:{count:t.multiple?2:1}})]),U(e,n)};G(i,e=>{t.allowDrop?t.isImageField?e(o,1):e(s,-1):e(a)});var c=I(i,2);n(c),U(e,r)},x=e=>{n(e)};return G(v,e=>{t.processing?e(y):PY.hasMouse?e(b,1):e(x,-1)}),D(_),D(m),fC(I(m,2),{get show(){return s.show},set show(e){s.show=e},children:(e,t)=>{bx(e,{status:`error`,children:(e,t)=>{Ur();var n=V();R(()=>W(n,s.message)),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),R(()=>h=$o(m,1,`empty svelte-1jvz1op`,null,h,{invalid:t.invalid,processing:t.processing,disabled:z(c)})),so(`click`,m,()=>{PY.hasMouse&&!z(c)&&(a(!1),i(!0))}),so(`keydown`,m,e=>{!z(c)&&Dx(e,`Accel+V`)&&(e.preventDefault(),d())}),U(e,p),k(f)}co([`click`,`keydown`]);var n6=(e,t)=>{Object.entries(t).forEach(([t,n])=>{e[t]!==n&&(e[t]=n)}),Object.keys(e).forEach(n=>{n in t||delete e[n]})},kXe=(e,t)=>[Em(e,t,{live:!0})??[],Object.fromEntries(Object.entries(e).filter(([e])=>!tm(e,t)))],AXe=(e,t,n)=>{let r=`${t}.`,i={},a=new Map;return Object.entries(e).forEach(([e,t])=>{let[,n,o]=e.startsWith(r)?e.slice(r.length).match(/^(\d+)($|[.#].*)/)??[]:[];n===void 0?i[e]=t:a.set(Number(n),[...a.get(Number(n))??[],[o,t]])}),n.forEach((e,t)=>{typeof e==`number`?a.get(e)?.forEach(([e,n])=>{i[`${r}${t}${e}`]=n}):i[`${r}${t}`]=e}),i},jXe=({draft:e,locale:t,valueStoreKey:n=`currentValues`,keyPath:r,manipulate:i})=>{let{defaultLocale:a}=Rf(e),[o,s]=kXe(e[n][t],r),c=t===a,l=c?[...Array(o.length).keys()]:[];i({valueList:o,expanderStateList:l}),hK(()=>{n6(e[n][t],{...bm(o,r),...s}),c&&n6(e.expanderStates._,AXe(e.expanderStates._,r,l))})},r6=({draft:e,locale:t,i18n:n,pairedItems:r=!1,fieldConfig:i,valueStoreKey:a=`currentValues`,keyPath:o,manipulate:s})=>{let c=(e,t,n)=>e.map(e=>qG({fieldConfig:i,value:e,sourceLocale:t,targetLocale:n})),{defaultLocale:l}=Rf(e);G3({valueStore:e[a],locale:t,i18n:r&&t===l?`duplicate`:n,draft:e,keyPath:o},(n,r)=>{jXe({draft:e,locale:r,valueStoreKey:a,keyPath:o,manipulate:!i||r===t?({valueList:e,expanderStateList:t})=>s({valueList:e,expanderStateList:t,locale:r}):({valueList:e,expanderStateList:n})=>{let i=c(e,r,t);s({valueList:i,expanderStateList:n,locale:t}),e.splice(0,e.length,...c(i,t,r))}})})},MXe=(e,t)=>Em(e,t,{live:!0})??[],NXe=({draft:e,locale:t,valueStoreKey:n=`currentValues`,keyPath:r,from:i,to:a})=>{let o=e[n][t],s=MXe(o,r);i!==a&&i in s&&a in s&&(s.splice(a,0,...s.splice(i,1)),s.forEach((e,t)=>{o[`${r}.${t}`]=e}))},PXe=({draft:e,locale:t,valueStoreKey:n=`currentValues`,keyPath:r,newValues:i,replaceIndex:a,max:o=1/0})=>{let s=e[n][t];if(a!==void 0){let[e]=i;e!==void 0&&(s[`${r}.${a}`]=e);return}let{length:c}=MXe(s,r);i.slice(0,Math.max(0,o-c)).forEach((e,t)=>{s[`${r}.${c+t}`]=e})},FXe=({draft:e,locale:t,valueStoreKey:n=`currentValues`,keyPath:r,index:i})=>{let a=e[n][t];for(let e=i;;e+=1){let t=`${r}.${e}`,n=`${r}.${e+1}`;if(n in a)a[t]=a[n];else{a[t]=null,delete a[t];break}}},i6=({getItemCount:e,getListElement:t,onMove:n,getItemData:r,settle:i=Za,getItemRect:a=e=>e.getBoundingClientRect()})=>{let o=j(void 0),s=j(void 0),c=[],l=A(()=>{let t=e(),n=z(s)?.previewOrder.length===t?z(s).previewOrder:[...Array(t).keys()];return(n.length!==c.length||n.some((e,t)=>e!==c[t]))&&(c=n),c}),u=()=>{ZYe(),M(o,void 0),M(s,void 0)},d=async(e,r,a=`reorder`)=>{n(e,r),await i(),WYe({listElement:t(),index:r,action:a})},f=(e,n,r)=>{M(s,{index:e,previewOrder:[...z(l)]}),XYe(t()),n?.dataTransfer&&(n.dataTransfer.effectAllowed=`move`,n.dataTransfer.setData(`text/plain`,r??``))},p={get grabbedIndex(){return z(o)},get dragIndex(){return z(s)?.index},get displayOrder(){return z(l)},grab:e=>{M(o,e,!0)},release:()=>{M(o,void 0)},move:d,onDragStart:f,onDragOver:e=>{if(!z(s))return;e.stopPropagation(),e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`move`);let n=VYe({target:e.target,listElement:t()});if(!n)return;let{index:r,previewOrder:i}=z(s),o=i.indexOf(r),c=LYe({dragIndex:o,dropIndex:IYe({index:n.index,clientY:e.clientY,rect:a(n.element)})});c!==void 0&&M(s,{index:r,previewOrder:Y3(i,o,c)})},onDrop:e=>{if(!z(s))return;e.stopPropagation(),e.preventDefault();let{index:t,previewOrder:n}=z(s),r=n.indexOf(t);u(),r!==t&&d(t,r)},onDragEnd:u,get listProps(){return{ondragovercapture:p.onDragOver,ondropcapture:p.onDrop}},reorderControlProps:e=>({onGrab:()=>{M(o,e,!0)},onRelease:()=>{M(o,void 0)},onMove:(t,n)=>d(e,t,n)}),itemProps:(e,{ownEventsOnly:t=!1}={})=>({draggable:z(o)===e,ondragstart:n=>{t&&n.target!==n.currentTarget||f(e,n,r?.(e))},ondragend:e=>{t&&e.target!==e.currentTarget||u()}})};return p},IXe=B(`<div role="none"><!></div>`),LXe=B(`<div></div> <!>`,1),RXe=B(`<!> <!> <!> <!> <!>`,1),zXe={hash:`svelte-17jic1t`,code:`.item-list.svelte-17jic1t {display:flex;flex-direction:column;gap:4px;& ~ [role='button'] {margin-top:calc(4px + var(--sui-focus-ring-width));}}`};function BXe(e,t){O(t,!0),K(e,zXe);let n=e=>{{let t=A(()=>z(ne)?void 0:e=>{M(h,!1),De([{file:e,folder:z(pe)}])});gs(OXe(e,{get allowDrop(){return z(we)},get invalid(){return p()},get readonly(){return f()},get processing(){return z(b)},get isImageField(){return z(se)},get multiple(){return z(he)},get selectFolder(){return z(ne)},get onFilePaste(){return z(t)},get showSelectAssetsDialog(){return z(m)},set showSelectAssetsDialog(e){M(m,e,!0)},get replaceMode(){return z(h)},set replaceMode(e){M(h,e,!0)}}),e=>M(w,e,!0),()=>z(w))}},r=e=>{var r=H(),i=P(r),a=e=>{var r=H(),i=P(r),a=e=>{var r=H(),i=P(r),a=e=>{var r=LXe(),i=P(r);fs(i,()=>({role:`none`,class:`item-list`,...Ae.listProps}),void 0,void 0,void 0,`svelte-17jic1t`),No(i,29,()=>Ae.displayOrder,e=>`${u()[e]}|${e}`,(e,n)=>{var r=IXe(),i=N(r);{let e=A(()=>Ae.dragIndex===z(n));uXe(i,ys(()=>z(be),{get index(){return z(n)},get itemCount(){return z(ge)},get value(){return u()[z(n)]},get fieldId(){return`${t.fieldId??``}-${z(n)??``}`},get groupFieldId(){return t.fieldId},get dragging(){return z(e)},onReplace:()=>{M(h,!0),M(g,z(n),!0),M(m,!0)},onRemove:()=>ke(z(n)),onDragStart:()=>Ae.onDragStart(z(n)),get onDragEnd(){return Ae.onDragEnd},onMove:(e,t)=>Ae.move(z(n),e,t)}))}D(r),Wo(r,()=>nC,()=>({duration:200})),U(e,r)}),D(i),gs(i,e=>M(C,e),()=>z(C));var a=I(i,2),o=e=>{n(e)};G(a,e=>{u().length<z(ee)&&e(o)}),U(e,r)},o=A(()=>Array.isArray(u()));G(i,e=>{z(o)&&e(a)}),U(e,r)},o=e=>{{let n=A(()=>z(ye)?Ee:void 0);uXe(e,ys(()=>z(be),{get value(){return u()},get fieldId(){return t.fieldId},onReplace:()=>{M(h,!0),M(m,!0)},get onRemove(){return z(n)}}))}};G(i,e=>{z(he)?e(a):typeof u()==`string`&&u()&&e(o,1)}),U(e,r)},o=e=>{n(e)};G(i,e=>{u()?.length&&!z(b)?e(a):e(o,-1)}),U(e,r)},i=LK(),{valueStoreKey:a=`currentValues`,fieldContext:o=void 0,parentComponentNames:s=[]}=UK(),c=HK(a),l=s.at(-1),u=J(t,`currentValue`,15),d=J(t,`required`,3,!0),f=J(t,`readonly`,3,!1),p=J(t,`invalid`,3,!1),m=j(!1),h=j(!1),g=j(-1),_=j(!1),v=j(``),y=j(void 0),b=j(!1),x=j(void 0),S=j(Xi([])),C=j(void 0),w=j(void 0),T=A(()=>t.fieldConfig.widget),ee=A(()=>Tr(t.fieldConfig.max,1/0)),E=A(()=>t.fieldConfig.accept),te=A(()=>Tr(t.fieldConfig.choose_url,!0)),ne=A(()=>z(T)===`file`&&t.fieldConfig.select_folder===!0),re=A(()=>i.current?.originalEntry),ie=A(()=>i.current?.collectionName??``),ae=A(()=>i.current?.fileName),oe=A(()=>i.current?.isIndexFile??!1),se=A(()=>z(T)===`image`),ce=A(()=>z(se)?`image`:void 0),le=A(()=>gJe({collectionName:z(ie),fileName:z(ae),isIndexFile:z(oe),componentName:l,typedKeyPath:t.typedKeyPath,fieldConfig:t.fieldConfig})),ue=A(()=>z(le).libraryConfig),de=A(()=>aJ({accept:z(E),image:z(se),transformations:z(ue).transformations})),fe=A(()=>z(le).folderMap),pe=A(()=>z(le).folder),me=nJe(()=>({draft:i.current,folder:z(pe),locale:t.locale,kind:z(ce),accept:z(de),slugificationEnabled:z(ue).slugify_filename})),he=A(()=>Hf(t.fieldConfig)),ge=A(()=>Array.isArray(u())?u().length:0),_e=A(()=>z(he)&&z(ge)>=z(ee)),ve=A(()=>z(ue).max_file_size),ye=A(()=>!d()&&(!o||![`rich-text-editor-component`,`single-subfield-list-field`].includes(o))),be=A(()=>({fieldConfig:t.fieldConfig,readonly:f(),invalid:p(),required:d(),collectionName:z(ie),fileName:z(ae),componentName:l,typedKeyPath:t.typedKeyPath,entry:z(re),locale:t.locale})),xe=A(()=>z(le).cloudServiceEntries),Se=A(()=>z(le).enabled&&!!z(pe)),Ce=A(()=>+!!z(Se)+z(xe).filter(([,{upload:e}])=>!!e).length),we=A(()=>z(Ce)===1&&!z(ne)),Te=()=>{z(y)?.reset(),z(he)||(u(``),Pi())},Ee=async()=>{Te(),await Za(),z(w)?.focus()},De=async e=>{let n=i.current;if(!n)return;let r=z(he)?void 0:u();Te(),M(b,!0);try{let o=await _Je({draft:n,resources:e,folder:z(pe),libraryConfig:z(ue),accept:z(de),locale:t.locale});if(i.current!==n)return;let{values:s,value:l,credit:d,rejected:f}=bJe({resources:o,multiple:z(he),previousValue:r,inEditorComponent:c});z(he)?PXe({draft:n,locale:t.locale,valueStoreKey:a,keyPath:t.keyPath,newValues:s,replaceIndex:z(h)?z(g):void 0,max:z(ee)}):u(l),M(v,d,!0),d&&M(_,!0),z(x)?.report(f)}finally{M(b,!1)}},Oe=async({files:e})=>{if(e.length){if(M(h,!1),z(Se)){let t=await Rqe({files:e,listedAssets:me.listedAssets});if(t===void 0)return;De(e.map(e=>({file:e,folder:z(pe),replace:t})))}else M(S,e,!0),M(m,!0)}},ke=async e=>{let n=i.current;n&&(FXe({draft:n,locale:t.locale,valueStoreKey:a,keyPath:t.keyPath,index:e}),await Za(),X3({index:e,getTarget:e=>{let n=z(C)?.querySelectorAll(`button[aria-controls="${t.fieldId}-${e}-value"]`);return n?.[n.length-1]},fallback:()=>{z(w)?.focus()}}))},Ae=i6({getItemCount:()=>z(ge),getListElement:()=>z(C),onMove:(e,n)=>{let r=i.current;r&&NXe({draft:r,locale:t.locale,valueStoreKey:a,keyPath:t.keyPath,from:e,to:n})},settle:()=>Iu(50)});var je=RXe(),Me=P(je),Ne=e=>{{let t=A(()=>f()||Ae.dragIndex!==void 0||z(_e));gs(z0(e,{get multiple(){return z(he)},get disabled(){return z(t)},get accept(){return z(de)},filterDroppedFiles:!1,onDrop:Oe,children:(e,t)=>{r(e)},$$slots:{default:!0}}),e=>M(y,e,!0),()=>z(y))}},Pe=e=>{r(e)};G(Me,e=>{z(we)?e(Ne):e(Pe,-1)});var Fe=I(Me,2);{let e=A(()=>!z(h)&&z(he));pJe(Fe,{get kind(){return z(ce)},get multiple(){return z(e)},get accept(){return z(de)},get canEnterURL(){return z(te)},get selectFolder(){return z(ne)},get draft(){return i.current},get locale(){return t.locale},get fieldConfig(){return t.fieldConfig},get assetLibraryFolderMap(){return z(fe)},get enabledCloudServiceEntries(){return z(xe)},onSelect:De,get open(){return z(m)},set open(e){M(m,e,!0)},get pendingFiles(){return z(S)},set pendingFiles(e){M(S,e,!0)}})}var Ie=I(Fe,2);hJe(Ie,{});var Le=I(Ie,2);gs(H0(Le,{get maxSize(){return z(ve)},get accept(){return z(de)}}),e=>M(x,e,!0),()=>z(x)),SXe(I(Le,2),{get credit(){return z(v)},get locale(){return t.locale},get keyPath(){return t.keyPath},get valueStoreKey(){return a},get componentName(){return l},get open(){return z(_)},set open(e){M(_,e,!0)}}),U(e,je),k()}var VXe=B(`<p><!></p>`),HXe=B(`<p> </p>`);function UXe(e,t){O(t,!0);let n=LK(),r=J(t,`typedKeyPath`,3,void 0),i=J(t,`locale`,3,void 0),a=j(void 0),o=j(void 0),s=A(()=>t.fieldConfig.widget),c=A(()=>z(s)===`image`),l=A(()=>n.current?.originalEntry),u=A(()=>n.current?.collectionName??``),d=A(()=>n.current?.fileName);cl(()=>(t.value,eo(async()=>t.value?iXe({value:t.value,kind:z(c)?`image`:void 0,entry:z(l),collectionName:z(u),fileName:z(d),fieldConfig:t.fieldConfig,typedKeyPath:r(),locale:i()}):{kind:void 0,src:void 0})),e=>{M(a,e.kind,!0),M(o,e.src,!0)});var f=H(),p=P(f),m=e=>{var t=VXe(),n=N(t);{let e=A(()=>[`audio`,`video`].includes(z(a)));k0(n,{get kind(){return z(a)},get src(){return z(o)},get controls(){return z(e)}})}D(t),U(e,t)},h=e=>{var n=HXe(),r=F(n,!0);R(()=>W(r,t.value)),U(e,n)},g=A(()=>typeof t.value==`string`&&t.value.trim()&&!t.value.startsWith(`blob:`));G(p,e=>{z(a)&&z(o)?e(m):z(g)&&e(h,1)}),U(e,f),k()}function WXe(e,t){O(t,!0);var n=H(),r=P(n),i=e=>{var n=H(),r=P(n),i=e=>{var n=H();No(P(n),19,()=>t.currentValue,(e,t)=>`${e}-${t}`,(e,n)=>{UXe(e,{get value(){return z(n)},get fieldConfig(){return t.fieldConfig},get typedKeyPath(){return t.typedKeyPath},get locale(){return t.locale}})}),U(e,n)},a=A(()=>Array.isArray(t.currentValue));G(r,e=>{z(a)&&e(i)}),U(e,n)},a=A(()=>Hf(t.fieldConfig)),o=e=>{UXe(e,{get value(){return t.currentValue},get fieldConfig(){return t.fieldConfig},get typedKeyPath(){return t.typedKeyPath},get locale(){return t.locale}})};G(r,e=>{z(a)?e(i):typeof t.currentValue==`string`&&t.currentValue&&e(o,1)}),U(e,n),k()}var GXe=B(`<div role="alert" class="validation svelte-6wra4i"><div role="none" class="svelte-6wra4i"><!> <!></div></div>`),KXe={hash:`svelte-6wra4i`,code:`.validation.svelte-6wra4i {color:var(--sui-error-foreground-color) !important;font-size:var(--sui-font-size-small);div:where(.svelte-6wra4i) {display:flex;align-items:center;gap:4px;margin:4px 0 0;.icon {flex:none;font-size:16px; /* !hardcoded */}}}`};function a6(e,t){K(e,KXe);let n=J(t,`id`,3,void 0),r=J(t,`live`,3,`polite`);var i=GXe(),a=N(i),o=N(a);gx(o,{name:`error`}),xo(I(o,2),()=>t.children),D(a),D(i),R(()=>{q(i,`id`,n()),q(i,`aria-live`,r())}),U(e,i)}var qXe=B(`<span role="none" class="type-label"> </span> <span role="none" class="type-description svelte-kkc51a"> </span>`,1),JXe={hash:`svelte-kkc51a`,code:`.sui.menuitem.variable-type-described {--sui-menuitem-height: auto;--sui-menuitem-padding: 8px 16px;.content {display:flex;flex-direction:column;gap:2px;}}.type-description.svelte-kkc51a {max-width:320px;white-space:normal;text-align:start;font-size:var(--sui-font-size-small);line-height:var(--sui-line-height-compact);color:var(--sui-tertiary-foreground-color);}button:hover .type-description.svelte-kkc51a {color:inherit;}`};function o6(e,t){let n=mo();O(t,!0),K(e,JXe);let r=J(t,`disabled`,3,!1),i=J(t,`locale`,3,void 0),a=J(t,`items`,19,()=>[]),o=J(t,`addItem`,3,()=>void 0),s=A(()=>t.fieldConfig.types),c=A(()=>t.fieldConfig.widget===`object`?void 0:t.fieldConfig),l=A(()=>z(c)?_G({config:z(c),option:`label_singular`,locale:i()}):void 0),u=A(()=>z(c)?.max??1/0),d=A(()=>Y(`add_x`,{values:{name:z(l)||vG({config:t.fieldConfig,locale:i()})}})),f=A(()=>a().length>=z(u));var p=H(),m=P(p),h=e=>{},g=e=>{hS(e,{variant:`tertiary`,size:`small`,get label(){return z(d)},get disabled(){return r()},startIcon:e=>{gx(e,{name:`add`})},endIcon:e=>{},popup:e=>{{let t=A(()=>Y(`select_list_type`));qS(e,{get ariaLabel(){return z(t)},children:(e,t)=>{var r=H();No(P(r),19,()=>z(s),e=>e.name,(e,t,r)=>{let a=A(()=>z(t)),s=A(()=>vG({config:z(t),locale:i()}));var c=H(),l=P(c),u=e=>{let t=A(()=>`${n}-type-${z(r)}-description`);JS(e,{class:`variable-type-described`,get"aria-label"(){return z(s)},get"aria-describedby"(){return z(t)},onclick:()=>o()({type:z(a).name}),children:(e,n)=>{var r=qXe(),i=P(r),o=F(i,!0),c=I(i,2),l=F(c,!0);R(()=>{W(o,z(s)),q(c,`id`,z(t)),W(l,z(a).description)}),U(e,r)},$$slots:{default:!0}})},d=e=>{JS(e,{get label(){return z(s)},onclick:()=>o()({type:z(a).name})})};G(l,e=>{z(a).description?e(u):e(d,-1)}),U(e,c)}),U(e,r)},$$slots:{default:!0}})}},$$slots:{startIcon:!0,endIcon:!0,popup:!0}})},_=A(()=>Array.isArray(z(s))),v=e=>{Xx(e,{variant:`tertiary`,size:`small`,get label(){return z(d)},get disabled(){return r()},onclick:()=>o()(),startIcon:e=>{gx(e,{name:`add`})},$$slots:{startIcon:!0}})};G(m,e=>{z(f)?e(h):z(_)?e(g,1):e(v,-1)}),U(e,p),k()}var YXe=({draft:e,valueStoreKey:t=`currentValues`,keyPath:n,locale:r})=>cK(e[t][r]??{},n),XXe=({pairs:e,edited:t})=>e.map(([e],n,r)=>{if(!e.trim()&&t[n])return`empty`;if(e.trim()&&r.findIndex(t=>t[0]===e)!==n)return`duplicate`}),ZXe=e=>e.filter(([e])=>e.trim()),QXe=({rows:e,storedPairs:t})=>!(0,Qc.default)(ZXe(e),t),$Xe=({storedPairs:e,storedValue:t})=>!e.length&&t!==null,eZe=({rows:e,validations:t,getStoredPairs:n})=>{if(t.some(Boolean))return;let r=ZXe(e);return r.length?r.length===e.length?r:void 0:n().some(([e])=>e.trim())?r:void 0},tZe=({draft:e,valueStoreKey:t=`currentValues`,keyPath:n,locale:r,fieldConfig:i,pairs:a})=>{let{i18n:o}=i,s=e[t];G3({valueStore:s,locale:r,i18n:o,draft:e,keyPath:n},e=>{lK(e,n,a),a.length||(e[n]=null)}),o===`duplicate_keys`&&r===e.defaultLocale&&U3({valueStore:s,defaultLocale:r,keyPath:n})},nZe=(e=[])=>{let t=0,n=()=>(t+=1,t-1),r=j(Xi(e)),i=j(Xi(e.map(n)));return{get values(){return z(r)},get ids(){return z(i)},insert:(e,t)=>{z(r).splice(e,0,t),z(i).splice(e,0,n())},remove:e=>{z(r).splice(e,1),z(i).splice(e,1)},move:(e,t)=>{M(r,Y3(z(r),e,t),!0),M(i,Y3(z(i),e,t),!0)},replace:(e,{keepIds:t=!1}={})=>{let a=z(i);M(r,e,!0),M(i,e.map((e,r)=>t&&r<a.length?a[r]:n()),!0)}}},rZe=B(`<th scope="col" class="reorder svelte-u0prcz"></th>`),iZe=B(`<th scope="col" class="action svelte-u0prcz"></th>`),aZe=B(`<td class="reorder svelte-u0prcz"><div role="none" class="svelte-u0prcz"><!></div></td>`),oZe=B(`<td class="action svelte-u0prcz"><!></td>`),sZe=B(`<tr><!><td class="key svelte-u0prcz"><!></td><td class="value svelte-u0prcz"><!></td><!></tr>`),cZe=B(`<table class="svelte-u0prcz"><thead><tr><!><th scope="col" class="key svelte-u0prcz"> </th><th scope="col" class="value svelte-u0prcz"> </th><!></tr></thead><tbody></tbody></table>`),lZe=B(`<!> <!>`,1),uZe=B(`<div role="none" class="toolbar svelte-u0prcz"><!></div>`),dZe=B(`<!> <!> <!>`,1),fZe={hash:`svelte-u0prcz`,code:`.toolbar.svelte-u0prcz {display:flex;align-items:center;margin-block-start:8px;&:first-child {margin-block-start:0;}}table.svelte-u0prcz {
/* Space the cells like the items of a List field. The outer spacing is cancelled out by the
negative margins, which the stretched width makes up for */margin:-4px;border-collapse:separate;border-spacing:4px;width:-moz-available;width:-webkit-fill-available;width:stretch;}th.svelte-u0prcz,
td.svelte-u0prcz {border-width:0;}th.svelte-u0prcz {padding-block:4px;color:var(--sui-tertiary-foreground-color);font-size:var(--sui-font-size-small);font-weight:var(--sui-font-weight-normal);text-align:start;&.key,
&.value {width:50%;}}td.svelte-u0prcz {padding:0;vertical-align:middle;&.reorder div:where(.svelte-u0prcz) {display:flex;align-items:center;}}`};function pZe(e,t){O(t,!0),K(e,fZe);let n=LK(),{valueStoreKey:r=`currentValues`}=UK(),i=J(t,`readonly`,3,!1),a=A(()=>Tr(t.fieldConfig.i18n,!1)),o=A(()=>t.fieldConfig.key_label),s=A(()=>t.fieldConfig.value_label),c=A(()=>Tr(t.fieldConfig.max,1/0)),l=A(()=>z(o)||Y(`key_value.key`)),u=A(()=>z(s)||Y(`key_value.value`)),d=A(()=>n.current?.defaultLocale),f=A(()=>i()||z(a)===`duplicate_keys`&&t.locale!==z(d)),p=nZe([]),m=Xi([]),h=j(void 0),g=j(Xi([])),_=j(Xi([])),v=A(()=>p.values.length===1&&!p.values[0][0]&&!p.values[0][1]),y=()=>{!p.values.length&&!z(f)&&(p.insert(p.values.length,[``,``]),z(g).push(!1))},b=()=>{let e=n.current;if(!e)return;let i=YXe({draft:e,valueStoreKey:r,keyPath:t.keyPath,locale:t.locale}),a=e[r][t.locale];if(QXe({rows:p.values,storedPairs:i})&&(p.replace([...i],{keepIds:!0}),M(g,i.map(()=>!1),!0)),y(),$Xe({storedPairs:i,storedValue:a[t.keyPath]})){let e=t.keyPath;BK(()=>{a[e]=null})}},x=()=>{p.insert(p.values.length,[``,``]),z(g).push(!1),window.requestAnimationFrame(()=>{m[p.values.length-1].querySelector(`input`).focus()})},S=async e=>{p.remove(e),z(g).splice(e,1),y(),await Za();let{rows:t}=z(h);X3({index:e,getTarget:e=>{let n=t[e];return n&&(n.querySelector(`td.action button:enabled`)??n.querySelector(`td.key input`))}})},C=i6({getItemCount:()=>p.values.length,getListElement:()=>z(h),onMove:(e,t)=>{p.move(e,t),M(g,Y3(z(g),e,t),!0)},getItemData:e=>p.values[e][0]}),w=()=>{let e=n.current;if(M(_,XXe({pairs:p.values,edited:z(g)}),!0),!e)return;let i=eZe({rows:p.values,validations:z(_),getStoredPairs:()=>YXe({draft:e,valueStoreKey:r,keyPath:t.keyPath,locale:t.locale})});if(!i)return;let a={draft:e,valueStoreKey:r,fieldConfig:t.fieldConfig,keyPath:t.keyPath,locale:t.locale,pairs:Yr(i)};BK(()=>{tZe(a)})},T=il(()=>{let e=jK(n.current,t.locale,t.keyPath,r);return[cK(e,t.keyPath,{live:!1}),e[t.keyPath]]});sl(()=>[T.current],()=>{b()}),sl(()=>Yr(p.values),()=>{w()});var ee=dZe(),E=P(ee),te=e=>{var n=cZe(),r=N(n),a=N(r),o=N(a),s=e=>{var t=rZe();R(e=>q(t,`aria-label`,e),[()=>Y(`reorder`)]),U(e,t)};G(o,e=>{z(f)||e(s)});var d=I(o),y=F(d,!0),b=I(d),w=F(b,!0),T=I(b),ee=e=>{var t=iZe();R(e=>q(t,`aria-label`,e),[()=>Y(`key_value.action`)]),U(e,t)};G(T,e=>{z(f)||e(ee)}),D(a),D(r);var E=I(r);fs(E,()=>({...C.listProps}),void 0,void 0,void 0,`svelte-u0prcz`),No(E,29,()=>C.displayOrder,e=>p.ids[e],(e,n)=>{var r=sZe();fs(r,e=>({...e,[ss]:{"drag-placeholder":C.dragIndex===z(n)}}),[()=>C.itemProps(z(n))],void 0,void 0,`svelte-u0prcz`);var a=N(r),o=e=>{var t=aZe(),r=N(t),i=N(r);{let e=A(()=>p.values.length<2),t=A(()=>C.reorderControlProps(z(n)));$3(i,ys({get index(){return z(n)},get itemCount(){return p.values.length},get disabled(){return z(e)}},()=>z(t)))}D(r),D(t),U(e,t)};G(a,e=>{z(f)||e(o)});var s=I(a),d=N(s);{let e=A(()=>!!z(_)[z(n)]),r=A(()=>z(_)[z(n)]?`${t.fieldId}-kv-error`:void 0);NS(d,{dir:`ltr`,get readonly(){return z(f)},flex:!0,get invalid(){return z(e)},get ariaLabel(){return z(l)},get"aria-errormessage"(){return z(r)},oninput:()=>{z(g)[z(n)]=!0},onkeydown:e=>{e.key===`Enter`&&!e.isComposing&&m[z(n)].querySelector(`td.value input`).focus()},get value(){return p.values[z(n)][0]},set value(e){p.values[z(n)][0]=e}})}D(s);var h=I(s),y=N(h);{let e=A(()=>Df(t.locale));NS(y,{get dir(){return z(e)},get readonly(){return i()},flex:!0,get ariaLabel(){return z(u)},onkeydown:e=>{e.key===`Enter`&&!e.isComposing&&(z(n)<p.values.length-1?m[z(n)+1].querySelector(z(f)?`td.value input`:`td.key input`).focus():!z(f)&&p.values.length<z(c)&&x())},get value(){return p.values[z(n)][1]},set value(e){p.values[z(n)][1]=e}})}D(h);var b=I(h),w=e=>{var t=oZe();F0(N(t),{variant:`ghost`,get disabled(){return z(v)},onclick:()=>{S(z(n))}}),D(t),U(e,t)};G(b,e=>{z(f)||e(w)}),D(r),gs(r,(e,t)=>m[t]=e,e=>m?.[e],()=>[z(n)]),Wo(r,()=>nC,()=>({duration:200})),U(e,r)}),D(E),gs(E,e=>M(h,e),()=>z(h)),D(n),R(()=>{W(y,z(l)),W(w,z(u))}),U(e,n)};G(E,e=>{p.values.length&&e(te)});var ne=I(E,2),re=e=>{a6(e,{get id(){return`${t.fieldId??``}-kv-error`},children:(e,t)=>{var n=lZe(),r=P(n),i=e=>{var t=V();R(e=>W(t,e),[()=>Y(`key_value.empty_key`)]),U(e,t)},a=A(()=>z(_).includes(`empty`));G(r,e=>{z(a)&&e(i)});var o=I(r,2),s=e=>{var t=V();R(e=>W(t,e),[()=>Y(`key_value.duplicate_key`)]),U(e,t)},c=A(()=>z(_).includes(`duplicate`));G(o,e=>{z(c)&&e(s)}),U(e,n)},$$slots:{default:!0}})},ie=A(()=>z(_).some(Boolean));G(ne,e=>{z(ie)&&e(re)});var ae=I(ne,2),oe=e=>{var n=uZe();o6(N(n),{get disabled(){return z(f)},get fieldConfig(){return t.fieldConfig},get locale(){return t.locale},get items(){return p.values},addItem:()=>{x()}}),D(n),U(e,n)};G(ae,e=>{p.values.length<z(c)&&e(oe)}),U(e,ee),k()}var mZe=B(`<tr><td class="svelte-11sa460"> </td><td class="svelte-11sa460"> </td></tr>`),hZe=B(`<table class="svelte-11sa460"><thead><tr><th scope="col" class="svelte-11sa460"> </th><th scope="col" class="svelte-11sa460"> </th></tr></thead><tbody></tbody></table>`),gZe={hash:`svelte-11sa460`,code:`table.svelte-11sa460 {width:-moz-available;width:-webkit-fill-available;width:stretch;}th.svelte-11sa460 {padding-block:4px;width:50%;color:var(--sui-tertiary-foreground-color);background-color:var(--sui-tertiary-background-color);font-size:var(--sui-font-size-small);font-weight:var(--sui-font-weight-normal);text-align:start;}td.svelte-11sa460 {&:empty::after {content:'\\00a0'; /* nbsp */}}`};function _Ze(e,t){O(t,!0),K(e,gZe);let n=LK(),r=A(()=>t.fieldConfig.key_label),i=A(()=>t.fieldConfig.value_label),a=A(()=>z(r)||Y(`key_value.key`)),o=A(()=>z(i)||Y(`key_value.value`)),s=A(()=>cK(jK(n.current,t.locale,t.keyPath),t.keyPath,{live:!1}));var c=H(),l=P(c),u=e=>{var t=hZe(),n=N(t),r=N(n),i=N(r),c=F(i,!0),l=F(I(i),!0);D(r),D(n);var u=I(n);No(u,23,()=>z(s),([e,t],n)=>`${e}-${n}`,(e,t)=>{var n=A(()=>Er(z(t),2));let r=()=>z(n)[0],i=()=>z(n)[1];var a=mZe(),o=N(a),s=F(o,!0),c=F(I(o),!0);D(a),R(()=>{W(s,r()),W(c,i())}),U(e,a)}),D(u),D(t),R(()=>{W(c,z(a)),W(l,z(o))}),U(e,t)};G(l,e=>{z(s).length&&e(u)}),U(e,c),k()}var vZe=B(`<!> <!> <!> <!>`,1),s6=B(`<!> <!>`,1),yZe=B(`<!> <!> <!> <!> <!>`,1);function bZe(e,t){O(t,!0);let n=(e,n=Cr,i=Cr)=>{var a=H(),o=P(a),s=e=>{{let a=e=>{var i=H();No(P(i),17,r,e=>e.name,(e,r)=>{{let i=A(()=>vG({config:z(r),locale:t.locale}));JS(e,{get label(){return z(i)},onclick:()=>t.addItem({index:n(),type:z(r).name})})}}),U(e,i)},o=A(()=>Y(`add_item_${i()}`));JS(e,{get label(){return z(o)},get disabled(){return t.isAddDisabled},items:a,$$slots:{items:!0}})}},c=e=>{{let r=A(()=>Y(`add_item_${i()}`));JS(e,{get label(){return z(r)},get disabled(){return t.isAddDisabled},onclick:()=>t.addItem({index:n()})})}};G(o,e=>{r()?e(s):e(c,-1)}),U(e,a)},r=J(t,`variableTypes`,3,void 0),i=A(()=>t.canReorder&&zYe(t.itemCount)),a=j(!1);var o=s6(),s=P(o);{let e=e=>{{let r=A(()=>Y(`list_item_options`));qS(e,{get ariaLabel(){return z(r)},children:(e,r)=>{var o=yZe(),s=P(o),c=e=>{var r=vZe(),i=P(r),a=e=>{{let n=A(()=>Y(`duplicate`)),r=A(()=>t.isAddDisabled||t.unknownType);JS(e,{get label(){return z(n)},get disabled(){return z(r)},onclick:()=>t.addItem({index:t.index+1,dupIndex:t.index})})}};G(i,e=>{t.allowDuplicate&&e(a)});var o=I(i,2);n(o,()=>t.index,()=>`above`);var s=I(o,2);n(s,()=>t.index+1,()=>`below`),FS(I(s,2),{}),U(e,r)};G(s,e=>{t.allowAdd&&!t.hasMaxItems&&e(c)});var l=I(s,2);{let e=A(()=>Y(`copy`));JS(l,{get label(){return z(e)},get disabled(){return t.unknownType},onclick:()=>t.copyItem(t.index)})}var u=I(l,2),d=e=>{{let n=A(()=>Y(`paste_item_to_replace`));JS(e,{get label(){return z(n)},get disabled(){return t.isAddDisabled},onclick:()=>t.pasteItem(t.index,{replace:!0})})}};G(u,e=>{t.allowAdd&&t.allowRemove&&e(d)});var f=I(u,2),p=e=>{var n=s6(),r=P(n);{let e=A(()=>Y(`paste_item_above`));JS(r,{get label(){return z(e)},get disabled(){return t.isAddDisabled},onclick:()=>t.pasteItem(t.index)})}var i=I(r,2);{let e=A(()=>Y(`paste_item_below`));JS(i,{get label(){return z(e)},get disabled(){return t.isAddDisabled},onclick:()=>t.pasteItem(t.index+1)})}U(e,n)};G(f,e=>{t.allowAdd&&!t.hasMaxItems&&e(p)});var m=I(f,2),h=e=>{var n=s6(),r=P(n);FS(r,{}),eXe(I(r,2),{get index(){return t.index},get itemCount(){return t.itemCount},get onMove(){return t.moveItem},onMoveTo:()=>{M(a,!0)}}),U(e,n)};G(m,e=>{z(i)&&e(h)}),U(e,o)},$$slots:{default:!0}})}},r=A(()=>Y(`list_item_options`));hS(s,{variant:`ghost`,size:`small`,iconic:!0,popupPosition:`bottom-right`,"data-action":`move-options`,get"aria-label"(){return z(r)},popup:e,$$slots:{popup:!0}})}var c=I(s,2),l=e=>{QYe(e,{get index(){return t.index},get itemCount(){return t.itemCount},onMove:e=>t.moveItem(e,`move-options`),get open(){return z(a)},set open(e){M(a,e,!0)}})};G(c,e=>{z(i)&&e(l)}),U(e,o),k()}function xZe(e,t){O(t,!0);let n=J(t,`expanded`,3,!1);{let t=A(()=>n()?`expand_more`:Tc()?`chevron_left`:`chevron_right`);gx(e,{get name(){return z(t)}})}k()}var SZe=B(`<div role="none" class="label svelte-1qyhxjh"><!> <div role="none" class="summary"> </div></div>`),CZe=B(`<!> <!>`,1),wZe=B(`<div role="none"><!> <div role="none" class="actions svelte-1qyhxjh"><!> <!></div></div>`),TZe=B(`<div role="none" class="toolbar bottom add svelte-1qyhxjh"><!> <!> <!></div>`),EZe={hash:`svelte-1qyhxjh`,code:`.toolbar.svelte-1qyhxjh {display:flex;align-items:center;flex-wrap:wrap;gap:0 8px;position:sticky;z-index:10;background-color:var(--sui-primary-background-color);min-height:var(--sui-secondary-toolbar-size);&.top {
/* Below the sticky toolbars of the rich text editors the field is in, if any */top:var(--sui-text-editor-inner-toolbar-top, 0);}&.bottom {bottom:0;}& > div:where(.svelte-1qyhxjh) {display:flex;align-items:center;&.actions {flex-wrap:wrap;margin-block:8px;margin-inline-start:auto;}}&.single > div.actions:where(.svelte-1qyhxjh) {
/* With no item count on the left, the Add button goes where the item would be */margin-inline-start:0;}}`};function DZe(e,t){O(t,!0),K(e,EZe);let n=e=>{var n=H(),r=P(n),i=e=>{{let n=e=>{gx(e,{name:`content_paste`})},r=A(()=>Y(`paste_item`));Xx(e,{variant:`tertiary`,size:`small`,iconic:!0,get"aria-label"(){return z(r)},get disabled(){return t.isAddDisabled},onclick:()=>t.pasteItem(t.addToTop?0:t.items.length),startIcon:n,$$slots:{startIcon:!0}})}};G(r,e=>{t.hasMaxItems||e(i)}),U(e,n)},r=J(t,`element`,15),i=J(t,`summaryId`,3,void 0);var a=H(),o=P(a),s=e=>{var a=wZe();let o;var s=N(a),c=e=>{var n=SZe(),r=N(n);{let e=e=>{xZe(e,{get expanded(){return t.parentExpanded}})},n=A(()=>!t.items.length),i=A(()=>t.parentExpanded?Y(`collapse`):Y(`expand`));Xx(r,{iconic:!0,get disabled(){return z(n)},get"aria-label"(){return z(i)},get"aria-expanded"(){return t.parentExpanded},get"aria-controls"(){return`list-${t.fieldId??``}-item-list`},onclick:()=>{t.updateExpanderStates({[t.parentExpandedKeyPath]:!t.parentExpanded})},startIcon:e,$$slots:{startIcon:!0}})}var a=I(r,2),o=F(a);D(n),R(()=>{q(a,`id`,i()),W(o,`${t.items.length??``}
${((t.items.length===1?t.labelSingular:void 0)||t.label||t.fieldName)??``}`)}),U(e,n)};G(s,e=>{t.singleItem||e(c)});var l=I(s,2),u=N(l),d=e=>{var r=CZe(),i=P(r);o6(i,{get disabled(){return t.isAddDisabled},get fieldConfig(){return t.fieldConfig},get locale(){return t.locale},get items(){return t.items},get addItem(){return t.addItem}});var a=I(i,2);n(a),U(e,r)};G(u,e=>{t.allowAdd&&(t.addToTop||!t.items.length||!t.parentExpanded)&&e(d)});var f=I(u,2),p=e=>{var n=H();No(P(n),16,()=>[!0,!1],e=>e,(e,n)=>{{let r=A(()=>Y(n?`expand_all`:`collapse_all`)),i=A(()=>t.itemExpanderStates.every(([,e])=>e===n));Xx(e,{variant:`tertiary`,size:`small`,get label(){return z(r)},get disabled(){return z(i)},onclick:()=>{t.updateExpanderStates(Object.fromEntries(t.itemExpanderStates.map(([e])=>[e,n])))}})}}),U(e,n)};G(f,e=>{t.parentExpanded&&t.items.length>1&&e(p)}),D(l),D(a),gs(a,e=>r(e),()=>r()),R(()=>o=$o(a,1,`toolbar top svelte-1qyhxjh`,null,o,{single:t.singleItem})),U(e,a)},c=e=>{var r=TZe(),i=N(r);yS(i,{flex:!0});var a=I(i,2);o6(a,{get disabled(){return t.isAddDisabled},get fieldConfig(){return t.fieldConfig},get locale(){return t.locale},get items(){return t.items},get addItem(){return t.addItem}});var o=I(a,2);n(o),D(r),U(e,r)};G(o,e=>{t.position===`top`?e(s):e(c,-1)}),U(e,a),k()}var OZe=e=>{if(e instanceof Error)return e.message;try{return String(e??``)}catch{return``}},kZe=B(`<span role="alert"> </span> <div role="none" class="buttons svelte-tpixvt"><!> <!></div>`,1),AZe=B(`<div role="none" class="field-error svelte-tpixvt"><!> <!></div>`),jZe={hash:`svelte-tpixvt`,code:`.buttons.svelte-tpixvt {display:flex;flex-wrap:wrap;justify-content:center;gap:8px;}.field-error.svelte-tpixvt {display:flex;flex-direction:column;align-items:flex-start;gap:8px;}`};function c6(e,t){O(t,!0),K(e,jZe);let n=J(t,`scope`,3,`field`),r=()=>{window.location.reload()};var i=H();ho(P(i),{onerror:e=>{console.error(e)},failed:(e,t=Cr,i=Cr)=>{let a=A(()=>Y(`${n()}_crashed`,{values:{message:OZe(t())}}));var o=H(),s=P(o),c=e=>{dH(e,{children:(e,t)=>{var n=kZe(),o=P(n),s=F(o,!0),c=I(o,2),l=N(c);{let e=A(()=>Y(`try_again`));Xx(l,{variant:`secondary`,get label(){return z(e)},get onclick(){return i()}})}var u=I(l,2);{let e=A(()=>Y(`reload_cms`));Xx(u,{variant:`primary`,get label(){return z(e)},onclick:r})}D(c),R(()=>W(s,z(a))),U(e,n)},$$slots:{default:!0}})},l=e=>{var t=AZe(),n=N(t);bx(n,{status:`error`,children:(e,t)=>{Ur();var n=V();R(()=>W(n,z(a))),U(e,n)},$$slots:{default:!0}});var r=I(n,2);{let e=A(()=>Y(`try_again`));Xx(r,{variant:`tertiary`,size:`small`,get label(){return z(e)},get onclick(){return i()}})}D(t),so(`click`,t,e=>e.stopPropagation()),so(`keydown`,t,e=>{e.key===`Enter`&&e.stopPropagation()}),U(e,t)};G(s,e=>{n()===`page`?e(c):e(l,-1)}),U(e,o)}},e=>{var n=H();xo(P(n),()=>t.children),U(e,n)}),U(e,i),k()}co([`click`,`keydown`]);var l6=e=>Error(`The response from the ${e} API was cut off at the token limit.`),MZe=(e,t,n)=>{let r=Array.isArray(e)?e.filter(e=>X(e)&&t(e)&&typeof e.text==`string`).map(({text:e})=>e):[];if(!r.length)throw Error(`Invalid response format from ${n} API.`);return r.join(``).trim()},NZe=(e,t)=>({"Content-Type":`application/json`,Authorization:`Bearer ${e}`,...t}),u6=async({endpoint:e,headers:t,body:n,apiLabel:r})=>{let i=await fetch(e,{method:`POST`,headers:t,body:JSON.stringify(n)});if(!i.ok){let e=await i.json().catch(()=>({})),t=e.error?.message||e.message||``;throw Error(`${r} API error: ${i.status} ${i.statusText}${t?` - ${t}`:``}`)}return i.json()},PZe=async({endpoint:e,headers:t={},apiKey:n,model:r,systemPrompt:i,userMessage:a,temperature:o=.3,maxTokens:s=16e3,reasoning:c=`high`,extraBody:l={}})=>{let u=await u6({endpoint:e,headers:NZe(n,t),apiLabel:`Chat Completions`,body:{model:r,messages:[{role:`system`,content:i},{role:`user`,content:a}],temperature:o,max_tokens:s,stream:!1,reasoning_effort:c,...l}});if(u.choices?.[0]?.finish_reason===`length`)throw l6(`Chat Completions`);if(!u.choices||!Array.isArray(u.choices)||!u.choices[0]?.message?.content)throw Error(`Invalid response format from Chat Completions API.`);return u.choices[0].message.content.trim()},FZe=async({endpoint:e,headers:t={},apiKey:n,model:r,systemPrompt:i,userMessage:a,maxTokens:o=16e3,reasoning:s,extraBody:c={}})=>{let l=await u6({endpoint:e,headers:NZe(n,t),apiLabel:`Responses`,body:{model:r,instructions:i,input:a,store:!1,max_output_tokens:o,...s?{reasoning:{effort:s}}:{},...c}});if(l.status===`incomplete`&&l.incomplete_details?.reason===`max_output_tokens`)throw l6(`Responses`);if(typeof l.output_text==`string`)return l.output_text.trim();let u=(Array.isArray(l.output)?l.output:[]).find(e=>X(e)&&`type`in e&&e.type===`message`&&`content`in e&&Array.isArray(e.content));if(!X(u)||!(`content`in u)||!Array.isArray(u.content))throw Error(`Invalid response format from Responses API.`);let{content:d}=u,f=d.find(e=>X(e)&&`type`in e&&e.type===`output_text`&&`text`in e&&typeof e.text==`string`);if(X(f)&&`text`in f&&typeof f.text==`string`)return f.text.trim();throw Error(`Invalid response format from Responses API.`)},IZe=async({endpoint:e,headers:t={},apiKey:n,model:r,systemPrompt:i,userMessage:a,maxTokens:o=16e3,reasoning:s,extraBody:c={}})=>{let l={"Content-Type":`application/json`,...t};!t.Authorization&&!t[`x-api-key`]&&(l[`x-api-key`]=n);let u=await u6({endpoint:e,headers:l,apiLabel:`Messages`,body:{model:r,max_tokens:o,system:i,messages:[{role:`user`,content:a}],...s===`none`?{thinking:{type:`disabled`}}:{},...c}});if(u.stop_reason===`refusal`)throw Error(`The request was declined by the Messages API.`);if(u.stop_reason===`max_tokens`)throw l6(`Messages`);return MZe(u.content,e=>e.type===`text`,`Messages`)},LZe=s({apiKeyPattern:()=>BZe,apiKeyURL:()=>`https://platform.claude.com/settings/keys`,apiLabel:()=>`Anthropic API`,complete:()=>VZe,developerURL:()=>`https://docs.claude.com/en/api/overview`,serviceId:()=>`anthropic`,serviceLabel:()=>`Anthropic Claude`}),RZe=`https://api.anthropic.com/v1/messages`,zZe={"anthropic-version":`2023-06-01`,"anthropic-dangerous-direct-browser-access":`true`},BZe=/^sk-ant-[a-z]+\d*-[a-zA-Z0-9-_]{40,}$/,VZe=async e=>IZe({...e,endpoint:RZe,headers:zZe}),HZe=s({apiKeyPattern:()=>WZe,apiKeyURL:()=>`https://platform.deepseek.com/api_keys`,apiLabel:()=>`DeepSeek API`,complete:()=>GZe,developerURL:()=>`https://api-docs.deepseek.com/`,serviceId:()=>`deepseek`,serviceLabel:()=>`DeepSeek`}),UZe=`https://api.deepseek.com/chat/completions`,WZe=/^sk-[a-zA-Z0-9]{32,}$/,GZe=async e=>PZe({...e,endpoint:UZe,extraBody:{thinking:{type:e.reasoning===`none`?`disabled`:`enabled`}}}),KZe=s({apiKeyPattern:()=>qZe,apiKeyURL:()=>`https://aistudio.google.com/api-keys`,apiLabel:()=>`Gemini API`,complete:()=>JZe,developerURL:()=>`https://ai.google.dev/gemini-api/docs`,serviceId:()=>`google-ai`,serviceLabel:()=>`Google Gemini`}),qZe=/^(?:AIza[a-zA-Z0-9_-]{35}|AQ\.[a-zA-Z0-9._-]{20,})$/,JZe=async({apiKey:e,model:t,systemPrompt:n,userMessage:r,temperature:i=.3,maxTokens:a=16e3,responseFormat:o})=>{let s=await u6({endpoint:`https://generativelanguage.googleapis.com/v1beta/models/${t}:generateContent`,headers:{"Content-Type":`application/json`,"x-goog-api-key":e},apiLabel:`Gemini`,body:{system_instruction:{parts:[{text:n}]},contents:[{parts:[{text:r}]}],generationConfig:{temperature:i,maxOutputTokens:a,...o?{responseMimeType:o}:{}}}}),c=Array.isArray(s.candidates)?s.candidates[0]:void 0;if(c?.finishReason===`MAX_TOKENS`)throw l6(`Gemini`);return MZe(c?.content?.parts,e=>!e.thought,`Gemini`)},YZe=s({apiKeyPattern:()=>ZZe,apiKeyURL:()=>`https://console.mistral.ai/home?profile_dialog=api-keys`,apiLabel:()=>`Mistral AI API`,complete:()=>QZe,developerURL:()=>`https://docs.mistral.ai/`,serviceId:()=>`mistral`,serviceLabel:()=>`Mistral`}),XZe=`https://api.mistral.ai/v1/chat/completions`,ZZe=/^(?:(?!AIza)[a-zA-Z0-9]{32,}|mstrl_[a-zA-Z0-9_-]{32,})$/,QZe=async e=>PZe({...e,endpoint:XZe}),$Ze=s({apiKeyPattern:()=>tQe,apiKeyURL:()=>`https://platform.openai.com/api-keys`,apiLabel:()=>`OpenAI API`,complete:()=>nQe,developerURL:()=>`https://platform.openai.com/docs/overview`,serviceId:()=>`openai`,serviceLabel:()=>`OpenAI GPT`}),eQe=`https://api.openai.com/v1/responses`,tQe=/^sk-(?!ant-)[a-zA-Z0-9-_]{40,}$/,nQe=async e=>FZe({...e,endpoint:eQe}),rQe=Object.fromEntries([LZe,HZe,KZe,YZe,$Ze].map(e=>[e.serviceId,e])),iQe=e=>Of(e,{displayLocale:`en`}),aQe=(e,t)=>{let n=[`- CRITICAL: Leave content EXACTLY unchanged within HTML elements that have translate="no"`,`- CRITICAL: Leave content EXACTLY unchanged within HTML elements that have class="notranslate"`,`- CRITICAL: Leave content EXACTLY unchanged between "notranslate" and "/notranslate" comments`,`- Preserve all markdown formatting (headers, links, bold, italic, code blocks, lists, etc.)`,`- Preserve all HTML tags and attributes exactly as they are`,`- Maintain the original structure and formatting`,`- Do not translate code content within code blocks or inline code`,`- Do not translate URLs, email addresses, or technical identifiers`,`- If you see translate="no", class="notranslate", or notranslate comments, copy that content verbatim without any changes`],r=[`- Do not split translations into separate paragraphs or add extra line breaks`,`- Keep each translation as a single continuous text string in the array`],i=[`- Return your response as a valid JSON array containing the translated texts`,`- The array should contain the translated texts in the same order as provided`,`- VALIDATION: Before responding, double-check that any translate="no", class="notranslate", or notranslate comment content remains EXACTLY the same`];return`You are a professional translator. Translate the given texts from ${e} to ${t}. Your response must be valid JSON that can be parsed directly.
IMPORTANT INSTRUCTIONS:\n${[...n,...r,...i].join(`
`)}\n\nOUTPUT FORMAT:
- Output ONLY valid JSON, nothing else
- Do NOT use markdown code blocks or formatting
- Do NOT add any explanation or commentary
- Your entire response should be parseable by JSON.parse()
- Start your response with [ and end with ]
Required JSON structure:
["translation 1", "translation 2", ...]`},oQe=e=>`Translate these texts and return ONLY valid JSON (no markdown, no code blocks):
${JSON.stringify(e)}\n\nRespond with JSON only:`,sQe=(e,t,n)=>{let r;try{r=JSON.parse(e)}catch{throw Error(`Failed to parse JSON response from ${n}.`)}if(!Array.isArray(r))throw Error(`Invalid JSON structure in ${n} response.`);if(r.length!==t)throw Error(`Translation count mismatch: expected ${t}, got ${r.length}`);return r},cQe=e=>({availability:async({sourceLanguage:t,targetLanguage:n})=>!!e(t)&&!!e(n),resolveLanguages:(t,n)=>{let r=e(t),i=e(n);if(!r)throw Error(`Source locale is not supported.`);if(!i)throw Error(`Target locale is not supported.`);return[r,i]}}),{availability:lQe,resolveLanguages:uQe}=cQe(iQe),dQe=(e,t,n,r={})=>async(i,{sourceLanguage:a,targetLanguage:o,apiKey:s})=>{let[c,l]=uQe(a,o);return sQe(await e({apiKey:s,model:t,systemPrompt:aQe(c,l),userMessage:oQe(i),...r}),i.length,n)},d6=({ai:{serviceId:e,serviceLabel:t,apiLabel:n,developerURL:r,apiKeyURL:i,apiKeyPattern:a,complete:o},model:s,extraOptions:c})=>({serviceId:e,serviceLabel:t,apiLabel:n,developerURL:r,apiKeyURL:i,apiKeyPattern:a,markdownSupported:!0,availability:lQe,translate:dQe(o,s,n,c)}),fQe=d6({ai:LZe,model:`claude-haiku-5-5`,extraOptions:{reasoning:`none`}}),pQe=d6({ai:HZe,model:`deepseek-flash`,extraOptions:{reasoning:`none`}}),mQe=`google`,hQe=`Google Cloud Translation`,gQe=`Cloud Translation API`,_Qe=`https://console.cloud.google.com/apis/library/translate.googleapis.com`,vQe=`https://console.cloud.google.com/apis/api/translate.googleapis.com/credentials`,yQe=/^AIza[0-9A-Za-z-_]{35}$/,bQe=`ab,ace,ach,af,ak,alz,am,ar,as,awa,ay,az,ba,ban,bbc,be,bem,bew,bg,bho,bik,bm,bn,br,bs,bts,btx,bua,ca,ceb,cgg,chm,ckb,cnh,co,crh,crs,cs,cv,cy,da,de,din,doi,dov,dv,dz,ee,el,en,eo,es,et,eu,fa,ff,fi,fil,fj,fr,fr-CA,fr-FR,fy,ga,gaa,gd,gl,gn,gom,gu,ha,haw,he,hi,hil,hmn,hr,hrx,ht,hu,hy,id,ig,ilo,is,it,iw,ja,jv,jw,ka,kk,km,kn,ko,kri,ktu,ku,ky,la,lb,lg,li,lij,lmo,ln,lo,lt,ltg,luo,lus,lv,mai,mak,mg,mi,min,mk,ml,mn,mni-Mtei,mr,ms,ms-Arab,mt,my,ne,new,nl,no,nr,nso,nus,ny,oc,om,or,pa,pa-Arab,pag,pam,pap,pl,ps,pt,pt-BR,pt-PT,qu,rn,ro,rom,ru,rw,sa,scn,sd,sg,shn,si,sk,sl,sm,sn,so,sq,sr,ss,st,su,sv,sw,szl,ta,te,tet,tg,th,ti,tk,tl,tn,tr,ts,tt,ug,uk,ur,uz,vi,xh,yi,yo,yua,yue,zh,zh-CN,zh-TW,zu`.split(`,`),xQe={nb:`no`},{availability:SQe,resolveLanguages:CQe}=cQe(e=>{let[t,...n]=e.split(/[-_]/),r=t.toLowerCase(),i=n.find(e=>/^[a-z]{4}$/i.test(e)),a=n.find(e=>/^(?:[a-z]{2}|\d{3})$/i.test(e))?.toUpperCase(),o=i?`${i[0].toUpperCase()}${i.slice(1).toLowerCase()}`:a&&pG(`${r}-${a}`)?.script;if(r===`zh`){if(o===`Hant`)return`zh-TW`;if(o===`Hans`)return`zh-CN`}if(!o||bQe.includes(`${r}-${o}`)||o===pG(r)?.script)return[o?`${r}-${o}`:void 0,a?`${r}-${a}`:void 0,xQe[r]??r].find(e=>!!e&&bQe.includes(e))}),wQe=128,TQe=9e4,EQe=e=>Wb(e,{maxItems:wQe,maxSize:TQe,getSize:ou}),DQe={serviceId:mQe,serviceLabel:hQe,apiLabel:gQe,developerURL:_Qe,apiKeyURL:vQe,apiKeyPattern:yQe,markdownSupported:!1,availability:SQe,translate:async(e,{sourceLanguage:t,targetLanguage:n,apiKey:r})=>{[t,n]=CQe(t,n);let i=[];for(let a of EQe(e)){let{data:e}=await u6({endpoint:`https://translation.googleapis.com/language/translate/v2`,headers:{"Content-Type":`application/json`,"X-goog-api-key":r},apiLabel:`Google Translate`,body:{q:a,source:t,target:n,format:`html`}});i.push(...e.translations.map(e=>e.translatedText.replace(/&#39;/g,`'`)))}return i}},f6={anthropic:fQe,deepseek:pQe,google:DQe,"google-ai":d6({ai:KZe,model:`gemini-3.5-flash-lite`,extraOptions:{responseFormat:`application/json`}}),mistral:d6({ai:YZe,model:`mistral-small-latest`,extraOptions:{reasoning:`none`}}),openai:d6({ai:$Ze,model:`gpt-6-luna`,extraOptions:{reasoning:`low`}})},OQe=Object.fromEntries(Object.entries(f6).filter(([e])=>!(e in rQe))),p6=rl(()=>{let{defaultTranslationService:e=`google`}=yu;return f6[e]??DQe}),m6=new Sie,kQe=({draft:e,targetLanguage:t,keyPath:n=``})=>[...m6].some(r=>r.draft===e&&r.targetLanguage===t&&r.keyPath===n),AQe=kH({loader:async()=>{let{default:e}=await Jc(`turndown`,`lib/turndown.browser.es.js`),t=new e({headingStyle:`atx`,bulletListMarker:`-`,codeBlockStyle:`fenced`});return t.keep([`span`,`div`]),t},notLoadedMessage:"Turndown is not loaded yet. Call `getTurndownService()` first."}).load,jQe={amp:`&`,lt:`<`,gt:`>`,quot:`"`,apos:`'`},MQe=e=>e.replace(/&(?:#(\d+)|#x([\da-f]+)|(amp|lt|gt|quot|apos));/gi,(e,t,n,r)=>{if(r)return jQe[r.toLowerCase()];let i=t?Number(t):Number.parseInt(n,16);return i<=1114111?String.fromCodePoint(i):e}),NQe=(e,t)=>{let n=t.split(`.`);return n.flatMap((r,i)=>{if(i===0||!eh(r))return[];let a=n.slice(0,i+1).join(`.`);return[{exists:t in e||a in e||Object.keys(e).some(e=>e.startsWith(`${a}.`)),id:e[`${a}.__sc_item_id`],originalKeyPath:e[`${a}.__sc_item_original_key_path`]}]})},PQe=(e,t,n)=>{let r=n.split(`.`),i=r.map((e,t)=>r.slice(0,t+1).join(`.`)).filter((e,t)=>t>0&&eh(r[t]));return e.every((e,n)=>{let{exists:r,id:a,originalKeyPath:o}=t[n],s=i[n];return r===e.exists?e.id===void 0?(a===void 0||o!==void 0)&&(o??s)===(e.originalKeyPath??s):a===e.id:!1})},FQe=/^(.+)\.\d+$/,IQe=({field:e,getFieldArgs:t})=>{let{keyPath:n}=t;if(e)return{keyPath:n,field:e};let[,r]=n.match(FQe)??[],i=r?lh({...t,keyPath:r}):void 0;return i?.widget===`list`&&!$G(i).hasSubFields?{keyPath:r,field:i}:void 0},LQe=({owner:{keyPath:e,field:t},getFieldArgs:n,content:r})=>N3({fieldConfig:t,getFieldArgs:{...n,keyPath:e}})(r),RQe=({draft:e,options:t})=>{let{currentValues:n}=e,{sourceLanguage:r,targetLanguage:i,keyPath:a=``,translate:o=!1}=t,s=n[r],c=ch(e,{valueMap:s});return Object.fromEntries(Object.entries(s).map(([e,t])=>{if(a&&!tm(e,a))return null;let r=n[i][e],s=lh({...c,keyPath:e}),l=s?.widget??`string`,u=IQe({field:s,getFieldArgs:{...c,keyPath:e}});return!NW(u?.field.i18n)||typeof t!=`string`||!t||![..._ie,`list`].includes(l)||l===`list`&&$G(s).hasSubFields||!o&&t===r||!a&&o&&r&&!(s&&YG(s)&&t===r)||!LQe({owner:u,getFieldArgs:c,content:n[i]})?null:[e,{value:t,format:Rd.includes(l)?T$(s):`plain`}]}).filter(e=>!!e))},h6=(e,t,{count:n,sourceLanguage:r})=>{r0.current={id:Date.now(),show:!0,status:e,message:t,count:n,sourceLanguage:r}},zQe=async({currentValues:e,options:t,copingFieldMap:n,isDraftClosed:r=()=>!1})=>{let{serviceId:i}=p6.current,{sourceLanguage:a,targetLanguage:o,keyPath:s}=t,c=Object.keys(n).length,l=Object.fromEntries(Object.keys(n).map(t=>[t,e[o][t]])),u=Object.fromEntries(Object.keys(n).map(t=>[t,NQe(e[o],t)])),d=yu.apiKeys?.[i];if(!d){let{promise:e,resolve:t}=Promise.withResolvers();n0.current.resolve?.(),n0.current={show:!0,multiple:c>1,resolve:t},d=await e}if(!d)return;let{markdownSupported:f,translate:p}=p6.current;h6(`info`,`translation.started`,{count:c,sourceLanguage:a});try{let t=await p(Object.entries(n).map(([,{value:e,format:t}])=>f||t===`html`?e:t===`markdown`?pr(e):Ku(e)),{apiKey:d,sourceLanguage:a,targetLanguage:o}),i=!f&&Object.values(n).some(({format:e})=>e===`markdown`)?await AQe():void 0;if(r())return;let c=0;Object.entries(n).forEach(([n,{format:r}],a)=>{let d=t[a];(s||e[o][n]===l[n])&&PQe(u[n],NQe(e[o],n),n)&&(c+=1,e[o][n]=f||r===`html`?d:r===`markdown`?i.turndown(d):MQe(d))}),h6(`success`,`translation.complete`,{count:c,sourceLanguage:a})}catch(e){r()||h6(`error`,`translation.error`,{count:c,sourceLanguage:a}),console.error(e)}},BQe=({currentValues:e,options:t,copingFieldMap:n})=>{let{sourceLanguage:r,targetLanguage:i}=t,a=Object.keys(n).length;Object.entries(n).forEach(([t,{value:n}])=>{e[i][t]=n}),h6(`success`,`copy.complete`,{count:a,sourceLanguage:r})},VQe=async({draft:e,options:t,entryDraft:n})=>{let{sourceLanguage:r,targetLanguage:i,keyPath:a=``,translate:o=!1}=t;if(o&&kQe({draft:e,targetLanguage:i,keyPath:a}))return;let{currentValues:s}=e,c=RQe({draft:e,options:t}),l=Object.keys(c).length;if(!l)h6(`info`,`${o?`translation`:`copy`}.none`,{count:l,sourceLanguage:r});else if(o){let r={draft:e,targetLanguage:i,keyPath:a},o=()=>!!n&&n.current!==e;m6.add(r);try{await zQe({currentValues:s,options:t,copingFieldMap:c,isDraftClosed:o})}finally{m6.delete(r)}}else BQe({currentValues:s,options:t,copingFieldMap:c})};function g6(e,t){O(t,!0);let n=e=>{var n=H();No(P(n),16,()=>t.otherLocales,e=>e,(e,n)=>{let r=A(()=>Of(n)??n),i=A(()=>({sourceLanguage:n,targetLanguage:t.locale}));var o=H();Do(P(o),()=>c(z(i)),null,(e,t)=>{{let n=A(()=>z(s)?z(r):Y(a()?`translate_from_x`:`copy_from_x`,{values:{locale:z(r)}}));JS(e,{get label(){return z(n)},get disabled(){return z(t)},onclick:()=>{l(z(i))}})}}),U(e,o)}),U(e,n)},r=LK(),i=J(t,`keyPath`,3,``),a=J(t,`translate`,3,!1),o=J(t,`submenu`,3,!1),s=A(()=>o()&&t.otherLocales.length>1),c=async({sourceLanguage:e,targetLanguage:t})=>!r.current?.currentLocales[t]||!r.current.currentLocales[e]||!!i()&&!Object.keys(RQe({draft:r.current,options:{sourceLanguage:e,targetLanguage:t,keyPath:i(),translate:a()}})).length||a()&&!await p6.current?.availability({sourceLanguage:e,targetLanguage:t}),l=e=>{r.current&&VQe({draft:r.current,options:{...e,keyPath:i(),translate:a()},entryDraft:r})};var u=H(),d=P(u),f=e=>{{let t=e=>{n(e)},r=A(()=>Y(a()?`translate_from`:`copy_from`));JS(e,{get label(){return z(r)},items:t,$$slots:{items:!0}})}},p=e=>{n(e)};G(d,e=>{z(s)?e(f):e(p,-1)}),U(e,u),k()}var HQe=new Set([`$$slots`,`$$events`,`$$legacy`,`children`]),UQe=B(`<section><!></section>`),WQe={hash:`svelte-wzztxu`,code:`section.svelte-wzztxu {position:relative;padding:var(--field-editor-padding);&:not(:last-child)::after {position:absolute;inset:auto var(--field-editor-padding) 0 var(--field-editor-padding);overflow:hidden;height:1px;background-color:var(--sui-tertiary-background-color);content:'';}& > * {margin-inline:auto !important;max-width:768px;}& > header {display:flex;align-items:center;margin:0 -8px 8px;height:var(--sui-button-small-height);h4 {margin-inline:var(--sui-focus-ring-width) 0;font-size:var(--sui-font-size-small);font-weight:var(--sui-font-weight-bold);color:var(--sui-secondary-foreground-color);}.required {margin-block:2px 0;margin-inline:2px 0;color:var(--sui-error-foreground-color);font-size:var(--sui-font-size-large);}}
/* The buttons are shown on hover, and kept visible while a keyboard user is in the field, so
the focused one isn’t invisible */
@media (hover: hover) {&:not(:hover, :focus-within) > header button {opacity:0;}
}}`};function _6(e,t){O(t,!0),K(e,WQe);let n=J(t,`children`,3,void 0),r=vs(t,HQe),i=j(void 0);So(()=>()=>{z(i)?.dispatchEvent(new CustomEvent(`Unmount`))});var a=UQe();fs(a,()=>({role:`group`,class:`field`,...r}),void 0,void 0,void 0,`svelte-wzztxu`),xo(N(a),()=>n()??Cr),D(a),gs(a,e=>M(i,e),()=>z(i)),U(e,a),k()}var GQe=[`revert`,`restore`,`clear`],KQe={field:{revert:`revert_changes`,restore:`restore_default`,clear:`clear`},locale:{revert:`revert_changes`,restore:`restore_default`,clear:`clear_all`},entry:{revert:`revert_all_changes`,restore:`restore_default`,clear:`clear_all`}},qQe={revert:`confirm_reverting_changes`,restore:`confirm_restoring_defaults`,clear:`confirm_clearing_fields`},JQe=(e,t)=>Y(KQe[t][e]),YQe=(e,t)=>t&&t!==`_default`?Y(`${qQe[e]}_x_locale`,{values:{locale:Of(t)??t}}):Y(qQe[e]),XQe=B(`<!> <!>`,1);function v6(e,t){O(t,!0);let n=J(t,`separator`,3,!0);var r=XQe(),i=P(r),a=e=>{FS(e,{})};G(i,e=>{n()&&e(a)}),No(I(i,2),16,()=>GQe.filter(e=>e in t.available),e=>e,(e,n)=>{{let r=A(()=>JQe(n,t.scope)),i=A(()=>!t.available[n]);JS(e,{get label(){return z(r)},get disabled(){return z(i)},onclick:()=>{t.onSelect(n)}})}}),U(e,r),k()}function ZQe(e,t){O(t,!0);let n=LK(),r=J(t,`size`,3,`medium`),i=J(t,`keyPath`,3,``),a=A(()=>!n.current?.currentLocales[t.locale]||GZ(n.current?.originalEntry)),o=A(()=>kQe({draft:n.current,targetLanguage:t.locale,keyPath:i()})),s=async({sourceLanguage:e,targetLanguage:t})=>z(a)||!n.current?.currentLocales[e]||!await p6.current?.availability({sourceLanguage:e,targetLanguage:t}),c=e=>{n.current&&VQe({draft:n.current,options:{...e,keyPath:i(),translate:!0},entryDraft:n})};var l=H(),u=P(l),d=e=>{let n=A(()=>{let[e]=t.otherLocales;return{otherLocale:e}}),i=A(()=>Y(`translate_from_x`,{values:{locale:Of(z(n).otherLocale)??z(n).otherLocale}})),a=A(()=>({sourceLanguage:z(n).otherLocale,targetLanguage:t.locale}));var l=H();Do(P(l),()=>s(z(a)),null,(e,t)=>{{let n=e=>{gx(e,{name:`translate`})},s=A(()=>z(t)||z(o));Xx(e,{variant:`ghost`,get size(){return r()},iconic:!0,popupPosition:`bottom-right`,get"aria-label"(){return z(i)},get title(){return z(i)},get disabled(){return z(s)},onclick:()=>{c(z(a))},startIcon:n,$$slots:{startIcon:!0}})}}),U(e,l)},f=e=>{{let n=e=>{gx(e,{name:`translate`})},o=e=>{{let n=A(()=>Y(`translation_options`));qS(e,{get ariaLabel(){return z(n)},children:(e,n)=>{g6(e,{get locale(){return t.locale},get otherLocales(){return t.otherLocales},get keyPath(){return i()},translate:!0})},$$slots:{default:!0}})}},s=A(()=>Y(`translate`));hS(e,{variant:`ghost`,get size(){return r()},iconic:!0,popupPosition:`bottom-right`,get"aria-label"(){return z(s)},get disabled(){return z(a)},endIcon:n,popup:o,$$slots:{endIcon:!0,popup:!0}})}};G(u,e=>{t.otherLocales.length===1?e(d):e(f,-1)}),U(e,l),k()}var QQe=[`compute`,`hidden`,`uuid`],y6=e=>{let{content:t,fieldConfig:n,keyPath:r,locale:i,defaultLocale:a,inheritedI18n:o}=e,{mirror:s=!1,syncOnly:c=!1,restore:l=!1}=e,{widget:u=`string`,i18n:d}=n,f=d??o;if(!(QQe.includes(u)||n.readonly)){if(u===`list`&&$G(n).hasSubFields){let{allow_add:e=!0,allow_remove:t=!0}=n;if(!t||l&&!e)return}if(u===`object`){if(t[r]===null)return;let{default:o}=yG({fieldConfig:{...n,i18n:f},locale:i,defaultLocale:a});(mh(n,t,r)??[]).forEach(t=>{let n=l&&X(o)&&Object.hasOwn(o,t.name)?{...t,default:o[t.name],default_localized:void 0}:t;y6({...e,fieldConfig:n,keyPath:`${r}.${t.name}`,inheritedI18n:f})})}else if(s?c?f===`sync`:PW(f)||eK(n):i===a||NW(d)||f===`sync`){if(Om(t,r),!l){if(u===`keyvalue`){t[r]=null;return}if(u===`list`){t[r]=[];return}}V3({content:t,keyPath:r,fieldConfig:{...n,i18n:f,...l?{}:{default:void 0,default_localized:void 0}},locale:i,defaultLocale:a,dynamicValues:{}})}}},$Qe=({valueStore:e,locale:t,...n})=>{let r=t!==n.defaultLocale;y6({...n,content:e[t],locale:t}),Object.entries(e).forEach(([e,i])=>{e!==t&&y6({...n,content:i,locale:e,mirror:!0,syncOnly:r})})},e$e=({draft:e,valueMap:t,...n})=>({...n,defaultLocale:e.defaultLocale,inheritedI18n:LW({fieldConfig:n.fieldConfig,getFieldArgs:ch(e,{keyPath:n.keyPath,valueMap:t})})}),t$e=e=>{let t=yK(e.valueMap,e.keyPath),n={...t};return y6({...e$e(e),content:n}),!(0,Qc.default)(t,n)},n$e=e=>{let{draft:t,locale:n}=e,{currentValues:r,defaultLocale:i}=t;hK(()=>{$Qe({...e$e({...e,valueMap:r[n]}),valueStore:r}),n===i&&W3({valueStore:r,defaultLocale:i,getFieldArgs:ch(t)})})},r$e=({currentValues:e,currentLocales:t},n)=>n?[n]:Object.keys(e).filter(e=>t[e]),i$e=({valueStore:e,fields:t,locales:n,defaultLocale:r,restore:i})=>{n.forEach(n=>{t.forEach(t=>{$Qe({valueStore:e,fieldConfig:t,keyPath:t.name,locale:n,defaultLocale:r,restore:i})})})},b6=({draft:e,locale:t,restore:n=!1})=>{let{fields:r,currentValues:i,defaultLocale:a}=e,o=()=>Object.fromEntries(Object.entries(i).map(([e,t])=>[e,_K(t)])),s=o(),c=o();return i$e({valueStore:c,fields:r,locales:r$e(e,t),defaultLocale:a,restore:n}),!(0,Qc.default)(s,c)},a$e=({draft:e,locale:t,restore:n=!1})=>{let{fields:r,currentValues:i,defaultLocale:a}=e,o=r$e(e,t);hK(()=>{i$e({valueStore:i,fields:r,locales:o,defaultLocale:a,restore:n}),o.includes(a)&&W3({valueStore:i,defaultLocale:a,getFieldArgs:ch(e)})})},o$e=(e,t)=>{let n=t.split(`.`),r=[...n],i=0;if(n.forEach((t,a)=>{if(a>=1&&eh(t)){let t=e[`${n.slice(0,a+1).join(`.`)}.__sc_item_original_key_path`];t!==void 0&&(r[a]=t.split(`.`).at(-1),i=a)}}),i)return{originalKeyPath:r.join(`.`),currentPrefix:n.slice(0,i+1).join(`.`),originalPrefix:r.slice(0,i+1).join(`.`)}},s$e=(e,t)=>yK(e,t,{relative:!0,dropEmptyPlaceholders:!0}),c$e=({currentValueMap:e,originalValueMap:t,keyPath:n})=>{let r=o$e(e,n)?.originalKeyPath??n;return!(0,Qc.default)(s$e(e,n),s$e(t,r))},l$e=({locale:e,isDefaultLocale:t,keyPath:n,getFieldArgs:r,currentValues:i,reset:a=!1,remapPrefix:o})=>{let{valueMap:s={}}=r;Object.entries(s).forEach(([s,c])=>{if(!n||tm(s,n)){let n=lh({...r,keyPath:s}),l=n?{keyPath:s,fieldConfig:n}:aK({...r,keyPath:s}),u=l?.fieldConfig.i18n;if(t||NW(u)||u===`duplicate_keys`||l&&zW({fieldConfig:l.fieldConfig,getFieldArgs:{...r,keyPath:l.keyPath}})){if(a)delete i[e][s];else{let t=o?`${o.to}${s.slice(o.from.length)}`:s;i[e][t]=c}}}})},x6=({draft:e,keyPath:t,locale:n,revertAll:r=!1})=>{let{currentValues:i,originalValues:a}=e,{defaultLocale:o}=Rf(e),s=r||n===o,c=ch(e,{keyPath:``}),l=t?o$e(i[n],t):void 0,u=l?.originalKeyPath??t,d=l?{from:l.originalPrefix,to:l.currentPrefix}:void 0;l$e({locale:n,isDefaultLocale:s,keyPath:t,getFieldArgs:{...c,valueMap:i[n]},currentValues:i,reset:!0}),l$e({locale:n,isDefaultLocale:s,keyPath:u,getFieldArgs:{...c,valueMap:a[n]},currentValues:i,remapPrefix:d})},u$e=({draft:e,keyPath:t})=>{if(!t)return tK(e.fields);let{currentValues:n}=e,{defaultLocale:r}=Rf(e),i=lh(ch(e,{keyPath:t,valueMap:n[r]}));return i?tK([i],t.split(`.`).slice(0,-1).join(`.`)):[]},d$e=({draft:e,locale:t=``,keyPath:n=``})=>{let{currentValues:r,originalLocales:i,originalPath:a,originalSlugs:o}=e,{allLocales:s,defaultLocale:c}=Rf(e),l=!t&&!n;t?x6({draft:e,keyPath:n,locale:t}):hK(()=>{s.forEach(t=>{x6({draft:e,keyPath:n,locale:t,revertAll:!0})})}),t===c&&hK(()=>{u$e({draft:e,keyPath:n}).forEach(t=>{s.forEach(n=>{n!==c&&r[n]&&x6({draft:e,keyPath:t,locale:n,revertAll:!0})})})}),W3({valueStore:r,defaultLocale:c,getFieldArgs:ch(e)}),l&&(e.currentLocales={...i},e.currentPath=a,e.currentSlugs={...o})},f$e=[`richtext`,`markdown`,`string`,`text`,`list`,`object`],p$e=e=>{let{widget:t=`string`}=e,n=t===`string`,r=[`boolean`,`number`,`string`].includes(t),{prefix:i,suffix:a}=n?e:{},{before_input:o,after_input:s}=r?e:{};return{prefix:i,suffix:a,beforeInputLabel:o,afterInputLabel:s,hasExtraLabels:!!(i||a||o||s)}},m$e=({fieldConfig:e,autoSet:t,locked:n,isDuplicated:r,isNew:i,parentReadonly:a=!1})=>{let{widget:o=`string`}=e,{readonly:s}=e,c=o===`compute`,l=s===!0||a;return{hidden:c||t&&i,readonly:(s??(o===`uuid`&&e.read_only!==!1))||l||t||n||r||c,subfieldsReadonly:l}},h$e=({fieldConfig:e,inline:t})=>{let{widget:n=`string`}=e;return t&&[`select`,`relation`].includes(n)?{...e,dropdown_threshold:0}:e},S6=e=>{let t=j(Xi({restore:!1,clear:!1})),n=j(`revert`),r=j(!1);return{get availability(){return z(t)},get action(){return z(n)},get dialogOpen(){return z(r)},set dialogOpen(e){M(r,e,!0)},update:()=>{M(t,e()??z(t),!0)},select:e=>{M(n,e,!0),M(r,!0)}}},g$e=B(`<div role="none" class="before-input svelte-dkfcyc"></div>`),_$e=B(`<div role="none" class="prefix svelte-dkfcyc"> </div>`),C6=B(`<!> <!>`,1),v$e=B(`<div role="none" class="suffix svelte-dkfcyc"> </div>`),y$e=B(`<div role="none" class="after-input svelte-dkfcyc"></div>`),b$e=B(`<span role="none" class="field inline"><span hidden=""> </span> <!></span>`),x$e=B(`<span class="required" aria-hidden="true">*</span>`),S$e=B(`<!> <!> <!>`,1),C$e=B(`<p class="hint svelte-dkfcyc"></p>`),w$e=B(`<div role="none" class="footer svelte-dkfcyc"><!> <!></div>`),T$e=B(`<header role="none"><h4 role="none"> </h4> <!> <!> <!> <!></header> <!> <div role="none"><!></div> <!>`,1),E$e={hash:`svelte-dkfcyc`,code:`.field-wrapper.svelte-dkfcyc {&.has-extra-labels {display:flex;align-items:center;justify-content:flex-start;gap:4px;}:is(input[type='text'], textarea) {width:100%;}
/* A native color, date or time input is still styled for a custom field type that renders
one. The built-in editors use Sveltia UI components instead, which have the \`sui\` class and
styles of their own, so they’re left out */input:is([type='color']:not(.sui), [type='number']) {border-width:1px;border-color:var(--sui-primary-border-color);border-radius:var(--sui-control-medium-border-radius);height:var(--sui-button-medium-height);color:inherit;background-color:var(--sui-textbox-background-color);}input:is([type='file'], [type='checkbox']) {color:inherit;}& > div {color:inherit;}input:is([type='date'], [type='datetime-local'], [type='time']):not(.sui) {margin:var(--sui-focus-ring-width);border-width:var(--sui-textbox-border-width, 1px);border-color:var(--sui-primary-border-color);border-radius:var(--sui-control-medium-border-radius);padding:var(--sui-textbox-singleline-padding);width:auto;height:var(--sui-textbox-height);color:var(--sui-textbox-foreground-color);background-color:var(--sui-textbox-background-color);font-family:var(--sui-textbox-font-family);font-size:var(--sui-textbox-font-size);text-transform:uppercase;&:disabled {opacity:0.4;}}input[aria-invalid='true']:is(
[type='color'],
[type='date'],
[type='datetime-local'],
[type='time']
):not(.sui) {border-color:var(--sui-error-border-color);}input:read-only {
/* Make readonly inputs selectable */-webkit-user-select:text;user-select:text;pointer-events:auto;}}.before-input.svelte-dkfcyc,
.after-input.svelte-dkfcyc,
.prefix.svelte-dkfcyc,
.suffix.svelte-dkfcyc {color:var(--sui-secondary-foreground-color);white-space:nowrap;}.hint.svelte-dkfcyc {flex:auto;margin-inline:var(--sui-focus-ring-width) !important;margin-block:var(--sui-focus-ring-width) 0 !important;font-size:var(--sui-font-size-small);line-height:var(--sui-line-height-compact);color:var(--sui-tertiary-foreground-color);}.footer.svelte-dkfcyc {display:flex;gap:16px;justify-content:flex-end;margin-top:4px;}`};function w6(e,t){let n=mo();O(t,!0),K(e,E$e);let r=e=>{var t=C6(),n=P(t),r=e=>{var t=g$e();Lo(t,()=>Xu(z(b)),!0),D(t),U(e,t)};G(n,e=>{z(b)&&e(r)});var i=I(n,2),a=e=>{var t=_$e(),n=F(t,!0);R(()=>W(n,z(v))),U(e,t)};G(i,e=>{z(v)&&e(a)}),U(e,t)},i=e=>{var t=C6(),n=P(t),r=e=>{var t=v$e(),n=F(t,!0);R(()=>W(n,z(y))),U(e,t)};G(n,e=>{z(y)&&e(r)});var i=I(n,2),a=e=>{var t=y$e();Lo(t,()=>Xu(z(x)),!0),D(t),U(e,t)};G(i,e=>{z(x)&&e(a)}),U(e,t)},a=UK(),o=LK(),s=J(t,`context`,19,()=>a.fieldContext??void 0),c=J(t,`valueStoreKey`,19,()=>a.valueStoreKey??`currentValues`),l=J(t,`inline`,3,!1),u=e=>{if(typeof e==`object`&&e)return;let n=o.current,r=c(),i=t.locale,a=t.keyPath;BK(()=>{n&&(n[r][i][a]=e)})},d=tl(),f=A(()=>HK(c())),p=A(()=>Tr(t.fieldConfig.widget,`string`)),m=A(()=>_G({config:t.fieldConfig,option:`hint`,locale:t.locale})??``),h=A(()=>fh({fieldConfig:t.fieldConfig,locale:t.locale})),g=A(()=>oh(t.fieldConfig)),_=A(()=>p$e(t.fieldConfig)),v=A(()=>z(_).prefix),y=A(()=>z(_).suffix),b=A(()=>z(_).beforeInputLabel),x=A(()=>z(_).afterInputLabel),S=A(()=>z(_).hasExtraLabels),C=A(()=>z(p)===`list`||z(g)),w=A(()=>o.current?.originalValues),T=A(()=>Rf(o.current)),ee=A(()=>z(T).allLocales),E=A(()=>z(ee).filter(e=>e!==t.locale)),te=A(()=>jK(o.current,t.locale,t.keyPath,c())),ne=A(()=>e6({draft:o.current,fieldConfig:t.fieldConfig,keyPath:t.keyPath,locale:t.locale,valueMap:z(te),inEditorComponent:z(f)})),re=A(()=>z(ne).canTranslate),ie=A(()=>z(ne).isDuplicated),ae=A(()=>z(ne).areKeysDuplicated),oe=A(()=>z(ne).isShown),se=A(()=>!z(f)&&z(re)&&z(E).length),ce=A(()=>!z(f)&&!z(ie)),le=A(()=>Hd.get(z(p))),ue=A(()=>ph({valueMap:z(te),keyPath:t.keyPath,isList:z(C),isCustomFieldType:!!z(le)})),de=A(()=>!c$e({currentValueMap:z(te),originalValueMap:z(w)?.[t.locale]??{},keyPath:t.keyPath})),fe=A(()=>o.current?.validities[t.locale][t.keyPath]),pe=A(()=>vG({config:t.fieldConfig,locale:t.locale})),me=A(()=>GZ(o.current?.originalEntry)),he=A(()=>oQ(o.current)),ge=A(()=>z(me)||z(he)),_e=A(()=>!z(f)&&z4(t.fieldConfig)),ve=A(()=>!!o.current&&B4({fieldConfig:t.fieldConfig,collection:o.current.collection,isIndexFile:o.current.isIndexFile,keyPath:t.keyPath,inEditorComponent:z(f)})),ye=A(()=>z(_e)||z(ve)),be=A(()=>m$e({fieldConfig:t.fieldConfig,autoSet:z(ye),locked:z(ge),isDuplicated:z(ie),isNew:!!o.current?.isNew,parentReadonly:!!a.readonly})),xe=A(()=>z(be).hidden),Se=A(()=>z(be).readonly),Ce=A(()=>z(be).subfieldsReadonly);WK({fieldContext:s(),parentComponentNames:[...a.parentComponentNames??[],t.componentName].filter(Boolean),extraHint:d,valueStoreKey:c(),get readonly(){return z(Ce)}});let we=A(()=>!z(f)&&!z(Se)&&!z(ae)),Te=S6(()=>{let e={draft:o.current,valueMap:z(te),fieldConfig:t.fieldConfig,keyPath:t.keyPath,locale:t.locale};return{restore:t$e({...e,restore:!0}),clear:t$e(e)}}),Ee=A(()=>z(fe)?.valid===!1),De=A(()=>h$e({fieldConfig:t.fieldConfig,inline:l()})),Oe=A(()=>({locale:t.locale,keyPath:t.keyPath,typedKeyPath:t.typedKeyPath,fieldId:n,fieldLabel:z(pe),fieldConfig:z(De),readonly:z(Se),required:z(h),invalid:z(Ee)}));var ke=H(),Ae=P(ke),je=e=>{let r=A(()=>T8[z(p)]);var i=b$e(),a=N(i),o=F(a,!0);c6(I(a,2),{children:(e,t)=>{var n=H(),i=P(n),a=()=>z(ue),o=e=>u(e);Ro(i,()=>z(r),(e,t)=>{t(e,ys(()=>z(Oe),{get currentValue(){return a()},set currentValue(e){o(e)}}))}),U(e,n)},$$slots:{default:!0}}),D(i),R(()=>{q(i,`data-field-type`,z(p)),q(i,`data-key-path`,t.keyPath),q(i,`data-typed-key-path`,t.typedKeyPath),q(a,`id`,`${n}-label`),W(o,z(pe))}),U(e,i)},Me=e=>{{let a=A(()=>Y(`x_field`,{values:{field:z(pe)}}));_6(e,{get"aria-label"(){return z(a)},get"data-field-type"(){return z(p)},get"data-key-path"(){return t.keyPath},get"data-typed-key-path"(){return t.typedKeyPath},get hidden(){return z(xe)},children:(e,a)=>{var s=T$e(),c=P(s),l=N(c),f=F(l,!0),g=I(l,2),_=e=>{U(e,x$e())};G(g,e=>{!z(Se)&&z(h)&&e(_)});var v=I(g,2);yS(v,{flex:!0});var y=I(v,2),b=e=>{ZQe(e,{size:`small`,get locale(){return t.locale},get otherLocales(){return z(E)},get keyPath(){return t.keyPath}})},x=A(()=>z(se)&&!z(he)&&f$e.includes(z(p)));G(y,e=>{z(x)&&e(b)});var C=I(y,2),w=e=>{{let n=e=>{{let n=A(()=>Y(`field_options`));qS(e,{get ariaLabel(){return z(n)},children:(e,n)=>{var r=C6(),i=P(r),a=e=>{g6(e,{get locale(){return t.locale},get otherLocales(){return z(E)},get keyPath(){return t.keyPath},submenu:!0})};G(i,e=>{z(se)&&e(a)});var s=I(i,2);{let e=A(()=>!!z(se)),n=A(()=>({revert:!z(de),...z(we)?Te.availability:{}}));v6(s,{scope:`field`,get separator(){return z(e)},get available(){return z(n)},onSelect:e=>{let n=o.current;e===`revert`?d$e({draft:n,locale:t.locale,keyPath:t.keyPath}):n$e({draft:n,fieldConfig:t.fieldConfig,keyPath:t.keyPath,locale:t.locale,restore:e===`restore`})}})}U(e,r)},$$slots:{default:!0}})}},r=A(()=>Y(`show_field_options`));hS(e,{variant:`ghost`,size:`small`,iconic:!0,get disabled(){return z(me)},popupPosition:`bottom-right`,get"aria-label"(){return z(r)},get onclick(){return Te.update},get onkeydown(){return Te.update},popup:n,$$slots:{popup:!0}})}};G(C,e=>{!z(he)&&(z(se)||z(ce)||z(we))&&e(w)}),D(c);var T=I(c,2),ee=e=>{a6(e,{get id(){return`${n}-error`},children:(e,n)=>{Ur();var r=V();R(e=>W(r,e),[()=>o.current?.validationMessages[t.locale][t.keyPath]?.join(` `)]),U(e,r)},$$slots:{default:!0}})};G(T,e=>{z(fe)?.valid===!1&&e(ee)});var te=I(T,2);let ne;c6(N(te),{children:(e,n)=>{var a=H(),o=P(a),s=e=>{var n=S$e(),a=P(n);r(a);var o=I(a,2);{let e=A(()=>({...z(Oe),fieldConfig:t.fieldConfig}));hYe(o,ys(()=>z(e),{get control(){return z(le).control},get currentValue(){return z(ue)}}))}var s=I(o,2);i(s),U(e,n)},c=e=>{bx(e,{status:`warning`,children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(`unsupported_field_type_x`,{values:{name:z(p)}})]),U(e,n)},$$slots:{default:!0}})},l=A(()=>dh(t.fieldConfig)===`unknown`),d=e=>{let t=A(()=>T8[z(p)]);var n=S$e(),a=P(n);r(a);var o=I(a,2),s=()=>z(ue),c=e=>u(e);Ro(o,()=>z(t),(e,t)=>{t(e,ys(()=>z(Oe),{get currentValue(){return s()},set currentValue(e){c(e)}}))});var l=I(o,2);i(l),U(e,n)};G(o,e=>{z(le)?e(s):z(l)?e(c,1):e(d,-1)}),U(e,a)},$$slots:{default:!0}}),D(te);var re=I(te,2),ie=e=>{let n=A(()=>d.current);var r=w$e(),i=N(r),a=e=>{var t=C$e();Lo(t,()=>Xu(z(m)),!0),D(t),U(e,t)};G(i,e=>{z(m)&&e(a)}),Ro(I(i,2),()=>z(n),(e,n)=>{n(e,{get fieldConfig(){return t.fieldConfig},get locale(){return t.locale},get currentValue(){return z(ue)}})}),D(r),U(e,r)};G(re,e=>{!z(Se)&&(z(m)||d.current)&&e(ie)}),R(()=>{q(l,`id`,`${n}-label`),W(f,z(pe)),ne=$o(te,1,`field-wrapper svelte-dkfcyc`,null,ne,{"has-extra-labels":z(S)})}),U(e,s)},$$slots:{default:!0}})}};G(Ae,e=>{o.current&&z(oe)&&z(p)!==`hidden`&&l()?e(je):o.current&&z(oe)&&z(p)!==`hidden`&&e(Me,1)}),U(e,ke),k()}var D$e=B(`<p class="type-hint svelte-1rz7ywc"></p>`),O$e=B(`<!> <!>`,1),k$e=B(`<div role="none" class="summary svelte-1rz7ywc"><!> <!></div>`),A$e={hash:`svelte-1rz7ywc`,code:`
/* The warning fills the Object field value or the List field item, which clips its corners */.object-unknown-type {overflow:hidden;.sui.alert {border-width:0;border-radius:0;}}.type-hint.svelte-1rz7ywc {margin:0 !important;padding:12px var(--field-editor-padding) 0;font-size:var(--sui-font-size-small);line-height:var(--sui-line-height-compact);color:var(--sui-tertiary-foreground-color);}.summary.svelte-1rz7ywc {display:flex;align-items:center;gap:8px;padding:8px;}`};function j$e(e,t){O(t,!0),K(e,A$e);let n=J(t,`summaryContent`,3,void 0),r=J(t,`summaryId`,3,void 0),i=J(t,`typeConfig`,3,void 0),a=J(t,`readonly`,3,!1),o=A(()=>a()||!i()?void 0:_G({config:i(),option:`hint`,locale:t.locale}));var s=H(),c=P(s),l=e=>{bx(e,{status:`warning`,children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(`unknown_variable_type`)]),U(e,n)},$$slots:{default:!0}})},u=e=>{var n=O$e(),r=P(n),i=e=>{var t=D$e();Lo(t,()=>Xu(z(o)),!0),D(t),U(e,t)};G(r,e=>{z(o)&&e(i)}),No(I(r,2),17,()=>t.subFields,e=>e.name,(e,n)=>{pH(e,{children:(e,r)=>{{let r=A(()=>t.getSubFieldProps(z(n)));w6(e,ys(()=>z(r),{get locale(){return t.locale},get fieldConfig(){return z(n)}}))}},$$slots:{default:!0}})}),U(e,n)},d=e=>{let i=A(()=>n()?``:t.getSummary()),a=A(()=>t.getThumbnail());var o=H(),s=P(o),c=e=>{var t=k$e(),o=N(t),s=e=>{P0(e,{get asset(){return z(a).asset},get src(){return z(a).url},variant:`icon`,cover:!0})};G(o,e=>{z(a)&&e(s)});var c=I(o,2),l=e=>{var t=H();xo(P(t),n),U(e,t)},u=e=>{{let t=A(()=>PY.isSmallScreen?2:1);Nx(e,{get lines(){return z(t)},children:(e,t)=>{Ur();var n=V();R(()=>W(n,z(i))),U(e,n)},$$slots:{default:!0}})}};G(c,e=>{n()?e(l):e(u,-1)}),D(t),R(()=>q(t,`id`,r())),U(e,t)};G(s,e=>{(n()||z(i)||z(a))&&e(c)}),U(e,o)};G(c,e=>{t.unknownType?e(l):t.expanded?e(u,1):e(d,-1)}),U(e,s),k()}var M$e=B(`<span role="none" class="position svelte-57h597"> </span>`),N$e=B(`<span role="none" class="type svelte-57h597"> </span>`),P$e=B(`<!> <!>`,1),F$e=B(`<span role="none" class="label svelte-57h597"><!></span>`),I$e=B(`<div role="none" class="header svelte-57h597"><div role="none" class="start svelte-57h597"><!></div> <div role="none" class="center svelte-57h597"><!></div> <div role="none" class="end svelte-57h597"><!></div></div>`),L$e={hash:`svelte-57h597`,code:`.header.svelte-57h597 {display:flex;align-items:center;gap:8px;height:28px;background-color:var(--sui-secondary-border-color);& > div:where(.svelte-57h597) {display:flex;align-items:center;}.start:where(.svelte-57h597) {justify-content:flex-start;width:40%;}.center:where(.svelte-57h597) {justify-content:center;width:20%;}.end:where(.svelte-57h597) {justify-content:flex-end;width:40%;}
/* Make the expander button full-width when there is no other content */&:has(.center:where(.svelte-57h597):empty):has(.end:where(.svelte-57h597):empty) {.start:where(.svelte-57h597) {width:100%;button {justify-content:flex-start;padding:var(--sui-button-small-padding);width:-moz-available;width:-webkit-fill-available;width:stretch;aspect-ratio:auto;}}.center:where(.svelte-57h597),
.end:where(.svelte-57h597) {display:none;}}.label:where(.svelte-57h597) {display:flex;align-items:center;gap:8px;padding:var(--sui-button-small-padding);}.position:where(.svelte-57h597) {min-width:1.5em;font-size:var(--sui-font-size-small);font-weight:var(--sui-font-weight-bold);font-variant-numeric:tabular-nums;color:var(--sui-secondary-foreground-color);text-align:center;}.type:where(.svelte-57h597) {font-size:var(--sui-font-size-small);font-weight:var(--sui-font-weight-bold);color:var(--sui-secondary-foreground-color);}}`};function T6(e,t){O(t,!0),K(e,L$e);let n=e=>{var t=P$e(),n=P(t),a=e=>{var t=M$e(),n=F(t,!0);R(()=>W(n,i())),U(e,t)};G(n,e=>{i()!==void 0&&e(a)});var o=I(n,2),s=e=>{var t=N$e(),n=F(t,!0);R(()=>W(n,r())),U(e,t)};G(o,e=>{r()&&e(s)}),U(e,t)},r=J(t,`label`,3,``),i=J(t,`position`,3,void 0),a=J(t,`expanded`,15),o=J(t,`expandable`,3,!0),s=J(t,`centerContent`,3,void 0),c=J(t,`endContent`,3,void 0);var l=I$e(),u=N(l),d=N(u),f=e=>{{let o=e=>{xZe(e,{get expanded(){return a()}})},s=A(()=>!r()&&i()===void 0),c=A(()=>a()?Y(`collapse`):Y(`expand`));Xx(e,{size:`small`,get iconic(){return z(s)},get"aria-label"(){return z(c)},get"aria-expanded"(){return a()},get"aria-controls"(){return t.controlId},onclick:()=>{a(!a()),t.toggleExpanded?.()},startIcon:o,children:(e,t)=>{n(e)},$$slots:{startIcon:!0,default:!0}})}},p=e=>{var t=F$e(),r=N(t);n(r),D(t),U(e,t)};G(d,e=>{o()?e(f):e(p,-1)}),D(u);var m=I(u,2);xo(N(m),()=>s()??Cr),D(m);var h=I(m,2);xo(N(h),()=>c()??Cr),D(h),D(l),U(e,l),k()}var R$e=B(`<span role="none"> </span> <!> <!>`,1);function z$e(e,t){O(t,!0);let n=J(t,`disabled`,3,!1);bx(e,{status:`info`,children:(e,r)=>{var i=R$e(),a=P(i),o=F(a,!0),s=I(a,2);yS(s,{flex:!0});var c=I(s,2);{let e=A(()=>Y(`restore`));Xx(c,{get id(){return t.id},variant:`secondary`,size:`small`,get label(){return z(e)},get disabled(){return n()},get onclick(){return t.onRestore}})}R(e=>W(o,e),[()=>Y(`item_removed`)]),U(e,i)},$$slots:{default:!0}}),k()}var E6=new WeakMap,B$e=e=>{let t=E6.get(e);E6.delete(e),Object.entries(t).forEach(([t,n])=>{e.expanderStates._[t]=n})},V$e=({draft:e,key:t,locale:n,collapsed:r=!1})=>{let i=E6.get(e)?.[t]??e.expanderStates?._[t];if(i!==void 0)return i;if(r===`auto`){let r=kK(e,n),i=`${t.replace(/#$/,``)}.`;return!rm(r,i).some(e=>!e.slice(i.length).includes(`.`)&&!!r[e])}return!r},D6=(e,t)=>e?.expanderStates?._[t]??!0,O6=({draft:e,stateMap:t})=>{let n=e.expanderStates?._;if(!n)return;let r=E6.get(e),i=Object.entries(t).filter(([e,t])=>(r?.[e]??n[e])!==t);i.length&&(r||(r={},E6.set(e,r),queueMicrotask(()=>B$e(e))),Object.assign(r,Object.fromEntries(i)))},H$e=({collectionName:e,fileName:t,valueMap:n,keyPath:r,isIndexFile:i=!1})=>{let a=new Set,o={collectionName:e,fileName:t,valueMap:n,isIndexFile:i};return r.split(`.`).forEach((e,t,n)=>{let r=n.slice(0,t+1).join(`.`),i=lh({...o,keyPath:r}),s=im.test(r);if(i?.widget===`object`)s&&a.add(r),a.add(`${r}#`);else if(i?.widget===`list`)a.add(s?r:`${r}#`);else if(t>0){let e=n.slice(0,t).join(`.`),i=lh({...o,keyPath:e});i?.widget===`object`&&`fields`in i&&a.add(`${e}.${i.name}#`),i?.widget===`list`&&(`field`in i||`types`in i)&&a.add(r)}}),[...a]},U$e=({draft:e})=>{let{collectionName:t,fileName:n,currentValues:r,validities:i,isIndexFile:a}=e,o={};Object.entries(i??{}).forEach(([e,i])=>{Object.entries(i).forEach(([i,{valid:s}])=>{s||H$e({collectionName:t,fileName:n,valueMap:r[e],keyPath:i,isIndexFile:a}).forEach(e=>{o[e]=!0})})}),O6({draft:e,stateMap:o})},k6=({locale:e,keyPath:t})=>{window.postMessage({type:`highlight-editor-field`,payload:{locale:e,keyPath:t}},window.location.origin)},W$e=(e,t)=>{let n=t.split(`.`);for(let t=n.length-1;t>=0;--t){let r=n.slice(0,t).join(`.`),i=e.querySelectorAll(r?`.field[data-key-path^="${CSS.escape(`${r}.`)}"]`:`.field[data-key-path]`);if(i.length)return i[i.length-1];let a=r?e.querySelector(`.field[data-key-path="${CSS.escape(r)}"]`):null;if(a)return a}},G$e=async({locale:e,keyPath:t,maxAttempts:n=20,interval:r=100})=>{let i=CSS.escape(t),a=`.field:is([data-key-path="${i}"], [data-validation-key="${i}"])`;await new Promise(e=>{window.requestAnimationFrame(e)});let o=document.querySelector(`.content-editor .pane[data-mode="edit"][data-locale="${CSS.escape(e)}"]`);if(!o)return null;let s;for(let e=0;e<n;e+=1){let e=o.querySelector(a);if(e||!o.isConnected)return e;let n=W$e(o,t);if(!n||n===s)return null;s=n,n.scrollIntoView({block:`center`}),await Iu(r)}return o.querySelector(a)},K$e=async({draft:e,locale:t,keyPath:n,isOutdated:r=()=>!1})=>{let{collectionName:i,fileName:a,currentValues:o,isIndexFile:s}=e,c=H$e({collectionName:i,fileName:a,valueMap:o[t]??{},keyPath:n,isIndexFile:s});O6({draft:e,stateMap:Object.fromEntries(c.map(e=>[e,!0]))});let l=await G$e({locale:t,keyPath:n});if(!l||r())return;typeof l.scrollIntoViewIfNeeded==`function`?l.scrollIntoViewIfNeeded():l.scrollIntoView();let u=l.querySelector(`.field-wrapper`);(u?.querySelector(`[contenteditable="true"], [tabindex="0"]`)??u?.querySelector(`input, textarea, button`))?.focus()},q$e=({event:e,locale:t})=>{let n=e.type===`keydown`;if(e.defaultPrevented||n&&e.key!==`Enter`)return;let{target:r}=e,i=(n?r:r.closest?.(`[data-key-path]`))?.getAttribute(`data-key-path`);i&&k6({locale:t,keyPath:i})},J$e=({scrollTop:e,scrollHeight:t,clientHeight:n,targetScrollHeight:r,targetClientHeight:i})=>{let a=t-n;return a<=0?0:Math.max(0,r-i)*(e/a)},Y$e=({y:e,top:t,height:n,targetTop:r,targetHeight:i})=>{let a=(e-t)/n;if(!(a<0||a>1))return r+i*a},X$e=(e,t)=>{let n=t.split(`.`);for(let t=n.length;t>0;--t){let r=CSS.escape(n.slice(0,t).join(`.`)),i=e.querySelector(`[data-key-path="${r}"]`);if(i?.getClientRects().length)return i;let a=[...e.querySelectorAll(`[data-lazy-key-path="${r}"]`)].findLast(e=>e.childElementCount&&e.getClientRects().length&&!(i&&e.contains(i)));if(a)return a}},Z$e=async({container:e,keyPath:t,scrollTo:n,isOutdated:r=()=>!1,maxAttempts:i=20,interval:a=100})=>{let o;for(let s=0;s<i;s+=1){let i=X$e(e,t);if(i?.dataset.lazyKeyPath===void 0||!n(i)&&i===o)return i;if(o=i,await Iu(a),r())return}return X$e(e,t)},Q$e=({viewTop:e,viewHeight:t,scrollTop:n,top:r,height:i,always:a=!1})=>{let o=r-e,s=e+t,c=r+i;if(i>t)return!a&&c>e&&r<s?void 0:Math.max(0,n+o);if(!(!a&&r>=e&&c<=s))return Math.max(0,n+o-(t-i)/2)},$$e=e=>e?Number.parseFloat(getComputedStyle(e).top)+e.getBoundingClientRect().height:0,e1e=async({item:e,list:t,isOutdated:n=()=>!1,maxAttempts:r=5,interval:i=100})=>{let a=e.firstElementChild,o=()=>e.getBoundingClientRect().top-t.getBoundingClientRect().top;for(let t=0;t<r;t+=1){e.scrollIntoView();let t=o();if(await Iu(i),n()||o()===t||a.getBoundingClientRect().bottom<=window.innerHeight)return}},t1e=async e=>{let t=await QX(e);return new File([t],e.name,{type:t.type})},n1e=({files:e,findExisting:t})=>{let n=new Map;return(r,i,a)=>{let o=n.get(r);return o||(o=(async()=>{let n=await i();if(!n)return;let r=await t?.(n,a);if(r)return r;let o=await KX(n);return e[o]={file:n,folder:a,replace:!1},o})(),n.set(r,o)),o}},r1e=(e,t)=>t?G$(e,t):[e],i1e=async({value:e,format:t,rewrite:n})=>{let r=new Map(await Promise.all(r1e(e,t).map(async e=>[e,await n(e)])));return t?Hze(e,r,t):r.get(e)},a1e=({container:e,key:t,fieldConfig:n,typedKeyPath:r,callback:i})=>{let a=e[t],{widget:o=`string`}=n,s=Rd.includes(o);if(s||Ld.includes(o)){(Array.isArray(a)&&!s?a.map((e,t)=>[a,t]):[[e,t]]).forEach(([e,t])=>{let a=e[t];typeof a==`string`&&a&&i({value:a,format:s?T$(n):void 0,typedKeyPath:r,set:n=>{e[t]=n}})});return}let{types:c,typeKey:l=`type`}=n;_h(a,n,(e,t,n)=>{X(e)&&A6({obj:e,fields:t,typedKeyPath:GG(n===void 0?r:`${r}.*`,c?e[l]:void 0),callback:i})},(e,t,n)=>{a1e({container:a,key:n,fieldConfig:t,typedKeyPath:`${r}.*.${t.name}`,callback:i})})},A6=({obj:e,fields:t,typedKeyPath:n,callback:r})=>{t.forEach(t=>{let{name:i}=t;i in e&&a1e({container:e,key:i,fieldConfig:t,typedKeyPath:`${n}.${i}`,callback:r})})},o1e=e=>wQ(e)&&!/^[a-z][a-z\d+.-]*:/i.test(e),s1e=(e,t)=>{let{field:n}=e,{fields:r}=e,{types:i}=e;return i?hh(i,t):r??[n]},c1e=1,j6=e=>(Array.isArray(e)?e.forEach(j6):X(e)&&Object.keys(e).forEach(t=>{jm(t)?delete e[t]:j6(e[t])}),e),l1e=({draft:e,valueStoreKey:t=`currentValues`,fieldConfig:n,keyPath:r,typedKeyPath:i,index:a,locale:o,pairedItems:s=!1,componentName:c})=>{let{originalEntry:l,collectionName:u,fileName:d}=e,{hasSingleSubField:f}=$G(n),{field:p}=n,{typeKey:m=`type`}=n,h=s?Object.keys(e[t]):[o],g={format:`sveltia-cms/list-item`,version:c1e,id:crypto.randomUUID(),copiedAt:Date.now(),locale:o,values:{},assets:{}},_=new Map;return h.forEach(o=>{let[s]=kXe(e[t][o],r);if(!(a in s))return;let h=j6(structuredClone(s[a])),v=f?{[p.name]:h}:h,y={};!f&&`types`in n&&(g.type??=v[m],delete v[m]),A6({obj:v,fields:s1e(n,g.type)??[],typedKeyPath:GG(`${i}.*`,g.type),callback:({value:t,format:n,typedKeyPath:r})=>{r1e(t,n).forEach(t=>{if(t.startsWith(`blob:`)){let n=e.files[t]?.file;n&&_.set(t,n);return}if(!o1e(t)||t in y)return;let n=TQ({value:t,entry:l,collectionName:u,fileName:d,componentName:c,typedKeyPath:r,locale:o});n&&(y[t]=n.path)})}}),g.values[o]=v,g.assets[o]=y}),{data:g,files:_}},u1e=e=>{let t;try{t=JSON.parse(e,(e,t)=>e===`__proto__`||jm(e)?void 0:t)}catch{return}if(!(!X(t)||t.format!==`sveltia-cms/list-item`||t.version!==c1e||typeof t.locale!=`string`||t.copiedAt!==void 0&&typeof t.copiedAt!=`number`||t.type!==void 0&&typeof t.type!=`string`||!X(t.values)||!X(t.values[t.locale])||!Object.values(t.values).every(X)||t.assets!==void 0&&!(X(t.assets)&&Object.values(t.assets).every(X))))return{assets:{},...t}},d1e=e=>typeof e==`string`||typeof e==`number`,f1e=(e,t)=>{let n=HU(e);return Number.isNaN(n)?void 0:GU({inputValue:n,fieldConfig:t})},p1e=(e,t)=>{let{widget:n=`string`}=t;if(e===null)return null;if(n===`boolean`)return typeof e==`boolean`?e:void 0;if(n===`code`)return typeof e==`string`||X(e)?e:void 0;if(n===`keyvalue`)return X(e)?e:void 0;if(!Fd.includes(n)&&!zd.includes(n))return e;if(d1e(e))return n===`number`?f1e(e,t):Id.includes(n)||Ld.includes(n)?String(e):e},m1e=(e,t,n)=>{let{widget:r=`string`}=t;if(r===`object`)return X(e)?h1e(e,t,n):void 0;if(r===`list`)return Array.isArray(e)?g1e(e,t,n):void 0;if(oh(t)&&e!==null){let n=(Array.isArray(e)?e:[e]).map(e=>p1e(e,t));return n.includes(void 0)?void 0:n}return p1e(zd.includes(r)&&Array.isArray(e)&&e.length===1?e[0]:e,t)},M6=(e,t,n)=>{let{locale:r,defaultLocale:i,stats:a}=n,o={},s=0;return t.forEach(t=>{let{name:a}=t;if(a in e){let r=m1e(e[a],t,n);if(r!==void 0){o[a]=r,s+=1;return}}let c=xm(H3({fields:[t],locale:r,defaultLocale:i}));a in c&&(o[a]=c[a])}),a.dropped+=Object.keys(e).length-s,{value:o,matched:s}},h1e=(e,t,n)=>{let{fields:r,types:i,typeKey:a=`type`}=t;if(!i)return M6(e,r??[],n).value;let{[a]:o,...s}=e,c=hh(i,o);if(c)return{...M6(s,c,n).value,[a]:o}},g1e=(e,t,n)=>{let{field:r,fields:i,types:a}=t;return r?e.flatMap(e=>{let t=m1e(e,r,n);return t===void 0?(n.stats.dropped+=1,[]):[t]}):i||a?e.flatMap(e=>{let r=X(e)?h1e(e,t,n):void 0;return r===void 0?(n.stats.dropped+=1,[]):[r]}):e.flatMap(e=>d1e(e)?[String(e)]:(n.stats.dropped+=1,[]))},_1e=async({draft:e,valueStoreKey:t=`currentValues`,copied:{data:n,files:r},fieldConfig:i,typedKeyPath:a,componentName:o,inEditorComponent:s=!1})=>{let{originalEntry:c,collectionName:l,fileName:u,isIndexFile:d}=e,{hasSingleSubField:f,hasVariableTypes:p}=$G(i),{field:m}=i,h=p?n.type:void 0,g=s1e(i,h);if(!g)return;let _={dropped:0},v=new Set,y={},b=[],x=n1e({files:e.files,findExisting:(t,n)=>T3({draft:e,file:t,folder:n})}),S=(e,t,n)=>x(e,t,n).catch(()=>void 0),C=async({src:t,assetPaths:n,fieldTypedKeyPath:i,locale:a})=>{let s=t.startsWith(`blob:`),f=n[t];if(s&&t in e.files||!s&&!f)return;let p=()=>w3({collectionName:l,fileName:u,componentName:o,typedKeyPath:i,isIndexFile:d});if(s){let e=r.get(t),n=e?p():void 0,i=e&&n?await S(t,async()=>e,n):void 0;return i||v.add(t),i}let m=_Q(f);if(!m){v.add(f);return}let h=fZ(m,{pathOnly:!0,allowSpecial:!0,entry:c,locale:a});if(h!==void 0)return h===t?void 0:h;let g=p(),_=g?await S(f,()=>t1e(m),g):void 0;return _||v.add(f),_},w=[];if(Object.keys(e[t]).every((t,r)=>{let i=t in n.values?t:n.locale,a=structuredClone(n.values[i]),o={locale:t,defaultLocale:s?t:e.defaultLocale,stats:r?{dropped:0}:_};f&&!(m.name in a)&&Object.keys(a).length===1&&(a={[m.name]:Object.values(a)[0]});let{value:c,matched:l}=M6(a,g,o);return Object.keys(a).length&&!l?!1:(w.push({locale:t,value:c,assetPaths:n.assets[i]??{}}),!0)}))return w.forEach(({locale:t,value:n,assetPaths:r})=>{A6({obj:n,fields:g,typedKeyPath:GG(`${a}.*`,h),callback:({value:n,format:i,typedKeyPath:a,set:o})=>{b.push((async()=>{let s=await i1e({value:n,format:i,rewrite:e=>C({src:e,assetPaths:r,fieldTypedKeyPath:a,locale:t})});s===void 0?!i&&n.startsWith(`blob:`)&&!(n in e.files)&&o(``):o(s)})())}}),y[t]=f?n[m.name]:n}),await Promise.all(b),{type:h,items:y,droppedCount:_.dropped,missingFileCount:v.size}},N6,v1e=async e=>{N6=l1e(e);try{return await navigator.clipboard.writeText(JSON.stringify(N6.data)),!0}catch{return!1}},y1e=async()=>{let e;try{e=u1e(await navigator.clipboard.readText())}catch{}return e&&e.id!==N6?.data.id&&!(N6&&(e.copiedAt??0)<N6.data.copiedAt)?{data:e,files:new Map}:N6},P6=(e,t,n)=>{let{widget:r=`string`}=t;if(r!==`object`&&r!==`list`){if(!LJe.includes(r))return e;let i=Nl(Nl(n.renewedValues,t,()=>new Map),JSON.stringify(e),()=>L3({...n,fieldConfig:t,keyPath:t.name,value:e}));return typeof i==`object`&&i?structuredClone(i):i}return _h(e,t,(e,t)=>(X(e)&&b1e(e,t,n),e),(e,t)=>P6(e,t,n))},b1e=(e,t,n)=>{t.forEach(t=>{let{name:r}=t;r in e&&(e[r]=P6(e[r],t,n))})},F6=e=>{Array.isArray(e)?e.forEach(F6):X(e)&&(delete e.__sc_item_original_key_path,Object.values(e).forEach(F6))},x1e=({draft:e,keyPath:t,itemCount:n,locale:r,collapsed:i,minimizeCollapsed:a=!1})=>({[`${t}#`]:a===`auto`?!n:!a,...Object.fromEntries(Array.from({length:n},(n,a)=>{let o=`${t}.${a}`;return[o,V$e({draft:e,key:o,locale:r,collapsed:i})]}))}),S1e=({valueList:e,keyPath:t,dupIndex:n,sourceItem:r,subFields:i,hasSingleSubField:a,field:o,type:s,types:c,typeKey:l,renewedValues:u=new Map,locale:d,defaultLocale:f})=>{let p=(()=>{let t={renewedValues:u,locale:d,defaultLocale:f},s=typeof n==`number`&&n in e;if(r!==void 0||s){let u=structuredClone(s?e[n]:r);return F6(u),a&&o?P6(u,o,t):(X(u)&&b1e(u,gh({value:u,fields:c?void 0:i,types:c,typeKey:l}),t),u)}let p=xm(H3({fields:i,locale:d,defaultLocale:f}));return a&&o?p[o.name]:p})();return s&&(p[l]=s),a||(p.__sc_item_id=crypto.randomUUID(),iK(e,t)),p},C1e=({valueList:e,expanderStateList:t},{index:n,item:r,replace:i=!1})=>{e.splice(n,+!!i,r),t.splice(n,+!!i,!0)},w1e=({valueList:e,expanderStateList:t},{index:n,keyPath:r,tagItems:i})=>{i&&iK(e,r,{assignIds:!0});let[a]=e.splice(n,1);return t.splice(n,1),a},T1e=({valueList:e,expanderStateList:t},{index:n,item:r,expanded:i,keyPath:a,tagItems:o})=>{o&&iK(e,a),e.splice(n,0,r),t.splice(n,0,i)},E1e=({valueList:e,expanderStateList:t},{from:n,to:r,keyPath:i,tagItems:a})=>{a&&iK(e,i,{assignIds:!0}),e.splice(r,0,...e.splice(n,1)),t.splice(r,0,...t.splice(n,1))},I6=(e,t)=>{i0.current={id:i0.current.id+1,show:!0,status:e,message:t}},D1e=({droppedCount:e,missingFileCount:t})=>{if(t)return{status:`warning`,message:Y(`list_item_pasted_without_files`,{values:{count:t}})};if(e)return{status:`info`,message:Y(`list_item_pasted_without_values`,{values:{count:e}})}},O1e=(e,t)=>{let{index:n}=t,r=e.findIndex(e=>e.index>n),i=e.map(e=>e.index>n?{...e,index:e.index-1}:e);return r===-1?[...i,t]:[...i.slice(0,r),t,...i.slice(r)]},k1e=(e,t)=>e.map(e=>e.index>t?{...e,index:e.index+1}:e),A1e=(e,t)=>{let n=e.findIndex(e=>e.id===t);return e.filter((e,t)=>t!==n).map((e,t)=>n!==-1&&t>=n?{...e,index:e.index+1}:e)},j1e=(e,t,n)=>{let r=`${t}.${n}`;return Object.entries(e).filter(([e])=>e.startsWith(r)&&/^[.#]/.test(e.slice(r.length))).map(([e,t])=>[e.slice(r.length),t])},M1e=({entryDraft:e,fieldId:t,valueStoreKey:n,componentName:r,inEditorComponent:i,removedItems:a,resolveType:o,getListState:s,getItemCount:c,getListElement:l,getTopToolbar:u})=>{let d=j(void 0),f,p=t=>(...n)=>{let r=e.current;return r?t(r,...n):void 0},m=(e,t)=>{let{locale:r,keyPath:i,fieldConfig:o,pairedItems:c}=s();r6({draft:e,locale:r,i18n:o.i18n,pairedItems:c,valueStoreKey:n,keyPath:i,manipulate:e=>{t(e),a.remember(e.valueList,e.locale)}})},h=()=>{let{keyPath:e,fieldConfig:t}=s();return{keyPath:e,tagItems:!$G(t).hasSingleSubField}},g=e=>l()?.children[e]?.querySelector(`.item`),_=p((e,t)=>{O6({draft:e,stateMap:t})}),v=p(e=>{let{locale:t,keyPath:n,fieldConfig:r}=s(),{collapsed:i,minimize_collapsed:a=!1}=r;O6({draft:e,stateMap:x1e({draft:e,keyPath:n,itemCount:c(),locale:t,collapsed:i,minimizeCollapsed:a})})}),y=async e=>{await Iu(50),M(d,void 0);let t=g(e);if(!t)return;let n=$$e(u());f=t,t.style.scrollMarginTop=`${n}px`,t.querySelector(`button`)?.focus({preventScroll:!0}),await e1e({item:t,list:l(),isOutdated:()=>t!==f})},b=p(async(e,{index:t,dupIndex:n,type:r,sourceItems:l,replace:u=!1}={})=>{let{keyPath:f,fieldConfig:p}=s(),{hasSingleSubField:h}=$G(p),{add_to_top:g=!1}=p,{field:_}=p,{types:v,typeKey:b=`type`}=p,x=t??(g?0:c()),S=new Map;M(d,x,!0),u||a.shift(x),m(e,({valueList:t,expanderStateList:a,locale:s})=>{let{subFields:c}=o(r),d=S1e({valueList:t,keyPath:f,dupIndex:n,sourceItem:l?.[s],subFields:c,hasSingleSubField:h,field:_,type:r,types:v,typeKey:b,renewedValues:S,locale:s,defaultLocale:i?s:e.defaultLocale});C1e({valueList:t,expanderStateList:a},{index:x,item:d,replace:u})}),O6({draft:e,stateMap:{[`${f}#`]:!0}}),await y(x)});return{get addedItemIndex(){return z(d)},updateExpanderStates:_,initializeExpanderStates:v,addItem:b,copyItem:p(async(e,t)=>{let{locale:i,keyPath:a,typedKeyPath:o,fieldConfig:c,pairedItems:l}=s();await v1e({draft:e,valueStoreKey:n,fieldConfig:c,keyPath:a,typedKeyPath:o,index:t,locale:i,pairedItems:l,componentName:r}),I6(`success`,Y(`list_item_copied`))}),pasteItem:p(async(t,a,{replace:o=!1}={})=>{let c=await y1e();if(!c){I6(`info`,Y(`no_list_item_to_paste`));return}let{typedKeyPath:l,fieldConfig:u}=s(),d=await _1e({draft:t,valueStoreKey:n,copied:c,fieldConfig:u,typedKeyPath:l,componentName:r,inEditorComponent:i});if(e.current!==t)return;if(!d){I6(`error`,Y(`list_item_not_compatible`));return}let{type:f,items:p,droppedCount:m,missingFileCount:h}=d;await b({index:a,type:f,sourceItems:p,replace:o});let g=D1e({droppedCount:m,missingFileCount:h});g&&I6(g.status,g.message)}),removeItem:p(async(e,n)=>{let r=h(),{keyPath:i}=r,o=crypto.randomUUID(),s={};a.add({id:o,index:n,values:s,expanded:D6(e,`${i}.${n}`),nestedExpanderStates:j1e(e.expanderStates._,i,n)}),m(e,({valueList:e,expanderStateList:t,locale:i})=>{let a=w1e({valueList:e,expanderStateList:t},{...r,index:n});a!==void 0&&(s[i]=a)}),await Iu(50),document.getElementById(`list-${t}-restore-${o}`)?.focus()}),restoreItem:p(async(e,{id:t,index:n,values:r,expanded:i,nestedExpanderStates:o})=>{let s=h(),{keyPath:c}=s;a.drop(t),m(e,({valueList:e,expanderStateList:t,locale:a})=>{a in r&&T1e({valueList:e,expanderStateList:t},{...s,index:n,item:r[a],expanded:i})}),O6({draft:e,stateMap:Object.fromEntries(o.map(([e,t])=>[`${c}.${n}${e}`,t]))}),await Iu(50),g(n)?.querySelector(`button`)?.focus()}),moveItem:p((e,t,n)=>{let r=h();m(e,({valueList:e,expanderStateList:i})=>{E1e({valueList:e,expanderStateList:i},{...r,from:t,to:n})})})}},N1e=({getLocale:e,getItemKeys:t})=>{let n=j([]),r=j(void 0),i=A(()=>z(r)?.locale===e()&&(0,Qc.default)(z(r).keys,t())?z(n):[]),a=A(()=>Map.groupBy(z(i),({index:e})=>e));return{get shown(){return z(i)},get byIndex(){return z(a)},remember:(t,n)=>{let i=e();n===i&&M(r,{locale:i,keys:t.map((e,n)=>rK(t,n))})},add:e=>{M(n,O1e(z(i),e))},drop:e=>{M(n,A1e(z(i),e))},shift:e=>{M(n,k1e(z(i),e))}}},P1e=({thumbnailFieldName:e,keyPath:t,typedKeyPath:n,hasSingleSubField:r=!1,collectionName:i,fileName:a,componentName:o,valueMap:s,isIndexFile:c=!1,entry:l,files:u,locale:d})=>{if(!e)return;let[f,...p]=nf(e).split(`.`),m={collectionName:i,fileName:a,componentName:o,valueMap:s,isIndexFile:c};if(r&&lh({...m,keyPath:t})?.name!==f)return;let h=[t,...r?p:[f,...p]].filter(Boolean).join(`.`),g=[n,f,...p].filter(Boolean).join(`.`),_=lh({...m,keyPath:h}),{widget:v=`string`}=_??{};if(!_||!Ld.includes(v))return;let y=_,b=s[Hf(y)?`${h}.0`:h];if(typeof b!=`string`||!b)return;let x=g$({value:b,entry:l,collectionName:i,fileName:a,componentName:o,fieldConfig:y,typedKeyPath:g,locale:d});if(!x)return;let{asset:S,url:C}=x;return S?bp(S)?x:void 0:(C.startsWith(`blob:`)?wp(u?.[C]?.file.type??``):Tp(C))===`image`?x:void 0},F1e=({draft:e,typedKeyPath:t,type:n,...r})=>P1e({...r,typedKeyPath:GG(t,n),collectionName:e?.collectionName??``,fileName:e?.fileName,isIndexFile:!!e?.isIndexFile,entry:e?.originalEntry,files:e?.files}),I1e=B(`<div role="none" hidden=""> </div>`),L1e=B(`<!> <!> <!>`,1),R1e=B(`<div><!> <div role="none" class="item-body"><!></div></div>`),z1e=B(`<div role="none" class="item-wrapper svelte-n5zzp2"><!> <!></div>`),B1e=B(`<div role="none" class="removed-item-list svelte-n5zzp2"><!></div>`),V1e=B(`<!> <!> <div></div> <!> <!>`,1),H1e={hash:`svelte-n5zzp2`,code:`.item-list.svelte-n5zzp2 {display:flex;flex-direction:column;gap:16px;&.collapsed {display:none;}}.item-wrapper.svelte-n5zzp2,
.removed-item-list.svelte-n5zzp2 {display:flex;flex-direction:column;gap:16px;}.removed-item-list.svelte-n5zzp2 {margin-block-start:16px;}.item.svelte-n5zzp2 {flex:none;position:relative;border-width:2px;border-color:var(--sui-secondary-border-color);border-radius:var(--sui-control-medium-border-radius);background-color:var(--sui-primary-background-color); /* for dragging opacity */
/* Like the field menus, the buttons at the end of the header (Move Up/Down, options and
remove) are shown on hover, and kept visible while a keyboard user is in the item, so the
focused one isn’t invisible, or while the options menu is open */
@media (hover: hover) {&:not(:hover, :focus-within) > .header > .end button:not([aria-expanded='true']) {opacity:0;}
}}`};function U1e(e,t){let n=mo();O(t,!0),K(e,H1e);let r=(e,t=Cr)=>{var r=H();No(P(r),17,()=>ke.byIndex.get(t())??[],e=>e.id,(e,t)=>{{let r=A(()=>z(fe)||z(Ce));z$e(e,{get id(){return`list-${n}-restore-${z(t).id??``}`},get disabled(){return z(r)},onRestore:()=>ze(z(t))})}}),U(e,r)},i=LK(),{valueStoreKey:a=`currentValues`,parentComponentNames:o=[]}=UK(),s=o.at(-1),c=J(t,`required`,3,!0),l=J(t,`readonly`,3,!1),u=A(()=>t.fieldConfig.name),d=A(()=>t.fieldConfig.i18n),f=A(()=>Tr(t.fieldConfig.allow_add,!0)),p=A(()=>Tr(t.fieldConfig.allow_remove,!0)),m=A(()=>Tr(t.fieldConfig.allow_duplicate,!0)),h=A(()=>Tr(t.fieldConfig.allow_reorder,!0)),g=A(()=>t.fieldConfig.summary),_=A(()=>t.fieldConfig.thumbnail),v=A(()=>Tr(t.fieldConfig.max,1/0)),y=A(()=>Tr(t.fieldConfig.add_to_top,!1)),b=A(()=>_G({config:t.fieldConfig,option:`label`,locale:t.locale})),x=A(()=>_G({config:t.fieldConfig,option:`label_singular`,locale:t.locale})),S=A(()=>t.fieldConfig.field),C=A(()=>t.fieldConfig.fields),w=A(()=>t.fieldConfig.types),T=A(()=>Tr(t.fieldConfig.typeKey,`type`)),ee=A(()=>$G(t.fieldConfig)),E=A(()=>z(ee).hasSingleSubField),te=A(()=>z(ee).hasVariableTypes),ne=A(()=>z(w)??[]),re=A(()=>z(C)??(z(S)?[z(S)]:[])),ie=A(()=>z(E)?gYe(z(S)):void 0),ae=e=>WG({types:z(te)?z(ne):void 0,fields:z(re),summary:z(g),type:e}),oe=A(()=>!!i.current?.isIndexFile),se=A(()=>i.current?.collectionName??``),ce=A(()=>i.current?.fileName),le=A(()=>i.current?.defaultLocale),ue=HK(a),de=A(()=>!ue&&eK(t.fieldConfig)),fe=A(()=>l()||t.locale!==z(le)&&(z(d)===`duplicate`||z(de))),pe=A(()=>jK(i.current,t.locale,t.keyPath,a)),me=A(()=>!ue&&t.locale!==z(le)&&zW({fieldConfig:t.fieldConfig,getFieldArgs:{collectionName:z(se),fileName:z(ce),isIndexFile:z(oe),keyPath:t.keyPath,valueMap:z(pe)}})),he=A(()=>`${t.keyPath}#`),ge={},_e=A(()=>Dm(ge,z(pe),t.keyPath)??[]),ve=A(()=>nK({fieldConfig:t.fieldConfig,itemCount:z(_e).length})),ye=A(()=>z(p)&&!(z(ve)&&c()&&!z(te))),be=A(()=>z(ve)||D6(i.current,z(he))),xe=A(()=>z(_e).map((e,n)=>{let r=`${t.keyPath}.${n}`;return[r,D6(i.current,r)]})),Se=il(()=>z(_e).map((e,t)=>rK(z(_e),t))),Ce=A(()=>z(_e).length>=z(v)),we=A(()=>z(te)?z(ne).flatMap(({fields:e=[]})=>e):z(re)),Te=A(()=>t.locale===z(le)||ue||z(me)||z(we).some(({i18n:e})=>NW(e))),Ee=A(()=>z(fe)||!z(Te)),De=A(()=>z(h)&&!z(ve)),Oe=A(()=>z(fe)||z(_e).length<2),ke=N1e({getLocale:()=>t.locale,getItemKeys:()=>Se.current}),Ae=j(void 0),je=j(void 0),Me=M1e({entryDraft:i,fieldId:n,valueStoreKey:a,componentName:s,inEditorComponent:ue,removedItems:ke,resolveType:ae,getListState:()=>({locale:t.locale,keyPath:t.keyPath,typedKeyPath:t.typedKeyPath,fieldConfig:t.fieldConfig,pairedItems:z(de)}),getItemCount:()=>z(_e).length,getListElement:()=>z(Ae),getTopToolbar:()=>z(je)}),{updateExpanderStates:Ne,initializeExpanderStates:Pe,addItem:Fe,copyItem:Ie,pasteItem:Le,removeItem:Re,restoreItem:ze,moveItem:Be}=Me,Ve=e=>jK(i.current,t.locale,`${t.keyPath}.${e}`,a),He=(e,n,r=z(pe))=>Rje({collectionName:z(se),fileName:z(ce),keyPath:t.keyPath,valueMap:r,locale:t.locale,summaryTemplate:n,hasSingleSubField:z(E),index:e,isIndexFile:z(oe)}),Ue=i6({getItemCount:()=>z(_e).length,getListElement:()=>z(Ae),onMove:Be,getItemData:e=>He(e,ae(z(te)?z(_e)[e][z(T)]:void 0).summaryTemplate),settle:()=>Iu(50),getItemRect:e=>e.lastElementChild.getBoundingClientRect()}),We=(e,n)=>F1e({draft:i.current,thumbnailFieldName:z(_),keyPath:`${t.keyPath}.${e}`,typedKeyPath:`${t.typedKeyPath}.*`,type:n,hasSingleSubField:z(E),componentName:s,valueMap:Ve(e),locale:t.locale}),eee=()=>{z(te)&&z(_e).forEach((e,n)=>{let r=e?.[z(T)];ae(r).unknownType&&UG({fieldType:`list`,keyPath:`${t.keyPath}.${n}`,type:r,typeKey:z(T),types:z(w)})})},Ge=A(()=>({fieldId:n,summaryId:t.summaryId,fieldConfig:t.fieldConfig,locale:t.locale,items:z(_e),fieldName:z(u),label:z(b),labelSingular:z(x),singleItem:z(ve),parentExpanded:z(be),parentExpandedKeyPath:z(he),itemExpanderStates:z(xe),allowAdd:z(f),addToTop:z(y),isAddDisabled:z(Ee),hasMaxItems:z(Ce),addItem:Fe,pasteItem:Le,updateExpanderStates:Ne}));So(()=>{Pe(),eee()});var Ke=V1e(),qe=P(Ke),Je=e=>{var n=I1e(),r=F(n,!0);R(()=>{q(n,`id`,t.summaryId),W(r,z(x)||z(b)||z(u))}),U(e,n)};G(qe,e=>{z(ve)&&e(Je)});var Ye=I(qe,2),Xe=e=>{DZe(e,ys({position:`top`},()=>z(Ge),{get element(){return z(je)},set element(e){M(je,e,!0)}}))};G(Ye,e=>{z(ve)&&z(_e).length||e(Xe)});var Ze=I(Ye,2);fs(Ze,()=>({role:`none`,id:`list-${n}-item-list`,class:`item-list`,...Ue.listProps,[ss]:{collapsed:!z(be)}}),void 0,void 0,void 0,`svelte-n5zzp2`),No(Ze,31,()=>Ue.displayOrder,e=>Se.current[e],(e,a,o)=>{let s=A(()=>z(_e)[z(a)]);var c=z1e(),u=N(c);r(u,()=>z(o));var d=I(u,2);{let e=A(()=>z(a)===Me.addedItemIndex);pH(d,{get eager(){return z(e)},children:(e,r)=>{let c=A(()=>`${t.keyPath}.${z(a)}`),u=A(()=>z(te)?z(s)[z(T)]:void 0),d=A(()=>ae(z(u))),h=A(()=>D6(i.current,z(c))),g=A(()=>Ue.reorderControlProps(z(a)));var _=R1e();fs(_,(e,t)=>({role:`group`,"aria-label":e,class:`item`,...t,[ss]:{"object-unknown-type":z(d).unknownType,"drag-placeholder":Ue.dragIndex===z(a)}}),[()=>z(ve)?void 0:Y(`list_item_position`,{values:{position:z(o)+1,count:z(_e).length}}),()=>Ue.itemProps(z(a),{ownEventsOnly:!0})],void 0,void 0,`svelte-n5zzp2`);var v=N(_);{let e=e=>{var t=H(),n=P(t),r=e=>{$3(e,ys({get index(){return z(a)},get itemCount(){return z(_e).length},get disabled(){return z(Oe)},icon:`drag_handle`,part:`handle`},()=>z(g)))};G(n,e=>{z(De)&&e(r)}),U(e,t)},r=e=>{var n=L1e(),r=P(n),i=e=>{$3(e,{get index(){return z(a)},get itemCount(){return z(_e).length},get disabled(){return z(Oe)},part:`buttons`,menu:!1,get onMove(){return z(g).onMove}})};G(r,e=>{z(De)&&e(i)});var o=I(r,2);{let e=A(()=>z(te)?z(ne):void 0),n=A(()=>z(De)&&!z(fe));bZe(o,{get index(){return z(a)},get locale(){return t.locale},get variableTypes(){return z(e)},get unknownType(){return z(d).unknownType},get allowAdd(){return z(f)},get allowRemove(){return z(p)},get allowDuplicate(){return z(m)},get hasMaxItems(){return z(Ce)},get isAddDisabled(){return z(Ee)},get itemCount(){return z(_e).length},get canReorder(){return z(n)},get moveItem(){return z(g).onMove},get copyItem(){return Ie},get pasteItem(){return Le},get addItem(){return Fe}})}var s=I(o,2),c=e=>{F0(e,{variant:`ghost`,get disabled(){return z(fe)},onclick:()=>Re(z(a))})};G(s,e=>{z(ye)&&e(c)}),U(e,n)},i=A(()=>z(te)&&z(d).typeConfig?vG({config:z(d).typeConfig,locale:t.locale}):``),s=A(()=>z(ve)?void 0:z(o)+1),l=A(()=>z(d).subFields.length>0);T6(v,{get label(){return z(i)},get position(){return z(s)},get controlId(){return`list-${n}-item-${z(a)??``}-body`},get expanded(){return z(h)},get expandable(){return z(l)},toggleExpanded:()=>Ne({[z(c)]:!z(h)}),centerContent:e,endContent:r,$$slots:{centerContent:!0,endContent:!0}})}var y=I(v,2);{let e=e=>{bYe(e,ys({get locale(){return t.locale},get keyPath(){return z(n)},get typedKeyPath(){return`${t.typedKeyPath??``}.*`},get currentValue(){return z(s)}},()=>({fieldConfig:z(S),preview:z(ie)})))},n=A(()=>`${t.keyPath}.${z(a)}`),r=A(()=>z(te)?z(s)[z(T)]:void 0),o=A(()=>ae(z(r))),c=A(()=>D6(i.current,z(n)));var b=N(y);{let i=A(()=>z(ie)?e:void 0);j$e(b,{get locale(){return t.locale},get subFields(){return z(o).subFields},getSubFieldProps:e=>({keyPath:z(E)?z(n):`${z(n)}.${e.name}`,typedKeyPath:KG({typedKeyPath:`${t.typedKeyPath}.*`,type:z(r),subFieldName:e.name}),context:z(E)?`single-subfield-list-field`:void 0}),get expanded(){return z(c)},get unknownType(){return z(o).unknownType},get typeConfig(){return z(o).typeConfig},get readonly(){return l()},getSummary:()=>He(z(a),z(o).summaryTemplate,Ve(z(a))),getThumbnail:()=>We(z(a),z(r)),get summaryContent(){return z(i)}})}D(y)}D(_),R(()=>q(y,`id`,`list-${n}-item-${z(a)??``}-body`)),U(e,_)},$$slots:{default:!0}})}D(c),Wo(c,()=>nC,()=>({duration:200})),U(e,c)}),D(Ze),gs(Ze,e=>M(Ae,e),()=>z(Ae));var Qe=I(Ze,2),$e=e=>{var t=B1e(),n=N(t);r(n,()=>z(_e).length),D(t),U(e,t)},tee=A(()=>ke.byIndex.has(z(_e).length)&&(z(be)||!z(_e).length));G(Qe,e=>{z(tee)&&e($e)});var et=I(Qe,2),tt=e=>{DZe(e,ys({position:`bottom`},()=>z(Ge)))};G(et,e=>{z(f)&&!z(y)&&z(_e).length&&z(be)&&!z(Ce)&&e(tt)}),U(e,Ke),k()}var W1e=B(`<div><!> <!> <!></div>`),G1e=B(`<div role="none" class="toolbar svelte-60yaxc"><!></div>`),K1e=B(`<div></div> <!>`,1),q1e={hash:`svelte-60yaxc`,code:`.item-list.svelte-60yaxc {display:flex;flex-direction:column;gap:4px;}.toolbar.svelte-60yaxc {display:flex;align-items:center;margin-block-start:8px;}.item.svelte-60yaxc {display:flex;align-items:center;gap:4px;}`};function J1e(e,t){O(t,!0),K(e,q1e);let{valueStoreKey:n=`currentValues`}=UK(),r=LK(),i=J(t,`required`,3,!0),a=J(t,`readonly`,3,!1),o=J(t,`invalid`,3,!1),s=nZe([``]),c=j(void 0),l=A(()=>t.fieldConfig.i18n),u=A(()=>Tr(t.fieldConfig.max,1/0)),d=A(()=>!a()),f=A(()=>s.values.length>1),p=A(()=>nK({fieldConfig:t.fieldConfig,itemCount:s.values.length})),m=()=>s.values.map(e=>e.trim()).filter(Boolean),h=()=>{let e=t.currentValue??[];(0,Qc.default)(m(),e)||s.replace(e.length?[...e]:[``])},g=()=>{let e=r.current,i=m();e&&((0,Qc.default)(i,t.currentValue??[])||cYe({draft:e,valueStoreKey:n,locale:t.locale,keyPath:t.keyPath,i18n:z(l),value:i}))},_=e=>z(c)?.children[e]?.querySelector(`input`),v=async e=>{s.insert(e,``),await Za(),_(e)?.focus()},y=async e=>{s.remove(e),await Za(),X3({index:e,getTarget:_})},b=i6({getItemCount:()=>s.values.length,getListElement:()=>z(c),onMove:(e,t)=>{s.move(e,t)},getItemData:e=>s.values[e]});sl(()=>t.currentValue,()=>{h()}),sl(()=>Yr(s.values),()=>{g()});var x=K1e(),S=P(x);fs(S,()=>({role:`none`,class:`item-list`,...b.listProps}),void 0,void 0,void 0,`svelte-60yaxc`),No(S,29,()=>b.displayOrder,e=>s.ids[e],(e,n)=>{var r=W1e();fs(r,e=>({role:`none`,class:`item`,...e,[ss]:{"drag-placeholder":b.dragIndex===z(n)}}),[()=>b.itemProps(z(n))],void 0,void 0,`svelte-60yaxc`);var c=N(r),l=e=>{{let t=A(()=>!z(f)),r=A(()=>b.reorderControlProps(z(n)));$3(e,ys({get index(){return z(n)},get itemCount(){return s.values.length},get disabled(){return z(t)}},()=>z(r)))}};G(c,e=>{z(d)&&!z(p)&&e(l)});var m=I(c,2);{let e=A(()=>Df(t.locale)),r=A(()=>i()&&s.values.length===1),c=A(()=>Y(`list_item_value`));NS(m,{get dir(){return z(e)},flex:!0,get readonly(){return a()},get invalid(){return o()},get required(){return z(r)},get ariaLabel(){return z(c)},get"aria-errormessage"(){return`${t.fieldId??``}-error`},onkeydown:e=>{e.key!==`Enter`||e.isComposing||!z(d)||s.values.length>=z(u)||(e.preventDefault(),v(z(n)+1))},get value(){return s.values[z(n)]},set value(e){s.values[z(n)]=e}})}var h=I(m,2),g=e=>{{let t=A(()=>!z(f));F0(e,{variant:`ghost`,get disabled(){return z(t)},onclick:()=>{y(z(n))}})}};G(h,e=>{z(d)&&!z(p)&&e(g)}),D(r),Wo(r,()=>nC,()=>({duration:200})),U(e,r)}),D(S),gs(S,e=>M(c,e),()=>z(c));var C=I(S,2),w=e=>{var n=G1e();o6(N(n),{get fieldConfig(){return t.fieldConfig},get locale(){return t.locale},get items(){return s.values},addItem:()=>v(s.values.length)}),D(n),U(e,n)};G(C,e=>{z(d)&&s.values.length<z(u)&&e(w)}),U(e,x),k()}var Y1e=new Set([`$$slots`,`$$events`,`$$legacy`,`fieldConfig`]);function X1e(e,t){let n=mo();O(t,!0);let r=vs(t,Y1e),i=`list-${n}-summary`,a=A(()=>$G(t.fieldConfig)),o=A(()=>z(a).hasSubFields);{let n=A(()=>z(o)?i:void 0);fH(e,{get"aria-labelledby"(){return z(n)},children:(e,n)=>{var a=H(),s=P(a),c=e=>{{let n=A(()=>({...r,fieldConfig:t.fieldConfig,summaryId:i}));U1e(e,ys(()=>z(n)))}},l=e=>{{let n=A(()=>({...r,fieldConfig:t.fieldConfig}));J1e(e,ys(()=>z(n)))}};G(s,e=>{z(o)?e(c):e(l,-1)}),U(e,a)},$$slots:{default:!0}})}k()}var Z1e=B(`<h4 class="svelte-s650n2"> </h4>`),Q1e=B(`<section role="group" tabindex="0" class="svelte-s650n2"><!> <!></section>`),$1e={hash:`svelte-s650n2`,code:`[role='document'] section.svelte-s650n2 {overflow:hidden;
/* Don’t set margin here because it makes scroll sync bumpy */padding:12px 0;h4:where(.svelte-s650n2) {color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);&:not(:last-child) {margin-bottom:8px;}}& > * {margin-inline:auto;max-width:768px;}p {margin:8px auto 0;-webkit-user-select:text;user-select:text;}img {max-height:800px !important;}.sui.alert {margin-block:16px;}}
@media (width < 768px) {
/* Remove the padding to make an image or an embedded video full-width */[role='document'] section.svelte-s650n2 > p:has(img, iframe) {margin-inline:calc(var(--entry-preview-padding-inline) * -1);}
/* A top-level field, which is wrapped for the Edit Pane to find it before it’s rendered */[role='document'] > [data-lazy-key-path] {& > section.svelte-s650n2:is([data-field-type='file']:where(.svelte-s650n2), [data-field-type='image']:where(.svelte-s650n2)):has(img),
& > section.svelte-s650n2:is([data-field-type='string']:where(.svelte-s650n2)):has(iframe) {overflow:visible;}& > section.svelte-s650n2:is([data-field-type='file']:where(.svelte-s650n2), [data-field-type='image']:where(.svelte-s650n2)) img {width:100%;max-height:none !important;}}
}`};function L6(e,t){O(t,!0),K(e,$1e);let n=LK(),r=J(t,`showLabel`,3,!0),i=A(()=>Tr(t.fieldConfig.widget,`string`)),a=A(()=>Tr(t.fieldConfig.preview,!0)),o=A(()=>vG({config:t.fieldConfig,locale:t.locale})),s=A(()=>oh(t.fieldConfig)),c=A(()=>z(i)===`list`||z(s)),l=A(()=>jK(n.current,t.locale,t.keyPath)),u=A(()=>e6({draft:n.current,fieldConfig:t.fieldConfig,keyPath:t.keyPath,locale:t.locale,valueMap:z(l)})),d=A(()=>z(u).isShown),f=A(()=>Hd.get(z(i))),p=A(()=>ph({valueMap:z(l),keyPath:t.keyPath,isList:z(c),isCustomFieldType:!!z(f)})),m=A(()=>({locale:t.locale,keyPath:t.keyPath,typedKeyPath:t.typedKeyPath,fieldConfig:t.fieldConfig,currentValue:z(p)}));var h=H(),g=P(h),_=e=>{var n=Q1e(),a=N(n),s=e=>{var t=Z1e(),n=F(t,!0);R(()=>W(n,z(o))),U(e,t)};G(a,e=>{r()&&e(s)}),c6(I(a,2),{children:(e,n)=>{var r=H(),a=P(r),o=e=>{{let n=A(()=>({...z(m),fieldConfig:t.fieldConfig}));bYe(e,ys(()=>z(n),{get preview(){return z(f).preview}}))}},s=e=>{let t=A(()=>E8[z(i)]);var n=H();Ro(P(n),()=>z(t),(e,t)=>{t(e,ys(()=>z(m)))}),U(e,n)};G(a,e=>{z(f)?.preview?e(o):z(i)in E8&&e(s,1)}),U(e,r)},$$slots:{default:!0}}),D(n),R(()=>{q(n,`data-field-type`,z(i)),q(n,`data-key-path`,t.keyPath),q(n,`data-typed-key-path`,t.typedKeyPath)}),so(`keydown`,n,e=>{e.key===`Enter`&&(e.stopPropagation(),k6({locale:t.locale,keyPath:t.keyPath}))}),so(`click`,n,e=>{e.stopPropagation(),k6({locale:t.locale,keyPath:t.keyPath})}),U(e,n)};G(g,e=>{t.fieldConfig&&z(i)!==`hidden`&&z(a)&&z(d)&&e(_)}),U(e,h),k()}co([`keydown`,`click`]);var e0e=B(`<div role="none" class="header svelte-1251rh2"> </div>`),t0e=B(`<div role="none"><!></div>`),n0e=B(`<div role="group" class="subsection svelte-1251rh2"><!> <div role="none" class="items svelte-1251rh2"></div></div>`),r0e={hash:`svelte-1251rh2`,code:`.subsection.svelte-1251rh2 {margin:16px auto;border:2px solid var(--sui-secondary-border-color);border-radius:var(--sui-control-medium-border-radius);.title {font-size:inherit;font-weight:var(--sui-font-weight-normal);}}.header.svelte-1251rh2 {display:flex;align-items:center;height:24px;padding-inline:8px;color:var(--sui-secondary-foreground-color);background-color:var(--sui-secondary-border-color);font-size:var(--sui-font-size-small);font-weight:var(--sui-font-weight-bold);}.items.svelte-1251rh2 {padding:8px 16px;
/* Hide when no subfield is shown, leaving only the empty wrappers marking the subfields */&:not(:has(> :not(:empty))) {display:none;}}`};function i0e(e,t){let n=mo();O(t,!0),K(e,r0e);let r=J(t,`single`,3,!1),i=`${n}-header`,a=A(()=>WG({types:t.types,fields:t.fields,type:t.type})),o=A(()=>z(a).typeConfig),s=A(()=>z(a).unknownType),c=A(()=>z(a).subFields),l=A(()=>z(o)?vG({config:z(o),locale:t.locale}):void 0);var u=H(),d=P(u),f=e=>{var n=n0e(),a=N(n),s=e=>{var t=e0e(),n=F(t,!0);R(()=>{q(t,`id`,i),W(n,z(l))}),U(e,t)};G(a,e=>{z(l)&&e(s)});var u=I(a,2);No(u,21,()=>z(c),e=>e.name,(e,n)=>{let i=A(()=>r()?t.keyPath:`${t.keyPath}.${z(n).name}`);var a=t0e();pH(N(a),{children:(e,r)=>{{let r=A(()=>KG({typedKeyPath:t.typedKeyPath,type:z(o)?.name,subFieldName:z(n).name}));L6(e,{get keyPath(){return z(i)},get typedKeyPath(){return z(r)},get locale(){return t.locale},get fieldConfig(){return z(n)}})}},$$slots:{default:!0}}),D(a),R(()=>q(a,`data-lazy-key-path`,z(i))),U(e,a)}),D(u),D(n),R(()=>q(n,`aria-labelledby`,z(l)?i:void 0)),U(e,n)};G(d,e=>{z(s)||e(f)}),U(e,u),k()}var a0e=B(`<div role="none"><!></div>`);function o0e(e,t){O(t,!0);let n=LK(),r=A(()=>t.fieldConfig.field),i=A(()=>t.fieldConfig.fields),a=A(()=>t.fieldConfig.types),o=A(()=>Tr(t.fieldConfig.typeKey,`type`)),s=A(()=>$G(t.fieldConfig)),c=A(()=>z(s).hasSingleSubField),l=A(()=>z(s).hasVariableTypes),u=A(()=>z(i)??(z(r)?[z(r)]:[])),d={},f=A(()=>Dm(d,jK(n.current,t.locale,t.keyPath),t.keyPath)??[]),p=A(()=>z(f).map(e=>z(l)?e[z(o)]:void 0));var m=H();No(P(m),19,()=>z(p),(e,t)=>rK(z(f),t),(e,n,r)=>{let i=A(()=>`${t.keyPath}.${z(r)}`);var o=a0e();pH(N(o),{children:(e,r)=>{{let r=A(()=>z(l)?z(a):void 0);i0e(e,{get locale(){return t.locale},get keyPath(){return z(i)},get typedKeyPath(){return`${t.typedKeyPath??``}.*`},get types(){return z(r)},get fields(){return z(u)},get type(){return z(n)},get single(){return z(c)}})}},$$slots:{default:!0}}),D(o),R(()=>q(o,`data-lazy-key-path`,z(i))),U(e,o)}),U(e,m),k()}var s0e=B(`<li> </li>`),c0e=B(`<ul></ul>`);function l0e(e,t){O(t,!0);var n=H(),r=P(n),i=e=>{var n=c0e();No(n,23,()=>t.currentValue,(e,t)=>`${e}-${t}`,(e,t)=>{var n=s0e(),r=F(n,!0);R(()=>W(r,z(t))),U(e,n)}),D(n),R((e,t)=>{q(n,`lang`,e),q(n,`dir`,t),n.dir=n.dir},[()=>Ef(t.locale),()=>Df(t.locale)]),U(e,n)},a=A(()=>Array.isArray(t.currentValue)&&t.currentValue.length);G(r,e=>{z(a)&&e(i)}),U(e,n),k()}var u0e=new Set([`$$slots`,`$$events`,`$$legacy`,`fieldConfig`]);function d0e(e,t){O(t,!0);let n=vs(t,u0e);var r=H(),i=P(r),a=e=>{{let r=A(()=>({...n,fieldConfig:t.fieldConfig}));o0e(e,ys(()=>z(r)))}},o=A(()=>$G(t.fieldConfig).hasSubFields),s=e=>{{let r=A(()=>({...n,fieldConfig:t.fieldConfig}));l0e(e,ys(()=>z(r)))}};G(i,e=>{z(o)?e(a):e(s,-1)}),U(e,r),k()}var f0e=new Set([`$$slots`,`$$events`,`$$legacy`,`coordinates`,`class`,`mapElement`,`onReady`]),p0e=B(`<div></div>`),m0e={hash:`svelte-1c5gj1k`,code:`
/* Leaflet default styles copied from \`node_modules/leaflet/dist/leaflet.css\`. Somehow we can’t */
/* import it directly here; Vite emits it as a separate CSS file, which we want to avoid. */
/* Rules for the features we don’t use — popups, tooltips, the Layers and Scale controls, */
/* image/video overlays, div icons, marker shadows, the Canvas renderer and the legacy IE/VML */
/* hacks — have been dropped. */.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-zoom-box,
.leaflet-layer {position:absolute;left:0;top:0;}.leaflet-container {overflow:hidden;-webkit-tap-highlight-color:transparent;background:#ddd;outline-offset:1px;font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;font-size:12px;font-size:0.75rem;line-height:1.5;}.leaflet-tile,
.leaflet-marker-icon {-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none;}.leaflet-tile::selection {background:transparent;}.leaflet-safari .leaflet-tile {image-rendering:-webkit-optimize-contrast;}.leaflet-safari .leaflet-tile-container {width:1600px;height:1600px;-webkit-transform-origin:0 0;transform-origin:0 0;}.leaflet-marker-icon {display:block;}.leaflet-container .leaflet-overlay-pane svg {max-width:none !important;max-height:none !important;}.leaflet-container .leaflet-marker-pane img,
.leaflet-container .leaflet-tile-pane img,
.leaflet-container .leaflet-tile {max-width:none !important;max-height:none !important;width:auto;padding:0;}.leaflet-container img.leaflet-tile {mix-blend-mode:plus-lighter;}.leaflet-container.leaflet-touch-zoom {-ms-touch-action:pan-x pan-y;touch-action:pan-x pan-y;}.leaflet-container.leaflet-touch-drag {-ms-touch-action:pinch-zoom;touch-action:none;touch-action:pinch-zoom;}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {-ms-touch-action:none;touch-action:none;}.leaflet-container a {-webkit-tap-highlight-color:rgba(51, 181, 229, 0.4);color:#0078a8;}.leaflet-tile {filter:inherit;visibility:hidden;}.leaflet-tile-loaded {visibility:inherit;}.leaflet-zoom-box {width:0;height:0;-moz-box-sizing:border-box;box-sizing:border-box;z-index:800;border:2px dotted #38f;background:rgba(255, 255, 255, 0.5);}.leaflet-overlay-pane svg {-moz-user-select:none;user-select:none;}.leaflet-pane {z-index:400;}.leaflet-tile-pane {z-index:200;}.leaflet-overlay-pane {z-index:400;}.leaflet-marker-pane {z-index:600;}.leaflet-map-pane svg {z-index:200;}.leaflet-control {position:relative;z-index:800;pointer-events:visiblePainted;pointer-events:auto;float:left;clear:both;cursor:auto;}.leaflet-top,
.leaflet-bottom {position:absolute;z-index:1000;pointer-events:none;}.leaflet-top {top:0;}.leaflet-right {right:0;}.leaflet-bottom {bottom:0;}.leaflet-left {left:0;}.leaflet-right .leaflet-control {float:right;margin-right:10px;}.leaflet-top .leaflet-control {margin-top:10px;}.leaflet-bottom .leaflet-control {margin-bottom:10px;}.leaflet-left .leaflet-control {margin-left:10px;}.leaflet-zoom-animated {-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0;}svg.leaflet-zoom-animated {will-change:transform;}.leaflet-zoom-anim .leaflet-zoom-animated {-webkit-transition:-webkit-transform 0.25s cubic-bezier(0, 0, 0.25, 1);-moz-transition:-moz-transform 0.25s cubic-bezier(0, 0, 0.25, 1);transition:transform 0.25s cubic-bezier(0, 0, 0.25, 1);}.leaflet-zoom-anim .leaflet-tile,
.leaflet-pan-anim .leaflet-tile {-webkit-transition:none;-moz-transition:none;transition:none;}.leaflet-zoom-anim .leaflet-zoom-hide {visibility:hidden;}.leaflet-interactive {cursor:pointer;}.leaflet-grab {
/* stylelint-disable-next-line declaration-property-value-no-unknown */cursor:-webkit-grab;
/* stylelint-disable-next-line declaration-property-value-no-unknown */cursor:-moz-grab;cursor:grab;}.leaflet-crosshair,
.leaflet-crosshair .leaflet-interactive {cursor:crosshair;}.leaflet-dragging .leaflet-grab,
.leaflet-dragging .leaflet-grab .leaflet-interactive {cursor:move;
/* stylelint-disable-next-line declaration-property-value-no-unknown */cursor:-webkit-grabbing;
/* stylelint-disable-next-line declaration-property-value-no-unknown */cursor:-moz-grabbing;cursor:grabbing;}.leaflet-marker-icon,
.leaflet-pane > svg path,
.leaflet-tile-container {pointer-events:none;}.leaflet-marker-icon.leaflet-interactive,
.leaflet-pane > svg path.leaflet-interactive {pointer-events:visiblePainted;pointer-events:auto;}.leaflet-bar {box-shadow:0 1px 5px rgba(0, 0, 0, 0.65);border-radius:4px;}.leaflet-bar a {background-color:#fff;background-position:50% 50%;background-repeat:no-repeat;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;display:block;text-align:center;text-decoration:none;color:black;}.leaflet-bar a:hover,
.leaflet-bar a:focus {background-color:#f4f4f4;}.leaflet-bar a:first-child {border-top-left-radius:4px;border-top-right-radius:4px;}.leaflet-bar a:last-child {border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:none;}.leaflet-bar a.leaflet-disabled {cursor:default;background-color:#f4f4f4;color:#bbb;}.leaflet-touch .leaflet-bar a {width:30px;height:30px;line-height:30px;}.leaflet-touch .leaflet-bar a:first-child {border-top-left-radius:2px;border-top-right-radius:2px;}.leaflet-touch .leaflet-bar a:last-child {border-bottom-left-radius:2px;border-bottom-right-radius:2px;}.leaflet-control-zoom-in,
.leaflet-control-zoom-out {font:bold 18px 'Lucida Console',
Monaco,
monospace;text-indent:1px;}.leaflet-touch .leaflet-control-zoom-in,
.leaflet-touch .leaflet-control-zoom-out {font-size:22px;}.leaflet-container .leaflet-control-attribution {background:#fff;background:rgba(255, 255, 255, 0.8);margin:0;}.leaflet-control-attribution {padding:0 5px;color:#333;line-height:1.4;}.leaflet-control-attribution a {text-decoration:none;}.leaflet-control-attribution a:hover,
.leaflet-control-attribution a:focus {text-decoration:underline;}.leaflet-attribution-flag {display:inline !important;vertical-align:baseline !important;width:1em;height:0.6669em;}.leaflet-touch .leaflet-control-attribution,
.leaflet-touch .leaflet-bar {box-shadow:none;}.leaflet-touch .leaflet-bar {border:2px solid rgba(0, 0, 0, 0.2);background-clip:padding-box;}.map.svelte-1c5gj1k {margin:var(--sui-focus-ring-width);border:1px solid var(--sui-textbox-border-color);border-radius:var(--sui-textbox-border-radius);overflow:hidden;aspect-ratio:1 / 1;background-clip:text;}.leaflet-container {font-family:inherit !important;font-size:var(--sui-font-size-small) !important;}.leaflet-container a {color:var(--sui-primary-accent-color-text) !important;text-decoration:none !important;}.leaflet-bar a {border-color:var(--sui-button-border-color) !important;color:var(--sui-secondary-foreground-color) !important;background-color:var(--sui-button-background-color) !important;}.leaflet-control {color:var(--sui-secondary-foreground-color) !important;background-color:var(--sui-secondary-background-color-translucent) !important;}.leaflet-control-attribution {padding:4px 8px;}
/* Dark theme: https://stackoverflow.com/q/59819792 */:root[data-theme='dark'] .leaflet-layer {filter:invert(100%) hue-rotate(180deg);}`};function h0e(e,t){O(t,!0),K(e,m0e);let n=J(t,`class`,3,``),r=J(t,`mapElement`,15),i=J(t,`onReady`,3,void 0),a=vs(t,f0e),o,s=!1,c=j(void 0),l,u,d=()=>{let{latitude:e,longitude:n}=t.coordinates??{};if(e===u?.latitude&&n===u?.longitude)return;let{leaflet:r,map:i,iconUrl:a}=z(c);if(u=t.coordinates,l?.remove(),l=void 0,t.coordinates){let e=r.icon({iconUrl:a,iconSize:[25,41]});l=r.marker([t.coordinates.latitude,t.coordinates.longitude],{icon:e}).addTo(i),i.setView([t.coordinates.latitude,t.coordinates.longitude],12)}},f=async()=>{if(!r())return;let e=await Jc(`leaflet`,`dist/leaflet-src.esm.js`),t=await Ore();if(s)return;let n=e.map(r(),{center:[0,0],zoom:2});e.tileLayer(`https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png`,{attribution:`&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors`,referrerPolicy:`strict-origin`}).addTo(n),M(c,{leaflet:e,map:n,iconUrl:t}),d(),r().querySelectorAll(`a[href^="https:"]`).forEach(e=>{e.setAttribute(`target`,`_blank`),e.setAttribute(`rel`,`noopener noreferrer`)}),o=new ResizeObserver(()=>{n?.invalidateSize()}),o.observe(r()),i()?.({leaflet:e,map:n})};L(()=>{z(c),t.coordinates?.latitude,t.coordinates?.longitude,eo(()=>{z(c)&&d()})}),So(()=>(f(),()=>{s=!0,o?.disconnect(),z(c)&&(z(c).map._animatingZoom=!1,z(c).map.remove())}));var p=p0e();fs(p,e=>({role:`application`,class:`map ${n()??``}`,"aria-label":e,...a}),[()=>t.coordinates?Y(`map_lat_lng`,{values:t.coordinates}):void 0],void 0,void 0,`svelte-1c5gj1k`),gs(p,e=>r(e),()=>r()),U(e,p),k()}var R6=kH({loader:()=>Zc(`map`),notLoadedMessage:`The map chunk is not loaded yet.`}),g0e=B(`<div role="alert" class="search-result searching svelte-ktr5k7"> </div>`),_0e=B(`<div role="alert" class="search-result no-result svelte-ktr5k7"> </div>`),v0e=B(`<div role="none" class="toolbar svelte-ktr5k7"><!> <!> <!></div> <!> <div class="map-wrapper svelte-ktr5k7"><!></div> <!>`,1),y0e={hash:`svelte-ktr5k7`,code:`.toolbar.svelte-ktr5k7 {display:flex;align-items:center;margin-bottom:var(--sui-spacing-2x);}.search-result.svelte-ktr5k7 {padding:12px;color:var(--sui-secondary-foreground-color);}.map-wrapper.svelte-ktr5k7 {display:contents;.map {aspect-ratio:auto;height:400px;&.invalid {border-color:var(--sui-error-border-color);}}}`};function b0e(e,t){O(t,!0),K(e,y0e);let n=J(t,`currentValue`,15),r=J(t,`readonly`,3,!1),i=J(t,`invalid`,3,!1),a=A(()=>Tr(t.fieldConfig.decimals,7)),o=A(()=>Tr(t.fieldConfig.type,`Point`)),s=A(()=>t.fieldConfig.center),c=A(()=>t.fieldConfig.zoom),l=j(void 0),u=j(void 0),d=j(void 0),f=j(``),p=j(``),m=j(void 0),h=j(!1),g=j(!1),_=j(``),v=!1;R6.preload();let y=async({leaflet:e,map:t})=>{let{createMapDrawController:r,isValidGeoJSON:i}=await R6.load(),l=await r({leaflet:e,map:t,geometryType:z(o),decimals:z(a),onChange:e=>{M(f,e,!0)},isCancelled:()=>v});l&&(M(d,l),n()&&i(n(),z(o))||l.showDefaultView({center:z(s),zoom:z(c)}))},b=()=>{if(!z(d))return;let e=R6.get().parseGeoJSON(n()??``,z(o)),t=e?n():``;z(f)!==t&&(M(f,t,!0),z(d).showGeometry(e))},x=()=>{if(!z(d))return;let e=z(f);n()!==e&&n(e)},S=e=>{if(!z(d))return;let t=z(d).setLocation(e);t!==void 0&&M(f,t,!0)},C=({lat:e,lon:t})=>{S({latitude:parseFloat(e),longitude:parseFloat(t)})},w=async()=>{let e,t;try{e=await R6.load(),t=await e.getCurrentPosition()}catch(t){M(g,!0),e&&t instanceof e.GeolocationUnsupportedError?M(_,Y(`geolocation_unsupported`),!0):(M(_,Y(`geolocation_error_body`),!0),console.error(`Error getting current location:`,t));return}S(t)},T=async()=>{n(``),await Za(),z(u).querySelector(`input`).focus()};Co(()=>{v=!0,z(d)?.stop()}),sl(()=>[z(d),n()],()=>{b()}),sl(()=>z(f),()=>{x()}),cl(()=>{let e=z(p);if(!e.trim())M(h,!1);else return M(h,!0),eo(async()=>(await R6.load()).searchLocations(e))},e=>{M(m,e,!0),M(h,!1)},()=>{M(m,[],!0),M(h,!1)});var ee=v0e(),E=P(ee),te=N(E);{let e=A(()=>Y(`find_place`)),t=A(()=>Y(`find_place`));rC(te,{debounce:!0,get readonly(){return r()},flex:!0,get placeholder(){return z(e)},get"aria-label"(){return z(t)},get value(){return z(p)},set value(e){M(p,e,!0)}})}var ne=I(te,2);{let e=e=>{gx(e,{name:`near_me`})},t=A(()=>Y(`use_your_location`)),n=A(()=>Y(`use_your_location`));Xx(ne,{variant:`tertiary`,iconic:!0,get title(){return z(t)},get"aria-label"(){return z(n)},get disabled(){return r()},onclick:()=>{w()},startIcon:e,$$slots:{startIcon:!0}})}var re=I(ne,2);{let e=A(()=>Y(`clear`)),t=A(()=>r()||!n());Xx(re,{variant:`tertiary`,get label(){return z(e)},get disabled(){return z(t)},onclick:()=>{T()}})}D(E),gs(E,e=>M(u,e),()=>z(u));var ie=I(E,2),ae=e=>{var t=g0e(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`searching`)]),U(e,t)},oe=e=>{var t=H(),n=P(t),r=e=>{var t=H(),n=P(t),r=e=>{{let t=A(()=>Y(`search_results`));WS(e,{get ariaLabel(){return z(t)},children:(e,t)=>{var n=H();No(P(n),17,()=>z(m),e=>e.place_id,(e,t)=>{KS(e,{get label(){return z(t).display_name},onSelect:()=>{C(z(t))}})}),U(e,n)},$$slots:{default:!0}})}},i=e=>{var t=_0e(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`no_results`)]),U(e,t)};G(n,e=>{z(m).length?e(r):e(i,-1)}),U(e,t)};G(n,e=>{z(m)&&e(r)}),U(e,t)};G(ie,e=>{z(h)?e(ae):z(p)&&e(oe,1)});var se=I(ie,2),ce=N(se);{let e=A(()=>i()?`invalid`:void 0);h0e(ce,{get inert(){return r()},get class(){return z(e)},onReady:y,get mapElement(){return z(l)},set mapElement(e){M(l,e,!0)}})}D(se);var le=I(se,2);{let e=A(()=>Y(`geolocation_error_title`));CS(le,{get title(){return z(e)},get open(){return z(g)},set open(e){M(g,e,!0)},children:(e,t)=>{Ur();var n=V();R(()=>W(n,z(_))),U(e,n)},$$slots:{default:!0}})}U(e,ee),k()}var x0e=B(`<pre class="svelte-1ox6w30"> </pre>`),S0e={hash:`svelte-1ox6w30`,code:`pre.svelte-1ox6w30 {white-space:pre-wrap;}`};function C0e(e,t){K(e,S0e);var n=H(),r=P(n),i=e=>{var n=x0e(),r=F(n,!0);R(()=>W(r,t.currentValue)),U(e,n)};G(r,e=>{t.currentValue&&e(i)}),U(e,n)}function w0e(e,t){O(t,!0);let n=J(t,`currentValue`,15),r=J(t,`required`,3,!0),i=J(t,`readonly`,3,!1),a=J(t,`invalid`,3,!1),o=j(void 0),s=j(``),c=A(()=>t.fieldConfig.min),l=A(()=>t.fieldConfig.max),u=A(()=>Tr(t.fieldConfig.step,1)),d=()=>z(o)===void 0&&z(s).trim()?z(s):z(o),{updateInput:f}=ll(()=>n(),e=>{n(e)},d,e=>{M(o,e,!0)},e=>fAe({currentValue:e,fieldConfig:t.fieldConfig,inputValue:d()}),e=>GU({inputValue:e,fieldConfig:t.fieldConfig}));{let n=A(()=>RU(t.fieldConfig));iH(e,{get min(){return z(c)},get max(){return z(l)},get step(){return z(u)},get fractional(){return z(n)},get readonly(){return i()},get required(){return r()},get invalid(){return a()},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`},oninput:e=>{M(s,e.target.value,!0)},onblur:()=>{f()},get value(){return z(o)},set value(e){M(o,e,!0)}})}k()}var T0e=B(`<p> </p>`);function E0e(e,t){O(t,!0);let n=A(()=>Ef(t.locale)),r=A(()=>Number(t.currentValue)),i=A(()=>Number.isNaN(z(r))?t.currentValue:IU(z(n)).format(z(r)));var a=H(),o=P(a),s=e=>{var r=T0e(),a=F(r,!0);R(e=>{q(r,`lang`,z(n)),q(r,`dir`,e),W(a,z(i)),r.dir=r.dir},[()=>Df(t.locale)]),U(e,r)};G(o,e=>{t.currentValue!==void 0&&t.currentValue!==null&&t.currentValue!==``&&e(s)}),U(e,a),k()}var D0e=({draft:e,valueStoreKey:t=`currentValues`,locale:n,keyPath:r,fieldConfig:i,type:a})=>{let{i18n:o=!1}=i,{types:s,typeKey:c=`type`}=i,{fields:l}=i,u=e[t],d=(a?s?.find(({name:e})=>e===a)?.fields:l)??[],f=t===`extraValues`?n:e.defaultLocale;hK(()=>{a&&G3({valueStore:u,locale:n,i18n:o,draft:e,keyPath:r},e=>{e[`${r}.${c}`]=a});let t=Object.fromEntries(Object.entries(H3({fields:d,locale:n,defaultLocale:f})).map(([e,t])=>[`${r}.${e}`,t])),i=n===f?t:oYe({draft:e,content:t,targetLanguage:n,keyPathPrefix:r});G3({valueStore:u,locale:n,i18n:o,draft:e,keyPath:r},e=>{Object.assign(e,Oc({...i,...e})),delete e[r]})})},O0e=({draft:e,valueStoreKey:t=`currentValues`,locale:n,keyPath:r,fieldConfig:i})=>{let{i18n:a=!1}=i,o={};return G3({valueStore:e[t],locale:n,i18n:a,draft:e,keyPath:r},(e,t)=>{let n={};rm(e,`${r}.`,{live:!0}).forEach(t=>{n[t.slice(r.length)]=Oc(e[t]),e[t]=null,delete e[t]}),o[t]=n,e[r]=null}),o},k0e=({draft:e,valueStoreKey:t=`currentValues`,keyPath:n,removedValues:r})=>{hK(()=>{Object.entries(r).forEach(([r,i])=>{let a=e[t][r];a&&(Object.entries(i).forEach(([e,t])=>{a[`${n}${e}`]=t}),delete a[n])})})},A0e=B(`<div role="none" class="removed-item svelte-pauyt3"><!></div>`),j0e=B(`<div role="group"><!> <div role="none" class="item-list"><!></div></div>`),M0e=B(`<!> <!> <!> <!>`,1),N0e={hash:`svelte-pauyt3`,code:`.wrapper.svelte-pauyt3 {border-inline-width:2px;border-color:var(--sui-secondary-border-color);border-radius:var(--sui-control-medium-border-radius);&.expanded,
&:has(.summary) {border-bottom-width:2px;}}.removed-item.svelte-pauyt3 {margin-top:8px;}.sui.checkbox + .wrapper.svelte-pauyt3 {& > .group {margin-top:8px;}}`};function P0e(e,t){let n=mo();O(t,!0),K(e,N0e);let r=LK(),{fieldContext:i,valueStoreKey:a=`currentValues`,parentComponentNames:o=[]}=UK(),s=o.at(-1),c=i===`single-subfield-list-field`,l=J(t,`required`,3,!0),u=J(t,`readonly`,3,!1),d=j(void 0),f=j(void 0),p=A(()=>t.fieldConfig.name),m=A(()=>t.fieldConfig.collapsed),h=A(()=>t.fieldConfig.summary),g=A(()=>t.fieldConfig.thumbnail),_=A(()=>t.fieldConfig.fields),v=A(()=>t.fieldConfig.types),y=A(()=>Tr(t.fieldConfig.typeKey,`type`)),b=A(()=>r.current?.isIndexFile??!1),x=A(()=>r.current?.collectionName??``),S=A(()=>r.current?.fileName),C=A(()=>jK(r.current,t.locale,t.keyPath,a)),w=A(()=>({collectionName:z(x),fileName:z(S),valueMap:z(C),isIndexFile:z(b)})),T=A(()=>rm(z(C),`${t.keyPath}.`).some(e=>z(C)[e]!==void 0)),ee=A(()=>`${t.keyPath}#`),E=A(()=>D6(r.current,z(ee))),te=A(()=>Array.isArray(z(v))),ne=A(()=>`${t.keyPath}.${z(y)}`),re=A(()=>!z(T)&&z(f)?.locale===t.locale),ie=A(()=>z(te)?z(C)[z(ne)]:void 0),ae=A(()=>WG({types:z(te)?z(v):void 0,fields:z(_),summary:z(h),type:z(ie)})),oe=A(()=>z(ae).typeConfig),se=A(()=>z(ae).unknownType),ce=A(()=>z(ae).subFields),le=A(()=>z(ae).summaryTemplate),ue=A(()=>z(oe)?vG({config:z(oe),locale:t.locale}):z(ie)),de=()=>{let e=r.current;if(c||!e)return;let n=z(ee);O6({draft:e,stateMap:{[n]:V$e({draft:e,key:n,locale:t.locale,collapsed:z(m)})}})},fe=({type:e}={})=>{let n=r.current;n&&(D0e({draft:n,valueStoreKey:a,locale:t.locale,keyPath:t.keyPath,fieldConfig:t.fieldConfig,type:e}),M(f,void 0))},pe=()=>{M(f,{locale:t.locale,values:O0e({draft:r.current,valueStoreKey:a,locale:t.locale,keyPath:t.keyPath,fieldConfig:t.fieldConfig})})},me=()=>{z(d).querySelector(`:scope > .header button`)?.focus()},he=async()=>{k0e({draft:r.current,valueStoreKey:a,keyPath:t.keyPath,removedValues:z(f).values}),M(f,void 0),await Za(),me()},ge=async({type:e})=>{fe({type:e}),await Za(),me()},_e=async()=>{pe(),await Za(),document.getElementById(`object-${n}-restore`)?.focus()},ve=()=>HG({...z(w),keyPath:t.keyPath,locale:t.locale,summaryTemplate:z(le)}),ye=()=>F1e({draft:r.current,thumbnailFieldName:z(g),keyPath:t.keyPath,typedKeyPath:t.typedKeyPath,type:z(ie),componentName:s,valueMap:z(C),locale:t.locale}),be=A(ve),xe=A(ye),Se=`object-${n}-summary`,Ce=A(()=>!z(E)&&!z(se)&&(z(be)||z(xe))?Se:void 0);So(()=>{de(),z(T)&&z(se)&&UG({fieldType:`object`,keyPath:t.keyPath,type:z(ie),typeKey:z(y),types:z(v)})});var we=M0e(),Te=P(we),Ee=e=>{{let n=A(()=>Y(`add_x`,{values:{name:t.fieldLabel||z(p)}}));vS(e,{get label(){return z(n)},get checked(){return z(T)},get disabled(){return u()},onChange:({detail:{checked:e}})=>{e?fe():pe()}})}};G(Te,e=>{!z(te)&&!l()&&e(Ee)});var De=I(Te,2),Oe=e=>{o6(e,{get disabled(){return u()},get fieldConfig(){return t.fieldConfig},get locale(){return t.locale},addItem:e=>ge(e)})};G(De,e=>{z(te)&&!z(T)&&e(Oe)});var ke=I(De,2),Ae=e=>{var t=A0e();z$e(N(t),{get id(){return`object-${n}-restore`},get disabled(){return u()},onRestore:he}),D(t),U(e,t)};G(ke,e=>{z(re)&&e(Ae)});var je=I(ke,2),Me=e=>{var i=j0e();let a;var o=N(i),s=e=>{{let t=e=>{var t=H(),n=P(t),r=e=>{F0(e,{get disabled(){return u()},onclick:()=>{_e()}})};G(n,e=>{z(te)&&e(r)}),U(e,t)},i=A(()=>z(te)?z(ue):``),a=A(()=>z(ce).length>0);T6(e,{get label(){return z(i)},get controlId(){return`object-${n}-item-list`},get expanded(){return z(E)},get expandable(){return z(a)},toggleExpanded:()=>O6({draft:r.current,stateMap:{[z(ee)]:!z(E)}}),endContent:t,$$slots:{endContent:!0}})}};G(o,e=>{c||e(s)});var l=I(o,2);j$e(N(l),{get locale(){return t.locale},get subFields(){return z(ce)},getSubFieldProps:e=>({keyPath:`${t.keyPath}.${e.name}`,typedKeyPath:KG({typedKeyPath:t.typedKeyPath,type:z(ie),subFieldName:e.name})}),get expanded(){return z(E)},get unknownType(){return z(se)},get typeConfig(){return z(oe)},get readonly(){return u()},getSummary:()=>z(be),getThumbnail:()=>z(xe),get summaryId(){return Se}}),D(l),D(i),gs(i,e=>M(d,e),()=>z(d)),R(()=>{a=$o(i,1,`wrapper svelte-pauyt3`,null,a,{"object-unknown-type":z(se),expanded:z(E)}),q(i,`aria-labelledby`,z(Ce)),q(l,`id`,`object-${n}-item-list`)}),U(e,i)};G(je,e=>{(l()&&!z(te)||z(T))&&e(Me)}),U(e,we),k()}function F0e(e,t){O(t,!0);let n=LK(),r=A(()=>t.fieldConfig.fields),i=A(()=>t.fieldConfig.types),a=A(()=>Tr(t.fieldConfig.typeKey,`type`)),o=A(()=>jK(n.current,t.locale,t.keyPath)),s=A(()=>rm(z(o),`${t.keyPath}.`).some(e=>{let t=z(o)[e];return t!==!1&&!Cm(t)})),c=A(()=>Array.isArray(z(i))),l=A(()=>`${t.keyPath}.${z(a)}`),u=A(()=>z(c)?z(o)[z(l)]:void 0);var d=H(),f=P(d),p=e=>{i0e(e,{get locale(){return t.locale},get keyPath(){return t.keyPath},get typedKeyPath(){return t.typedKeyPath},get types(){return z(i)},get fields(){return z(r)},get type(){return z(u)}})};G(f,e=>{z(s)&&e(p)}),U(e,d),k()}function I0e(e,t){O(t,!0);let n=e=>{var n=H();No(P(n),17,()=>z(a),e=>e.path,(e,n)=>{I0e(e,{get node(){return z(n)},get selectedPath(){return t.selectedPath},get onSelectPath(){return t.onSelectPath}})}),U(e,n)},r=A(()=>t.node.path),i=A(()=>t.node.label),a=A(()=>t.node.children),o=A(()=>t.selectedPath===z(r)),s=A(()=>!z(r)||z(o)||t.selectedPath.startsWith(`${z(r)}/`));{let c=e=>{{let t=A(()=>z(r)?`folder`:`bookmark_manager`);gx(e,{get name(){return z(t)}})}},l=A(()=>z(a).length?n:void 0);cH(e,{get label(){return z(i)},get selected(){return z(o)},get expanded(){return z(s)},get items(){return z(l)},onSelect:()=>{t.onSelectPath(z(r))},startIcon:c,$$slots:{startIcon:!0}})}k()}var z6=e=>e?e.split(`/`).length:0,L0e=(e,t)=>t?e===t?2:0:Iie.includes(e)?2:1,R0e=({entries:e,indexFileName:t,subfolders:n})=>{let r=new Map,i=new Map;return e.forEach(e=>{let a=xf(e.subPath);if(!a)return;if(n){let n=L0e(e.subPath.slice(a.length+1),t);n>(i.get(a)??0)?(i.set(a,n),r.set(a,e)):r.has(a)||r.set(a,void 0)}else r.has(a)||r.set(a,void 0);let o=xf(a);for(;o&&!r.has(o);)r.set(o,void 0),o=xf(o)}),r},z0e=({collection:e,path:t,indexEntry:n,summaryTemplate:r,locale:i})=>{let a=tu(t);return n&&wW(e,n,{locale:i,useTemplate:!0,template:r})||a},B0e=({collection:e,entries:t,pruneLeaves:n,excludePath:r,maxDepth:i=1/0,locale:a})=>{let o=hf(e);if(!o)return[];let{summary:s,subfolders:c}=o,l=R0e({entries:t,indexFileName:vf(e),subfolders:c}),u=new Map;[...l.keys()].forEach(e=>{let t=xf(e);Nl(u,t,()=>[]).push(e)});let d=t=>(u.get(t)??[]).filter(e=>(!n||!c||!!u.get(e)?.length)&&e!==r&&z6(e)<=i).map(t=>({path:t,label:z0e({collection:e,path:t,indexEntry:l.get(t),summaryTemplate:s,locale:a}),children:d(t)})).sort((e,t)=>Bc(e.label,t.label));return d(``)},V0e=({collection:e,entries:t})=>B0e({collection:e,entries:t,pruneLeaves:!0}),H0e=({collection:e,entries:t,ownFolderPath:n})=>{let r=hf(e)?.depth??1/0;if(!vf(e))return r-1;if(!n)return r-2;let i=z6(xf(n));return r-Math.max(2,...t.filter(({subPath:e})=>e.startsWith(`${n}/`)).map(({subPath:e})=>z6(e)-i))},U0e=({collection:e,entries:t,excludePath:n,locale:r})=>B0e({collection:e,entries:t,pruneLeaves:!1,excludePath:n,maxDepth:H0e({collection:e,entries:t,ownFolderPath:n}),locale:r}),W0e=({nodes:e,path:t})=>{let n=t.split(`/`).filter(Boolean),r=(e,[t,...n],i)=>{let a=i?`${i}/${t}`:t,o=e.find(e=>e.path===a);if(o)return n.length?e.map(e=>e===o?{...e,children:r(e.children,n,a)}:e):e;let s={path:a,label:t,children:n.length?r([],n,a):[]};return[...e,s].sort((e,t)=>Bc(e.label,t.label))};return n.length?r(e,n,``):e},G0e=(e,t)=>e.reduce((e,n)=>e??(n.path===t?n:G0e(n.children,t)),void 0),K0e=({collection:e,subPath:t,isNew:n=!1})=>{if(n||!t||!e||!vf(e))return;let r=xf(t);return r?tu(r):void 0},q0e=({collection:e,label:t,entries:n,newFolderPaths:r,excludePath:i,locale:a})=>({path:``,label:t,children:r.reduce((e,t)=>W0e({nodes:e,path:t}),U0e({collection:e,entries:n,excludePath:i,locale:a}))}),J0e=e=>(e?.children??[]).map(({path:e})=>tu(e)),Y0e=B(`<span role="none" class="label"> </span>`),X0e=B(`<header role="none"><h4 role="none"> </h4></header> <!> <div role="none" class="field-wrapper svelte-1cngjyd"><!> <!> <!></div>`,1),Z0e=B(`<div role="none" class="new-parent-folder svelte-1cngjyd"><div role="none"><!> <!></div> <p role="none" class="svelte-1cngjyd"> </p></div>`),Q0e=B(`<!> <!>`,1),$0e={hash:`svelte-1cngjyd`,code:`.field-wrapper.svelte-1cngjyd {display:flex;align-items:center;
/* Look like the \`<Select>\` trigger, which is a styled div rather than a button */.parent-folder-button {justify-content:flex-start;border-color:var(--sui-control-border-color);border-radius:var(--sui-textbox-border-radius);padding-inline:calc(var(--sui-textbox-height) / 4);flex:auto;min-width:0;height:var(--sui-textbox-height);color:var(--sui-control-foreground-color);background-color:var(--sui-disabled-background-color);font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);font-weight:var(--sui-font-weight-normal, normal);line-height:var(--sui-control-line-height);&:is(:hover, :focus-visible, [aria-expanded='true']) {color:var(--sui-control-foreground-color);background-color:var(--sui-hover-background-color);}&[aria-invalid='true'] {border-color:var(--sui-error-border-color);}.icon {font-size:var(--sui-font-size-xx-large);opacity:0.5;}.label {flex:auto;overflow:hidden;text-align:start;text-overflow:ellipsis;white-space:nowrap;}}.parent-folder-tree {min-width:240px;max-height:50vh;}
/* Stand beside the picker without stretching, so the folder name gets the room */.new-parent-folder-button {flex:none;height:var(--sui-textbox-height);white-space:nowrap;}}.new-parent-folder.svelte-1cngjyd {display:flex;flex-direction:column;gap:8px;min-width:320px;p:where(.svelte-1cngjyd) {margin:0;color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);}}`};function e2e(e,t){let n=mo();O(t,!0),K(e,$0e);let r=LK(),i=A(()=>r.current?.collection),a=A(()=>z(i)?_f(z(i)):void 0),o=A(()=>r.current?.validities[t.locale]._path),s=A(()=>z(o)?.valid===!1),c=A(()=>t.locale===z(i)?._i18n.defaultLocale),l=A(()=>z(c)&&!oQ(r.current)),u=A(()=>K0e({collection:z(i),subPath:r.current?.originalEntry?.subPath,isNew:r.current?.isNew})),d=A(()=>Lc(r.current?.currentPath??``)),f=A(()=>z(u)?xf(z(d)):z(d)),p=A(()=>!!z(i)&&hf(z(i))?.subfolders===!1),m=A(()=>!!z(i)&&z(f).split(`/`).filter(Boolean).length<H0e({collection:z(i),entries:[]})),h=j(!1),g=j(``),_=j(!1),v=j(Xi([])),y=A(()=>z(i)?q0e({collection:z(i),label:qf(z(i)),entries:k2(z(i)),newFolderPaths:z(v),excludePath:z(u)?xf(r.current?.originalEntry?.subPath):void 0,locale:t.locale}):{path:``,label:``,children:[]}),b=A(()=>!z(i)||z(c)?z(f):A2({collection:z(i),dirPath:z(f),locale:t.locale})),x=A(()=>G0e([z(y)],z(f))),S=A(()=>z(x)?.label??z(b)),C=j(void 0),w=j(!1),T=A(()=>J0e(z(x))),ee=A(()=>LH({takenNames:z(T),name:z(g)})),E=A(()=>z(_)&&!!z(ee)),te=A(()=>!!z(y).children.length),ne=e=>{r.current&&(r.current.currentPath=z(u)?$l([e,z(u)]):e),M(w,!1)};var re=H(),ie=P(re),ae=e=>{var t=Q0e(),r=P(t);_6(r,{"data-validation-key":`_path`,children:(e,t)=>{var r=X0e(),i=P(r),a=N(i),c=F(a,!0);D(i);var u=I(i,2),d=e=>{a6(e,{get id(){return`${n}-error`},children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>HWe(z(o)).join(` `)]),U(e,n)},$$slots:{default:!0}})};G(u,e=>{z(s)&&e(d)});var v=I(u,2),x=N(v);{let e=e=>{{let t=A(()=>z(f)?`folder`:`bookmark_manager`);gx(e,{get name(){return z(t)}})}},t=e=>{gx(e,{name:`expand_more`})},r=A(()=>!z(te)||!z(l)),i=A(()=>z(b)||void 0);Xx(x,{class:`parent-folder-button`,variant:`tertiary`,get disabled(){return z(r)},"aria-haspopup":`tree`,get"aria-invalid"(){return z(s)},get"aria-labelledby"(){return`${n}-label`},get"aria-errormessage"(){return`${n}-error`},get"aria-description"(){return z(i)},get element(){return z(C)},set element(e){M(C,e,!0)},startIcon:e,endIcon:t,children:(e,t)=>{var n=Y0e(),r=F(n,!0);R(()=>W(r,z(S))),U(e,n)},$$slots:{startIcon:!0,endIcon:!0,default:!0}})}var T=I(x,2);Jx(T,{get anchor(){return z(C)},position:`bottom-left`,get open(){return z(w)},set open(e){M(w,e,!0)},children:(e,t)=>{{let t=A(()=>Y(`entry_parent_folder`));uH(e,{get ariaLabel(){return z(t)},class:`parent-folder-tree`,selectionFollowsFocus:!1,children:(e,t)=>{I0e(e,{get node(){return z(y)},get selectedPath(){return z(f)},onSelectPath:ne})},$$slots:{default:!0}})}},$$slots:{default:!0}});var ee=I(T,2),E=e=>{{let t=e=>{gx(e,{name:`create_new_folder`})},n=A(()=>!z(l)||!z(m)),r=A(()=>Y(`new_parent_folder`));Xx(e,{variant:`ghost`,iconic:!0,class:`new-parent-folder-button`,get disabled(){return z(n)},get"aria-label"(){return z(r)},onclick:()=>{M(g,``),M(_,!1),M(h,!0)},startIcon:t,$$slots:{startIcon:!0}})}};G(ee,e=>{z(p)&&e(E)}),D(v),R(e=>{q(a,`id`,`${n}-label`),W(c,e)},[()=>Y(`entry_parent_folder`)]),U(e,r)},$$slots:{default:!0}});var i=I(r,2);{let e=A(()=>Y(`new_parent_folder`)),t=A(()=>Y(`new_parent_folder_create`)),r=A(()=>!!z(ee));SS(i,{get title(){return z(e)},get okLabel(){return z(t)},get okDisabled(){return z(r)},onOk:()=>{let e=$l([z(f),IH(z(g))]);M(v,[...z(v),e],!0),ne(e)},get open(){return z(h)},set open(e){M(h,e,!0)},children:(e,t)=>{var r=Z0e(),i=N(r),a=N(i);{let e=A(()=>Y(`new_parent_folder_name`));NS(a,{dir:`auto`,flex:!0,get ariaLabel(){return z(e)},get"aria-errormessage"(){return`${n}-new-folder-error`},get invalid(){return z(E)},oninput:()=>{M(_,!0)},get value(){return z(g)},set value(e){M(g,e,!0)}})}var o=I(a,2),s=e=>{a6(e,{get id(){return`${n}-new-folder-error`},children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(`new_parent_folder_error.${z(ee)}`)]),U(e,n)},$$slots:{default:!0}})};G(o,e=>{z(E)&&e(s)}),D(i);var c=F(I(i,2),!0);D(r),R(e=>W(c,e),[()=>Y(`new_parent_folder_description`,{values:{folder:z(S)}})]),U(e,r)},$$slots:{default:!0}})}U(e,t)};G(ie,e=>{r.current&&z(a)&&(z(te)||z(p))&&e(ae)}),U(e,re),k()}var t2e=B(`<!> <!>`,1);function n2e(e,t){O(t,!0);let n=LK(),r=A(()=>n.current?.fields??[]),i=A(()=>n.current?.currentPath!==void 0&&!n.current?.isIndexFile);pH(e,{children:(e,n)=>{var a=t2e(),o=P(a),s=e=>{e2e(e,{get locale(){return t.locale}})};G(o,e=>{z(i)&&e(s)}),No(I(o,2),17,()=>z(r),e=>e.name,(e,n)=>{pH(e,{children:(e,r)=>{w6(e,{get keyPath(){return z(n).name},get typedKeyPath(){return z(n).name},get locale(){return t.locale},get fieldConfig(){return z(n)}})},$$slots:{default:!0}})}),U(e,a)},$$slots:{default:!0}}),k()}var r2e=0,B6=void 0,V6=void 0,H6=0,i2e={saved:!1,restored:!1,deleted:!1},U6=nl({show:!1}),W6=nl({...i2e}),G6=async(e,t=``)=>{await B6?.delete([e,t])},K6=async(e,t=``)=>{let n=await B6?.get([e,t]);return n?n.cmsConfigVersion===kl.current?n:(await G6(e,t),null):null},q6=({collection:e,fileName:t,isIndexFile:n,originalEntry:r})=>t??r?.subPath??(n?af(e):``),a2e=async e=>{let t=await K6(e.collectionName,q6(e)),n=t?.baseEntry?.subPath;return n!==void 0&&n!==e.originalEntry?.subPath?null:t},o2e=({originalEntry:e})=>e?.arrayIndex!==void 0,s2e=async e=>{if(!(yu.useDraftBackup??!0)||!e.interacted||oQ(e)||o2e(e))return;let{collectionName:t,isNew:n,originalEntry:r,pendingEntries:i=[]}=e,a=q6(e);if(SK(e)){let o={timestamp:new Date,cmsConfigVersion:kl.current,collectionName:t,slug:a,...CK(e),pendingEntries:el(i),...!n&&r?{baseEntry:el(r)}:{}};await B6?.put(o)}else await K6(t,a)&&await G6(t,a)},c2e=async({currentValues:e,files:t})=>{let n=new Set;return Object.values(e).forEach(e=>{Object.values(e).forEach(e=>{typeof e==`string`&&[...e.matchAll(Vc(`g`))].forEach(([e])=>{let r=t[e]?.file;r&&n.add(r)})})}),new Map(await Promise.all([...n].map(async e=>[e,await KX(e)])))},l2e=({baseEntry:e,draft:t})=>{let{originalEntry:n,originalLocales:r}=t;e&&n&&!(0,Qc.default)(e.locales,el(n.locales))&&(t.originalEntry=e,t.originalLocales=Object.fromEntries(Object.keys(r).map(t=>[t,!!e.locales[t]?.content])))},u2e=async({backup:e,draft:t})=>{let{baseEntry:n,currentLocales:r,currentPath:i,currentSlugs:a,currentValues:o,files:s,pendingEntries:c=[]}=e,l=await c2e(e);hK(()=>{t.currentLocales=r,t.currentSlugs=a,i!==void 0&&(t.currentPath=i),t.pendingEntries=c;let e=sW(t.collection);Object.entries(o).forEach(([n,r])=>{if(e&&e in r){let i=t.originalEntry?.locales[n]?.content?.[e];i===void 0?delete r[e]:r[e]=i}Object.entries(r).forEach(([e,n])=>{typeof n==`string`&&([...n.matchAll(Vc(`g`))].forEach(([e])=>{let r=s[e],{file:i}=r??{};if(!r||!i)return;let a=l.get(i);t.files[a]??=r,n=n.replaceAll(e,a)}),r[e]=n)}),t.currentValues[n]?n6(t.currentValues[n],r):t.currentValues[n]=F3({draft:t,locale:n,target:structuredClone(r)});let i=t.currentValues[n],a=Object.keys(i),o=$K(i);a.forEach(e=>{i[e]===null&&eq(o,e)&&(i[e]={})}),t.originalValues[n]||(t.originalValues[n]={})}),l2e({baseEntry:n,draft:t})})},J6=()=>(U6.current.show&&(U6.current.show=!1,U6.current.resolve?.()),H6+=1,H6),d2e=async({draft:e})=>{let t=J6();if(!(yu.useDraftBackup??!0)||oQ(e)||o2e(e))return;let{collectionName:n}=e,r=q6(e),i=await a2e(e);if(!i||t!==H6)return;let{timestamp:a}=i,{promise:o,resolve:s}=Promise.withResolvers();e.restorePending=!0,U6.current={show:!0,timestamp:a,resolve:s};let c;try{if(c=await o,c===void 0)return;c?(await u2e({backup:i,draft:e}),e.interacted=!0):await G6(n,r)}finally{e.restorePending=!1}W6.current={restored:c,deleted:!c,saved:!1}},f2e=async e=>{(yu.useDraftBackup??!0)&&e&&!W6.current.saved&&await a2e(e)&&(W6.current={restored:!1,deleted:!1,saved:!0})},p2e=()=>{W6.current={...i2e}};ol(()=>{let e=NX(LX.current);e?e!==V6&&(V6=e,B6=new hu(e,`draft-backups`,{keyPath:[`collectionName`,`slug`]})):(B6=null,V6=void 0)});var Y6=()=>{globalThis.clearTimeout(r2e)},m2e=e=>{Y6(),e&&B6&&(r2e=globalThis.setTimeout(()=>{s2e(e)},500))},h2e=[`code`,`hidden`,`keyvalue`],g2e=[`true`,`yes`,`on`,`y`,`1`],_2e=[`false`,`no`,`off`,`n`,`0`],X6=(e,t)=>{Object.hasOwn(e,t)&&!wm(e[t])&&delete e[t]},v2e=({field:e,fieldType:t,keyPath:n,content:r,index:i})=>{if(eq(i,n)){let[e]=tq(i,n);if(e!==void 0){let t=r[`${n}.${e}`];Om(r,n),r[n]=t}else return Om(r,n),!1}let a=r[n];if(X(a)||Array.isArray(a))return Om(r,n),!1;if(Id.includes(t))return typeof a!=`string`&&(r[n]=String(a??``)),!0;if(t===`boolean`){if(typeof a!=`boolean`){let e=typeof a==`string`?a.trim().toLowerCase():String(a),t=g2e.includes(e);if(!t&&!_2e.includes(e))return!1;r[n]=t}return!0}if(t===`number`){let{value_type:t=`int`}=e;if(t!==`int`&&t!==`float`||typeof a==`number`||a===null)return!0;let i=typeof a==`string`?Number(a.trim()):NaN;if(a===``||Number.isNaN(i))return!1;r[n]=i}return!0},y2e=({keyPath:e,content:t,index:n,hasSubFields:r})=>{if(tq(n,e).length)return X6(t,e),!0;if(eq(n,e))return Om(t,e),!1;let i=t[e];return Array.isArray(i)?!0:!r&&i!=null&&!X(i)?(delete t[e],t[`${e}.0`]=i,!0):(Om(t,e),!1)},b2e=[`number`,`boolean`,`bigint`],x2e=(e,t,n)=>{let r=tq(n,t);(r.length?r:[0]).forEach(n=>{let r=`${t}.${n}`,i=e[r];Object.hasOwn(e,r)&&(i===null||b2e.includes(typeof i))&&(e[r]=String(i??``))})},S2e=({keyPath:e,content:t,index:n})=>eq(n,e)?(X6(t,e),!0):t[e]===null||(Om(t,e),!1),C2e=e=>{let{field:t,keyPath:n,content:r,index:i}=e,{widget:a=`string`}=t;if(h2e.includes(a)||dh(t)!==`builtin`)return eq(i,n)&&X6(r,n),!0;if(a===`object`)return S2e(e);if(a===`list`){let{hasSubFields:n}=$G(t);return y2e({...e,hasSubFields:n})}return oh(t)?y2e({...e,hasSubFields:!1}):v2e({...e,fieldType:a})},w2e=({content:e,defaultLocaleContent:t,field:n,keyPath:r,locale:i,defaultLocale:a})=>{let o=Object.keys(t).filter(e=>tm(e,r));return o.forEach(r=>{e[r]=JG({fieldConfig:n,value:t[r],sourceLocale:a,targetLocale:i})}),!!o.length},T2e=({defaultLocaleContent:e,variableTypes:t})=>Object.entries(t).every(([t,n])=>e[t]===n),E2e=({field:e,content:t,keyPath:n,variableTypes:r})=>{let{fields:i}=e;if(i)return{fields:i,variableTypes:r};let{typeKey:a=`type`}=e,o=`${n}.${a}`,s=t[o],c=mh(e,t,n);return{fields:c,variableTypes:c?{...r,[o]:s}:r}},Z6=e=>{let{field:t,keyPath:n,content:r,index:i,locale:a,defaultLocale:o,defaultLocaleContent:s}=e,{fillDefaults:c=!0,inheritedI18n:l,variableTypes:u={}}=e,d=t.i18n??l,f=a!==o&&s&&T2e({defaultLocaleContent:s,variableTypes:u})?s:void 0;if(t.widget===`keyvalue`&&t.i18n===`duplicate_keys`&&f){U3({valueStore:{[o]:f,[a]:r},defaultLocale:o,keyPath:n});return}if(c&&f&&YG(t)&&ZG({content:r,fieldConfig:t,keyPath:n})&&!ZG({content:f,fieldConfig:t,keyPath:n})){w2e({content:r,defaultLocaleContent:f,field:t,keyPath:n,locale:a,defaultLocale:o});return}if(!(Object.hasOwn(r,n)||eq(i,n))||!C2e(e)||t.widget===`list`&&QJe({fieldConfig:t,locale:a})&&!tq(i,n).length){if(!c||PW(d)&&f&&w2e({content:r,defaultLocaleContent:f,field:t,keyPath:n,locale:a,defaultLocale:o}))return;V3({content:r,keyPath:n,fieldConfig:t,locale:a,defaultLocale:o,dynamicValues:{}});return}let{widget:p=`string`}=t;if(Ld.includes(p)&&oh(t)){x2e(r,n,i);return}if(p===`keyvalue`){PW(d)&&f&&zje({content:r,referenceContent:f,keyPath:n});return}if(p===`object`){if(r[n]===null)return;let i=E2e({field:t,content:r,keyPath:n,variableTypes:u});i.fields?.forEach(t=>{Z6({...e,field:t,keyPath:`${n}.${t.name}`,inheritedI18n:d,variableTypes:i.variableTypes})});return}if(p!==`list`)return;let{field:m}=t,{fields:h}=t,{types:g}=t;!m&&!h&&!g?x2e(r,n,i):tq(i,n).forEach(i=>{let a=`${n}.${i}`;if(m){Z6({...e,field:m,keyPath:a,inheritedI18n:d});return}X6(r,a);let o=E2e({field:t,content:r,keyPath:a,variableTypes:u});o.fields?.forEach(t=>{Z6({...e,field:t,keyPath:`${a}.${t.name}`,inheritedI18n:d,variableTypes:o.variableTypes})})})},Q6=({fields:e,content:t,locale:n,defaultLocale:r,defaultLocaleContent:i,fillDefaults:a=!0})=>{let o=$K(t);return e.forEach(e=>{Z6({field:e,keyPath:e.name,fillDefaults:a,content:t,index:o,locale:n,defaultLocale:r,defaultLocaleContent:i})}),t},D2e=({fields:e,contentMap:t,defaultLocale:n})=>{let r=t[n];return r&&Q6({fields:e,content:r,locale:n,defaultLocale:n}),Object.entries(t).forEach(([t,i])=>{t!==n&&Q6({fields:e,content:i,locale:t,defaultLocale:n,defaultLocaleContent:r})}),t},O2e=({collection:e,collectionFile:t,originalSlugs:n,isIndexFile:r=!1})=>{let i=e._type===`entry`,{allLocales:a,defaultLocale:o}=(t??e)._i18n;if(!i||r)return Object.fromEntries(a.map(e=>[e,!1]));let{editable:{create:s}}=E2(e),c=D2(e);return Object.fromEntries(a.map(e=>!s||n._||n[e]?[e,!1]:[e,e===o||c||`readonly`]))},k2e=({slugEditor:e,locale:t,defaultLocale:n})=>Object.entries(e).filter(([e,r])=>e===t||t===n&&r===`readonly`).map(([e])=>e),A2e=({slugEditor:e,defaultLocale:t,initialSlug:n})=>!n?.trim()||e[t]!==!0?{}:Object.fromEntries(k2e({slugEditor:e,locale:t,defaultLocale:t}).map(e=>[e,n])),j2e=({collection:e,originalEntry:t,initialPath:n})=>{if(!_f(e))return;let{subPath:r}=t;return typeof r==`string`?xf(r):Lc(n??mf.current)},M2e=({contentMap:e,defaultLocale:t,getFieldArgs:n})=>{let r=e[t];r&&Object.entries(r).forEach(([i,a])=>{let o={...n,keyPath:i,valueMap:r},s=lh(o);s?.widget===`hidden`&&RW({fieldConfig:s,getFieldArgs:o})&&Object.entries(e).forEach(([e,n])=>{e!==t&&i in n&&(n[i]=structuredClone(a))})})},$6=({collection:e,collectionFile:t,originalEntry:n={},dynamicValues:r,extraValues:i,expanderStates:a,initialPath:o,initialSlug:s,isIndexFile:c=cf(e,n)})=>{let l=e.name,u=t?.name,{id:d,locales:f}=n,p=d===void 0,{fields:m=[],_i18n:h}=t??e,g=c?of(e):void 0,_=g?.fields??m,v=g?.editor?.preview??t?.editor?.preview??e.editor?.preview??Dl.current?.editor?.preview??!0,y=g?.editor?.second_pane??t?.editor?.second_pane??e.editor?.second_pane??Dl.current?.editor?.second_pane??!0,{allLocales:b,initialLocales:x,defaultLocale:S,canonicalSlug:{key:C}}=h,w=p?x:b.filter(e=>!!f?.[e]?.content),T=Object.fromEntries(b.map(e=>[e,w.includes(e)])),ee=j2e({collection:e,originalEntry:n,initialPath:o}),E=p?{}:C in(f?.[S]?.content??{})?Object.fromEntries(b.map(e=>[e,f?.[e]?.slug])):{_:f?.[S]?.slug??n.slug},te=Object.fromEntries(w.map(e=>p?[e,H3({fields:_,locale:e,defaultLocale:S,dynamicValues:r})]:[e,structuredClone(f?.[e]?.content)]));if(p){let e={contentMap:te,defaultLocale:S,getFieldArgs:{collectionName:l,fileName:u,isIndexFile:c}};zJe(e),M2e(e)}else D2e({fields:_,contentMap:te,defaultLocale:S});let ne=O2e({collection:e,collectionFile:t,originalSlugs:E,isIndexFile:c}),re=$c({id:p?crypto.randomUUID():d,createdAt:Date.now(),isNew:p,isIndexFile:c,canPreview:v,canShowSecondPane:y,collectionName:l,collection:e,fileName:u,collectionFile:t,fields:_,originalEntry:p?void 0:n,defaultLocale:S,originalLocales:T,currentLocales:structuredClone(T),originalSlugs:E,currentSlugs:{...structuredClone(E),...A2e({slugEditor:ne,defaultLocale:S,initialSlug:s})},originalPath:ee,currentPath:ee,originalValues:te,currentValues:{},files:{},extraValues:Object.fromEntries(b.map(e=>[e,DK(i?.[e]?el(i[e]):{})])),validities:Object.fromEntries(b.map(e=>[e,{}])),validationMessages:Object.fromEntries(b.map(e=>[e,{}])),expanderStates:a??{_:{}},slugEditor:ne,interacted:!1,pendingEntries:[]},fK);return w.forEach(e=>{re.currentValues[e]=F3({draft:re,locale:e,target:structuredClone(te[e])})}),re},e8=({entryDraft:e,...t})=>{let{originalEntry:n={}}=t;MWe(),gK(e.current);let r=$6(t);return e.current=r,GZ(n)?J6():d2e({draft:r}),r},t8=e=>!!e&&e.collection._type===`entry`&&!e.isIndexFile,N2e=e=>{if(!e||e.isNew||!t8(e)||oQ(e)||GZ(UZ(e)))return!1;let{collection:t}=e;return gf(t)&&!vf(t)?!1:E2(t).editable.update},P2e=e=>!!e?.isNew&&t8(e)&&Object.values(e.slugEditor).includes(!0)&&E2(e.collection).editorRequired,F2e=(e,{templateOnly:t=!1}={})=>{let{defaultLocaleSlug:n,localizedSlugs:r}=I2({draft:e,templateOnly:t});return r?Object.fromEntries(Object.entries(r).filter(([t])=>!!e.currentLocales[t])):{_:n}},I2e=({draft:e,slugs:t})=>{e.currentSlugs={...e.currentSlugs,...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,FH(t,{locale:e})]))}},L2e=e=>{let{collection:t,isNew:n,defaultLocale:r,currentPath:i,currentLocales:a,currentSlugs:o}=e;if(n||!vf(t))return;let s=Lc(i??``);return D2(t)?{[r]:s,...Object.fromEntries(Object.entries(o).filter(([e,t])=>e!==r&&!!a[e]&&!!O2(t)).map(([e,t])=>[e,xf(t)]))}:{[r]:s}},R2e=({draft:e,ownFolderPaths:t})=>{let{defaultLocale:n,originalEntry:r}=e,i=P4(e).filter(e=>e.id!==r?.id);return Object.fromEntries(Object.entries(t).map(([e,t])=>{let r=xf(t);return[e,i.map(t=>e===n?t.subPath:t.locales[e]?.slug).filter(e=>typeof e==`string`).map(e=>xf(e)).filter(e=>xf(e)===r).map(e=>tu(e))]}))},z2e=({draft:e,ownFolderPaths:t,folderNames:n})=>{let{defaultLocale:r}=e,{currentPath:i,currentSlugs:a}=e;Object.entries(n).forEach(([e,n])=>{let o=$l([xf(t[e]),IH(n)]);e===r?i=o:a={...a,[e]:$l([o,Uc(a[e]).basename])}}),e.currentPath=i,e.currentSlugs=a},B2e=B(`<span class="required" aria-hidden="true">*</span>`),V2e=B(`<header role="none"><h4 role="none"> </h4> <!></header>`),H2e=B(`<!> <!> <div role="none" class="field-wrapper"><!></div>`,1);function U2e(e,t){let n=mo();O(t,!0);let r=LK(),i=J(t,`ariaLabelledby`,3,void 0),a=A(()=>i()??`${n}-label`),o=A(()=>r.current?.slugEditor[t.locale]),s=A(()=>E2(r.current.collection)),c=A(()=>z(o)===!0&&z(s).editorRequired),l=A(()=>z(o)===`readonly`),u=A(()=>r.current?.validities[t.locale]._slug),d=A(()=>!z(l)&&z(u)?.valid===!1),f=A(()=>z(u).customErrorMessage),p=A(()=>r.current?.currentSlugs[t.locale]??``),m=A(()=>{if(z(s).editorRequired)return``;let e=F2e(r.current,{templateOnly:!0});return e[t.locale]??e._}),h=A(()=>z(p)||z(m)),g=j(!1),_=j(``),v=A(()=>F4(r.current,[t.locale])[t.locale]),y=A(()=>{if(z(g))return I4({slug:z(_),required:!1,pattern:z(s).pattern,takenSlugs:z(v),locale:t.locale})}),b=e=>{let n=r.current;n&&k2e({slugEditor:n.slugEditor,locale:t.locale,defaultLocale:n.defaultLocale}).forEach(t=>{n.currentSlugs[t]=e})},x=e=>!z(y)&&(e!==z(h)&&b(e.trim()),!0);sl(()=>z(p),()=>{z(c)&&z(_)!==z(p)&&M(_,z(p),!0)});var S=H(),C=P(S),w=e=>{_6(e,{children:(e,t)=>{var r=H2e(),o=P(r),u=e=>{var t=V2e(),r=N(t),i=F(r,!0),a=I(r,2),o=e=>{U(e,B2e())};G(a,e=>{z(c)&&e(o)}),D(t),R(e=>{q(r,`id`,`${n}-label`),W(i,e)},[()=>Y(`slug`)]),U(e,t)};G(o,e=>{i()||e(u)});var p=I(o,2),v=e=>{a6(e,{get id(){return`${n}-error`},children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>L4({error:z(y),pattern:z(s).pattern})]),U(e,n)},$$slots:{default:!0}})},S=e=>{a6(e,{get id(){return`${n}-error`},children:(e,t)=>{Ur();var n=V();R(()=>W(n,z(f))),U(e,n)},$$slots:{default:!0}})};G(p,e=>{z(y)?e(v):z(d)&&!z(g)&&e(S,1)});var C=I(p,2),w=N(C),T=e=>{NS(e,{dir:`auto`,oninput:()=>{b(z(_))},flex:!0,get required(){return z(c)},get invalid(){return z(d)},get"aria-labelledby"(){return z(a)},get"aria-errormessage"(){return`${n}-error`},get value(){return z(_)},set value(e){M(_,e,!0)}})},ee=e=>{{let t=A(()=>!z(l)),r=A(()=>Y(`edit_slug`)),i=A(()=>!!z(y)||z(d)&&!z(g)),o=A(()=>!!z(y));J3(e,{get id(){return`${n}-value`},get value(){return z(h)},get canEdit(){return z(t)},get editLabel(){return z(r)},get placeholder(){return z(m)},get invalid(){return z(i)},get applyDisabled(){return z(o)},get ariaLabelledby(){return z(a)},get ariaErrormessage(){return`${n}-error`},onApply:x,get editing(){return z(g)},set editing(e){M(g,e,!0)},get text(){return z(_)},set text(e){M(_,e,!0)}})}};G(w,e=>{z(c)?e(T):e(ee,-1)}),D(C),U(e,r)},$$slots:{default:!0}})};G(C,e=>{r.current&&e(w)}),U(e,S),k()}var W2e=B(` <!>`,1);function G2e(e,t){O(t,!0);let n=J(t,`show`,15,!1),r=J(t,`onShowErrors`,3,void 0);fC(e,{get show(){return n()},set show(e){n(e)},children:(e,i)=>{bx(e,{status:`error`,children:(e,i)=>{Ur();var a=W2e(),o=P(a),s=I(o),c=e=>{{let t=A(()=>Y(`show_errors`));Xx(e,{variant:`secondary`,size:`small`,get label(){return z(t)},onclick:()=>{n(!1),r()()}})}};G(s,e=>{r()&&e(c)}),R(e=>W(o,`${e??``} `),[()=>Y(`entry_validation_errors`,{values:{count:t.count}})]),U(e,a)},$$slots:{default:!0}})},$$slots:{default:!0}}),k()}var K2e=/(?:^|\/)(?:\.{1,2})(?:\/|$)/,q2e=e=>{let{id:t,collection:n,currentLocales:r}=e,{defaultLocale:i}=n._i18n,a=vf(n);if(!bf(e))return!1;let{defaultLocaleSlug:o,localizedSlugs:s}=I2({draft:e}),c=[...iW(n.name),...RZ(n.name)].filter(e=>e.id!==t);return Object.entries(r).filter(([,e])=>e).some(([t])=>{let n=s?.[t]??o;if(iKe({draft:e,locale:t,slug:n}))return!1;let r=rKe({draft:e,slug:n,indexFileName:a,locale:t});return c.some(e=>t===i?e.subPath===r:e.locales[t]?.slug===r)})},J2e=e=>{let{collection:t,currentLocales:n,originalPath:r,currentPath:i}=e;if(!_f(t))return{valid:!0,validities:{}};let a=Lc(i??``),o=K2e.test(a)||a.includes(`\\`),s=!o&&!!r&&a!==r&&!!hf(t)?.subfolders&&Sf(r,a),c=!o&&!s&&q2e(e),l=o||s||c,u={};return Object.keys(n).forEach(e=>{u[e]={_path:{patternMismatch:o,customError:s,duplicateError:c,valid:!l}}}),{valid:!l,validities:u}},n8=({draft:e,enforceRequired:t=!0})=>{let{valid:n,validities:r,validationMessages:i}=K4(`currentValues`,{enforceRequired:t,draft:e}),{valid:a,validities:o,validationMessages:s}=K4(`extraValues`,{enforceRequired:t,draft:e}),{valid:c,validities:l}=fGe(e),{valid:u,validities:d}=J2e(e);return{valid:n&&a&&c&&u,validities:Object.fromEntries(Object.keys(r).map(e=>[e,{...r[e],...o[e],...l[e],...d[e]}])),validationMessages:Object.fromEntries(Object.keys(i).map(e=>[e,{...i[e],...s[e]}]))}},Y2e=({draft:e,enforceRequired:t=!0})=>{let{valid:n,validities:r,validationMessages:i}=n8({draft:e,enforceRequired:t});return e.validities=r,e.validationMessages=i,n},X2e=({draft:e,enforceRequired:t=!0})=>Y2e({draft:e,enforceRequired:t})?!0:(U$e({draft:e}),!1),r8=async({draft:e,enforceRequired:t=!0,awaitFieldUpdates:n=!0})=>(n&&await qK(),await FWe(),X2e({draft:e,enforceRequired:t})),Z2e=e=>Object.values(e??{}).some(({valid:e})=>!e),Q2e=e=>Object.values(e).flatMap(e=>Object.values(e).filter(({valid:e})=>!e)).length,i8=tl(),a8=(e,t=!1)=>{i8.current={...i8.current,[e]:!(i8.current?.[e]??t)}},o8={},$2e=async({repository:e})=>{o8.entryEditorSettings?.(),o8.selectAssetsView?.(),o8.entryEditorSettings=await oG(e,`entry-view`,i8,{defaults:{showSecondPane:!0,showPreview:!0,syncScrolling:!0,selectAssetsView:{type:`grid`}}}),s0.current=i8.current?.selectAssetsView,o8.selectAssetsView=ol(()=>{let e=s0.current;e&&Object.keys(e).length&&eo(()=>{let t=i8.current,n=t?.selectAssetsView??{};(0,Qc.default)(e,n)||(i8.current={...t,selectAssetsView:e})})})};ol(()=>{let{current:e}=LX;e&&!eo(()=>i8.current)&&$2e(e)});var e4e=B(`<!> <!>`,1),t4e=B(`<div role="none" class="inner svelte-1ibgz0y"><!> <!></div>`),n4e=B(`<div role="none" class="wrapper svelte-1ibgz0y"><!></div>`),r4e={hash:`svelte-1ibgz0y`,code:`.wrapper.svelte-1ibgz0y {display:contents;.combobox {
@media (width < 1024px) {min-width:128px;--sui-textbox-height: 32px;--sui-button-medium-height: 32px;
}&.error [role='combobox'] {border-color:var(--sui-error-border-color);}}}.inner.svelte-1ibgz0y {display:contents;:is(.error, .error button[data-mode='edit']) {color:var(--sui-error-foreground-color) !important;}}`};function i4e(e,t){O(t,!0),K(e,r4e);let n=LK(),r=J(t,`thisPane`,7),i=J(t,`thatPane`,23,()=>tl(null)),a=J(t,`previewInThisPane`,3,!1),o=A(()=>Rf(n.current)),s=A(()=>z(o).i18nEnabled),c=A(()=>z(o).allLocales),l=A(()=>z(s)&&z(c).length>1),u=A(()=>n.current?.validities??{}),d=A(()=>n.current?.canPreview??!0),f=A(()=>PY.isSmallScreen||PY.isMediumScreen?[...z(c)]:z(c).filter(e=>i().current?.mode!==`edit`||i().current.locale!==e)),p=A(()=>a()||i().current?.mode===`edit`&&z(d)&&!!i8.current?.showPreview),m=A(()=>Object.entries(z(u)).some(([e,t])=>z(f).includes(e)&&Z2e(t))),h=A(()=>PY.isSmallScreen||PY.isMediumScreen||z(c).length>=5),g=A(()=>z(h)?iC:pS),_=A(()=>z(h)?KS:mS),v=A(()=>z(h)?void 0:`tertiary`),y=A(()=>z(h)?void 0:`small`),b=A(()=>r().current?.mode===`edit`?r().current.locale:r().current?.mode===`preview`?`preview`:void 0);var x=n4e(),S=N(x);{let e=A(()=>z(m)&&z(h)?`error`:void 0),a=A(()=>Y(z(l)?`switch_locale`:`switch_view`)),o=A(()=>t.id.replace(`-header`,`-body`));Ro(S,()=>z(g),(t,s)=>{s(t,{get value(){return z(b)},get class(){return z(e)},get ariaLabel(){return z(a)},get"aria-controls"(){return z(o)},children:(e,t)=>{var a=t4e(),o=N(a);No(o,16,()=>z(f),e=>e,(e,t)=>{let a=A(()=>z(l)?Of(t)??t:Y(`edit`)),o=A(()=>!n.current?.currentLocales[t]),s=A(()=>Z2e(z(u)[t]));var c=H(),d=P(c);{let e=e=>{var t=H(),n=P(t),r=e=>{gx(e,{name:`edit_off`})},i=e=>{gx(e,{name:`error`})};G(n,e=>{z(o)?e(r):z(s)&&e(i,1)}),U(e,t)},n=A(()=>z(a)),c=A(()=>z(o)?Y(`locale_content_disabled_short`):z(s)?Y(`locale_content_error_short`):``),l=A(()=>r().current?.mode===`edit`&&r().current.locale===t),u=A(()=>z(s)?`error`:``);Ro(d,()=>z(_),(o,s)=>{s(o,{get variant(){return z(v)},get size(){return z(y)},get label(){return z(a)},get value(){return t},get"aria-label"(){return`${z(n)??``} ${z(c)??``}`},get selected(){return z(l)},get class(){return z(u)},"data-mode":`edit`,onSelect:()=>{JK(()=>{r().current={mode:`edit`,locale:t},i().current?.mode===`preview`&&(i().current={mode:`preview`,locale:t})})},startIcon:e,$$slots:{startIcon:!0}})})}U(e,c)});var s=I(o,2),c=e=>{var t=e4e(),n=P(t),a=e=>{FS(e,{})};G(n,e=>{z(h)&&e(a)});var o=I(n,2);{let e=A(()=>Y(`preview`)),t=A(()=>r().current?.mode===`preview`);Ro(o,()=>z(_),(n,a)=>{a(n,{get variant(){return z(v)},get size(){return z(y)},get label(){return z(e)},value:`preview`,get selected(){return z(t)},"data-mode":`preview`,onSelect:()=>{let{locale:e}=i().current??r().current;JK(()=>{r().current={mode:`preview`,locale:e}})}})})}U(e,t)};G(s,e=>{z(p)&&e(c)}),D(a),U(e,a)},$$slots:{default:!0}})})}D(x),U(e,x),k()}var a4e=new WeakMap,o4e=e=>bh(e,({widget:e})=>e===`compute`,a4e),s8=e=>{let{field:t,keyPath:n,valueMap:r,getIndex:i,results:a}=e;if(!o4e(t))return;let{widget:o=`string`}=t;if(o===`compute`){a.push({keyPath:n,fieldConfig:t});return}if(o===`object`){if(r[n]===null)return;(mh(t,r,n)??[]).forEach(t=>{s8({...e,field:t,keyPath:`${n}.${t.name}`})});return}let s=t,{hasSingleSubField:c}=$G(s);rq(i(),n).forEach(t=>{let i=`${n}.${t}`;c?s8({...e,field:s.field,keyPath:i}):(mh(s,r,i)??[]).forEach(t=>{s8({...e,field:t,keyPath:`${i}.${t.name}`})})})},s4e=({fields:e,valueMap:t,getIndex:n,keyPathPrefix:r=``})=>{let i=[];return e.forEach(e=>{s8({field:e,keyPath:`${r}${e.name}`,valueMap:t,getIndex:n,results:i})}),i},c4e=(e,t)=>{let n=[],r=new Set;return Object.keys(e).forEach(i=>{let[a]=i.match(b$)??[];if(a===void 0||r.has(a))return;r.add(a);let{fields:o}=$m(e[`${a}__sc_component_name`])??{};o&&n.push(...s4e({fields:o,valueMap:e,getIndex:t,keyPathPrefix:a}))}),n},l4e=({fieldConfig:e,locale:t,defaultLocale:n,i18nEnabled:r})=>t===n||r&&FW(e.i18n)&&e.i18n!==`sync`,u4e=({draft:e,valueStoreKey:t,locale:n,valueMap:r,target:i})=>{let{collectionName:a,fileName:o,fields:s,isIndexFile:c}=e,{i18nEnabled:l,defaultLocale:u}=Rf(e),d,f=()=>(d??=nq(r),d),p=t===`extraValues`?c4e(r,f):s4e({fields:s,valueMap:r,getIndex:f});if(!p.length)return!1;let m=!1,h=VW({getFieldArgs:{collectionName:a,fileName:o,isIndexFile:c},locale:n,defaultLocale:u,content:t===`extraValues`?kK(e,n):r,defaultContent:kK(e,u)}),g=t===`extraValues`?r:h;return p.forEach(({keyPath:e,fieldConfig:s})=>{if(t!==`extraValues`&&!l4e({fieldConfig:s,locale:n,defaultLocale:u,i18nEnabled:l}))return;let d=AMe({fieldConfig:s,keyPath:e,locale:n,valueMap:g,collectionName:a,fileName:o,isIndexFile:c,...t===`extraValues`?{keyPathPrefix:e.match(b$)[0],entryValueMap:h}:{}});g[e]!==d&&(i[e]=d,g=g===r?{...r}:g,g[e]=d,m=!0)}),m},c8=e=>{let{currentLocales:t,fields:n}=e,r=!1;return[`currentValues`,`extraValues`].forEach(i=>{(i!==`currentValues`||n.some(o4e))&&Object.entries(e[i]).forEach(([n,a])=>{let o=kK(e,n,i);t[n]&&Object.keys(o).length&&u4e({draft:e,valueStoreKey:i,locale:n,valueMap:o,target:a})&&(r=!0)})}),r},l8=new WeakSet,d4e=e=>{[e.currentValues,e.extraValues].forEach(e=>{Object.values(e).forEach(TK)}),Yr(e.currentLocales),l8.has(e)||(l8.add(e),BK(()=>{l8.delete(e),c8(e)}))},f4e=(e,t)=>{L(()=>{let n=t();n&&zK(n,e())}),L(()=>{let t=e().current;t&&d4e(t)})},u8=e=>aW(e,[...QZ(rW(e),OZ.current.filter(({workflow:t})=>t.collectionName===e)),...FZ(e)]),d8=(e,t)=>{let n=e.arrayIndex===void 0;if(!t)return{type:`deleted`,canOverwrite:n};if(!(0,Qc.default)(t.locales,e.locales))return{type:`modified`,entry:t,canOverwrite:n}},f8=e=>d8(e,Vp.current.find(({id:t})=>t===e.id)),p4e=async e=>{let{isNew:t,originalEntry:n}=e;if(!t&&n){try{await m3()}catch(e){console.error(`Failed to check the repository for changes.`,e)}return f8(n)}},m4e=({type:e,entry:t,canOverwrite:n},r)=>{if(e===`deleted`)return{description:Y(`save_conflict.deleted`),warning:Y(n?`save_conflict.recreate_warning`:`save_conflict.reload_warning`)};let{commitAuthor:i,commitDate:a}=t,o=hW(i);return{description:o&&a?Y(`save_conflict.modified_by`,{values:{name:o,date:bU(a,r)}}):Y(`save_conflict.modified`),warning:Y(n?`save_conflict.overwrite_warning`:`save_conflict.reload_warning`)}},h4e=(e,t)=>{e.isNew&&e.collection._type===`entry`&&SGe(e,t),wGe(e,t),bGe(e)},g4e=(e,t)=>!jd(e)&&!cf(e,t)&&!a3(t),_4e={...nx,draft:`status.drafts`},v4e={info:`workflow.updating_status`,success:`workflow.status_updated`,error:`workflow.status_change_failed`},y4e={info:`workflow.refreshing`,success:`workflow.refreshed`,error:`workflow.refresh_failed`},b4e={info:`workflow.deleting_entry`,success:`workflow.entry_deleted`,error:`deleting_entry_failed`},x4e={info:`workflow.cancelling_deletion`,success:`workflow.deletion_cancelled`,error:`workflow.cancelling_deletion_failed`},S4e={info:`workflow.publishing_entry`,success:`workflow.entry_published`,error:`workflow.publishing_entry_failed`},C4e=e=>e?x4e:b4e,w4e=e=>e?b4e:S4e,T4e=(e,t)=>{let n=t=>e.find(e=>e.status===t)?.entries.length,r=n(`draft`),[i,a]=[n(`pending_review`),n(`pending_publish`)],o=t.length;return i===void 0?a===void 0?{key:`viewing_preview_workflow`,values:{draft:r,deletion:o}}:{key:`viewing_editorial_workflow_without_review`,values:{draft:r,ready:a,deletion:o}}:a===void 0?{key:`viewing_open_authoring_workflow`,values:{draft:r,review:i,deletion:o}}:{key:`viewing_editorial_workflow`,values:{draft:r,review:i,ready:a,deletion:o}}},E4e=(e,t,n=e=>e.workflow.status)=>{let r=new Map(t.map(e=>[e,n(e)])),i=new Set(r.values());return{columns:$b.filter(t=>e.includes(t)||i.has(t)).map(e=>({status:e,entries:t.filter(t=>r.get(t)===e)})),pendingDeletions:t.filter(e=>r.get(e)===`pending_deletion`)}},D4e=e=>{let{collectionName:t,fileName:n}=e.workflow,r=Kf(t);if(!r)return e.slug;let i=n?Wp(r,n):void 0;return i?Kp(i):wW(r,e)},O4e=(e,t)=>{let{companions:n=[]}=e.workflow;if(!t)return[];let r=(e,n)=>{if(!e.length)return[];let r=e.map(({collectionName:e,entry:t})=>{let n=Kf(e);return n?._type===`entry`?Y(`workflow.companion_entry`,{values:{collection:qf(n,{useSingular:!0}),title:wW(n,t)}}):t.slug});return[Y(n,{values:{entries:kf(t).format(r)}})]};return[...r(n.filter(({edited:e})=>!e),`workflow.companion_entries`),...r(n.filter(({edited:e})=>e),`workflow.edited_companion_entries`)]},p8=e=>e.quickAddHost??{collectionName:e.collectionName,workflow:WZ(e),branch:UZ(e)?.workflow.pullRequest.branch,entryIds:[e.id]},k4e=e=>{let t=p8(e);return{...t,entryIds:Ac([...t.entryIds,e.id])}},m8=e=>{let{branch:t}=p8(e);return t?HZ(t):void 0},A4e=(e,t)=>{let n=m8(e);return n?FZ(t,[n]):[]},h8=(e,t=void 0)=>{if(!e)return;let n=t??e.pendingEntries,r=m8(e)?.workflow.companions??[];return r.length?[...r,...n]:n},j4e=(e,t)=>(m8(e)?.workflow.companions??[]).find(({entry:e})=>e.id===t)?.entry??Vp.current.find(e=>e.id===t),M4e=(e,t)=>d8(t,j4e(e,t.id)),N4e=(e,t)=>e.workflow?t.name!==e.collectionName:!DZ(t),P4e=({fieldConfig:{collection:e,file:t},draft:n})=>{if(t)return;let r=Kf(e);if(!(r?._type!==`entry`||r.hide||r.create===!1||iQ({collection:r})))return N4e(p8(n),r)?r:void 0},F4e=({collection:e,draft:t})=>{let{name:n,limit:r=1/0}=e,i=new Set(FZ(n).map(({id:e})=>e)),a=gH(t,n).filter(({entry:e})=>!i.has(e.id)).length;return u8(n)+a<r},I4e=({draft:e,fieldConfig:{collection:t},refEntries:n})=>{if(!e)return[];let r=new Set(n.map(({id:e})=>e));return[...hH(e,t).map(({entry:e})=>e),...A4e(e,t)].filter(({id:e})=>!r.has(e)&&(r.add(e),!0))},L4e=({draft:e,fieldConfig:t})=>{let n=wje(t),r=e?m8(e):void 0,i=new Map([...(r?rRe(t.collection,[r]):[]).map(e=>[e.id,e]),...(e?hH(e,t.collection):[]).filter(({baseEntry:e})=>!!e).map(({entry:e})=>[e.id,e])]),a=i.size?n.map(e=>i.get(e.id)??e):n,o=I4e({draft:e,fieldConfig:t,refEntries:a});return o.length?[...a,...o]:a},R4e=({draft:e,pendingEntries:t})=>{let n=I2({draft:e,pendingEntries:t}),{defaultLocaleSlug:r,localizedSlugs:i}=n,a=[...t.filter(t=>t.collectionName===e.collectionName).map(({entry:e})=>e),...FZ(e.collectionName)].map(({slug:e})=>e);if(Xl(r,a)===r)return n;let o=Xl(r,[...a,...rW(e.collectionName).map(({slug:e})=>e)],{hasExtension:!1}),s=i?{...i,[e.defaultLocale]:o}:void 0;return{defaultLocaleSlug:o,localizedSlugs:s,canonicalSlug:F2({draft:e,defaultLocaleSlug:o,localizedSlugs:s,fillSlugOptions:P2({draft:e})})}},z4e=async({draft:e,parentDraft:t,fieldConfig:n})=>{let{id:r,isNew:i,collectionName:a,originalEntry:o}=e,s=CK(e),c=t.pendingEntries.filter(({entry:e})=>e.id!==r),l=gH(t,a),u=l.findIndex(({entry:e})=>e.id===r);h4e(e,u>-1?u:l.length),c8(e);let d=await n3({draft:e,slugs:i?R4e({draft:e,pendingEntries:c}):I2({draft:e}),runPreSave:!1}),{changes:f,savingAssets:p}=d,m=xKe(d.savingEntry);return{collectionName:a,entry:m,changes:f,savingAssets:p,values:Ac(Object.keys(t.currentValues).flatMap(e=>FG({locale:e,fieldConfig:n,refEntry:m,pendingEntries:h8(t,c)}).map(({value:e})=>e))),...i||!o?{}:{baseEntry:el(o)},source:s}},B4e=({parentDraft:e,entry:t})=>{if(!t)return{changedSince:!1};let n=e.pendingEntries.find(({entry:{id:e}})=>e===t.id);if(!n)return{baseEntry:t,changedSince:!1};let{baseEntry:r}=n;if(!r)return{pendingEntry:n,changedSince:!1};let i=j4e(e,r.id);return{pendingEntry:n,baseEntry:i??r,changedSince:!!i&&!!M4e(e,r)}},V4e=async({collection:e,parentDraft:t,entry:n})=>{let r=t.pendingEntries,{pendingEntry:i,baseEntry:a,changedSince:o}=B4e({parentDraft:t,entry:n}),s=$6(a?{collection:e,originalEntry:el(a)}:{collection:e,initialPath:``});return i?.source&&(s.id=i.entry.id,await u2e({backup:el(i.source),draft:s})),s.pendingEntries=[...r],s.quickAddHost=k4e(t),{draft:s,changedSince:o}},H4e=({baseEntry:e,changes:t})=>!!e&&t.some(({action:e})=>e===`move`),U4e=({draft:e,pendingEntry:{entry:t,source:n}})=>{Object.entries(n?.currentValues??{}).forEach(([n,r])=>{let i=t.locales[n]?.content??{},a=e.currentValues[n];Object.entries(r).forEach(([e,t])=>{a[e]!==t&&a[e]===i[e]&&(a[e]=t)})})},W4e=(e,t)=>{t.forEach(t=>{let n=e.pendingEntries.findIndex(({entry:e})=>e.id===t.entry.id);n>-1?e.pendingEntries[n]=t:e.pendingEntries.push(t)})},G4e=({draft:e,parentDraft:t})=>{let n=_H(e);return e.pendingEntries.filter(e=>n.has(e)&&!t.pendingEntries.includes(e)).map(e=>el(e))},K4e=({draft:e,locale:t,keyPath:n,valueStoreKey:r,fieldConfig:i,pendingEntry:a})=>{let{i18n:o,multiple:s,max:c}=i,[l]=FG({locale:t,fieldConfig:i,refEntry:a.entry,pendingEntries:h8(e)}).map(e=>e.value);l!==void 0&&(s?r6({draft:e,locale:t,i18n:o,fieldConfig:i,valueStoreKey:r,keyPath:n,manipulate:({valueList:e})=>{!e.includes(l)&&(typeof c!=`number`||e.length<c)&&e.push(l)}}):e[r][t][n]=l)},q4e=({draft:e,parentDraft:t})=>!e.isNew&&!t.pendingEntries.some(({entry:t})=>t.id===e.id)&&!SK({...e,pendingEntries:[]})&&!G4e({draft:e,parentDraft:t}).length,J4e=({draft:e,keyPath:t,valueStoreKey:n,fieldConfig:r,previousEntry:i,entry:a})=>{let o=h8(e),{collectionName:s,fileName:c,isIndexFile:l}=e,u=r.collection,d=(e,t)=>{let n=n=>FG({locale:e,fieldConfig:t,refEntry:n,pendingEntries:o}).map(({value:e})=>e),r=n(i),s=n(a);return r.length===s.length?new Map(r.map((e,t)=>[e,s[t]]).filter(([e,t])=>e!==t)):new Map},f=(e,t,n)=>{t.forEach(t=>{n.has(e[t])&&(e[t]=n.get(e[t]))})};Object.entries(e.currentValues).forEach(([e,t])=>{let n=new Map;Object.keys(t).forEach(r=>{let i=lh({collectionName:s,fileName:c,isIndexFile:l,valueMap:t,keyPath:r});mH(i,u)&&(n.has(i)||n.set(i,d(e,i)),f(t,[r],n.get(i)))})}),n===`extraValues`&&Object.entries(e.extraValues).forEach(([e,n])=>{let i=r.multiple?sm(n,t,{live:!0}):[t];f(n,i,d(e,r))})},Y4e=({fieldConfig:{collection:e,file:t},draft:n,entry:r})=>{let i=hH(n,e).find(e=>e.entry.id===r.id);if(i&&!i.source)return!1;if(i&&!i.baseEntry)return!0;let a=Kf(e);if(t||a?._type!==`entry`||a.hide||iQ({collection:a})||!g4e(a,r)||GZ(r))return!1;let o=p8(n);if(!N4e(o,a))return!1;let s=LZ(r);if(zZ({collectionName:e,subPath:r.subPath})||s&&s.workflow.pullRequest.branch!==o.branch)return!1;if(!s&&o.branch&&r.commitDate){let{pullRequest:e,companions:t=[]}=HZ(o.branch)?.workflow??{};if(e&&r.commitDate>e.createdDate&&!t.some(e=>e.entry.id===r.id))return!1}return r.id!==n.id&&!o.entryIds.includes(r.id)},X4e=({draft:e,locale:t,fieldConfig:n,refEntries:r,currentValue:i})=>{let a=(Array.isArray(i)?i:[i]).filter(e=>e!=null&&e!==``);if(!a.length)return[];let o=h8(e),s=new Set(a),c=Map.groupBy(r.flatMap(e=>FG({locale:t,fieldConfig:n,refEntry:e,pendingEntries:o}).filter(({value:e})=>s.has(e)).map(({label:t,value:n})=>({value:n,label:t,entry:e}))),({value:e})=>e),l=new Set;return a.flatMap(t=>{let[r,...i]=c.get(t)??[];return!r||i.some(({entry:e})=>e.id!==r.entry.id)||l.has(r.entry.id)||!Y4e({fieldConfig:n,draft:e,entry:r.entry})?[]:(l.add(r.entry.id),[r])})},Z4e=e=>{if(!e||e.isNew||!e.originalEntry)return;let t=LZ(e.originalEntry);return t?D4e(t):void 0},Q4e=B(`<!> <!> <!>`,1),$4e=B(`<div role="none" class="fields svelte-197lmw7"><!> <!></div>`),e3e=B(`<div role="none" class="wrapper svelte-197lmw7"><p class="hint svelte-197lmw7"> </p> <!> <!></div>`),t3e=B(`<!> <!> <!> <!>`,1),n3e={hash:`svelte-197lmw7`,code:`.wrapper.svelte-197lmw7 {--field-editor-padding: 16px;display:flex;flex-direction:column;gap:16px;}.hint.svelte-197lmw7 {margin:0;color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);}.fields.svelte-197lmw7 {display:flex;flex-direction:column;}`};function r3e(e,t){let n=mo();O(t,!0),K(e,n3e);let r=J(t,`open`,15,!1),i=J(t,`entry`,3,void 0),a=LK(),o=IK(new FK),s=tl(null),c=j(void 0),l=j(!1),u=!1,d=j(!1),f=j(0),p=j(!1),m=j(!1),h=j(!1),g=j(void 0),_=0,v=A(()=>Ec.current?qf(t.collection,{useSingular:!0}):``),y=A(()=>t.collection._i18n),b=A(()=>z(y).i18nEnabled),x=A(()=>z(y).allLocales),S=A(()=>z(y).defaultLocale),C=A(()=>z(b)&&z(x).length>1),w=A(()=>!!z(g)),T=e=>{M(p,!0),console.error(e)},ee=async()=>{_+=1;let e=_,n=i();M(g,n),M(h,!1);let{draft:c,changedSince:l}=await V4e({collection:t.collection,parentDraft:a.current,entry:n});e!==_||!r()?gK(c):(o.current=c,s.current={mode:`edit`,locale:z(S)},M(h,l,!0),u=!1)},E=()=>{u||gK(o.current),_+=1,o.current=void 0,s.current=null,M(g,void 0)},te=async()=>{let e=o.current;if(e&&a.current){if(q4e({draft:e,parentDraft:a.current}))r(!1);else{M(l,!0);try{if(!await r8({draft:e,enforceRequired:!0})){M(f,Q2e(e.validities),!0),M(d,!0);return}let n=await z4e({draft:e,parentDraft:a.current,fieldConfig:t.fieldConfig});if(!r()||o.current!==e)return;if(H4e(n)){U4e({draft:e,pendingEntry:n}),M(m,!0);return}W4e(a.current,[...G4e({draft:e,parentDraft:a.current}),n]),t.onAdd(n,z(g)),u=!0,r(!1)}catch(e){T(e)}finally{M(l,!1)}}}};L(()=>{r()&&eo(()=>{ee().catch(T)})}),f4e(()=>o,()=>z(c));var ne=t3e(),re=P(ne);{let e=e=>{var t=H(),r=P(t),i=e=>{i4e(e,{get id(){return`${n}-header`},get thisPane(){return s}})};G(r,e=>{z(C)&&o.current&&e(i)}),U(e,t)},t=e=>{var t=Q4e(),n=P(t);yS(n,{flex:!0});var i=I(n,2);{let e=A(()=>Y(z(w)?`update`:`add`));Xx(i,{variant:`primary`,get label(){return z(e)},get disabled(){return z(l)},onclick:()=>{te()}})}var a=I(i,2);{let e=A(()=>Y(`cancel`));Xx(a,{variant:`secondary`,get label(){return z(e)},get disabled(){return z(l)},onclick:()=>{r(!1)}})}U(e,t)},i=A(()=>Y(z(w)?`relation_field.edit_entry_title`:`create_entry_title`,{values:{name:z(v)}}));SS(re,{get title(){return z(i)},size:`large`,showOk:!1,showCancel:!1,onClose:()=>{E()},get open(){return r()},set open(e){r(e)},headerExtra:e,footer:t,children:(e,t)=>{var r=e3e(),i=N(r),a=F(i,!0),l=I(i,2),u=e=>{bx(e,{status:`warning`,children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(`relation_field.changed_since_edit`,{values:{name:z(v)}})]),U(e,n)},$$slots:{default:!0}})};G(l,e=>{z(h)&&e(u)});var d=I(l,2),f=e=>{let t=A(()=>s.current);var r=$4e(),i=N(r),a=e=>{var n=H();Oo(P(n),()=>z(t).locale,e=>{U2e(e,{get locale(){return z(t).locale}})}),U(e,n)},c=A(()=>P2e(o.current)&&o.current.slugEditor[z(t).locale]);G(i,e=>{z(c)&&e(a)}),n2e(I(i,2),{get locale(){return z(t).locale}}),D(r),R(()=>q(r,`id`,`${n}-body`)),U(e,r)};G(d,e=>{o.current&&s.current&&e(f)}),D(r),gs(r,e=>M(c,e),()=>z(c)),R(e=>W(a,e),[()=>Y(z(w)?`relation_field.edit_together_hint`:`relation_field.save_together_hint`,{values:{name:z(v)}})]),U(e,r)},$$slots:{headerExtra:!0,footer:!0,default:!0}})}var ie=I(re,2);G2e(ie,{get count(){return z(f)},get show(){return z(d)},set show(e){M(d,e,!0)}});var ae=I(ie,2);fC(ae,{get show(){return z(p)},set show(e){M(p,e,!0)},children:(e,t)=>{bx(e,{status:`error`,children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(z(w)?`relation_field.edit_failed`:`relation_field.add_failed`,{values:{name:z(v)}})]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),fC(I(ae,2),{get show(){return z(m)},set show(e){M(m,e,!0)},children:(e,t)=>{bx(e,{status:`error`,children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(`relation_field.move_unsupported`,{values:{name:z(v)}})]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),U(e,ne),k()}function i3e(e,t){O(t,!0);let n=LK(),{valueStoreKey:r=`currentValues`}=UK(),i=J(t,`required`,3,!0),a=J(t,`readonly`,3,!1),o=J(t,`invalid`,3,!1),s=A(()=>t.fieldConfig.i18n),c=A(()=>t.fieldConfig.max),l=A(()=>Tr(t.fieldConfig.dropdown_threshold,5)),u=e=>{let i=n.current;i&&r6({draft:i,locale:t.locale,i18n:z(s),fieldConfig:t.fieldConfig,valueStoreKey:r,keyPath:t.keyPath,manipulate:e})},d=e=>{u(({valueList:t})=>{t.push(e)})},f=e=>{u(({valueList:t})=>{let n=t.indexOf(e);n>-1&&t.splice(n,1)})};var p=H(),m=P(p),h=e=>{Kme(e,ys({get disabled(){return a()},get readonly(){return a()},get required(){return i()},get invalid(){return o()},get options(){return t.options}},()=>({values:t.currentValue}),{get max(){return z(c)},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`},onAddValue:({detail:{value:e}})=>{d(e)},onRemoveValue:({detail:{value:e}})=>{f(e)},onReorder:({detail:{values:e}})=>{u(({valueList:t})=>{t.splice(0,t.length,...e)})}}))},g=e=>{ffe(e,{get"aria-labelledby"(){return`${t.fieldId??``}-label`},children:(e,n)=>{var r=H();No(P(r),19,()=>t.options,({label:e,value:t},n)=>`${n}-${t}`,(e,n)=>{let r=()=>z(n).label,s=()=>z(n).value;{let n=A(()=>t.currentValue?.includes(s())??!1);vS(e,{get label(){return r()},get value(){return s()},get readonly(){return a()},get required(){return i()},get invalid(){return o()},get checked(){return z(n)},get"aria-errormessage"(){return`${t.fieldId??``}-error`},onChange:({detail:{checked:e}})=>{e?d(s()):f(s())}})}}),U(e,r)},$$slots:{default:!0}})};G(m,e=>{t.options.length>z(l)?e(h):e(g,-1)}),U(e,p),k()}function a3e(e,t){O(t,!0);let n=J(t,`currentValue`,15),r=J(t,`required`,3,!0),i=J(t,`readonly`,3,!1),a=J(t,`invalid`,3,!1),o=A(()=>Tr(t.fieldConfig.dropdown_threshold,5)),s=A(()=>t.options.some(({value:e})=>e===null||e===``)),c=A(()=>!r()&&!z(s)?[{label:Y(`unselected_option`),value:BG(t.options[0]?.value),searchValue:``},...t.options]:t.options);var l=H(),u=P(l),d=e=>{iC(e,{get readonly(){return i()},get required(){return r()},get invalid(){return a()},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`},get value(){return n()},set value(e){n(e)},children:(e,t)=>{var r=H();No(P(r),19,()=>z(c),({label:e,value:t,searchValue:n},r)=>`${r}-${t}`,(e,t)=>{let r=()=>z(t).label,i=()=>z(t).value,a=()=>z(t).searchValue;{let t=A(()=>zG(i())),o=A(()=>i()===n());KS(e,{get label(){return r()},get value(){return i()},get valueType(){return z(t)},get searchValue(){return a()},get selected(){return z(o)},wrap:!0})}}),U(e,r)},$$slots:{default:!0}})},f=e=>{eme(e,{get readonly(){return i()},get required(){return r()},get invalid(){return a()},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`},onChange:({detail:{value:e}})=>{n(e)},children:(e,t)=>{var r=H();No(P(r),19,()=>z(c),({label:e,value:t},n)=>`${n}-${t}`,(e,t)=>{let r=()=>z(t).label,i=()=>z(t).value;{let t=A(()=>zG(i())),a=A(()=>i()===n());ZS(e,{get label(){return r()},get value(){return i()},get valueType(){return z(t)},get checked(){return z(a)}})}}),U(e,r)},$$slots:{default:!0}})};G(u,e=>{z(c).length>z(o)?e(d):e(f,-1)}),U(e,l),k()}function o3e(e,t){O(t,!0);let n=J(t,`currentValue`,15),r=J(t,`required`,3,!0),i=J(t,`readonly`,3,!1),a=J(t,`invalid`,3,!1),o=A(()=>t.fieldConfig.options),s=A(()=>t.fieldConfig.multiple),c=A(()=>z(s)?i3e:a3e),l=A(()=>z(o).map(e=>X(e)?e:{label:e,value:e}));var u=H();Oo(P(u),()=>JSON.stringify(z(l)),e=>{var o=H();Ro(P(o),()=>z(c),(e,o)=>{o(e,{get locale(){return t.locale},get keyPath(){return t.keyPath},get fieldId(){return t.fieldId},get fieldConfig(){return t.fieldConfig},get readonly(){return i()},get required(){return r()},get invalid(){return a()},get options(){return z(l)},get currentValue(){return n()},set currentValue(e){n(e)}})}),U(e,o)}),U(e,u),k()}var s3e=`bulk-edit-row`,c3e=()=>ei(s3e),l3e=e=>{ti(s3e,e)},u3e=({entry:e,locale:t,edits:n})=>{let r={...e.locales[t]?.content};return Object.entries(n??{}).forEach(([e,t])=>{Object.keys(r).forEach(t=>{t.startsWith(`${e}.`)&&delete r[t]}),r[e]=t}),r},d3e=(e,t)=>e.locales[t]?.slug??e.slug,f3e=()=>{let e=LK(),{valueStoreKey:t=`currentValues`}=UK(),n=c3e();return{getValues:r=>{let i=e?.current;return i?i[t]?.[r]:n?.values},getSharedValues:n=>t===`currentValues`?QAe(e?.current,n):void 0,getSlug:t=>{let r=e?.current;return r?r.currentSlugs[t]??r.currentSlugs._:n?.slug}}},p3e=B(`<div role="none" class="actions svelte-1hlgcqp"><!> <!></div>`),m3e=B(`<div role="none" class="wrapper svelte-1hlgcqp"><!> <!> <!></div>`),h3e={hash:`svelte-1hlgcqp`,code:`.wrapper.svelte-1hlgcqp {display:flex;flex-direction:column;gap:8px;}.actions.svelte-1hlgcqp {display:flex;}`};function g3e(e,t){O(t,!0),K(e,h3e);let n=LK(),{valueStoreKey:r=`currentValues`}=UK(),i=f3e(),a=J(t,`currentValue`,15),o=J(t,`required`,3,!0),s=J(t,`readonly`,3,!1),c=J(t,`invalid`,3,!1),l=j(!1),u=j(void 0),d=j(!1),f=A(()=>L4e({draft:n.current,fieldConfig:t.fieldConfig})),p=A(()=>({...t.fieldConfig,widget:`select`,options:PG({locale:t.locale,fieldConfig:t.fieldConfig,refEntries:z(f),currentLocaleValues:i.getValues(t.locale),currentSlug:i.getSlug(t.locale),sharedValues:i.getSharedValues(t.locale),pendingEntries:h8(n.current)})})),m=A(()=>s()||!n.current?void 0:P4e({fieldConfig:t.fieldConfig,draft:n.current})),h=A(()=>!!z(m)&&!!n.current&&F4e({collection:z(m),draft:n.current})),g=A(()=>s()||!n.current?[]:X4e({draft:n.current,locale:t.locale,fieldConfig:t.fieldConfig,refEntries:z(f),currentValue:a()})),_=A(()=>Kf(t.fieldConfig.collection)),v=A(()=>!!z(m)||!!z(g).length),y=A(()=>Ec.current?qf(z(_),{useSingular:!0}):``),b=e=>{M(d,!0),M(u,e),M(l,!0)};var x=m3e(),S=N(x);o3e(S,{get locale(){return t.locale},get keyPath(){return t.keyPath},get typedKeyPath(){return t.typedKeyPath},get fieldId(){return t.fieldId},get fieldLabel(){return t.fieldLabel},get fieldConfig(){return z(p)},get readonly(){return s()},get required(){return o()},get invalid(){return c()},get currentValue(){return a()},set currentValue(e){a(e)}});var C=I(S,2),w=e=>{var n=p3e(),r=N(n),i=e=>{{let t=e=>{gx(e,{name:`add`})},n=A(()=>Y(`add_x`,{values:{name:z(y)}})),r=A(()=>!z(h));Xx(e,{variant:`tertiary`,size:`small`,get label(){return z(n)},get disabled(){return z(r)},"aria-haspopup":`dialog`,onclick:()=>{b()},startIcon:t,$$slots:{startIcon:!0}})}};G(r,e=>{z(m)&&e(i)});var a=I(r,2),o=e=>{{let t=e=>{gx(e,{name:`edit`})},n=e=>{},r=e=>{{let t=A(()=>Y(`relation_field.select_entry_to_edit`));qS(e,{get ariaLabel(){return z(t)},children:(e,t)=>{var n=H();No(P(n),17,()=>z(g),({label:e,entry:t})=>t.id,(e,t)=>{let n=()=>z(t).label,r=()=>z(t).entry;JS(e,{get label(){return n()},"aria-haspopup":`dialog`,onclick:()=>{b(r())}})}),U(e,n)},$$slots:{default:!0}})}},i=A(()=>Y(`edit_x`,{values:{name:z(y)}}));hS(e,{variant:`tertiary`,size:`small`,get label(){return z(i)},startIcon:t,endIcon:n,popup:r,$$slots:{startIcon:!0,endIcon:!0,popup:!0}})}},s=e=>{let t=A(()=>{let[{label:e,entry:t}]=z(g);return{label:e,entry:t}});{let n=e=>{gx(e,{name:`edit`})},r=A(()=>Y(`edit_x`,{values:{name:z(t).label}}));Xx(e,{variant:`tertiary`,size:`small`,get label(){return z(r)},"aria-haspopup":`dialog`,onclick:()=>{b(z(t).entry)},startIcon:n,$$slots:{startIcon:!0}})}};G(a,e=>{t.fieldConfig.multiple&&z(g).length?e(o):z(g).length&&e(s,1)}),D(n),U(e,n)};G(C,e=>{z(v)&&e(w)});var T=I(C,2),ee=e=>{r3e(e,{get collection(){return z(_)},get fieldConfig(){return t.fieldConfig},get entry(){return z(u)},onAdd:(e,i)=>{if(!n.current)return;let a={draft:n.current,keyPath:t.keyPath,valueStoreKey:r,fieldConfig:t.fieldConfig};i?J4e({...a,previousEntry:i,entry:e.entry}):K4e({...a,locale:t.locale,pendingEntry:e})},get open(){return z(l)},set open(e){M(l,e,!0)}})};G(T,e=>{(z(v)||z(d))&&e(ee)}),D(x),U(e,x),k()}var _3e=[`slug`,`{{slug}}`,`{{fields.slug}}`],v3e=({fieldConfig:e,currentValue:t,options:n})=>{let{multiple:r=!1,value_field:i=`{{slug}}`}=e;return(r?t??[]:[t]).filter(e=>e!=null&&e!==``).map(e=>String(e)).map(e=>{let t=n.find(t=>t.value===e)?.label;return!t||t===e?e:_3e.includes(i)?t:`${t} (${e})`})},y3e=B(`<p> </p>`);function b3e(e,t){O(t,!0);let n=LK(),r=A(()=>kf(t.locale)),i=A(()=>L4e({draft:n.current,fieldConfig:t.fieldConfig})),a=A(()=>PG({locale:t.locale,fieldConfig:t.fieldConfig,refEntries:z(i),pendingEntries:h8(n.current)})),o=A(()=>v3e({fieldConfig:t.fieldConfig,currentValue:t.currentValue,options:z(a)}));var s=H(),c=P(s),l=e=>{var n=y3e(),i=F(n,!0);R((e,t,r)=>{q(n,`lang`,e),q(n,`dir`,t),W(i,r),n.dir=n.dir},[()=>Ef(t.locale),()=>Df(t.locale),()=>z(r).format(z(o))]),U(e,n)};G(c,e=>{z(o).length&&e(l)}),U(e,s),k()}var x3e=`https://sveltiacms.app/en/docs/troubleshooting#using-proper-naming-conventions`,g8=({type:e=`error`,strKey:t,values:n={},extraStrKey:r,context:i={},collectors:a})=>{let{collection:o,collectionFile:s,componentName:c,typedKeyPath:l}=i,{errors:u,warnings:d}=a,f=[];o&&f.push(Y(`config.error_locator.collection`,{values:{collection:o.label_singular||o.label||o.name}})),s&&f.push(Y(`config.error_locator.file`,{values:{file:s.label||s.name}})),c&&f.push(Y(`config.error_locator.component`,{values:{component:c}})),l&&f.push(Y(`config.error_locator.field`,{values:{field:l}}));let p=e===`error`?u:d,m=Ec.current,h=f.length?`${kf(m).format(f)}: `:``,g=Y(`config.${e}.${t}`,{values:n});t===`invalid_field_name`&&(g=Ju(g,x3e));let _=r?Y(`config.${r}`,{values:{link:r===`compatibility_link`?`https://sveltiacms.app/en/docs/migration/netlify-decap-cms#compatibility`:void 0}}):``;p.add(`${h}${g}${_?` ${_}`:``}`)},_8=({UNSUPPORTED_OPTIONS:e,config:t,context:n,collectors:r})=>{e.forEach(({type:e=`error`,prop:i,newProp:a,value:o,strKey:s=`unsupported_deprecated_option`})=>{i in t&&(o===void 0||t[i]===o)&&g8({type:e,strKey:s,values:{prop:i,newProp:a},extraStrKey:`compatibility_link`,context:n,collectors:r})})},S3e=/^[^\s.*:<>]+$/,C3e=e=>S3e.test(e)&&e!==`__proto__`,v8=({name:e,index:t,nameCounts:n,strKeyBase:r,context:i,collectors:a,required:o=!1})=>{if(typeof e!=`string`||!e){if(e===``||o&&e===void 0){let e=String(t+1);g8({strKey:`missing_${r}`,context:i,values:{count:e},collectors:a})}return!1}if(!C3e(e))return g8({strKey:`invalid_${r}`,context:i,values:{name:e},collectors:a}),!1;let s=Object.hasOwn(n,e)?n[e]:0;return s===1?(g8({strKey:`duplicate_${r}`,context:i,values:{name:e},collectors:a}),!1):(n[e]=s+1,!0)},y8=({option:e,pattern:t,context:n,collectors:r})=>{typeof t==`string`&&XU(t)===void 0&&g8({strKey:`invalid_regex`,values:{option:e,pattern:t},context:n,collectors:r})},w3e=[`boolean`,`color`,`datetime`,`number`,`relation`,`select`,`string`],b8=e=>{if(e.length!==1)return!1;let[t]=e,n=t.widget??`string`;return w3e.includes(n)&&!t.multiple},T3e=({definition:e,componentName:t,cmsConfig:n,collectors:r})=>{let i={cmsConfig:n,componentName:t};if(km(e)){Mm(e.pattern)&&g8({type:`warning`,strKey:`inline_component_multiline_pattern`,context:i,collectors:r});return}let{mode:a,fields:o}=e;a===`inline`&&!b8(o)&&g8({strKey:`invalid_inline_component_fields`,context:i,collectors:r})},E3e=({template:e,values:t,fields:n,locale:r})=>{if(!e)return null;let i=Qd(e,()=>``);if(i===e)return e.trim()||null;if(!t)return null;let a=bm(t),o=e=>{let{value:t,transformations:i}=gU(e),s=nf(t),c=a[s];if(c==null)return``;let l=SH(i,o);return l.length&&(c=_U({fieldConfig:n.find(e=>e.name===s),value:c,transformations:l,locale:r})),String(c)},s=Qd(e,(e,t)=>o(t));return s!==i&&s.trim()?s.trim():null},D3e=({currentValues:e,values:t,fields:n})=>n.some(t=>e?.[t.name]!==void 0)?e:t,O3e=({template:e,currentValues:t,values:n,fields:r,locale:i,label:a,hasThumbnail:o=!1})=>{let s=D3e({currentValues:t,values:n,fields:r}),c=E3e({template:e,values:s,fields:r,locale:i});if(c)return c;let l=r.find(e=>e.widget===`string`||e.widget===`text`||!e.widget);if(l&&s){let e=s[l.name];if(typeof e==`string`&&e.trim())return e.trim()}return o?``:a},k3e=({thumbnailFieldName:e,values:t,...n})=>{if(e&&t)return P1e({...n,thumbnailFieldName:e,keyPath:``,typedKeyPath:``,valueMap:bm(t)})},A3e=({draft:e,locale:t,keyPathPrefix:n})=>{let{validities:r,validationMessages:i}=K4(`extraValues`,{draft:e});return Object.keys(e.validities).forEach(t=>{Object.assign(e.validities[t],r[t]),Object.assign(e.validationMessages[t],i[t])}),!Object.entries(r[t]??{}).some(([e,t])=>e.startsWith(n)&&!t.valid)},x8=(e,t)=>{Object.keys(e??{}).forEach(n=>{n.startsWith(t)&&delete e[n]})},j3e=(e,t)=>{Object.keys(e).forEach(n=>{n.startsWith(t)&&!n.slice(t.length).includes(`:`)&&delete e[n]})},M3e=(e,t)=>Object.fromEntries(Object.entries(bm(e)).map(([e,n])=>[`${t}${e}`,n])),N3e=(e,t)=>Sm(Object.fromEntries(rm(e,t).map(n=>[n.slice(t.length),e[n]]))),P3e=({values:e,fields:t,componentName:n,locale:r,defaultLocale:i})=>{let a=e??xm(H3({fields:t,locale:r,defaultLocale:r}));a.__sc_component_name=n;let o=xm(Q6({fields:t,content:bm(a),locale:r,defaultLocale:i,fillDefaults:!1}));return(0,Qc.default)(o,a)?a:o},F3e=B(`<span role="none"> </span>`),I3e=B(`<!> <!> <!> <!>`,1),L3e=B(`<div role="none" class="fields svelte-1l1n28m"><!></div>`),R3e=B(`<span contenteditable="false" tabindex="0"><!> <!></span> <!>`,1),z3e=B(`<span role="group" class="component inline-field svelte-1l1n28m" contenteditable="false" tabindex="0"><!></span>`),B3e=B(`<div role="none" class="item-list"><!></div>`),V3e=B(`<div role="group" contenteditable="false" tabindex="0"><!> <!></div>`),H3e={hash:`svelte-1l1n28m`,code:`.component.svelte-1l1n28m {&.block {display:block;&:not(:first-child) {margin-top:var(--sui-paragraph-margin);}&:not(:last-child) {margin-bottom:var(--sui-paragraph-margin);}}&.inline {display:inline-block;}}.wrapper.svelte-1l1n28m {border-inline-width:2px;border-color:var(--sui-secondary-border-color);border-radius:var(--sui-control-medium-border-radius);width:100%;color:var(--sui-secondary-foreground-color); /* Reset color within a link */background-color:var(--sui-primary-background-color);white-space:normal;-webkit-user-select:none;user-select:none;&.expanded {border-bottom-width:2px;}&:focus {outline-color:var(--sui-primary-accent-color-translucent);}
/* Make the input fields compact within the built-in image component */&:is([data-component-name='image']:where(.svelte-1l1n28m), [data-component-name='linked-image']:where(.svelte-1l1n28m)) {
@media (768px <= width) {
/* Hide the bottom border */[data-field-type]::after {display:none;}[data-field-type='string'] {display:flex;align-items:center;gap:8px;padding-block:0 16px;h4 {margin-bottom:0 !important;}.field-wrapper {flex:auto;}}
}button {margin:var(--sui-focus-ring-width);}}}.inline-field.svelte-1l1n28m {
/* Make the controls as compact as the text around them allows */--sui-textbox-singleline-min-width: 8em;--sui-combobox-min-width: 6em;display:inline-flex;align-items:center;vertical-align:middle;margin-inline:2px;border-radius:var(--sui-control-medium-border-radius);padding:2px;background-color:var(--sui-secondary-background-color);white-space:normal;-webkit-user-select:none;user-select:none;&:focus {outline:2px solid var(--sui-primary-accent-color-translucent);outline-offset:1px;}.field.inline {display:inline-flex;align-items:center;}
/* Only the control itself, not the text box within a number input */.field.inline > .sui:is(.text-input, .number-input, .combobox) {margin:0;width:auto;}}.placeholder.svelte-1l1n28m {--icon-size: 20px; /* Thumbnail size */align-items:center;gap:0.4em;border:dashed 1px currentColor;border-color:hsl(from currentColor h s l / 0.5);border-radius:2px;padding-inline:0.4em;cursor:pointer;-webkit-user-select:none;user-select:none;&:not(.static):hover {border-color:currentColor;}&:focus {outline:2px solid var(--sui-primary-accent-color-translucent);outline-offset:1px;}&.inline {display:inline-flex;}&.block {display:flex;width:fit-content;}
/* Center the thumbnail on the line rather than sitting it on the baseline */&:has(.preview) {vertical-align:middle;}&.thumbnail-only {padding:2px;}
/* A component without fields can’t be edited */&.static {cursor:default;}}.fields.svelte-1l1n28m {display:flex;flex-direction:column;gap:16px;}`};function U3e(e,t){let n=mo();O(t,!0),K(e,H3e);let r=(e,n)=>{let r=()=>(n?.()).typedPrefix,i=()=>(n?.()).observe,a=yi(()=>Tr((n?.()).inline,!1));var o=H();No(P(o),17,()=>t.fields,e=>e.name,(e,n)=>{let o=e=>{w6(e,{get locale(){return z(p)},get keyPath(){return`${z(C)??``}${z(n).name??``}`},get typedKeyPath(){return`${r()??``}${z(n).name??``}`},get fieldConfig(){return z(n)},context:`rich-text-editor-component`,get componentName(){return t.componentName},valueStoreKey:E,get inline(){return z(a)}})};var s=H(),c=P(s),l=e=>{pH(e,{children:(e,t)=>{o(e)},$$slots:{default:!0}})},u=e=>{o(e)};G(c,e=>{i()?e(l):e(u,-1)}),U(e,s)}),U(e,o)},i=j(void 0);IK({get current(){return z(i)?.current},set current(e){z(i)&&(z(i).current=e)},get modified(){return z(i)?.modified??!1}});let a=j([]),o=j(!1);WK({get parentComponentNames(){return z(a)},get readonly(){return z(o)}});let s=J(t,`mode`,3,`block`),c=J(t,`inline`,3,!1),l=J(t,`collapsed`,3,!1),u=J(t,`values`,7),d=J(t,`onChange`,3,()=>void 0),f=j(void 0),p=j(``),m=j(``),h=j(``),g=j(!l()),_=j(!1),v=j(void 0),y=j(!1),b=A(()=>t.fields.length>0),x=A(()=>s()===`inline`&&b8(t.fields)),S=A(()=>JSON.stringify([...z(a),t.componentName])),C=A(()=>z(m)?`${z(m)}:${n}:`:``),w=A(()=>z(h)?`${z(h)}:${n}:`:``),T=()=>z(f),ee=e=>{let{target:t}=e;t.closest(`[contenteditable]`)===z(f)&&(e.stopPropagation(),!t.matches(`button, input, textarea`)&&e.key!==`Tab`&&e.preventDefault(),t===z(f)&&e.key===`Backspace`&&!z(o)&&d()(new CustomEvent(`remove`)))},E=`extraValues`,te,ne=!1,re=!1,ie=A(()=>{if(z(i)?.current&&z(p)&&z(m))return N3e(kK(z(i).current,z(p),E),z(C))}),ae=e=>{z(i)&&zK(e,z(i))},oe=e=>{(0,Qc.default)(e,u())||(ne=!0,u(e))},se=()=>{z(b)&&(M(v,z(ie)?{...z(ie)}:void 0,!0),M(_,!0))},ce=()=>{let e=z(i)?.current;e&&z(p)&&z(m)&&z(v)&&(x8(e[E][z(p)],z(C)),Object.assign(e[E][z(p)],M3e(z(v),z(C))))},le=()=>{M(_,!1),d()(new CustomEvent(`remove`))},ue=async()=>{await qK();let e=z(i)?.current;e&&A3e({draft:e,locale:z(p),keyPathPrefix:z(C)})&&(M(y,!1),M(_,!1),d()(new CustomEvent(`update`,{detail:z(ie)})),M(v,void 0))},de=()=>{z(y)?(M(_,!1),d()(new CustomEvent(`remove`))):(ce(),M(_,!1),M(v,void 0))},fe=j(void 0),pe=A(()=>{let e=z(i)?.current;if(!e)return;let n=k3e({thumbnailFieldName:t.thumbnail,values:D3e({currentValues:z(ie),values:u(),fields:t.fields}),componentName:t.componentName,collectionName:e.collectionName,fileName:e.fileName,isIndexFile:e.isIndexFile,entry:e.originalEntry,files:e.files,locale:z(p)});return n&&(n.asset??n.url)!==z(fe)?n:void 0}),me=A(()=>O3e({template:t.summary,currentValues:z(ie),values:u(),fields:t.fields,locale:z(p),label:t.label,hasThumbnail:!!z(pe)}));So(()=>{let e=Lm(z(f),e=>{M(o,e,!0)});return window.requestAnimationFrame(()=>{if(re)return;M(i,qje(z(f)),!0),M(a,koe(z(f)));let e=z(f)?.closest(`[data-locale]`),t=z(f)?.closest(`[data-key-path]`);M(p,e?.dataset.locale,!0),M(m,t?.dataset.keyPath,!0),s()!==`dialog`&&M(h,t?.dataset.typedKeyPath,!0),M(y,!u()),s()===`dialog`&&z(y)&&se()}),()=>{let t=z(i)?.current;re=!0,e(),t&&(x8(t[E][z(p)],z(C)),x8(t.validities[z(p)],z(C)))}}),sl(()=>[u(),z(p),z(m)],()=>{if(z(i)?.current&&z(p)&&z(m)){let e=ne;ne=!1;let n=P3e({values:u(),fields:t.fields,componentName:t.componentName,locale:z(p),defaultLocale:z(i).current.defaultLocale});if(n!==u()&&u(n),e&&(te=u()),!(0,Qc.default)(u(),z(ie))){let t=z(i),n=M3e(u(),z(C));BK(()=>{let r=t.current;r&&(re||(e&&j3e(r[E][z(p)],z(C)),Object.assign(r[E][z(p)],n)))})}s()===`dialog`&&!z(b)&&z(y)&&(M(y,!1),d()(new CustomEvent(`update`,{detail:u()})))}}),sl(()=>[s(),z(ie)],()=>{s()!==`dialog`&&!(0,Qc.default)(te,z(ie))&&(d()(new CustomEvent(`update`,{detail:z(ie)})),te=z(ie))});var he={getElement:T,setValues:oe},ge=H(),_e=P(ge),ve=e=>{var n=R3e(),i=P(n);let a;var s=N(i),l=e=>{P0(e,{get asset(){return z(pe).asset},get src(){return z(pe).url},variant:`icon`,cover:!0,onError:()=>{let{asset:e,url:t}=z(pe);M(fe,e??t)}})};G(s,e=>{z(pe)&&e(l)});var u=I(s,2),h=e=>{var t=F3e(),n=F(t,!0);R(()=>W(n,z(me))),U(e,t)};G(u,e=>{z(me)&&e(h)}),D(i),gs(i,e=>M(f,e),()=>z(f));var g=I(i,2),v=e=>{SS(e,{get title(){return t.label},size:`large`,showOk:!1,showCancel:!1,onCancel:()=>{de()},get open(){return z(_)},set open(e){M(_,e,!0)},footer:e=>{var t=I3e(),n=P(t),r=e=>{{let t=A(()=>Y(`remove`));Xx(e,{variant:`secondary`,get label(){return z(t)},onclick:()=>{le()}})}};G(n,e=>{z(o)||e(r)});var i=I(n,2);yS(i,{flex:!0});var a=I(i,2),s=e=>{{let t=A(()=>Y(z(y)?`insert`:`update`));Xx(e,{variant:`primary`,get label(){return z(t)},onclick:()=>{ue()}})}};G(a,e=>{z(o)||e(s)});var c=I(a,2);{let e=A(()=>Y(`cancel`));Xx(c,{variant:`secondary`,get label(){return z(e)},onclick:()=>{de()}})}U(e,t)},children:(e,t)=>{var n=L3e(),i=N(n),a=e=>{r(e,()=>({typedPrefix:z(C),observe:!1}))};G(i,e=>{z(p)&&z(m)&&e(a)}),D(n),qo(n,()=>ae),R(()=>{q(n,`data-locale`,z(p)),q(n,`data-component-path`,z(S))}),U(e,n)},$$slots:{footer:!0,default:!0}})};G(g,e=>{z(b)&&e(v)}),R(()=>{q(i,`role`,z(b)?`button`:`img`),a=$o(i,1,`component ${c()?`inline`:`block`} placeholder`,`svelte-1l1n28m`,a,{static:!z(b),"thumbnail-only":!!z(pe)&&!z(me)}),q(i,`aria-label`,t.label),q(i,`title`,t.label),q(i,`data-key-path-prefix`,z(C)),q(i,`data-component-name`,t.componentName)}),so(`click`,i,()=>{se()}),so(`keydown`,i,e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),se()),e.key===`Backspace`&&(e.preventDefault(),z(o)||d()(new CustomEvent(`remove`)))}),U(e,n)},ye=e=>{var n=z3e(),i=N(n),a=e=>{r(e,()=>({typedPrefix:z(w),observe:!1,inline:!0}))};G(i,e=>{z(p)&&z(m)&&e(a)}),D(n),gs(n,e=>M(f,e),()=>z(f)),qo(n,()=>e=>ao(e,`keydown`,ee)),R(()=>{q(n,`aria-label`,t.label),q(n,`title`,t.label),q(n,`data-key-path-prefix`,z(C)),q(n,`data-component-name`,t.componentName),q(n,`data-component-path`,z(S))}),U(e,n)},be=e=>{var i=V3e();let a;var s=N(i);T6(s,{get label(){return t.label},get controlId(){return`object-${n}-item-list`},get expandable(){return z(b)},get expanded(){return z(g)},set expanded(e){M(g,e,!0)},endContent:e=>{var t=H(),n=P(t),r=e=>{F0(e,{onclick:()=>{d()(new CustomEvent(`remove`))}})};G(n,e=>{z(o)||e(r)}),U(e,t)},$$slots:{endContent:!0}});var l=I(s,2),u=e=>{var t=B3e(),i=N(t),a=e=>{r(e,()=>({typedPrefix:z(w),observe:!0}))};G(i,e=>{z(p)&&z(m)&&z(g)&&e(a)}),D(t),R(()=>q(t,`id`,`object-${n}-item-list`)),U(e,t)};G(l,e=>{z(b)&&e(u)}),D(i),gs(i,e=>M(f,e),()=>z(f)),qo(i,()=>e=>ao(e,`keydown`,ee)),R(()=>{a=$o(i,1,`component ${c()?`inline`:`block`} wrapper`,`svelte-1l1n28m`,a,{expanded:z(b)&&z(g)}),q(i,`aria-label`,t.label),q(i,`data-key-path-prefix`,z(C)),q(i,`data-component-name`,t.componentName),q(i,`data-component-path`,z(S))}),U(e,i)};return G(_e,e=>{s()===`dialog`?e(ve):z(x)?e(ye,1):e(be,-1)}),U(e,ge),k(he)}co([`click`,`keydown`]);var W3e=/^([ \t]*)(`{3,}|~{3,})(.*)$/,G3e=/`+/g,K3e=/\n[ \t]*\n/,q3e=RegExp(`^ {0,3}</?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:[ \\t]|/?>|$)`,`i`),J3e=/^ {0,3}(?:<(?!(?:pre|script|style|textarea)[\s/>])[a-z][a-z\d-]*(?:[ \t]+[a-z_:][\w.:-]*(?:[ \t]*=[ \t]*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*[ \t]*\/?>|<\/[a-z][a-z\d-]*[ \t]*>)[ \t]*$/i,Y3e=(e,t,n)=>{let r=0;for(;t-r>n&&e[t-r-1]===`\\`;)r+=1;return r%2==1},X3e=e=>{let[,t=``,n=``,r=``]=e.match(W3e)??[];if(!(!n||n[0]==="`"&&r.includes("`")))return{indent:t,char:n[0],length:n.length,info:r}},Z3e=(e,{char:t,length:n})=>{let r=e.trim();return r.length>=n&&r===t.repeat(r.length)},Q3e=e=>{let t=[],n,r=0,i=0,a=(n,r)=>{let i=e.slice(n,r),a=[...i.matchAll(G3e)],o=0;a.forEach(({0:e,index:r},s)=>{if(r<o||Y3e(i,r,o))return;let c=a.find((t,n)=>n>s&&t[0].length===e.length);c&&!K3e.test(i.slice(r,c.index))&&(o=c.index+e.length,t.push([n+r,n+o]))})};return e.split(`
`).forEach(e=>{let o=i+e.length;if(n)Z3e(e,n)&&(t.push([n.start,o]),n=void 0,r=o);else{let t=X3e(e);t&&(a(r,i),n={start:i+t.indent.length,char:t.char,length:t.length})}i=o+1}),n?t.push([n.start,e.length]):a(r,e.length),t.sort(([e],[t])=>e-t)},$3e=(e,t)=>t.some(([t,n])=>e>t&&e<n),e6e=(e,{afterParagraph:t=!1}={})=>q3e.test(e)||!t&&J3e.test(e),t6e=(e,t)=>{let n=e.slice(0,Math.max(0,t-1)).split(`
`),r=n.findLastIndex(e=>!e.trim())+1;return n.slice(r).some((e,t)=>e6e(e,{afterParagraph:t>0}))},S8=()=>void 0,n6e=new WeakMap,r6e=({fields:e})=>_4.current?Nl(n6e,e,()=>b4().fromJS(e)):void 0,i6e=e=>Array.from(e).reduce((e,t)=>((e^t.charCodeAt(0))>>>0)*16777619>>>0,2166136261).toString(16),a6e=(...e)=>{let{alt:t,src:n,title:r,singleQuotedTitle:i,alt2:a,src2:o,title2:s,singleQuotedTitle2:c,link:l}=e.at(-1);if(o!==void 0){let e=/["']/.test(l)?l:l.replaceAll(` `,`%20`);return`[${a6e({alt:a,src:o,title:s,singleQuotedTitle:c})}](${e})`}let u=n.replaceAll(` `,`%20`);return r?`![${t}](${u} "${r}")`:i?`![${t}](${u} '${i}')`:`![${t}](${u})`},o6e=new RegExp(Um,`g`),s6e=[`image`,`linked-image`],c6e=new Map,l6e=10,u6e=e=>typeof e==`string`?[e]:e&&typeof e==`object`?Object.values(e).flatMap(u6e):[],d6e=e=>Nl(c6e,`${e.source}|${e.flags}`,()=>e.global?e:new RegExp(e.source,`${e.flags}g`)),f6e=({match:e,index:t,end:n},r)=>r.some(r=>t>=r.start&&n<=r.end&&r.values.some(t=>t.includes(e[0]))),p6e=(e,t,n)=>{let r=[],i=Q3e(e);t.forEach((t,a)=>{(t.inlinePattern?Am(e,t.pattern,t.inlinePattern):e.matchAll(d6e(t.pattern))).forEach(e=>{let o={def:t,match:e,index:e.index,end:e.index+e[0].length,order:a};e[0]&&!$3e(e.index,i)&&(!n||f6e(o,n))&&r.push(o)})}),r.sort((e,t)=>e.index-t.index||t.end-e.end||e.order-t.order);let a=0;return r.filter(e=>e.index<a?!1:(a=e.end,!0))},m6e=(e,t)=>({seenHashes:new Map,previewMap:new Map,previousPreviewMap:e,getAsset:t,assetMap:new Map}),h6e=(e,{def:t,fieldProps:n,source:r})=>{let{seenHashes:i,previewMap:a,previousPreviewMap:o,getAsset:s,assetMap:c}=e,{toPreview:l}=t,u=i6e(r),d=i.get(u)??0,f=d===0?u:`${u}-${d}`,p=o?.get(f);if(p==null&&l){let e=[];p=l(n,(t,n)=>{let r=s(t,n);return r&&e.push(r),r},r6e(t)),e.length&&c.set(f,e)}return i.set(u,d+1),a.set(f,p),{key:f,preview:p}},g6e=(e,t)=>{let n=e.indexOf(`
`,t);return n>=0&&e.slice(n+1).split(`
`,1)[0].trim()?n:void 0},_6e=(e,{preview:t,index:n,end:r})=>{let i=e.lastIndexOf(`
`,n-1)+1,a=e.slice(i,n);if(!/^ {0,3}$/.test(a)||t.includes(`
`))return;let[o]=t.split(`
`),s=g6e(e,r),c=a+o+(o===t?e.slice(r,s??e.indexOf(`
`,r)):``),l=i?e.slice(e.lastIndexOf(`
`,i-2)+1,i-1):``;return s!==void 0&&e6e(c,{afterParagraph:!!l.trim()})&&!t6e(e,i)?s:void 0},v6e=(e,{string:t,matches:n})=>{let r=[],i=[],a=0,o=0,s,c=e=>{let n=t.slice(a,e);s!==void 0&&s<e&&(n=`${t.slice(a,s)}\n${t.slice(s,e)}`,s=void 0),r.push(n),o+=n.length};return n.forEach(({def:n,match:l,index:u,end:d})=>{let f=n.fromBlock?.(l)??l.groups??{},{key:p,preview:m}=h6e(e,{def:n,fieldProps:f,source:l[0]});if(c(u),typeof m==`string`)i.push({start:o,end:o+m.length,values:u6e(f)}),r.push(m),o+=m.length,s=_6e(t,{preview:m,index:u,end:d})??s;else{let e=`<span data-component-key="${p}"></span>`;r.push(e),o+=e.length}s!==void 0&&s<d&&(s=g6e(t,d)),a=d}),c(t.length),{string:r.join(``),regions:i}},y6e=(e,t,n,r=S8)=>{let i=t.filter(e=>Fm(e)&&!!e.toPreview),a=m6e(n,r),{previewMap:o,assetMap:s}=a;if(!i.length)return{markdown:e,previewMap:o,assetMap:s};let c=document.createElement(`template`);c.innerHTML=e;let l=e=>{[...e.children].forEach(e=>{let t,n=i.find(n=>(t=e.matches(n.htmlSelector)?n.fromBlockHTML(e):void 0,!!t));if(!n){l(e);return}let{key:r,preview:o}=h6e(a,{def:n,fieldProps:t,source:e.outerHTML});if(typeof o==`string`){let t=document.createElement(`template`);t.innerHTML=o,e.replaceWith(t.content)}else{let t=document.createElement(`span`);t.dataset.componentKey=r,e.replaceWith(t)}})};return l(c.content),{markdown:c.innerHTML,previewMap:o,assetMap:s}},b6e=(e,t,n,r=S8,i=`markdown`)=>{if(i===`html`)return y6e(e??``,t,n,r);let a=m6e(n,r),{previewMap:o,assetMap:s}=a,c=e??``,l=Q3e(c),u=t.filter(({id:e})=>!s6e.includes(e)),d=c.replace(o6e,(...e)=>$3e(e.at(-3),l)?e[0]:a6e(...e)),f;for(let e=0;e<l6e&&u.length;e+=1){let e=p6e(d,u,f);if(!e.length)break;let t=v6e(a,{string:d,matches:e});if(d=t.string,f=t.regions,!f.length)break}return{markdown:d,previewMap:o,assetMap:s}},x6e=({toPreview:e,toInline:t},n)=>{let r,i=``;try{r=e?.(n,S8,void 0)}catch{r=void 0}if(typeof r==`string`||r instanceof HTMLElement||(0,mr.isValidElement)(r))return{preview:r,text:i};try{i=String(t(n)??``)}catch{}return{text:i}},S6e=(e,{preview:t,text:n})=>typeof t==`string`?(e.innerHTML=Km(fr(t)),()=>e.replaceChildren()):t instanceof HTMLElement?(e.replaceChildren(t),()=>{e.replaceChildren(),t.dispatchEvent(new CustomEvent(`Unmount`))}):t?OJe(e,t):(e.textContent=n,()=>e.replaceChildren()),C6e=B(`<span contenteditable="false" tabindex="0"><span role="none" class="preview"></span></span>`),w6e={hash:`svelte-dyy7pv`,code:`.inline-pattern.svelte-dyy7pv {display:inline-flex;align-items:baseline;vertical-align:baseline;border-radius:var(--sui-control-medium-border-radius);padding-inline:2px;cursor:default;-webkit-user-select:none;user-select:none;&.editable {cursor:pointer;&:hover {background-color:var(--sui-hover-background-color);}}&:focus {outline:2px solid var(--sui-primary-accent-color-translucent);outline-offset:1px;}}`};function T6e(e,t){O(t,!0),K(e,w6e);let n=J(t,`onChange`,3,()=>void 0),r=j(void 0),i=j(t.values??{}),a=j(!1),o=!1,s=A(()=>x6e({toPreview:t.toPreview,toInline:t.toInline},z(i))),c=()=>z(r),l=e=>{M(i,e)},u=async()=>{if(!(!t.onEdit||z(a)||o)){o=!0;try{let e=await t.onEdit({data:z(i)});e&&typeof e==`object`&&(M(i,e),n()(new CustomEvent(`update`,{detail:e})))}catch(e){console.error(e)}finally{o=!1}}};So(()=>Lm(z(r),e=>{M(a,e,!0)}));var d={getElement:c,setValues:l},f=C6e();let p;return qo(N(f),()=>e=>S6e(e,z(s))),D(f),gs(f,e=>M(r,e),()=>z(r)),R(()=>{q(f,`role`,t.onEdit?`button`:`group`),p=$o(f,1,`component inline-pattern svelte-dyy7pv`,null,p,{editable:!!t.onEdit&&!z(a)}),q(f,`aria-label`,t.onEdit?void 0:t.label),q(f,`title`,t.label),q(f,`data-component-name`,t.componentName)}),so(`click`,f,e=>{e.preventDefault(),u()}),so(`keydown`,f,e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),u()),(e.key===`Backspace`||e.key===`Delete`)&&(e.preventDefault(),z(a)||n()(new CustomEvent(`remove`)))}),U(e,f),k(d)}co([`click`,`keydown`]);var E6e=/^<(?<tagName>[a-z]+)/i,D6e=new WeakMap,O6e=(e,t)=>{if(e&&typeof e==`object`&&`localName`in e)return e.localName;if(typeof e==`string`)return e.trim().match(E6e)?.groups?.tagName??(typeof t==`string`?t.trim().match(E6e)?.groups?.tagName:void 0)},k6e=(e,t=[])=>{try{return e?.({},...t)}catch{return}},A6e=e=>{let{id:t,label:n,collapsed:r,mode:i,summary:a,thumbnail:o,fields:s,toBlock:c,toPreview:l,htmlSelector:u,fromBlockHTML:d,toBlockHTML:f,inlinePattern:p}=e,m=Nm(e),h=Fm(e),g=!h&&!p,_=h?Pm(u):[],v=g?k6e(l,[S8,r6e(e)]):void 0,y=g?k6e(c):void 0,b=g?O6e(v,y):void 0,x=e=>e.matches(u)?d(e):void 0;class S extends BT{__props;__selectedText;constructor(e,t){super(t),this.__props=e}static getType(){return t}isInline(){return m}static clone(e){return new S(e.__props,e.__key)}static importJSON(e){return new S(e.props).updateFromJSON(e)}exportJSON(){return{props:Im(this.__props??{}),type:t,version:1}}createDOM(e,u){let d=!!u&&!jD(`sui-import`)&&!jD(`history-merge`),{__selectedText:f}=this,h,g=null,_,v=!1,y=()=>{v||(v=!0,yo(_))},b=async({type:e,detail:t})=>{await Za(),g??=BE(h);let{activeElement:n}=document,r=n,i=r?.matches(`[contenteditable="true"]`)?window.getSelection():null,a=i&&i.rangeCount>0?i.getRangeAt(0).cloneRange():null;g?.update(()=>{if(e===`update`)try{this.getWritable().__props=t}catch{}e===`remove`&&(y(),this.remove())},{discrete:!0,tag:e===`update`?`skip-dom-selection`:void 0,onUpdate:()=>{r&&document.body.contains(r)&&(r.focus({preventScroll:!0}),a&&i&&(i.removeAllRanges(),i.addRange(a)))}})},x=async e=>{let t;try{let{onInsert:n}=p;t=await n({selectedText:e})}catch(e){console.error(e)}g??=BE(h),g?.update(()=>{let n=$E(this.getKey());if(n){if(t&&typeof t==`object`)n.getWritable().__props=t,n.selectNext(0,0);else if(e){let t=iE(e);n.replace(t),t.select(0,e.length)}else n.selectPrevious(),n.remove()}},{discrete:!0,tag:`history-merge`}),g?.focus()};return _=p?go(T6e,{target:document.createElement(`div`),props:{componentName:t,label:n,toPreview:l,toInline:c,onEdit:p.onEdit,values:this.__props,onChange:b}}):go(U3e,{target:document.createElement(`div`),props:{componentName:t,label:n,collapsed:r,mode:i,inline:m,summary:a,thumbnail:o,fields:s,values:this.__props,onChange:b}}),Pi(),h=_.getElement(),D6e.set(h,_),window.requestAnimationFrame(()=>{let e=h.isConnected?h.closest(`[data-lexical-editor]`):null;if(!e){y();return}p?d&&f!==void 0&&x(f):d&&h.closest(`[role="textbox"][aria-readonly="false"]`)&&h.focus(),h.closest(`.field`)?.addEventListener(`Unmount`,y,{once:!0});let t=new MutationObserver(()=>{h.isConnected||(y(),t.disconnect())});t.observe(e,{childList:!0,subtree:!0})}),h}exportDOM(){if(!f)return{element:this.createDOM()};let e=f(Im(this.__props??{}));if(e&&typeof e==`object`)return{element:e};let t=document.createElement(`template`);return t.innerHTML=typeof e==`string`?e:``,{element:t.content}}static importDOM(){let e={};return h?(_.forEach(t=>{e[t]=e=>{let t=x(e);return t?{conversion:()=>({node:new S(t),after:()=>[]}),priority:4}:null}}),e):(b&&(e[b]=()=>({conversion:e=>({node:new S(Object.fromEntries(s.map(({name:t})=>[t,e[t]??``])))}),priority:3})),e)}updateDOM(e,t){return e.__props!==this.__props&&D6e.get(t)?.setValues(this.__props??{}),!1}}return S},j6e=({componentDef:e,CustomNode:t})=>{let{id:n,pattern:r,fromBlock:i,toBlock:a,inlinePattern:o}=e,s=new RegExp(r.source,r.flags.replace(`g`,``)),c=e=>i?.(e)??e.groups??{},l=e=>e instanceof t&&e.getType()===n,u=e=>l(e)?a(Im(e.__props??{})):null;return Nm(e)?{type:`text-match`,dependencies:[t],importRegExp:o?Eoe(s,o):s,regExp:s,replace:(e,n)=>{e.replace(new t(c(n)))},export:u}:{type:`multiline-element`,dependencies:[t],regExpStart:/^./,regExpEnd:{optional:!0,regExp:/.$/},handleImportAfterStartMatch:({lines:e,rootNode:n,startLineIndex:r})=>{let i=e.slice(r).join(`
`),[a]=i.match(s)??[];if(!a||!i.startsWith(a))return null;let o=a.match(s),l=a.replace(/\n$/,``).split(`
`),u=r+l.length-1;return e[u].slice(l.at(-1).length).trim()?null:o?(n.append(new t(c(o))),[!0,u]):[!1,u]},replace:()=>!1,export:u}},M6e=new Map,N6e=e=>{let t=A6e(e);return{node:t,createNode:n=>{let r=new t(n);return!n&&e.inlinePattern?.onInsert&&(r.__selectedText=$()?.getTextContent()??``),r},transformer:j6e({componentDef:e,CustomNode:t})}},P6e=class{constructor(e){let t=Nl(M6e,e.id,()=>N6e(e));Object.assign(this,{...e,...t})}},F6e=/^data:(?<type>image\/.+?);base64,.+/,I6e=`image.png`,L6e=e=>Pq.test(e)||QMe.test(e),R6e=(e,t=``)=>{let{year:n,month:r,day:i,hour:a,minute:o,second:s}=CU();return`${n}${r}${i}-${a}${o}${s}${t}.${e}`},z6e=(e,t)=>{let n=Ul(new URL(e).pathname.split(`/`).pop());if(!L6e(n))return;let{filename:r,extension:i}=Uc(n),a=gp.getExtension(t);return Ql(i,a)?n:`${r}.${a}`},B6e=e=>new DOMParser().parseFromString(e,`text/html`).querySelector(`img`),V6e=async e=>{let{clipboardData:t}=e,n=t?.items;if(!n)return[];let r=[],i=[...n].findIndex(({kind:e,type:t})=>e===`file`&&Iq.includes(t)),a=[...n].findIndex(({kind:e,type:t})=>e===`string`&&t===`text/html`);if(i>-1&&a>-1){let t=n[i].getAsFile();if(!t)return[];n.clear(),e.stopPropagation();let o=``,s=t.name,c=await new Promise(e=>{n[a].getAsString(t=>{e(B6e(t))})});c&&(o=c.alt,/^https?:/.test(c.src)&&(s=z6e(c.src,t.type)??s)),r=[{file:new File([t],s,{type:t.type}),alt:o}]}else r=[...t.files].filter(({type:e})=>Iq.includes(e)).map(e=>({file:e}));return r.map(({file:e,alt:t},n)=>{if(e?.name===I6e){let t=r.length>1?`-${n+1}`:``;e=new File([e],R6e(`png`,t),{type:e.type})}return{file:e,alt:t}})},H6e=async e=>{let{dataTransfer:t}=e,n=t?.files;if(n?.length)return[...n].filter(({type:e})=>Iq.includes(e)).map(e=>({file:e}));let r=t?.getData(`text/html`),i=r?B6e(r):null;if(!i)return[];let{src:a,alt:o}=i,s=a.match(F6e)?.groups?.type??``,c;if(Iq.includes(s))try{let e=await(await fetch(a)).blob(),t=s.split(`/`)[1].replace(/\+.*$/,``);c=new File([e],R6e(t),{type:s})}catch{return[]}return[{file:c,src:a,alt:o}]},U6e=B(`<div role="none" class="wrapper svelte-duifo7"><!></div>`),W6e={hash:`svelte-duifo7`,code:`.wrapper.svelte-duifo7 {--sui-paragraph-margin: 20px;display:contents;
@media (width < 768px) {.sui.text-editor {
/* Remove the section padding */margin:0 calc(var(--field-editor-padding) * -1) calc(var(--field-editor-padding) * -1);width:100dvw;}:is(.sui.toolbar, .lexical-root, textarea) {border:0;border-radius:0;}
}}`};function G6e(e,t){O(t,!0),K(e,W6e);let n=LK(),r=Dl.current?.field_defaults?.richtext??{},{parentComponentNames:i,valueStoreKey:a}=UK(),o=HK(a),s=i.at(-1),c=J(t,`currentValue`,15),l=J(t,`required`,3,!0),u=J(t,`readonly`,3,!1),d=J(t,`invalid`,3,!1),f=j(void 0),p=j(``),m=0,h=j(!1),g=A(()=>Tr(t.fieldConfig.modes,()=>r.modes??[...Sze],!0)),_=A(()=>Tr(t.fieldConfig.buttons,()=>r.buttons??[...C$],!0)),v=A(()=>Tr(t.fieldConfig.use_emoji_autocomplete,()=>r.use_emoji_autocomplete??!0,!0)),y=A(()=>Tr(t.fieldConfig.use_markdown_shortcuts,()=>r.use_markdown_shortcuts??!0,!0)),b=A(()=>Tr(t.fieldConfig.minimal,()=>r.minimal??!1,!0)),x=A(()=>Tr(t.fieldConfig.multiline,()=>r.multiline??!0,!0)),S=A(()=>T$(t.fieldConfig)),C=A(()=>z(g).map(e=>Cze[e]).filter(Boolean)),w=A(()=>n.current?.isIndexFile??!1),T=A(()=>n.current?.collectionName??``),ee=A(()=>n.current?.fileName),E=A(()=>jK(n.current,t.locale,t.keyPath,a)),te=A(()=>E$(t.fieldConfig)),ne=A(()=>Eze(z(_),z(te))),re=A(()=>Dze(o?lh({collectionName:z(T),fileName:z(ee),isIndexFile:z(w),valueMap:z(E),keyPath:Oze(t.keyPath)}):t.fieldConfig)),ie=A(()=>kze({fieldConfig:t.fieldConfig,format:z(S),allowNestedComponents:z(re),inEditorComponent:o,parentComponentNames:i}).map(e=>new P6e(e))),ae=A(()=>z(ie).find(({id:e})=>e===`image`||e===`linked-image`)),oe=A(()=>w3({collectionName:z(T),fileName:z(ee),componentName:s,typedKeyPath:t.typedKeyPath,isIndexFile:z(w)})),se=async({target:e,images:r})=>{let i=e?.closest(`div`),a=BE(i);if(!n.current||!z(ae)||!i?.matches(`.lexical-root`)||!a)return;let o=z(ae).fields?.find(({name:e})=>e===`src`),{config:s}=nJ({fieldConfig:o}),c=n.current,l=z(oe);for(let{file:e,src:n,alt:i=``}of r){let r=n;if(e){let{value:n}=await E3({draft:c,resource:{file:e,folder:l},libraryConfig:s,locale:t.locale});r=n}if(!r)continue;let o=r;a.update(()=>{let e=z(ae).createNode({src:o,alt:i});lj(z(x)?[e,EE()]:[e])})}},ce=e=>async t=>{if(u())return;let{target:n}=t,r=await e(t);r.length&&await se({target:n,images:r})},le=ce(V6e),ue=ce(H6e),de=()=>{let e=n.current;e&&!o&&(window.clearTimeout(m),m=window.setTimeout(()=>{Aze(e.extraValues[t.locale],t.keyPath,e=>!!z(f)?.querySelector(`[data-key-path-prefix="${e}"]`)).forEach(n=>{delete e.extraValues[t.locale][n]})},500))};ll(()=>c(),e=>{c(e)},()=>z(p),e=>{M(p,e,!0)},e=>typeof e==`string`?e:``),sl(()=>c(),()=>{de()}),L(()=>()=>{window.clearTimeout(m)}),YK(()=>z(h));var fe=U6e();Do(N(fe),Iu,null,e=>{var n=H();Oo(P(n),()=>JSON.stringify(t.fieldConfig),e=>{{let n=A(()=>Ef(t.locale)),r=A(()=>Df(t.locale));nOe(e,{get lang(){return z(n)},get dir(){return z(r)},get format(){return z(S)},get modes(){return z(C)},get buttons(){return z(ne)},get components(){return z(ie)},get useEmojiAutocomplete(){return z(v)},get useMarkdownShortcuts(){return z(y)},get minimal(){return z(b)},get multiline(){return z(x)},flex:!0,get readonly(){return u()},get required(){return l()},get invalid(){return d()},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`},autoResize:!0,onpastecapture:e=>{le(e)},ondrop:e=>{ue(e)},get value(){return z(p)},set value(e){M(p,e,!0)},get pending(){return z(h)},set pending(e){M(h,e,!0)}})}}),U(e,n)}),D(fe),gs(fe,e=>M(f,e),()=>z(f)),U(e,fe),k()}var K6e=!1,C8=e=>function(t){return rr.prototype[e].call(this,t).replace(/^<(\w+)/,`<$1 dir="auto"`)},q6e={heading:C8(`heading`),list:C8(`list`),paragraph:C8(`paragraph`)},J6e=({text:e,lang:t})=>(t?xwe(e,t):void 0)??!1,Y6e=()=>{K6e||(K6e=!0,dr({renderer:{...q6e,code:J6e}}))},X6e=new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`]),Z6e=e=>{let t=X3e(e);return t&&/^ {0,3}$/.test(t.indent)?t:void 0},Q6e=/^<([a-zA-Z][a-zA-Z0-9]*)(?:[\s>])/,$6e=[{start:/^ {0,3}<(?:pre|script|style|textarea)(?:[\s>]|$)/i,end:/<\/(?:pre|script|style|textarea)>/i},{start:/^ {0,3}<!--/,end:/-->/},{start:/^ {0,3}<\?/,end:/\?>/},{start:/^ {0,3}<![a-z]/i,end:/>/},{start:/^ {0,3}<!\[CDATA\[/,end:/\]\]>/}],e8e=/^ {0,3}(?:[-+*]|\d{1,9}[.)])(?:[ \t]|$)/,t8e=new Map,n8e=e=>{let t=document.createElement(`template`);return t.innerHTML=e,[...t.content.childNodes].map(e=>e.nodeType===Node.ELEMENT_NODE?e.outerHTML:e.nodeType===Node.TEXT_NODE?Ku(e.data):``).filter(Boolean)},r8e=e=>{let t=$6e.find(({start:t})=>t.test(e));return t&&!t.end.test(e.replace(t.start,``))?t.end:void 0},i8e=e=>{if(!e)return[];let t=e.split(`
`),n=[],r=[],i=null,a=null,o,s=!1,c=e=>{let n=t.find((t,n)=>n>e&&t.trim())??``;return/^[ \t]/.test(n)||e8e.test(n)};return t.forEach((e,t)=>{if(i)r.push(e),e.length-e.trimStart().length<=3&&Z3e(e,i)&&(i=null);else if(o)r.push(e),o.test(e)&&(o=void 0);else if(a){r.push(e);let{openRe:t,closeRe:n}=a;a.depth+=[...e.matchAll(t)].length-[...e.matchAll(n)].length,a.depth<=0&&(a=null)}else{let l=Z6e(e);if(o=l?void 0:r8e(e),l)r.push(e),i={char:l.char,length:l.length};else if(o)r.push(e);else{let i=Q6e.exec(e);if(i){let t=i[1].toLowerCase();if(r.push(e),!X6e.has(t)){let{openRe:n,closeRe:r}=Nl(t8e,t,()=>({openRe:RegExp(`<${t}(?:[\\s>])`,`gi`),closeRe:RegExp(`<\\/${t}>`,`gi`)})),i=[...e.matchAll(n)].length-[...e.matchAll(r)].length;i>0&&(a={tag:t,depth:i,openRe:n,closeRe:r})}}else e===``?s&&c(t)?r.push(e):r.length&&(n.push(r.splice(0).join(`
`)),s=!1):(r.push(e),s||=e8e.test(e))}}}),r.length&&n.push(r.join(`
`)),n},a8e=e=>{let t=[],n=e=>{e.forEach(e=>{e.type===`def`?t.push(e.raw.trim()):e.type===`list`?e.items.forEach(e=>{n(e.tokens)}):e.type===`blockquote`&&n(e.tokens)})};return e.filter(e=>e.includes(`]:`)).forEach(e=>n(fee(e))),t.join(`
`)},o8e=e=>{let t=a8e(e);return t?e.map(e=>`${t}\n\n${e}`):e},s8e=(e,{isHTML:t})=>t?n8e(e):o8e(i8e(e)),c8e=(e,t)=>{let n=new Map,r=new Map;return{list:e.map(e=>{let i=n.get(e)??0,a=`${i}\n${e}`,o=t.get(a)??{key:a,block:e};return n.set(e,i+1),r.set(a,o),o}),items:r}},l8e=e=>e.split(`
`).map(e=>/^[ \t]*([^\s`]+)/.exec(Z6e(e)?.info??``)?.[1]).filter(e=>e!==void 0).filter((e,t,n)=>n.indexOf(e)===t).sort(),u8e=[`href`,`src`,`action`,`formaction`,`data`,`from`,`to`,`values`],d8e=RegExp(`(?:${u8e.join(`|`)})\\s*=`,`i`),f8e=/^[\u0000-\u0020]+|[\t\n\r]/g,p8e=e=>/^javascript:/i.test(e.replaceAll(f8e,``)),m8e=e=>{if(!d8e.test(e))return e;let t=document.createElement(`template`),n=!1;return t.innerHTML=e,t.content.querySelectorAll(`*`).forEach(e=>{[...e.attributes].forEach(({localName:t,name:r,value:i})=>{u8e.includes(t)&&i.split(`;`).some(p8e)&&(e.removeAttribute(r),n=!0)})}),n?t.innerHTML:e};Y6e();var h8e=B(`<div role="none" data-rich-text-preview="" class="svelte-14tuh7g"><!></div>`),g8e={hash:`svelte-14tuh7g`,code:`[role='document'] div.svelte-14tuh7g {:is(h1, h2, h3, h4, h5, h6, p, ul, ol) {margin:1em 0 0;}:is(video, img) {max-width:100%;max-height:100%;}:is(a:has(img)) {display:inline-block;img {pointer-events:none;}}pre.shiki {background-color:var(--sui-code-background-color) !important;}}div.svelte-14tuh7g {
/* Make the preview the containing block of any positioned element in the content, so an element
with \`position: fixed\` from an inline style can’t cover the rest of the app */translate:0;[data-component-key] {display:contents;}}`};function w8(e,t){O(t,!0),K(e,g8e);let n=LK(),r=Dl.current?.field_defaults?.richtext??{},i=new Cie,a=new Sie,o=new Map,s=new Map,c=new Map,l=j(void 0),u=j(!1),d=j(0),f=j(0),p=``,m=A(()=>n?.current?.originalEntry),h=A(()=>n?.current?.collectionName??``),g=A(()=>n?.current?.fileName),_=A(()=>Tr(t.fieldConfig.sanitize_preview,()=>r.sanitize_preview??!0,!0)),v=A(()=>T$(t.fieldConfig)),y=A(()=>z(v)===`html`),b=A(()=>D$(t.fieldConfig)),x=A(()=>z(b).map(({id:e})=>e)),S=A(()=>yWe({entry:z(m),collectionName:z(h),fileName:z(g),files:n?.current?.files,typedKeyPath:t.typedKeyPath,componentNames:z(x),locale:t.locale})),C=A(()=>{if(typeof t.currentValue!=`string`||!t.currentValue.trim())return``;z(f);let{markdown:e,previewMap:n,assetMap:r}=b6e(t.currentValue,z(b),o,z(S),z(v));return o=n,s=r,e}),w=A(()=>{let{list:e,items:t}=c8e(s8e(z(C),{isHTML:z(y)}),c);return c=t,e}),T=async e=>{let t=l8e(e).join(`,`);t&&t!==p&&(p=t,await Promise.all(t.split(`,`).map(e=>SV(e))),M(d,z(d)+1))},ee=e=>e.closest(`[data-rich-text-preview]`)===z(l),E=(e,t)=>{let n=M3(e);i.set(e,n),n.render(t)},te=e=>{console.error(e)},ne=e=>{if(!ee(e))return;let t=e.dataset.componentKey,n=t?o.get(t):void 0;n instanceof Element?(e.replaceChildren(n),a.add(n)):(0,mr.isValidElement)(n)?DJe.current?E(e,n):A3().then(()=>{e.isConnected&&!i.has(e)&&E(e,n)}).catch(te):e.remove()},re=e=>{[e,...e.querySelectorAll(`span[data-component-key]`)].forEach(e=>{let t=i.get(e);t&&(t.unmount(),i.delete(e))})},ie=(e=!1)=>{a.forEach(t=>{(e||!z(l)?.contains(t))&&(a.delete(t),t.dispatchEvent(new CustomEvent(`Unmount`)))})},ae=e=>{e.forEach((e,t)=>{let n=o.get(t);Promise.all(e.map(dWe)).then(async e=>{e.includes(!0)&&o.get(t)===n&&(o.delete(t),M(f,z(f)+1),await Za(),z(l)?.querySelectorAll(`[data-component-key="${t}"]`).forEach(e=>{i.get(e)?.unmount(),i.delete(e),ne(e)}),ie())})})},oe=async e=>{ee(e)&&(e.dataset.processed=`true`,await Lze(e,e=>xze({value:e,entry:z(m),collectionName:z(h),fileName:z(g),typedKeyPath:t.typedKeyPath,componentNames:z(x),locale:t.locale})))},se=e=>{let t=[];e.forEach(({removedNodes:e,addedNodes:n})=>{e.forEach(e=>{e.nodeType===Node.ELEMENT_NODE&&t.push(e)}),n.forEach(e=>{if(e.nodeType!==Node.ELEMENT_NODE)return;let t=e;t.matches(`span[data-component-key]`)?ne(t):t.querySelectorAll(`span[data-component-key]`).forEach(e=>{ne(e)}),t.matches(I$)&&oe(t),t.querySelectorAll(I$).forEach(e=>{oe(e)})})}),t.forEach(e=>{re(e)}),ie()},ce=e=>{z(d);let t=z(y)?e:pr(e,{breaks:!0});return Fze(z(_)?Km(t):m8e(t))};L(()=>{z(C)&&!z(y)&&T(z(C))}),L(()=>{z(C),ae(s)}),So(()=>{let e=new MutationObserver(se);return e.observe(z(l),{childList:!0,subtree:!0}),M(u,!0),()=>{e.disconnect(),i.forEach(e=>e.unmount()),i.clear(),ie(!0)}});var le=h8e(),ue=N(le),de=e=>{var t=H();No(P(t),17,()=>z(w),({key:e,block:t})=>e,(e,t)=>{let n=()=>z(t).block;var r=H();Lo(P(r),()=>ce(n())),U(e,r)}),U(e,t)};G(ue,e=>{z(u)&&z(C)&&e(de)}),D(le),gs(le,e=>M(l,e),()=>z(l)),U(e,le),k()}var _8e=B(`<p> </p>`);function v8e(e,t){O(t,!0);let n=A(()=>kf(t.locale)),r=A(()=>Aje({fieldConfig:t.fieldConfig,currentValue:t.currentValue}));var i=H(),a=P(i),o=e=>{var i=_8e(),a=F(i,!0);R((e,t,n)=>{q(i,`lang`,e),q(i,`dir`,t),W(a,n),i.dir=i.dir},[()=>Ef(t.locale),()=>Df(t.locale),()=>z(n).format(z(r))]),U(e,i)};G(a,e=>{z(r).length&&e(o)}),U(e,i),k()}var y8e=B(`<div class="wrapper svelte-19vklom"><!> <span role="none"> </span> <!></div>`),b8e={hash:`svelte-19vklom`,code:`.wrapper.svelte-19vklom {flex:none;color:var(--sui-tertiary-foreground-color) !important;font-size:var(--sui-font-size-small);line-height:var(--sui-line-height-compact);text-align:end;}.count.svelte-19vklom {&.invalid {color:var(--sui-error-foreground-color);}&:not(.invalid) {color:var(--sui-success-foreground-color);}}`};function x8e(e,t){O(t,!0),K(e,b8e);let n=A(()=>t.fieldConfig.minlength),r=A(()=>t.fieldConfig.maxlength),i=A(()=>N4({fieldConfig:t.fieldConfig,locale:t.locale,value:t.currentValue}).detail),a=A(()=>z(i).count),o=A(()=>z(i).hasMin),s=A(()=>z(i).hasMax),c=A(()=>z(i).invalid);var l=H(),u=P(l),d=e=>{var t=y8e(),i=N(t),l=e=>{var t=V();R(()=>W(t,`${z(n)??``} / `)),U(e,t)};G(i,e=>{z(o)&&e(l)});var u=I(i,2);let d;var f=F(u,!0),p=I(u,2),m=e=>{var t=V();R(()=>W(t,` /
${z(r)??``}`)),U(e,t)};G(p,e=>{z(s)&&e(m)}),D(t),R(e=>{q(t,`aria-label`,e),d=$o(u,1,`count svelte-19vklom`,null,d,{invalid:z(c)}),W(f,z(a))},[()=>Y(z(o)&&z(s)?`character_counter.min_max`:z(o)?`character_counter.min`:`character_counter.max`,{values:{count:z(a),min:z(n),max:z(r)}})]),U(e,t)};G(u,e=>{(z(o)||z(s))&&e(d)}),U(e,l),k()}var S8e=e=>{let{extraHint:t}=UK();L(()=>{t&&(t.current=e)})},C8e=({currentValue:e,fieldConfig:t})=>{let{prefix:n=``,suffix:r=``}=t,i=typeof e==`string`?e:String(e??``);return n&&i.startsWith(n)&&(i=i.slice(n.length)),r&&i.endsWith(r)&&(i=i.slice(0,-r.length)),i},w8e=({inputValue:e,fieldConfig:t})=>{let{prefix:n=``,suffix:r=``}=t;return e.trim()&&(n||r)?`${n}${e}${r}`:e};function T8e(e,t){O(t,!0);let n=J(t,`currentValue`,15),r=J(t,`required`,3,!0),i=J(t,`readonly`,3,!1),a=J(t,`invalid`,3,!1),o=J(t,`multiline`,3,!1),s=j(``),c=A(()=>t.fieldConfig),l=A(()=>Tr(z(c).type,`text`)),u=A(()=>Tr(z(c).use_emoji_autocomplete,o()||z(l)===`text`));ll(()=>n(),e=>{n(e)},()=>z(s),e=>{M(s,e,!0)},e=>o()?typeof e==`string`?e:``:C8e({currentValue:e,fieldConfig:z(c)}),e=>o()?e:w8e({inputValue:e,fieldConfig:z(c)})),S8e(x8e);var d=H(),f=P(d),p=e=>{{let n=A(()=>Ef(t.locale)),o=A(()=>Df(t.locale));RV(e,{get lang(){return z(n)},get dir(){return z(o)},flex:!0,get readonly(){return i()},get required(){return r()},get invalid(){return a()},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`},get useEmojiAutocomplete(){return z(u)},autoResize:!0,get value(){return z(s)},set value(e){M(s,e,!0)}})}},m=e=>{{let n=A(()=>Ef(t.locale)),o=A(()=>Df(t.locale));NS(e,{get lang(){return z(n)},get dir(){return z(o)},flex:!0,get readonly(){return i()},get required(){return r()},get invalid(){return a()},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`},get useEmojiAutocomplete(){return z(u)},get type(){return z(l)},get inputmode(){return z(l)},get value(){return z(s)},set value(e){M(s,e,!0)}})}};G(f,e=>{o()?e(p):e(m,-1)}),U(e,d),k()}var E8e=e=>{if(!zc(e))return!1;let{origin:t,pathname:n,searchParams:r}=new URL(e);return!!((t===`https://www.youtube.com`||t===`https://www.youtube-nocookie.com`)&&(n===`/watch`&&r.has(`v`)||n===`/playlist`&&r.has(`list`)||n.startsWith(`/embed/`))||t===`https://youtu.be`&&n)},D8e=e=>{let t=`https://www.youtube-nocookie.com`,{pathname:n,search:r,searchParams:i}=new URL(e);if(n===`/watch`){let e=new URLSearchParams(i),n=`${t}/embed/${e.get(`v`)}`;return e.get(`list`)&&(e.delete(`v`),e.set(`listType`,`playlist`),n+=`?${e}`),n}return n===`/playlist`?`${t}/embed/videoseries${r}`:n.startsWith(`/embed/`)?`${t}${n}${r}`:`${t}/embed${n}${r}`},O8e=B(`<iframe frameborder="0" allow="autoplay; encrypted-media; picture-in-picture; clipboard-write" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen="" sandbox="allow-same-origin allow-scripts allow-popups" class="svelte-spbxln"></iframe>`),k8e=B(`<a> </a>`),A8e=B(`<div role="none"><!></div>`),j8e={hash:`svelte-spbxln`,code:`iframe.svelte-spbxln {display:block;margin:0 auto;width:100%;height:auto;aspect-ratio:16 / 9;}`};function M8e(e,t){O(t,!0),K(e,j8e);let n=j(!0),r=A(()=>D8e(t.url)),i=({blockedURI:e,violatedDirective:t})=>{e===new URL(z(r)).origin&&t===`frame-src`&&(M(n,!1),window.removeEventListener(`securitypolicyviolation`,i))};So(()=>(window.addEventListener(`securitypolicyviolation`,i),()=>{window.removeEventListener(`securitypolicyviolation`,i)}));var a=A8e(),o=N(a),s=e=>{pH(e,{children:(e,t)=>{var n=O8e();R((e,t)=>{q(n,`src`,e),q(n,`title`,t)},[()=>Wl(z(r)),()=>Y(`youtube_video_player`)]),U(e,n)},$$slots:{default:!0}})},c=e=>{var n=k8e(),r=F(n,!0);R(e=>{q(n,`href`,e),W(r,t.url)},[()=>Wl(t.url)]),U(e,n)};G(o,e=>{z(n)?e(s):e(c,-1)}),D(a),U(e,a),k()}var N8e=/^(?:https|mailto|tel):/,P8e=({fieldConfig:e,value:t})=>{let{type:n=`text`}=e;return n===`url`||zc(t)?E8e(t)?`youtube`:N8e.test(t)?`link`:`text`:n===`email`?`email`:`text`},F8e=B(`<a> </a>`),I8e=B(`<p><!></p>`),L8e={hash:`svelte-euqs6c`,code:`.title.svelte-euqs6c {font-size:var(--sui-font-size-xxx-large);font-weight:var(--sui-font-weight-bold);}`};function R8e(e,t){O(t,!0),K(e,L8e);let n=A(()=>t.fieldConfig.name),r=A(()=>typeof t.currentValue==`string`&&t.currentValue.trim()?t.currentValue:``),i=A(()=>z(r)?P8e({fieldConfig:t.fieldConfig,value:z(r)}):`text`);var a=H(),o=P(a),s=e=>{var a=I8e();let o;var s=N(a),c=e=>{M8e(e,{get url(){return z(r)}})},l=e=>{var t=F8e(),n=F(t,!0);R(e=>{q(t,`href`,e),W(n,z(r))},[()=>Wl(z(r))]),U(e,t)},u=e=>{var t=F8e(),n=F(t,!0);R(e=>{q(t,`href`,e),W(n,z(r))},[()=>Wl(`mailto:${z(r)}`)]),U(e,t)},d=e=>{var t=V();R(()=>W(t,z(r))),U(e,t)};G(s,e=>{z(i)===`youtube`?e(c):z(i)===`link`?e(l,1):z(i)===`email`?e(u,2):e(d,-1)}),D(a),R((e,t)=>{q(a,`lang`,e),q(a,`dir`,t),o=$o(a,1,`svelte-euqs6c`,null,o,{title:z(n)===`title`}),a.dir=a.dir},[()=>Ef(t.locale),()=>Df(t.locale)]),U(e,a)};G(o,e=>{z(r)&&e(s)}),U(e,a),k()}var z8e=new Set([`$$slots`,`$$events`,`$$legacy`,`currentValue`]);function B8e(e,t){O(t,!0);let n=J(t,`currentValue`,15),r=vs(t,z8e);T8e(e,ys(()=>r,{multiline:!0,get currentValue(){return n()},set currentValue(e){n(e)}})),k()}var V8e=B(`<p class="svelte-q17c48"> </p>`),H8e={hash:`svelte-q17c48`,code:`p.svelte-q17c48 {white-space:pre-wrap;}`};function U8e(e,t){O(t,!0),K(e,H8e);var n=H(),r=P(n),i=e=>{var n=V8e(),r=F(n,!0);R((e,i)=>{q(n,`lang`,e),q(n,`dir`,i),W(r,t.currentValue),n.dir=n.dir},[()=>Ef(t.locale),()=>Df(t.locale)]),U(e,n)},a=A(()=>typeof t.currentValue==`string`&&t.currentValue.trim());G(r,e=>{z(a)&&e(i)}),U(e,n),k()}function W8e(e,t){O(t,!0);let n=LK(),{valueStoreKey:r=`currentValues`}=UK(),i=HK(r),a=J(t,`currentValue`,15),o=J(t,`required`,3,!0),s=J(t,`readonly`,3,!0),c=J(t,`invalid`,3,!1),l=A(()=>n.current?.defaultLocale);sl(()=>t.locale,()=>{!a()&&(t.locale===z(l)||i||NW(t.fieldConfig?.i18n))&&a(I3(t.fieldConfig))}),NS(e,{dir:`ltr`,flex:!0,get readonly(){return s()},get required(){return o()},get invalid(){return c()},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`},get value(){return a()},set value(e){a(e)}}),k()}var G8e=B(`<p class="svelte-1phz9g8"> </p>`),K8e={hash:`svelte-1phz9g8`,code:`p.svelte-1phz9g8 {font-family:var(--sui-font-family-monospace);}`};function q8e(e,t){O(t,!0),K(e,K8e);var n=H(),r=P(n),i=e=>{var n=G8e(),r=F(n,!0);R(()=>W(r,t.currentValue)),U(e,n)},a=A(()=>typeof t.currentValue==`string`&&t.currentValue.trim());G(r,e=>{z(a)&&e(i)}),U(e,n),k()}var T8={boolean:KOe,code:Yje,color:oMe,compute:uMe,datetime:DYe,file:BXe,image:BXe,keyvalue:pZe,list:X1e,map:b0e,markdown:G6e,number:w0e,object:P0e,relation:g3e,richtext:G6e,select:o3e,string:T8e,text:B8e,uuid:W8e},E8={boolean:JOe,code:Zje,color:lMe,compute:MMe,datetime:SYe,file:WXe,image:WXe,keyvalue:_Ze,list:d0e,map:C0e,markdown:w8,number:E0e,object:F0e,relation:b3e,richtext:w8,select:v8e,string:R8e,text:U8e,uuid:q8e},J8e=({initialProps:e,transforms:t={},onValueChange:n})=>{let r=Xi({...e}),i={};return Object.keys(e).forEach(e=>{let a=t[e];Object.defineProperty(i,e,{enumerable:!0,get:a?()=>a(r[e]):()=>r[e],set:e===`currentValue`?n:void 0})}),{values:r,props:i}},Y8e=(e,t)=>{Object.entries(t).forEach(([t,n])=>{(0,Qc.default)(e[t],n)||(e[t]=n)})},X8e=[`boolean`,`color`,`datetime`,`map`,`number`,`select`,`string`,`text`,`uuid`],Z8e=new Map,Q8e=new WeakMap,$8e=e=>typeof e.toJS==`function`?e.toJS():typeof e.get==`function`?new Proxy({},{get:(t,n)=>typeof n==`string`?e.get(n):void 0,has:(t,n)=>typeof n==`string`&&e.get(n)!==void 0}):X(e)?e:{},D8=e=>{if(e===null||typeof e!=`object`&&typeof e!=`function`)return{};let t=Q8e.get(e);if(t)return t;let n=$8e(e);return Q8e.set(e,n),n},e5e=(e,t)=>{let{value:n,field:r,forID:i,locale:a,keyPath:o,required:s,readonly:c,invalid:l}=e,u=D8(r),{name:d,required:f}=u,p=a??t.locale??``;return{locale:p,keyPath:o??t.keyPath??d??``,typedKeyPath:``,fieldId:i??``,fieldLabel:vG({config:u,locale:p}),fieldConfig:r,currentValue:n,required:s??t.required??f,readonly:c??t.readonly,invalid:l??t.invalid}},t5e=({value:e,field:t,locale:n,keyPath:r},i)=>({locale:n??i.locale??``,keyPath:r??i.keyPath??D8(t).name??``,typedKeyPath:``,fieldConfig:t,currentValue:e}),n5e=({SvelteComponent:e,buildProps:t})=>n=>{let r=(0,mr.useContext)(O3),i=(0,mr.useRef)(n),a=(0,mr.useRef)(void 0);i.current=n,a.current?Y8e(a.current.values,t(n,r)):a.current=J8e({initialProps:t(n,r),transforms:{fieldConfig:D8},onValueChange:e=>{let{values:t}=a.current;(0,Qc.default)(t.currentValue,e)||(t.currentValue=e,i.current.onChange?.(e))}});let o=(0,mr.useCallback)(t=>{if(!t)return;let{props:n}=a.current,r=go(e,{target:t,props:n});return()=>{yo(r)}},[]);return(0,mr.createElement)(`div`,{ref:o})},r5e=e=>({control:n5e({SvelteComponent:T8[e],buildProps:e5e}),preview:n5e({SvelteComponent:E8[e],buildProps:t5e})}),i5e=e=>{if(!X8e.includes(e)){Pd.includes(e)&&console.warn(`The built-in "${e}" field type cannot be reused in a custom field type, because its editor works only within the entry editor. Reusable field types are: ${X8e.join(`, `)}.`);return}let t=Z8e.get(e);if(t)return t;let n=r5e(e);return Z8e.set(e,n),n},a5e=(e,t=new Set)=>{let n=Hd.get(e);if(!n)return i5e(e);let{control:r,preview:i,summary:a,schema:o}=n;return typeof r==`string`?(t.add(e),{control:t.has(r)?void 0:a5e(r,t)?.control,preview:i,summary:a,schema:o}):{control:r,preview:i,summary:a,schema:o}},O8=(e,t)=>{if(!e)throw TypeError(t)},k8=(e,t,n,r)=>{O8(e,`The \`${n}\` option for \`CMS.${t}()\` must be ${r}`)},A8=(e,t,n)=>{O8(e,`The \`definition.${t}\` must be ${n}`)},o5e=({name:e,reserved:t,subject:n,builtin:r,custom:i})=>{if(t.includes(e))throw Error(`The ${n} name "${e}" is reserved for a ${r}. Choose a different name for your ${i}.`)},s5e=e=>URL.parse(e,window.location.href),j8=e=>(k8(Uu(e),`getFieldType`,`name`,`a non-empty string`),a5e(e)),M8=e=>Kf(e),c5e=(e,t)=>{if(e.folder.collectionName===t)return e;let n=jy(e.path).find(e=>e.collectionName===t);return n?{...e,folder:n}:e},l5e=(e,t)=>{let n=jy(Qp(e)[0]).filter(e=>e.collectionName!==t);if(n.length&&!QU(M8(t),e))return n.find(t=>QU(M8(t.collectionName),e))},u5e=(e,t)=>Object.values(e.locales).map(({content:e})=>e[t]).find(e=>typeof e==`string`)??e.subPath,d5e=({entry:e,previousPaths:t,collectionName:n,fileName:r})=>{let i=Hp(new Set([...Qp(e),...t]));if(i)return i;if(r)return Jp(n,r);let a=Kf(n);if(!a||!Bf(a._i18n.structureMap))return;let o=a._i18n.canonicalSlug.key,s=u5e(e,o);return rW(n).find(e=>u5e(e,o)===s)},f5e=({entry:e,previousPaths:t,deletedPaths:n,collectionName:r,fileName:i,publishedEntry:a=d5e({entry:e,previousPaths:t,collectionName:r,fileName:i})})=>{if(!a)return e;let o=!!t.length&&!!e.slug;return{...a,...e,locales:{...Object.fromEntries(Object.entries(a.locales).filter(([,{path:e}])=>!n.has(e))),...e.locales},slug:o?e.slug:a.slug,subPath:o?e.subPath:a.subPath}},p5e=async(e,t,n)=>{let r=e=>M8(e).create!==!1,i=e.filter(({folder:e,text:n})=>{let r=Kf(e.collectionName);return e.collectionName!==t&&e.fileName===void 0&&n!==void 0&&r?._type===`entry`&&!iQ({collection:r})});return(await Promise.all([...Map.groupBy(i,({folder:e})=>e.collectionName)].map(async([e,t])=>(await ly(t)).entries.flatMap(t=>{let i=d5e({entry:t,previousPaths:[],collectionName:e});return i?g4e(M8(e),i)?[{collectionName:e,entry:{...f5e({entry:t,previousPaths:[],deletedPaths:n,collectionName:e,publishedEntry:i}),id:i.id},edited:!0}]:[]:r(e)?[{collectionName:e,entry:t}]:[]})))).flat()},m5e=({entries:e,slug:t,pullRequest:n,previousPaths:r})=>{let i=new Map(n.files.flatMap(({path:e,previousPath:t})=>t?[[e,t]]:[])),a=e.map(e=>{let t=Qp(e),n=t.flatMap(e=>i.get(e)??[]);return{entry:e,publishedEntry:Hp(t)??(n.length?Hp(n):void 0),renamed:!!n.length}}),o=a.filter(({entry:e,publishedEntry:n})=>!n||e.slug===t||n.slug===t).map(({entry:e})=>e);if(o.length)return o;if(!r.length)return e;let s=e=>e.subPath.split(`/`).length,[c]=a.filter(({renamed:e})=>e).map(({entry:e})=>e).sort((e,t)=>s(e)-s(t));return c?[c]:[]},N8=({pullRequest:e,collectionName:t,fileName:n,previousPaths:r,companions:i=[]})=>({pullRequest:e,status:e.status,collectionName:t,fileName:n,previousPaths:r,...i.length?{companions:i}:{}}),h5e=async e=>{let t=Qb(e.branch);if(!t||t.legacy&&e.files.some(({path:e,previousPath:t})=>!pu(e)||t!==void 0&&!pu(t)))return{entries:[],assets:[]};let{collectionName:n}=t,{entryFiles:r,assetFiles:i}=My(e.files.filter(({deleted:e})=>!e).map(({path:e,sha:t,size:n,text:r})=>fy(e,{sha:t,size:n,text:r}))),a=r.map(e=>c5e(e,n)),o=e.files.flatMap(({path:e,deleted:t,previousPath:n})=>n?[n]:t?[e]:[]),s=o.length?My(o.map(e=>fy(e))).entryFiles.map(e=>c5e(e,n)).filter(({folder:e})=>e.collectionName===n):[],c=s.map(({path:e})=>e),l=new Set(e.files.filter(({deleted:e})=>e).map(({path:e})=>e)),u=i.map(t=>({...dy(t),workflow:{branch:e.branch}})),d=a.filter(({folder:e,text:t})=>e.collectionName===n&&t!==void 0),f=d.length?(await ly(d)).entries:[],p=f.flatMap(e=>{let r=e.slug!==t.slug&&l5e(e,n);return r?[{entry:e,folder:r}]:[]}),m=p.length<f.length?p:[],h=new Set(m.map(({entry:e})=>e));if(m.length){let e=new Map(m.flatMap(({entry:e,folder:t})=>Qp(e).map(e=>[e,t])));a=a.map(t=>{let n=e.get(t.path);return n?{...t,folder:n}:t}),d=d.filter(({path:t})=>!e.has(t))}let g=d.length?m5e({entries:f.filter(e=>!h.has(e)),slug:t.slug,pullRequest:e,previousPaths:c}):[];if(!g.length){let t=new Set(c);return{entries:(c.length?Vp.current.filter(e=>Object.values(e.locales).some(({path:e})=>t.has(e))):[]).map(t=>{let r=Object.entries(t.locales).filter(([,{path:e}])=>!l.has(e));return r.length?{...t,locales:Object.fromEntries(r),workflow:N8({pullRequest:e,collectionName:n,fileName:s[0].folder.fileName,previousPaths:c})}:{...t,workflow:{pullRequest:e,status:`pending_deletion`,collectionName:n,fileName:void 0,previousPaths:c}}}),assets:u}}let _=new Set(g.flatMap(e=>Qp(e))),{fileName:v}=(d.find(({path:e})=>_.has(e))??d[0]).folder,y=await p5e(a,n,l);return{entries:g.map(t=>({...f5e({entry:t,previousPaths:c,deletedPaths:l,collectionName:n,fileName:v}),workflow:N8({pullRequest:e,collectionName:n,fileName:v,previousPaths:c,companions:y})})),assets:u}},g5e=async e=>{let t=await Promise.all(e.map(h5e));return{entries:t.flatMap(({entries:e})=>e),assets:t.flatMap(({assets:e})=>e)}},P8={time:0,head:``},F8,_5e=e=>{P8={time:Date.now(),head:e}},v5e=()=>{let{backend:e}=Dl.current??{};return!(e&&`open_authoring`in e&&e.open_authoring)||Xf.current},y5e=()=>{let e=LX.current?.workflow;return EZ.current&&e&&v5e()?e:void 0},b5e=()=>{let e=y5e();if(!e)return;kZ.current=!0;let t=e.fetchPullRequests();return t.catch(()=>{}),t},x5e=async(e=b5e())=>{if(!e)return;let t=sp.current,n=lp();try{let{entries:r,assets:i}=await g5e(await e);n()||(OZ.current=r,Y4(i),_5e(t))}catch(e){console.error(e)}finally{n()||(kZ.current=!1,AZ.current=!0)}},I8=e=>Map.groupBy(e,({workflow:e})=>e.pullRequest.branch),S5e=(e=[],t=[])=>e.length===t.length&&e.every((e,n)=>e===t[n]),C5e=(e,t=[])=>{let n=new Map(t.flatMap(({entry:e})=>Qp(e).map(t=>[t,e.id])));return e?.map(e=>{let t=Qp(e.entry).map(e=>n.get(e)).find(Boolean);return t?{...e,entry:{...e.entry,id:t}}:e})},w5e=(e,t)=>{let n=e.map((e,n)=>{let r=t[n];if(!r)return e;let{workflow:i}=e,a={...e,id:r.id,...i.companions?{workflow:{...i,companions:C5e(i.companions,r.workflow.companions)}}:{}};return(0,Qc.default)(a,r)?r:a});return S5e(n,t)?t:n},L8=e=>e?.[0]?.workflow.pullRequest.headSHA,T5e=async(e,t,n,r)=>{let i=new Set;return await Ed([...t.keys()].filter(e=>{let i=L8(t.get(e));return r.has(e)&&!!i&&i!==L8(n.get(e))}),async n=>{try{await e.fetchBranchHead(n)===L8(t.get(n))&&i.add(n)}catch(e){console.error(`Failed to check the workflow branch for changes.`,e)}}),i},E5e=async e=>{let t=lp(),n=sp.current,r=I8(OZ.current),i=await e.fetchPullRequests();if(t())return!1;let a=new Set(i.map(({branch:e})=>e));if([...r.keys()].some(e=>!a.has(e))){try{await m3()}catch(e){console.error(`Failed to check the repository for changes.`,e)}if(t())return!1}let{entries:o,assets:s}=await g5e(i);if(t())return!1;let c=I8(o),l=await T5e(e,r,c,a);if(t())return!1;let u=I8(OZ.current),d=new Set(jZ.current),f=new Set,p=e=>{let t=u.get(e)??[];if(d.has(e)||l.has(e)||!S5e(t,r.get(e)))return t;let n=w5e(c.get(e)??[],t);return n!==t&&f.add(e),n},m=[...new Set([...u.keys(),...c.keys()])].flatMap(p);return _5e(n),f.size?(OZ.current=m,f.forEach(X4),Y4(s.filter(({workflow:e})=>f.has(e?.branch))),!0):!1},R8=async({fresh:e=!1}={})=>{let t=y5e();return!t||!AZ.current?!1:(e&&F8&&await F8.catch(()=>void 0),F8||=E5e(t).finally(()=>{F8=void 0}),F8)},D5e=async({maxAge:e=3e5}={})=>!F8&&sp.current===P8.head&&Date.now()-P8.time<e?!1:R8(),z8=0,O5e=0,k5e=()=>document.visibilityState===`visible`,A5e=async({maxAge:e=0,workflowMaxAge:t=3e5}={})=>{try{await m3({maxAge:e})}catch(e){console.error(`Failed to check the repository for changes.`,e)}try{await D5e({maxAge:t})}catch(e){console.error(`Failed to check the unpublished entries for changes.`,e)}},j5e=()=>{k5e()&&A5e()},B8=()=>{k5e()&&Date.now()-O5e>=1e4&&A5e({maxAge:1e4,workflowMaxAge:3e4})},M5e=()=>{z8||(O5e=Date.now(),z8=window.setInterval(j5e,6e4),document.addEventListener(`visibilitychange`,B8),window.addEventListener(`focus`,B8))},N5e=()=>{z8&&=(window.clearInterval(z8),document.removeEventListener(`visibilitychange`,B8),window.removeEventListener(`focus`,B8),0)},V8=tl({}),P5e=100,H8=new Map,F5e=()=>{if(H8.size<=P5e)return;let e=Date.now()-3e4,t=new Set([...H8.entries()].filter(([,{time:t}])=>t<e).map(([e])=>e));[...H8.keys()].forEach(e=>{H8.size-t.size>P5e&&t.add(e)}),t.forEach(e=>H8.delete(e)),V8.current=Object.fromEntries(Object.entries(V8.current).filter(([e])=>!t.has(e)))},I5e=async e=>{let t;try{t=await Vu(e,{method:`GET`},{responseType:`raw`})}catch{return`unknown`}return t.ok?`ready`:t.status===404?`pending`:`unknown`},L5e=async(e,{recheckPending:t=!1}={})=>{let n=H8.get(e),r=t&&V8.current[e]===`pending`;if(n&&!r&&Date.now()-n.time<3e4)return n.promise;let i=!1;try{i=new URL(e).origin===window.location.origin}catch{i=!1}let a=i?I5e(e):Promise.resolve(`unknown`);H8.delete(e),H8.set(e,{time:Date.now(),promise:a}),F5e();let o=await a;return V8.current=V8.current[e]===o?V8.current:{...V8.current,[e]:o},o},R5e=()=>{H8.clear(),V8.current={}},z5e=()=>{let{current:e}=Dl,{current:t}=LX;if(!e||!t?.isGit)return{};let{skip_ci:n,automatic_deployments:r}=e.backend;return{skipCI:n,autoDeploy:r}},U8=rl(()=>{let{skipCI:e,autoDeploy:t}=z5e();return typeof e==`boolean`||typeof t==`boolean`}),W8=rl(()=>{let{skipCI:e,autoDeploy:t}=z5e();return e===!0||t===!1}),G8=e=>U8.current&&tp(e),K8=(e,t)=>{yu.devModeEnabled&&console.info(`deployPreview: ${e}`,(typeof t==`function`?t():t)??``)},q8=0,J8=0,B5e=()=>{q8+=1},Y8=()=>{let e=LX.current?.repository?.branch??``,t=[],n=new Set,r=Hy.current;return r&&(t.push({sha:r,branch:e,kind:`production`}),n.add(r)),OZ.current.forEach(({workflow:{pullRequest:e}})=>{let{number:r,headSHA:i,branch:a}=e;r!==void 0&&i&&!n.has(i)&&(t.push({sha:i,branch:a,kind:`preview`}),n.add(i))}),t},X8=rl(()=>Y8()),Z8=()=>{let{show_preview_links:e=!0}=Dl.current??{};return(e||U8.current)&&!!LX.current?.fetchDeployments},V5e=e=>!!e&&e.state!==`checking`&&Date.now()-e.checkedTime<3e4,H5e=e=>{let t=Vy.current,n=Object.fromEntries(e.filter(({sha:e})=>!t[e]).map(({sha:e})=>[e,{state:`checking`,checkedTime:0}]));Object.keys(n).length&&(Vy.current={...t,...n})},U5e=()=>{H5e(Y8())},Q8=async({force:e=!1,pendingOnly:t=!1}={})=>{if(!Z8()){K8(`not looking anything up: the backend can’t report deployments, or preview links are off`);return}let n=LX.current?.fetchDeployments,r=Vy.current,i=Y8().filter(({sha:n})=>{if(e)return!0;let i=r[n]?.state;return t?i!==`ready`&&i!==`error`:!V5e(r[n])});if(!i.length){K8(`nothing to look up`,()=>({tracked:Y8(),known:r}));return}K8(`looking up`,i);let a=q8;J8+=1;let o=J8;H5e(i);let s;try{s=await n(i)}catch(e){console.error(`Failed to fetch the deployment info.`,e),s=Object.fromEntries(i.map(({sha:e})=>[e,{state:`unknown`,checkedTime:Date.now()}]))}a===q8?o===J8?(K8(`resolved`,s),Vy.current={...Vy.current,...s}):K8(`discarding a result that a later lookup has superseded`,s):K8(`discarding a result that arrived after the lookup was cancelled`,s)},W5e=async()=>{let e=LX.current?.fetchBranchHeadSHA;if(e)try{let t=await e()??``;K8(`tracking the branch head`,t),Hy.current=t}catch(e){console.error(`Failed to fetch the branch head commit.`,e)}},G5e=async({head:e}={})=>{try{e&&LX.current?.fetchBranchHeadSHA?(K8(`tracking the branch head`,e),Hy.current=e):await W5e(),await Q8()}catch(e){console.error(`Failed to look up the deployment info.`,e)}},K5e=e=>new TextEncoder().encode(JSON.stringify(e)).toBase64({alphabet:`base64url`,omitPadding:!0}),q5e=e=>{let t=Uint8Array.fromBase64(e.replaceAll(`+`,`-`).replaceAll(`/`,`_`),{alphabet:`base64url`}),n;try{n=new TextDecoder(`utf-8`,{fatal:!0}).decode(t)}catch{n=Array.from(t,e=>String.fromCharCode(e)).join(``)}return JSON.parse(n)},$8=tl([]),J5e=e=>{let t=e?Vy.current[e]?.state:void 0;return t===`ready`||t===`unknown`},Y5e=rl(()=>J5e(Hy.current)),X5e=rl(()=>{if(Y5e.current)return[];let e=$8.current,t=e.findLastIndex(({sha:e})=>J5e(e));return t===-1?e:e.slice(t+1)}),Z5e=e=>{let t=Hy.current;if(!Z8()||!t)return;let{workflow:n}=e,{branch:r}=n.pullRequest;$8.current=[...X5e.current.filter(e=>e.entry.workflow.pullRequest.branch!==r),{entry:{...e,workflow:{...n,pullRequest:{...n.pullRequest,updatedDate:new Date}}},sha:t}]},Q5e=()=>{$8.current=[]};ol(()=>{Wy.current&&Q5e()});var $5e=/^\/signin\/(?<encodedData>.+)/,e5=Xi({signInError:{message:``,context:`authentication`},unauthenticated:!0,signingIn:!1}),t5=tl(),e7e=()=>{yu.apiKeys={},delete yu.logins,delete yu.deployHookURL,delete yu.deployHookAuthHeader,delete yu.magicLinkAccount},n5=e=>{let{magicLinkAccount:t}=yu;t&&(t.backendName!==e?.backendName||t.id!==e?.id||t.login!==e?.login)&&e7e()},r5=async()=>{n5(),await Promise.all([_u.set(`sveltia-cms.user`,{}),...Pu.map(e=>_u.delete(e))]),Fu.account=void 0,e5.unauthenticated=!0},t7e=async e=>{(typeof e?.cause?.status==`number`||e?.message===`Not a collaborator of the repository`)&&await r5()},n7e=()=>{e5.signInError={message:``,context:`authentication`}},i5=(e,t=`authentication`)=>{let n=e.cause?.message||Y(`unexpected_error`);e.name===`NotFoundError`&&(n=Y(`sign_in_error.not_project_root`)),e.name===`AbortError`&&(n=Y(IX.current===`local`?`sign_in_error.picker_dismissed`:`sign_in_error.authentication_aborted`)),e5.signInError={message:n,context:t},console.error(e.name,e.message,e.cause)},r7e=()=>{let{path:e}=m0(),{encodedData:t}=e.match($5e)?.groups??{};if(!t)return{_user:void 0,copiedPrefs:void 0};x0(``,{replaceState:!0});let n,r;try{let e=q5e(t);X(e)&&typeof e.token==`string`&&(n={token:e.token},X(e.prefs)&&(r=e.prefs))}catch{}return{_user:n,copiedPrefs:r}},i7e=async()=>{let e=e=>X(e)&&typeof e.backendName==`string`;return[`sveltia-cms.user`,...Pu].reduce(async(t,n)=>{let r=await t;if(r)return r;let i=await _u.get(n);return e(i)?i:void 0},Promise.resolve(void 0))},a7e=e=>e?.backendName===`proxy`?`local`:e?.backendName,o7e=async e=>{try{return await zX(e)}catch(e){i5(e);return}},s7e=async e=>o7e(a7e(e)===`local`?`local`:Dl.current.backend.name),c7e=async e=>{let t=await s7e(void 0);if(!t)return;let n;e5.signingIn=!0;try{n=await t.signIn({token:e,auto:!0})}catch{}if(e5.signingIn=!1,n)return await al(t5,{account:n},!1)?n:void 0},l7e=(e,t)=>{n5(),`deployHookURL`in e&&delete yu.deployHookAuthHeader,Object.assign(yu,e,{magicLinkAccount:{backendName:t.backendName,id:t.id,login:t.login}})},u7e=async e=>{let t=lp(),n=!e.repository||e.repository.branch?b5e():void 0;await e.fetchFiles(),t()||(await x5e(n),t()||(G5e({head:sp.current}),M5e()))},d7e=async()=>{n7e();let{_user:e,copiedPrefs:t}=r7e(),n=e?await c7e(e.token):void 0,r=!!n;n??=await i7e();let i=await s7e(n);if(n){if(!r&&i&&a7e(n)!==IX.current)await r5();else{if(!r&&i){Fu.account=n;let{token:e,refreshToken:t}=n;e5.signingIn=!0;try{n=await i.signIn({token:e,refreshToken:t,auto:!0})}catch{n=void 0,Fu.account=void 0}}if(e5.signingIn=!1,e5.unauthenticated=!n,n&&i){Fu.account=n,r&&t?l7e(t,Fu.account):n5(Fu.account);try{await u7e(i)}catch(e){[401,403,404].includes(e.cause?.status)?e5.unauthenticated=!0:i5(e,`dataFetch`),await t7e(e)}}}}},a5=async(e,t)=>{n7e();let n=await o7e(e);if(!n)return;let r;Fu.account=void 0,e5.signingIn=!0;try{r=await n.signIn({token:t,auto:!1})}catch(e){e5.signingIn=!1,e5.unauthenticated=!0,t&&e.cause?.status===401?i5(Error(`Invalid token`,{cause:{message:Y(`sign_in_error.invalid_token`)}})):i5(e);return}if(e5.signingIn=!1,e5.unauthenticated=!r,r){n5(r),Fu.account=r;try{await u7e(n)}catch(e){i5(e,`dataFetch`),await t7e(e)}}},f7e=async()=>{N5e(),cp.current+=1;try{await LX.current?.signOut()}catch(e){console.error(e)}await r5(),e7e(),await zX(void 0),Rp.current=!1,sy.clear(),sp.current=``,ul.current=void 0,dl.current=void 0,OZ.current=[],AZ.current=!1,jZ.current=[],t5.current?.respond(!1),Qf.current?.respond(!1),Jf.current=void 0,Xf.current=!1,Q5e(),lue(),R5e();let e=Dl.current?.logout_redirect_url;e&&(window.location.href=e)},p7e=(e,t)=>{let{name:n}=e,r=n===`test-repo`,{auth_methods:i}=e,a=e,o=vl(n);return{serviceLabel:o&&Nu(a)===`https://codeberg.org`?`Codeberg`:t,tokenOptionHidden:!r&&i?.includes(`token`)===!1,oauthOptionHidden:!r&&i?.includes(`oauth`)===!1,oauthOptionDisabled:o&&!a.app_id}},m7e=B(`<div role="alert" class="message svelte-1ff54ya"> </div> <!>`,1),h7e=B(`<div role="alert" class="svelte-1ff54ya"><!></div>`),g7e=B(`<div role="none"><!></div>`),_7e=B(`<!> <!> <!>`,1),v7e=B(`<div role="alert" class="svelte-1ff54ya"> </div>`),y7e=B(`<!> <!>`,1),b7e=B(`<div role="alert" class="error iconic svelte-1ff54ya"><!> </div>`),x7e=B(` <!> <!>`,1),S7e=B(`<div role="none" class="buttons svelte-1ff54ya"><!> <!></div> <!> <!>`,1),C7e={hash:`svelte-1ff54ya`,code:`.buttons.svelte-1ff54ya {display:flex;flex-direction:column;align-items:center;gap:12px;.button {width:320px;}}[role='alert'].svelte-1ff54ya {&.iconic {display:flex;align-items:center;gap:8px;}&.error {color:var(--sui-error-foreground-color);}}`};function w7e(e,t){O(t,!0),K(e,C7e);let n=j(!1),r=j(``),i=A(()=>Dl.current?.backend),a=A(()=>z(i).name),o=j(void 0),s=A(()=>z(a)===`test-repo`),c=A(()=>MX(z(a))),l=A(()=>z(s)&&!PY.isTestBackendSupported),u=A(()=>z(i).repo?.split(`/`).pop()),d=A(()=>PY.isLocalHost&&!z(s)),f=A(()=>z(r).trim()),p=A(()=>z(a)===`github`&&lx(Dl.current)),m=A(()=>p7e(z(i),z(o)?.label)),h=A(()=>z(m).serviceLabel),g=A(()=>z(m).tokenOptionHidden),_=A(()=>z(m).oauthOptionHidden),v=A(()=>z(m).oauthOptionDisabled),y=A(()=>{let{login:e,name:t}=t5.current?.account??{};return e||t||``});L(()=>{let e=z(a);M(o,void 0),RX(e).then(t=>{e===z(a)&&M(o,t)},()=>{})}),So(()=>{!e5.signInError.message&&!e5.signingIn&&d7e()});var b=S7e(),x=P(b),S=N(x),C=e=>{var t=m7e(),n=P(t),r=F(n,!0),i=I(n,2),a=e=>{{let t=A(()=>Y(`cancel`));Xx(e,{variant:`secondary`,get label(){return z(t)},get onclick(){return sd.current}})}};G(i,e=>{sd.current&&e(a)}),R(e=>W(r,e),[()=>Y(`signing_in`)]),U(e,t)},w=e=>{var t=_7e(),r=P(t),i=e=>{var t=_7e(),n=P(t);{let e=A(()=>Y(`work_with_local_repo`)),t=A(()=>!PY.isLocalBackendSupported);Xx(n,{variant:`primary`,get label(){return z(e)},get disabled(){return z(t)},onclick:async()=>{await a5(`local`)}})}var r=I(n,2),i=e=>{var t=h7e(),n=N(t),r=e=>{var t=H();Lo(P(t),()=>Ju(Y(`local_workflow.disabled`),`https://sveltiacms.app/en/docs/workflows/local#enabling-file-system-access-api-in-brave`)),U(e,t)},i=e=>{var t=V();R(e=>W(t,e),[()=>Y(`local_workflow.unsupported_browser`)]),U(e,t)};G(n,e=>{PY.isBrave?e(r):e(i,-1)}),D(t),U(e,t)},a=e=>{var t=g7e(),n=N(t),r=e=>{var t=V();R(e=>W(t,e),[()=>Y(`work_with_local_repo_description`,{values:{repo:z(u)}})]),U(e,t)},i=e=>{var t=V();R(e=>W(t,e),[()=>Y(`work_with_local_repo_description_no_repo`)]),U(e,t)};G(n,e=>{z(u)?e(r):e(i,-1)}),D(t),U(e,t)};G(r,e=>{PY.isLocalBackendSupported?e5.signInError.message||e(a,1):e(i)}),yS(I(r,2),{}),U(e,t)};G(r,e=>{z(d)&&e(i)});var o=I(r,2),f=e=>{var t=y7e(),n=P(t);{let e=A(()=>z(d)?`secondary`:`primary`),t=A(()=>z(c)?Y(`start_demo`):z(s)?Y(`work_with_test_repo`):Y(`sign_in_with_x`,{values:{service:z(h)}})),r=A(()=>z(v)||z(l));Xx(n,{get variant(){return z(e)},get label(){return z(t)},get disabled(){return z(r)},onclick:async()=>{await a5(z(a))}})}var r=I(n,2),i=e=>{var t=v7e(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`test_repo_unsupported_browser`)]),U(e,t)};G(r,e=>{z(l)&&e(i)}),U(e,t)};G(o,e=>{z(_)||e(f)});var p=I(o,2),m=e=>{{let t=A(()=>Y(`sign_in_using_access_token`,{values:{service:z(h)}}));Xx(e,{variant:`secondary`,get label(){return z(t)},onclick:()=>{M(n,!0)}})}};G(p,e=>{!z(s)&&!z(g)&&e(m)}),U(e,t)};G(S,e=>{e5.signingIn?e(C):z(o)&&e(w,1)});var T=I(S,2),ee=e=>{var t=b7e(),n=N(t);gx(n,{name:`error`});var r=I(n);D(t),R(()=>W(r,` ${e5.signInError.message??``}`)),U(e,t)};G(T,e=>{e5.signInError.message&&e5.signInError.context===`authentication`&&e(ee)}),D(x);var E=I(x,2);{let e=A(()=>Y(`sign_in_using_access_token`)),t=A(()=>({spellcheck:!1,ariaLabel:Y(`personal_access_token`)})),i=A(()=>Y(`sign_in`)),s=A(()=>!z(f));PS(E,{get title(){return z(e)},get textboxAttrs(){return z(t)},get okLabel(){return z(i)},get okDisabled(){return z(s)},onOk:()=>{a5(z(a),z(f))},onkeydown:e=>{!e.isComposing&&e.key===`Enter`&&z(f)&&(e.preventDefault(),M(n,!1),a5(z(a),z(f)))},get open(){return z(n)},set open(e){M(n,e,!0)},get value(){return z(r)},set value(e){M(r,e,!0)},children:(e,t)=>{Ur();var n=x7e(),r=P(n),i=I(r),a=e=>{var t=V();R(e=>W(t,e),[()=>Y(`sign_in_using_access_token_workflow_note`)]),U(e,t)};G(i,e=>{z(p)&&e(a)});var s=I(i,2),c=e=>{var t=H();Lo(P(t),()=>Ju(Y(`sign_in_using_access_token_link`,{values:{service:z(h)}}),z(o).repository.tokenPageURL)),U(e,t)};G(s,e=>{z(o)?.repository?.tokenPageURL&&e(c)}),R(e=>W(r,`${e??``} `),[()=>Y(`sign_in_using_access_token_description`)]),U(e,n)},$$slots:{default:!0}})}var te=I(E,2);{let e=A(()=>!!t5.current),t=A(()=>Y(`sign_in_with_link`)),n=A(()=>Y(`sign_in`));wS(te,{get open(){return z(e)},get title(){return z(t)},get okLabel(){return z(n)},onOk:()=>{t5.current?.respond(!0)},onClose:()=>{t5.current?.respond(!1)},children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(`sign_in_with_link_confirmation`,{values:{account:z(y),service:z(h)}})]),U(e,n)},$$slots:{default:!0}})}U(e,b),k()}var T7e=/^data:(image\/[a-zA-Z0-9.+-]+);base64,/,E7e=`data:image/svg+xml;base64,${btoa(`<svg viewBox="0 0 800 800" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><linearGradient id="a" gradientUnits="userSpaceOnUse" x1="400" x2="400" y1="0" y2="800"><stop offset="0" stop-color="#f0980b"/><stop offset="1" stop-color="#ff1d00"/></linearGradient><clipPath id="b"><rect height="800" rx="80" width="800"/></clipPath><rect fill="url(#a)" height="800" rx="80" width="800"/><g style="clip-path:url(#b);fill:none;stroke:#fff;stroke-linecap:round;stroke-linejoin:round;stroke-width:180"><path d="m320-80-200 320 200 320-200 320"/><path d="m400 240 200 320 200-320"/></g></svg>`)}`,o5=rl(()=>Dl.current?.app_title||`Sveltia CMS`),s5=rl(()=>Dl.current?.logo?.src||Dl.current?.logo_url||E7e),D7e=rl(()=>{let e=s5.current,t=e.match(T7e);return t?t[1]:gp.getType(e)??void 0}),O7e=async(e,t)=>{let n=await eJ(e,t),r=await Gc(n);return`data:${n.type};base64,${r}`},c5=tl();ol(()=>{let e=!1,t=s5.current;return(async()=>{let n;try{let e=await(await Bu(t)).blob(),[r,i]=await Promise.all([O7e(e,{...$q,width:192,height:192}),O7e(e,$q)]);n={small:r,large:i}}catch{n=void 0}e||(c5.current=n)})(),()=>{e=!0}});var k7e=rl(()=>{let e=o5.current,t=c5.current;if(!t)return;let{origin:n,pathname:r}=window.location,i=t.small.match(T7e)[1],a={name:e,short_name:e,start_url:`${n}${r}`,display:`standalone`,icons:[{src:t.small,sizes:`192x192`,type:i},{src:t.large,sizes:`512x512`,type:i}]},o=new Blob([JSON.stringify(a)],{type:`application/manifest+json`});return URL.createObjectURL(o)}),l5=tl([{name:`Uint8Array Base64/hex conversion`,test:()=>typeof Uint8Array.fromBase64==`function`&&typeof Uint8Array.prototype.toHex==`function`},{name:`Iterator helpers`,test:()=>typeof globalThis.Iterator==`function`&&typeof globalThis.Iterator.prototype.map==`function`}].filter(({test:e})=>!e()).map(({name:e})=>e)),A7e=(e,t=Cr)=>{var n=H();Lo(P(n),()=>Yu(t(),{allowedTags:[`a`,`code`]})),U(e,n)},j7e=B(`<img alt="" class="logo svelte-7ua6x9"/> <h1 class="svelte-7ua6x9"> </h1>`,1),u5=B(`<div role="alert" class="message"> </div>`),M7e=B(`<li><!></li>`),N7e=B(`<div role="alert" class="message"><div role="none"> </div> <ul class="error svelte-7ua6x9"></ul></div>`),P7e=B(`<div role="alert"><div role="none" class="message"> </div> <div role="none" class="error svelte-7ua6x9"><!></div></div>`),F7e=B(`<!> <!>`,1),I7e=B(`<div role="alert" class="message"> </div> <!>`,1),L7e=B(`<div role="none" class="powered-by svelte-7ua6x9"> </div>`),R7e=B(`<div role="none" class="container svelte-7ua6x9"><div role="none" class="inner svelte-7ua6x9"><!> <!></div></div> <!>`,1),z7e={hash:`svelte-7ua6x9`,code:`.container.svelte-7ua6x9 {position:absolute;inset:0;z-index:101;flex:auto;display:flex;justify-content:center;align-items:center;gap:16px;padding:32px;.inner:where(.svelte-7ua6x9) {display:flex;flex-direction:column;align-items:center;gap:32px;min-width:240px;max-width:800px;min-height:240px;}.logo:where(.svelte-7ua6x9) {width:auto;height:160px;
@media (width < 768px) {height:120px;
}}h1:where(.svelte-7ua6x9) {font-size:48px;}.logo:where(.svelte-7ua6x9) ~ h1:where(.svelte-7ua6x9) {font-size:var(--sui-font-size-xxx-large);}.error:where(.svelte-7ua6x9) {border-radius:var(--sui-control-medium-border-radius);padding:12px;background-color:var(--sui-tertiary-background-color);font-size:var(--sui-font-size-default);text-align:center;-webkit-user-select:text;user-select:text;cursor:text;}
/* \`<SignIn>\` also has \`.message\` */.message {margin:0 0 16px;font-size:var(--sui-font-size-large);font-weight:var(--sui-font-weight-normal);text-align:center;ul {margin:12px 0 0;padding:0;max-height:160px;overflow-y:auto;list-style:none;}li {margin:12px;padding:0;}}}.powered-by.svelte-7ua6x9 {position:absolute;inset:auto 24px 24px;color:var(--sui-tertiary-foreground-color);font-size:var(--sui-font-size-small);text-align:center;}`};function B7e(e,t){O(t,!0),K(e,z7e);let n=A(()=>!!l5.current.length),r=A(()=>!!e5.signInError.message&&e5.signInError.context===`dataFetch`);L(()=>{jl.current&&(d0.current=Y(`welcome_message`,{values:{name:o5.current}}))});var i=R7e(),a=P(i),o=N(a),s=N(o),c=e=>{var t=j7e(),n=P(t),r=F(I(n,2),!0);R(()=>{q(n,`src`,s5.current),W(r,o5.current)}),U(e,t)};G(s,e=>{(jl.current||z(n))&&e(c)});var l=I(s,2),u=e=>{var t=u5(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`unsupported_browser_error`)]),U(e,t)},d=e=>{var t=N7e(),n=N(t),r=F(n,!0),i=I(n,2);No(i,20,()=>Al.current,e=>e,(e,t)=>{var n=M7e();A7e(N(n),()=>t),D(n),U(e,n)}),D(i),D(t),R(e=>W(r,e),[()=>Y(`config.errors`,{values:{count:Al.current.length}})]),U(e,t)},f=e=>{var t=u5(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`prefs.error.${vu.current.type}`)]),U(e,t)},p=e=>{var t=u5(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`loading_cms_config`)]),U(e,t)},m=A(()=>!Dl.current||!Object.keys(yu).length),h=e=>{var t=F7e(),n=P(t),i=e=>{var t=P7e(),n=N(t),r=F(n,!0),i=I(n,2);A7e(N(i),()=>e5.signInError.message),D(i),D(t),R(e=>W(r,e),[()=>Y(`loading_site_data_error`)]),U(e,t)};G(n,e=>{z(r)&&e(i)}),w7e(I(n,2),{}),U(e,t)},g=e=>{var t=u5(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`authorizing`)]),U(e,t)},_=e=>{var t=I7e(),n=P(t),r=F(n,!0),i=I(n,2),a=e=>{Xpe(e,{get now(){return zp.current}})};G(i,e=>{zp.current!==void 0&&e(a)}),R(e=>W(r,e),[()=>Y(`loading_site_data`)]),U(e,t)};G(l,e=>{z(n)?e(u):Al.current.length?e(d,1):vu.current?e(f,2):z(m)?e(p,3):z(r)||!od.current&&(!Fu.account||e5.unauthenticated)?e(h,4):od.current?e(g,5):Rp.current||e(_,6)}),D(o),D(a);var v=I(a,2),y=e=>{var t=L7e(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`powered_by`,{values:{name:`Sveltia CMS`}})]),U(e,t)};G(v,e=>{jl.current&&o5.current!==`Sveltia CMS`&&e(y)}),U(e,i),k()}var V7e=B(`<div role="none" class="preview svelte-di72gm"> </div>`),H7e=B(`<!> <!>`,1),U7e={hash:`svelte-di72gm`,code:`.preview.svelte-di72gm {margin:8px 0 0;color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);overflow-wrap:anywhere;}`};function W7e(e,t){let n=mo();O(t,!0),K(e,U7e);let r=A(()=>m2.current),i=A(()=>!!z(r)),a=!1,o=A(()=>z(r).mode),s=A(()=>z(r).defaultMessage),c=A(()=>z(r).initialValue),l=A(()=>{let e=z(c).trim();return e?z(o)===`prefix`?`${e} ${z(s)}`:`${z(s)} ${e}`:z(s)});{let t=e=>{var t=H7e(),r=P(t);{let e=A(()=>Y(z(o)===!0?`commit_message.message`:`commit_message.addition`)),t=A(()=>z(o)===!0?void 0:`${n}-preview`);NS(r,{dir:`auto`,flex:!0,autofocus:!0,get ariaLabel(){return z(e)},get"aria-describedby"(){return z(t)},onkeydown:e=>{e.key===`Enter`&&!e.isComposing&&(e.preventDefault(),a=!0,M(i,!1))},get value(){return z(c)},set value(e){M(c,e)}})}var s=I(r,2),u=e=>{var t=V7e(),r=F(t,!0);R(e=>{q(t,`id`,`${n}-preview`),W(r,e)},[()=>Y(`commit_message.preview`,{values:{message:z(l)}})]),U(e,t)};G(s,e=>{z(o)!==!0&&e(u)}),U(e,t)},s=A(()=>Y(`commit_message.title`));PS(e,{get title(){return z(s)},onOk:()=>{z(r)?.respond(z(c))},onClose:()=>{z(r)?.respond(a?z(c):null),a=!1},get open(){return z(i)},set open(e){M(i,e)},input:t,children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(z(o)===!0?`commit_message.description_replace`:`commit_message.description_addition`)]),U(e,n)},$$slots:{input:!0,default:!0}})}k()}var G7e=B(` <!>`,1),K7e=B(`<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>`,1);function q7e(e,t){O(t,!0);let n=0,r=j(`none`),i=async()=>{LX.current?.checkStatus&&M(r,await LX.current.checkStatus(),!0)},a=()=>{window.clearInterval(n),i(),n=window.setInterval(()=>{i()},3e5)},o=()=>{window.clearInterval(n),M(r,`none`)},s=()=>{LX.current?.checkStatus&&!LX.current.repository?.isSelfHosted?a():o()};So(()=>()=>{o()}),L(()=>{LX.current,Dl.current,s()});var c=H(),l=P(c),u=e=>{var t=K7e(),n=P(t);{let e=A(()=>z(r)===`major`?`error`:`warning`);ko(n,()=>({"--sui-infobar-message-justify-content":`center`})),Zx(n.lastChild,{get status(){return z(e)},children:(e,t)=>{Ur();var n=G7e(),i=P(n),a=I(i);{let e=A(()=>Y(`details`));Xx(a,{variant:`link`,get label(){return z(e)},onclick:()=>{Tq(LX.current?.statusDashboardURL)}})}R(e=>W(i,`${e??``} `),[()=>Y(`backend_status.${z(r)}_incident`,{values:{service:LX.current?.label}})]),U(e,n)},$$slots:{default:!0}}),D(n)}U(e,t)},d=A(()=>[`minor`,`major`].includes(z(r)));G(l,e=>{z(d)&&e(u)}),U(e,c),k()}var J7e=async(e=``)=>{try{let t=await fetch(`https://unpkg.com/@sveltia/cms${e?`@${e}`:``}/package.json`);if(!t.ok)return;let{version:n}=await t.json();return typeof n==`string`&&n?n:void 0}catch{return}},Y7e=e=>{let t=e.split(`.`).map(Number),n=`0.266.0`.split(`.`).map(Number),r=t.findIndex((e,t)=>e!==(n[t]??0));return r>-1&&t[r]>(n[r]??0)},X7e=async()=>{let e=jre();if(e!==void 0){let t=await J7e(e);if(t&&Y7e(t))return!0;if(!e)return!1}let t=await J7e();return!t||!Y7e(t)||console.warn(`[Sveltia CMS] A new version (${t}) is available. You are using version 0.266.0. Update the pinned version in your script tag or package.json to upgrade.`),!1},Z7e=B(` <!>`,1),Q7e=B(`<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>`,1);function $7e(e,t){O(t,!0);let n=0,r=0,i=j(!1),a=async()=>{await X7e()&&(r=window.setTimeout(()=>{M(i,!0)},6e5))},o=()=>{window.location.reload()};So(()=>(a(),n=window.setInterval(()=>{a()},36e5),()=>{window.clearInterval(n),window.clearTimeout(r)}));var s=H(),c=P(s),l=e=>{var t=Q7e(),n=P(t);ko(n,()=>({"--sui-infobar-message-justify-content":`center`})),Zx(n.lastChild,{children:(e,t)=>{Ur();var n=Z7e(),r=P(n),i=I(r);{let e=A(()=>Y(`update_now`));Xx(i,{variant:`link`,get label(){return z(e)},onclick:o})}R(e=>W(r,`${e??``} `),[()=>Y(`update_available`)]),U(e,n)},$$slots:{default:!0}}),D(n),U(e,t)};G(c,e=>{z(i)&&e(l)}),U(e,s),k()}var e9e={create:`New`,select:`Select`,select_all:`Select All`,select_item:`Select {$name}`,upload:`Upload`,copy:`Copy`,download:`Download`,duplicate:`Duplicate`,delete:`Delete`,reorder:`Reorder`,cancel:`Cancel`,done:`Done`,save:`Save`,saving:`Saving…`,publish:`Publish`,publishing:`Publishing…`,rename:`Rename`,update:`Update`,replace:`Replace`,add:`Add`,remove:`Remove`,clear:`Clear`,expand:`Expand`,expand_all:`Expand All`,collapse:`Collapse`,collapse_all:`Collapse All`,insert:`Insert`,restore:`Restore`,discard:`Discard`,searching:`Searching…`,no_results:`No results found.`,global:`Global`,primary:`Primary`,secondary:`Secondary`,collection:`Collection`,folder:`Folder`,folders:`Folders`,more_folders:`More Folders`,api_key:`API Key`,details:`Details`,back:`Back`,automatic:`Automatic`,loading:`Loading…`,later:`Later`,slug:`Slug`,singleton:`Singleton`,singletons:`Singletons`,clipboard_error:`Couldn’t copy to clipboard.`,welcome_message:`Welcome to {$name}`,powered_by:`Powered by {$name}`,unsupported_browser_error:`Your browser is not supported. Please update it to the latest version or use another browser.`,loading_cms_config:`Loading CMS Configuration…`,loading_site_data:`Loading Site Data…`,loading_site_data_error:`There was an error while loading site data.`,sign_in_with_x:`Sign In with {$service}`,sign_in_using_access_token:`Sign In Using Access Token`,sign_in_using_access_token_description:`Enter your token below. It must have read/write access to the repository content.`,sign_in_using_access_token_workflow_note:`Since Editorial Workflow is enabled, it must also have read/write access to pull requests.`,sign_in_using_access_token_link:`You can generate a token on the <a>{$service} user settings page</a>.`,personal_access_token:`Personal Access Token`,authorizing:`Authorizing…`,signing_in:`Signing in…`,work_with_local_repo:`Work with Local Repository`,work_with_local_repo_description:`Once prompted, select the root directory of the “{$repo}” repository.`,work_with_local_repo_description_no_repo:`Once prompted, select the root directory of your Git repository.`,work_with_test_repo:`Work with Test Repository`,start_demo:`Start Demo`,test_repo_unsupported_browser:`Your browser can’t save the files of the test repository. Please update it to the latest version or use another browser.`,sign_in_error:{not_project_root:`The selected folder is not a repository root directory. Please try again.`,picker_dismissed:`A repository root directory could not be selected. Please try again.`,authentication_aborted:`Authentication aborted. Please try again.`,invalid_token:`The provided token is invalid. Please check and try again.`,UNSUPPORTED_BACKEND:`Your Git backend is not supported by the authenticator.`,UNSUPPORTED_DOMAIN:`Your domain is not allowed to use the authenticator.`,MISCONFIGURED_CLIENT:`OAuth app client ID or secret is not configured.`,AUTH_CODE_REQUEST_FAILED:`Failed to receive an authorization code. Please try again later.`,CSRF_DETECTED:`Potential CSRF attack detected. Authentication flow aborted.`,TOKEN_REQUEST_FAILED:`Failed to request an access token. Please try again later.`,TOKEN_REFRESH_FAILED:`Failed to refresh the access token. Please try again later.`,MALFORMED_RESPONSE:`Server responded with malformed data. Please try again later.`},backend_unsupported_version:`The {$name} backend requires {$name} {$version} or later.`,repository_no_access:`You don’t have access to the “{$repo}” repository.`,repository_no_write_access:`You don’t have write access to the “{$repo}” repository.`,repository_not_found:`The “{$repo}” repository doesn’t exist.`,repository_empty:`The “{$repo}” repository has no branches.`,branch_not_found:`The “{$repo}” repository doesn’t have the “{$branch}” branch.`,root_dir_not_found:`The root directory “{$dir}” doesn’t exist in the “{$repo}” repository.`,unexpected_error:`Unexpected Error`,page_crashed:`Something went wrong, and this page can’t be displayed. {$message}`,field_crashed:`Something went wrong, and this field can’t be displayed. {$message}`,try_again:`Try Again`,reload_cms:`Reload CMS`,entry_parse_errors:`.input {$count :integer} .match $count one {{There was an error while parsing an entry file. Check the browser console for details.}} * {{There were errors while parsing entry files. Check the browser console for details.}}`,username:`Username`,password:`Password`,sign_in:`Sign In`,sign_in_with_mobile:`Sign In with Mobile`,sign_in_with_mobile_instruction:`Scan the QR code below with your phone or tablet for passwordless sign-in. Your settings will be automatically copied.`,sign_in_with_link:`Sign In with Link`,sign_in_with_link_confirmation:`This link signs you in as {$account} on {$service} and copies the settings from the device it was created on. Continue only if you created the link yourself.`,signed_in_as_x:`Signed In as {$name}`,working_with_local_repo:`Working with Local Repository`,working_with_test_repo:`Working with Test Repository`,working_in_demo_mode:`Demo Mode`,demo_welcome:{title:`Welcome to Sveltia CMS Demo`,description:`Feel free to explore the CMS and edit the sample content. Your changes are only saved in this browser. Nothing is published online, and no one else can see them.`,reset_hint:`To start over with the original content, select Erase All Data under Settings > Data Management.`,button_label:`Get Started`},sign_out:`Sign Out`,install_as_app:`Install as App`,contents:`Contents`,assets:`Assets`,editorial_workflow:`Editorial Workflow`,drafts:`Drafts`,cms_config:`CMS Configuration`,menu:`Menu`,custom_pages:`Pages`,mobile_promo_title:`Sveltia CMS is now available on mobile!`,mobile_promo_button:`Give it a try`,new_language_available:`Sveltia CMS is now available in {$locale}!`,change_language:`Change Language`,live_reload_warning:`Your development server reloads this page whenever a file changes, which can interrupt saving and leave your files broken. Serve the CMS from a static HTML file instead. <a>Learn more</a>`,switching_language:`Switching to {$locale}…`,locale_load_failed:`Couldn’t load the {$locale} translation. Please try again later.`,local_git_not_committed:`Your changes have been saved but not committed to Git. {$reason} To only save the files, turn off Git commits under Settings > Developer.`,local_git_skip_reasons:{unsupported_repository:`Your repository uses a Git feature the CMS doesn’t support, such as a linked worktree, SHA-256 object names, the reftable format, a sparse index, or an index in version 3 or 4, which the feature.manyFiles option and git add -N use.`,missing_identity:`Your name and email address aren’t set in the repository’s Git configuration, and the CMS can’t read your global one. Set them in the repository with git config --local user.name "Your Name" and git config --local user.email "you@example.com".`,locked:`Another Git process is using the repository. If none is running, delete the .git/index.lock file.`,operation_in_progress:{merge:`A merge is in progress. Finish it with git commit, or cancel it with git merge --abort.`,rebase:`A rebase is in progress. Finish it with git rebase --continue, or cancel it with git rebase --abort. If you’ve moved on, git rebase --quit drops it without changing your files.`,cherry_pick:`A cherry-pick is in progress. Finish it with git cherry-pick --continue, or cancel it with git cherry-pick --abort.`,revert:`A revert is in progress. Finish it with git revert --continue, or cancel it with git revert --abort.`,am:`Applying patches with git am is in progress. Finish it with git am --continue, or cancel it with git am --abort.`,conflict:`Some files have conflicts. Resolve them and stage the results first.`},detached_head:`No branch is checked out.`,staged_changes:`You have other changes staged for commit. Commit or unstage them first.`,lfs:`{$path} is tracked with Git LFS, which the CMS can’t commit to.`,error:`An unexpected error occurred. {$message}`},visit_live_site:`Visit Live Site`,switch_page:`Switch Page`,search_placeholder_contents:`Search for contents…`,search_placeholder_assets:`Search for assets…`,search_placeholder_all:`Search for contents and assets…`,create_entry_or_assets:`Create Entry or Assets`,publish_changes:`Publish Changes`,publishing_changes:`Publishing Changes…`,publishing_changes_failed:`Couldn’t publish changes. Please try again.`,show_notifications:`Show Notifications`,notifications:`Notifications`,show_account_menu:`Show Account Menu`,account:`Account`,live_site:`Live Site`,git_repository:`Git Repository`,settings:`Settings`,show_help_menu:`Show Help Menu`,help:`Help`,keyboard_shortcuts:`Keyboard Shortcuts`,documentation:`Documentation`,release_notes:`Release Notes`,announcements:`Announcements`,version_x:`Version {$version}`,report_issue:`Report Issue`,share_feedback:`Share Feedback`,get_help:`Get Help`,donate:`Donate`,join_discord:`Join Us on Discord`,bluesky:`Follow Us on Bluesky`,update_available:`The latest version of Sveltia CMS is available.`,update_now:`Update Now`,backend_status:{minor_incident:`{$service} is experiencing a minor incident. Your workflow may be affected.`,major_incident:`{$service} is experiencing a major incident. You may want to wait until the situation has improved.`},content_library:`Content Library`,asset_library:`Asset Library`,collections:`Collections`,entries:`Entries`,files:`Files`,asset_location:{repository:`Your Site`,external:`External Locations`,stock_photos:`Stock Photos`},collection_assets:`Collection Assets`,entry_list:`Entry List`,file_list:`File List`,asset_list:`Asset List`,x_collection:`{$collection} Collection`,x_asset_folder:`{$folder} Asset Folder`,viewing_collection_list:`You’re now viewing the collection list.`,viewing_asset_folder_list:`You’re now viewing the asset folder list.`,viewing_x_collection:`.input {$count :integer} .match $count 0 {{You’re now viewing the “{$collection}” collection, which has no entries yet.}} one {{You’re now viewing the “{$collection}” collection, which has one entry.}} * {{You’re now viewing the “{$collection}” collection, which has {$count} entries.}}`,viewing_x_asset_folder:`.input {$count :integer} .match $count 0 {{You’re now viewing the “{$folder}” asset folder, which has no assets yet.}} one {{You’re now viewing the “{$folder}” asset folder, which has one asset.}} * {{You’re now viewing the “{$folder}” asset folder, which has {$count} assets.}}`,viewing_x_external_location:`You’re now viewing the assets on {$service}.`,singleton_selected_announcement:`Press Enter to edit the “{$file}” file.`,page_not_found:`Page not found.`,collection_not_found:`Collection not found.`,asset_folder_not_found:`Asset folder not found.`,file_not_found:`File not found.`,x_of_x_selected:`{$selected} of {$total} selected`,switch_view:`Switch View`,table_view:`Table View`,list_view:`List View`,grid_view:`Grid View`,switch_to_list_view:`Switch to List View`,switch_to_grid_view:`Switch to Grid View`,sort:`Sort`,sorting_options:`Sorting Options`,table_column_keys:{dirname:`Folder`,filename:`File Name`,extension:`Extension`,locales:`Languages`},sort_keys:{none:`None`,name:`Name`,slug:`Slug`,commit_author:`Updated by`,commit_date:`Updated on`,last_modified:`Modified on`,size:`Size`,_summary:`Summary`,_manual:`Manual`},ascending:`{$label}, A to Z`,ascending_date:`{$label}, old to new`,descending:`{$label}, Z to A`,descending_date:`{$label}, new to old`,ascending_number:`{$label}, small to large`,descending_number:`{$label}, large to small`,filter:`Filter`,filtering_options:`Filtering Options`,group:`Group`,grouping_options:`Grouping Options`,type:`Type`,all:`All`,domain:`Domain`,image:`Image`,video:`Video`,audio:`Audio`,document:`Document`,other:`Other`,show_assets:`Show Assets`,hide_assets:`Hide Assets`,show_info:`Show Info`,hide_info:`Hide Info`,all_assets:`All Assets`,global_assets:`Global Assets`,linked_files:`Linked Files`,file_unavailable:`Unavailable`,file_unavailable_description:`This file couldn’t be loaded. It may have been moved or deleted.`,loading_entries:`.input {$count :integer} .match $count one {{Loading entry…}} * {{Loading entries…}}`,entry_not_found:`Entry not found.`,creating_entries_disabled_by_admin:`Creating new entries in this collection is disabled by the administrator.`,creating_entries_disabled_by_quota:`.input {$quota :integer} .match $quota one {{You cannot add new entries to this collection because it has reached its limit of {$quota} entry.}} * {{You cannot add new entries to this collection because it has reached its limit of {$quota} entries.}}`,creating_entries_nearing_quota:`.input {$quota :integer} .input {$remaining :integer} .match $quota $remaining one one {{This collection is nearing its limit of {$quota} entry. You can only create {$remaining} more entry.}} one * {{This collection is nearing its limit of {$quota} entry. You can only create {$remaining} more entries.}} * one {{This collection is nearing its limit of {$quota} entries. You can only create {$remaining} more entry.}} * * {{This collection is nearing its limit of {$quota} entries. You can only create {$remaining} more entries.}}`,readonly_cms:`The CMS is in read-only mode. You can view content and assets but cannot make any changes.`,readonly_collection:`This collection is read-only. You can view its content but cannot make any changes.`,readonly_entry:`This entry is read-only. You can view it but cannot make any changes.`,readonly_asset_folder:`This folder is read-only. You can view its assets but cannot make any changes.`,readonly_branch:`You don’t have permission to push to the “{$branch}” branch. You can view this content but cannot make any changes.`,readonly_reference:`The entry is read-only, so the reference can’t be removed.`,cannot_rename_referenced_entry:`This entry can’t be renamed, because the following read-only entries refer to it by its current name: {$entries}.`,cannot_move_referenced_asset:`This asset can’t be moved or renamed, because the following read-only entries use it: {$entries}.`,back_to_collection:`Back to Collection`,collection_list:`Collection List`,back_to_collection_list:`Back to Collection List`,asset_folder_list:`Asset Folder List`,back_to_asset_folder_list:`Back to Asset Folder List`,back_to_parent_folder:`Back to Parent Folder`,search_results:`Search Results`,search_results_for_x:`Search Results for “{$terms}”`,viewing_entry_search_results:`.input {$count :integer} .match $count 0 {{You’re now viewing search results for “{$terms}”. We couldn’t find any entries.}} one {{You’re now viewing search results for “{$terms}”. We’ve found one entry.}} * {{You’re now viewing search results for “{$terms}”. We’ve found {$count} entries.}}`,viewing_asset_search_results:`.input {$count :integer} .match $count 0 {{You’re now viewing search results for “{$terms}”. We couldn’t find any assets.}} one {{You’re now viewing search results for “{$terms}”. We’ve found one asset.}} * {{You’re now viewing search results for “{$terms}”. We’ve found {$count} assets.}}`,x_entries:`.input {$count :integer} .match $count 0 {{No entries}} one {{{$count} entry}} * {{{$count} entries}}`,x_assets:`.input {$count :integer} .match $count 0 {{No assets}} one {{{$count} asset}} * {{{$count} assets}}`,no_files_found:`No files found.`,no_entries_found:`No entries found.`,upload_assets:`Upload New Assets`,new_folder:`New Folder`,new_folder_name:`Folder Name`,new_folder_create:`Create`,new_folder_description:`The new folder will be created in “{$folder}”.`,new_folder_error:{empty:`The folder name cannot be empty.`,invalid:`The folder name cannot contain slashes or start with a dot.`,reserved:`The files in a folder with this name are read-only, as the CMS itself is usually served from it.`,duplicate:`A folder or file with this name already exists here.`},creating_folder:`Creating the folder…`,creating_folder_failed:`Couldn’t create the folder.`,folder_options:`Folder Options`,show_folder_options:`Show Folder Options`,rename_folder:`Rename Folder`,delete_folder:`Delete Folder`,enter_new_name_for_folder:`.input {$count :integer} .match $count 0 {{Enter a new name below.}} one {{Enter a new name below. The asset in the folder will be moved along, and any entry using it will be updated.}} * {{Enter a new name below. The {$count} assets in the folder will be moved along, and any entries using them will be updated.}}`,enter_new_name_for_external_folder:`.input {$count :integer} .match $count 0 {{Enter a new name below.}} one {{Enter a new name below. The file in the folder will be moved along, and its URL will change, so update any entry using it.}} * {{Enter a new name below. The {$count} files in the folder will be moved along, and their URLs will change, so update any entries using them.}}`,renaming_external_folder_breaks_links:`.input {$count :integer} .match $count one {{An entry links to a file in this folder. The entry won’t be updated, so the link will break once the folder is renamed.}} * {{{$count} entries link to files in this folder. The entries won’t be updated, so the links will break once the folder is renamed.}}`,confirm_deleting_folder:`.input {$count :integer} .match $count 0 {{Are you sure you want to delete the empty “{$name}” folder?}} one {{Are you sure you want to delete the “{$name}” folder and the asset in it?}} * {{Are you sure you want to delete the “{$name}” folder and the {$count} assets in it?}}`,renaming_folder:`Renaming the folder…`,renaming_folder_failed:`Couldn’t rename the folder.`,deleting_folder:`Deleting the folder…`,deleting_folder_failed:`Couldn’t delete the folder.`,external_assets_truncated:`There are too many files on the service to list them all, so some of them are left out.`,edit_options:`Edit Options`,show_edit_options:`Show Edit Options`,copy_options:`Copy Options`,edit_asset:`Edit Asset`,edit_x:`Edit {$name}`,wrap_long_lines:`Wrap Long Lines`,rename_asset:`Rename Asset`,rename_x:`Rename {$name}`,enter_new_name_for_asset:`.input {$count :integer} .match $count 0 {{Enter a new name below.}} one {{Enter a new name below. An entry using the asset will also be updated.}} * {{Enter a new name below. {$count} entries using the asset will also be updated.}}`,renaming_external_asset_breaks_links:`.input {$count :integer} .match $count one {{An entry links to this file. The entry won’t be updated, so the link will break once the file is renamed.}} * {{{$count} entries link to this file. The entries won’t be updated, so the links will break once the file is renamed.}}`,enter_new_name_for_asset_error:{empty:`File name cannot be empty.`,character:`File name cannot contain special characters.`,duplicate:`This file name is used for another asset.`,leading_dot:`File name cannot start with a dot.`,file_duplicate:`Another file with this name already exists here.`,folder_duplicate:`A folder with this name already exists here.`},file_will_be_saved_as:`The file will be saved as “{$name}”.`,change_file_extension:`Change File Extension`,confirm_file_extension_change:{change:`Are you sure you want to change the extension from “.{$oldExtension}” to “.{$newExtension}”?`,add:`Are you sure you want to add the extension “.{$newExtension}”?`,remove:`Are you sure you want to remove the extension “.{$oldExtension}”?`},file_extension_change_warning:`The file may not be displayed or handled correctly if the extension doesn’t match the actual file format.`,replace_asset:`Replace Asset`,replace_x:`Replace {$name}`,replace_file:`Replace File`,replace_image:`Replace Image`,remove_file:`Remove File`,remove_image:`Remove Image`,click_to_browse:`Click to browse…`,tap_to_browse:`Tap to browse…`,drop_files_or_click_to_browse:`.input {$count :integer} .match $count one {{Drop a file here or click to browse…}} * {{Drop files here or click to browse…}}`,drop_files_or:`.input {$count :integer} .match $count one {{Drop a file here or}} * {{Drop files here or}}`,drop_image_files_or:`.input {$count :integer} .match $count one {{Drop an image file here or}} * {{Drop image files here or}}`,browse:`Browse`,paste:`Paste`,paste_image:`Paste Image`,no_image_in_clipboard:`No image found in clipboard.`,clipboard_access_denied:`Clipboard access denied.`,drop_files_here:`.input {$count :integer} .match $count one {{Drop a file here}} * {{Drop files here}}`,unsupported_file_type:`Unsupported File Type`,dropped_file_type_mismatch:`The dropped file is not one of the following types: {$types}. Please try again.`,dropped_image_type_mismatch:`The dropped file is not supported. Only an image of the following types is accepted: {$types}. Please try again.`,choose_files:`.input {$count :integer} .match $count one {{Choose File}} * {{Choose Files}}`,delete_assets:`.input {$count :integer} .match $count one {{Delete Asset}} * {{Delete Assets}}`,delete_selected_assets:`.input {$count :integer} .match $count one {{Delete Selected Asset}} * {{Delete Selected Assets}}`,confirm_deleting_this_asset:`Are you sure you want to delete this asset?`,confirm_deleting_selected_assets:`.input {$count :integer} .match $count one {{Are you sure you want to delete the selected asset?}} * {{Are you sure you want to delete the selected {$count} assets?}}`,confirm_deleting_all_assets:`Are you sure you want to delete all the assets?`,deleting_referenced_assets_note:`.input {$count :integer} .match $count one {{The reference to it in an entry will be removed as well.}} * {{The references to it in {$count} entries will be removed as well.}}`,cannot_delete_referenced_assets:`.input {$count :integer} .match $count one {{This asset can’t be deleted, because the following fields in the entries using it would no longer be valid without it. Update those entries first.}} * {{These assets can’t be deleted, because the following fields in the entries using them would no longer be valid without them. Update those entries first.}}`,checking_asset_references_failed:`.input {$count :integer} .match $count one {{Couldn’t check which entries use this asset. Close this dialog and try again.}} * {{Couldn’t check which entries use these assets. Close this dialog and try again.}}`,delete_entries:`.input {$count :integer} .match $count one {{Delete Entry}} * {{Delete Entries}}`,delete_selected_entries:`.input {$count :integer} .match $count one {{Delete Selected Entry}} * {{Delete Selected Entries}}`,confirm_deleting_this_entry:`Are you sure you want to delete this entry?`,confirm_deleting_this_entry_with_assets:`Are you sure you want to delete this entry and associated assets?`,deleting_entry_failed:`Couldn’t delete the entry. Please try again.`,confirm_deleting_selected_entries:`.input {$count :integer} .match $count one {{Are you sure you want to delete the selected entry?}} * {{Are you sure you want to delete the selected {$count} entries?}}`,confirm_deleting_selected_entries_with_assets:`.input {$count :integer} .match $count one {{Are you sure you want to delete the selected entry and associated assets?}} * {{Are you sure you want to delete the selected {$count} entries and associated assets?}}`,confirm_deleting_all_entries:`Are you sure you want to delete all the entries?`,confirm_deleting_all_entries_with_assets:`Are you sure you want to delete all the entries and associated assets?`,deleting_referenced_entries_note:`.input {$count :integer} .match $count one {{The reference to it in another entry will be removed as well.}} * {{The references to it in {$count} other entries will be removed as well.}}`,cannot_delete_referenced_entries:`.input {$count :integer} .match $count one {{This entry can’t be deleted, because the following fields in other entries would no longer be valid without it. Update those entries first.}} * {{These entries can’t be deleted, because the following fields in other entries would no longer be valid without them. Update those entries first.}}`,reorder_entries:`Reorder Entries`,done_reordering_entries:`Done Reordering Entries`,cancel_reordering_entries:`Cancel Reordering Entries`,saving_reorder_failed:`Failed to save new entry order. Please try again.`,bulk_edit_entries:`Edit Entries in Bulk`,save_bulk_edits:`Save Bulk Edits`,cancel_bulk_edits:`Cancel Bulk Edits`,bulk_edit_entry:`Entry`,bulk_edit_table:`Bulk Editor`,bulk_edit_cell:`{$field} of {$entry}`,bulk_edit_count:`.input {$count :integer} .match $count 0 {{No changes}} one {{1 change}} * {{{$count} changes}}`,bulk_edit_invalid:`Some of the values aren’t valid. Fix the highlighted fields and try again.`,saving_bulk_edits_failed:`Failed to save the changes. Please try again.`,discard_bulk_edits_confirm:`Discard the changes made to the entries?`,processing_files:`.input {$count :integer} .match $count one {{Processing a file. This may take a while.}} * {{Processing files. This may take a while.}}`,uploading_files:`Uploading Files`,confirm_replacing_file:`“{$name}” will be replaced with this file:`,confirm_uploading_files:`.input {$count :integer} .match $count one {{This file will be saved to the “{$folder}” folder:}} * {{These {$count} files will be saved to the “{$folder}” folder:}}`,oversized_files:`Oversized Files`,warning_oversized_files:`.input {$count :integer} .match $count one {{This file cannot be uploaded because it exceeds the maximum size of {$size}. Please reduce the size or select a different file.}} * {{These files cannot be uploaded because they exceed the maximum size of {$size}. Please reduce the sizes or select different files.}}`,invalid_files:`Invalid Files`,warning_invalid_files:`.input {$count :integer} .match $count one {{This file cannot be uploaded because it’s damaged, or its content doesn’t match its file extension. This often happens when a photo is renamed rather than converted, such as a HEIC image saved as a JPEG file. Please convert the file and try again.}} * {{These files cannot be uploaded because they’re damaged, or their content doesn’t match their file extensions. This often happens when photos are renamed rather than converted, such as HEIC images saved as JPEG files. Please convert the files and try again.}}`,warning_unsupported_files:`.input {$count :integer} .match $count one {{This file cannot be uploaded because it’s not one of the following types: {$types}.}} * {{These files cannot be uploaded because they’re not one of the following types: {$types}.}}`,warning_unsupported_image_files:`.input {$count :integer} .match $count one {{This file cannot be uploaded because only an image of the following types is accepted: {$types}.}} * {{These files cannot be uploaded because only images of the following types are accepted: {$types}.}}`,mismatched_files:`Mismatched Files`,warning_mismatched_files:`.input {$count :integer} .match $count one {{This file cannot replace “{$name}” because it’s in a different format. Please convert the file to the same format and try again.}} * {{These files cannot replace “{$name}” because they’re in a different format. Please convert the files to the same format and try again.}}`,file_name_conflict_confirmation:`.input {$count :integer} .match $count one {{A file with the same name already exists in this folder. Do you want to replace it?}} * {{{$count} files with the same names already exist in this folder. Do you want to replace them?}}`,file_name_conflict_confirmation_with_name:`.input {$count :integer} .input {$name :string} .match $count one {{A file named “{$name}” already exists in this folder. Do you want to replace it?}} * {{{$count} files with the same names already exist in this folder. Do you want to replace them?}}`,file_name_conflict_resolution:`File Name Conflict Resolution`,keep_both:`Keep Both`,uploading_files_progress:`Uploading…`,uploading_files_failed:`Upload failed.`,deleting_assets_failed:`Delete failed.`,renaming_asset_failed:`Rename failed.`,saving_asset_failed:`Save failed.`,file_meta_converted_from_x:`(converted from {$type})`,no_entries_created:`This collection has no entries yet.`,create_new_entry:`Create New Entry`,entry:`Entry`,index_file:`Index File`,no_files_in_collection:`No files available in this collection.`,duplicate_entry:`Duplicate Entry`,entry_duplicated:`Entry duplicated as a new draft.`,entry_validation_errors:`.input {$count :integer} .match $count one {{One field has an error. Please correct it to save the entry.}} * {{{$count} fields have errors. Please correct them to save the entry.}}`,show_errors:`Show Errors`,entry_saved:`.input {$count :integer} .match $count one {{Entry saved.}} * {{{$count} entries saved.}}`,entry_saved_and_published:`.input {$count :integer} .match $count one {{Entry saved and published.}} * {{{$count} entries saved and published.}}`,entries_deleted:`.input {$count :integer} .match $count one {{Entry deleted.}} * {{{$count} entries deleted.}}`,assets_saved:`.input {$count :integer} .match $count one {{Asset saved.}} * {{{$count} assets saved.}}`,assets_saved_and_published:`.input {$count :integer} .match $count one {{Asset saved and published.}} * {{{$count} assets saved and published.}}`,asset_urls_copied:`.input {$count :integer} .match $count one {{URL copied to clipboard.}} * {{{$count} URLs copied to clipboard.}}`,asset_paths_copied:`.input {$count :integer} .match $count one {{File path copied to clipboard.}} * {{{$count} file paths copied to clipboard.}}`,asset_ids_copied:`.input {$count :integer} .match $count one {{File ID copied to clipboard.}} * {{{$count} file IDs copied to clipboard.}}`,asset_data_copied:`.input {$count :integer} .match $count one {{File data copied to clipboard.}} * {{{$count} files’ data copied to clipboard.}}`,assets_downloaded:`.input {$count :integer} .match $count one {{Asset downloaded.}} * {{{$count} assets downloaded.}}`,assets_moved:`.input {$count :integer} .match $count one {{Asset moved.}} * {{{$count} assets moved.}}`,assets_renamed:`.input {$count :integer} .match $count one {{Asset renamed.}} * {{{$count} assets renamed.}}`,assets_deleted:`.input {$count :integer} .match $count one {{Asset deleted.}} * {{{$count} assets deleted.}}`,folder_created:`Folder created.`,folder_path:`Folder Path`,folder_contents:`Contents`,x_folders:`.input {$count :integer} .match $count 0 {{No folders}} one {{{$count} folder}} * {{{$count} folders}}`,folder_renamed:`Folder renamed.`,folder_deleted:`Folder deleted.`,content_editor:`Content Editor`,restore_backup_title:`Restore Draft`,restore_backup_description:`This entry has a backup from {$datetime}. Do you want to restore the edited draft?`,draft_backup_saved:`Draft backup saved.`,draft_backup_restored:`Draft backup restored.`,draft_backup_deleted:`Draft backup deleted.`,cancel_editing:`Cancel Editing`,create_entry_title:`Creating {$name}`,create_entry_announcement:`You’re now creating a new entry in the “{$collection}” collection.`,edit_entry_announcement:`You’re now editing the “{$entry}” entry in the “{$collection}” collection.`,edit_file_announcement:`You’re now editing the “{$file}” file in the “{$collection}” collection.`,edit_singleton_announcement:`You’re now editing the “{$file}” file.`,save_and_publish:`Save and Publish`,save_without_publishing:`Save without Publishing`,save_and_publish_needs_review:`Save and Publish (Related Entries Need Review)`,show_editor_options:`Show Editor Options`,editor_options:`Editor Options`,show_second_pane:`Show Second Pane`,show_preview:`Show Preview`,sync_scrolling:`Sync Scrolling`,switch_locale:`Switch Locale`,locale_content_disabled_short:`(disabled)`,locale_content_error_short:`(error)`,edit:`Edit`,preview:`Preview`,swap_panes:`Swap Panes`,edit_x_locale:`Edit {$locale} Content`,preview_x_locale:`Preview {$locale} Content`,edit_content:`Edit Content`,preview_content:`Preview Content`,content_preview:`Content Preview`,show_content_options_x_locale:`Show {$locale} Content Options`,content_options_x_locale:`{$locale} Content Options`,show_content_options:`Show Content Options`,content_options:`Content Options`,x_field:`“{$field}” Field`,show_field_options:`Show Field Options`,field_options:`Field Options`,unsupported_field_type_x:`Unsupported field type: {$name}`,enable_x_locale:`Enable {$locale}`,reenable_x_locale:`Reenable {$locale}`,disable_x_locale:`Disable {$locale}`,locale_x_has_been_disabled:`The {$locale} content has been disabled.`,locale_x_now_disabled:`The {$locale} content is now disabled. It will be deleted when you save the entry.`,view_in_repository:`View in Repository`,view_on_x:`View on {$service}`,view_on_live_site:`View on Live Site`,deploy_preview:{view:`View Preview`,building:`The preview is still being built.`,failed:`The preview couldn’t be built.`,checking:`Checking for a preview…`,check_again:`Check for Preview`,awaiting:`Checking for Preview`,short:{building:`Building…`,failed:`Build Failed`}},copy_from:`Copy from…`,copy_from_x:`Copy from {$locale}`,translation_options:`Translation Options`,translate:`Translate`,translate_fields:`.input {$count :integer} .match $count one {{Translate Field}} * {{Translate Fields}}`,translate_from:`Translate from…`,translate_from_x:`Translate from {$locale}`,revert_changes:`Revert Changes`,revert_all_changes:`Revert All Changes`,restore_default:`Restore Default`,clear_all:`Clear All`,confirm_reverting_changes:`Are you sure you want to revert all the changes made to this entry?`,confirm_reverting_changes_x_locale:`Are you sure you want to revert all the changes made to the {$locale} content?`,confirm_restoring_defaults:`Are you sure you want to restore the default values of all the fields in this entry? Your changes will be lost.`,confirm_restoring_defaults_x_locale:`Are you sure you want to restore the default values of all the fields in the {$locale} content? Your changes will be lost.`,confirm_clearing_fields:`Are you sure you want to clear all the fields in this entry? Your changes will be lost.`,confirm_clearing_fields_x_locale:`Are you sure you want to clear all the fields in the {$locale} content? Your changes will be lost.`,edit_slug:`Edit Slug`,edit_slug_error:{empty:`The slug cannot be empty.`,invalid:`The slug cannot contain special characters, including slashes and spaces.`,duplicate:`This slug is used for another entry.`},entry_parent_folder:`Parent Folder`,new_parent_folder:`New Folder`,new_parent_folder_create:`Create`,new_parent_folder_name:`Folder Name`,new_parent_folder_description:`The new folder will be created in “{$folder}”.`,new_parent_folder_error:{empty:`The folder name cannot be empty.`,invalid:`The folder name cannot contain slashes or start with a dot, and must include letters or numbers.`,duplicate:`A folder with this name already exists here.`},edit_path_error:{invalid:`The path cannot contain relative segments such as “..”.`,recursive:`The entry cannot be moved into one of its own subfolders.`,duplicate:`This path is used for another entry.`},required:`Required`,editor:{translation:{none:`Nothing to translate.`,started:`Translating…`,error:`Translation failed.`,complete:`.input {$count :integer} .match $count 0 {{No fields translated from {$source}.}} one {{Field translated from {$source}.}} * {{{$count} fields translated from {$source}.}}`},copy:{none:`Nothing to copy.`,complete:`.input {$count :integer} .match $count 0 {{No fields copied from {$source}.}} one {{Field copied from {$source}.}} * {{{$count} fields copied from {$source}.}}`}},validation:{value_missing:`This field is required.`,range_underflow:{"datetime-local":`The date/time must be at or after {$min}.`,date:`The date must be on or after {$min}.`,time:`The time must be at or after {$min}.`,number:`The value must be greater than or equal to {$min}.`,select:`.input {$min :integer} .match $min one {{You must select at least {$min} option.}} * {{You must select at least {$min} options.}}`,add:`.input {$min :integer} .match $min one {{You must add at least {$min} item.}} * {{You must add at least {$min} items.}}`},range_overflow:{"datetime-local":`The date/time must be at or before {$max}.`,date:`The date must be on or before {$max}.`,time:`The time must be at or before {$max}.`,number:`The value must be less than or equal to {$max}.`,select:`.input {$max :integer} .match $max one {{You cannot select more than {$max} option.}} * {{You cannot select more than {$max} options.}}`,add:`.input {$max :integer} .match $max one {{You cannot add more than {$max} item.}} * {{You cannot add more than {$max} items.}}`},too_short:`.input {$min :integer} .match $min one {{You must enter at least {$min} character.}} * {{You must enter at least {$min} characters.}}`,too_long:`.input {$max :integer} .match $max one {{You cannot enter more than {$max} character.}} * {{You cannot enter more than {$max} characters.}}`,type_mismatch:{number:`Please enter a number.`,email:`Please enter a valid email.`,url:`Please enter a valid URL.`},value_not_unique:`This value is used for another entry.`,key_not_unique:`This key is used for another item.`,key_numeric:`The key can’t be a whole number, as the items would lose their order.`,invalid_value:`Invalid value.`,unexpected_error:`Unexpected error occurred.`},entry_sidebar:{sidebar_panels:`Sidebar Panels`,validation:{title:`Validation`,placeholder:`Validation results will be shown here.`,no_errors_found:`No errors found.`,validate:`Validate`},slug:{title:`Slug`,generated_on_save:`The slug is generated from the entry’s content when it’s saved. Any date and time in it will be those of the save.`,unavailable:`This entry doesn’t have a slug.`},history:{title:`History`,fetch_failed:`Failed to load history.`,no_history:`No history found.`},backlinks:{title:`Backlinks`,no_entries:`No entries are referencing this entry.`}},save_progress:{preparing:`Preparing files: {$done} of {$total}`,committing:`Saving to GitHub: {$done} of about {$total} commits`},saving_entry:{error:{title:`Error`,description:`There was an error while saving the entry. Please try again later.`}},save_conflict:{title:`Entry Changed by Someone Else`,modified_by:`{$name} changed this entry on {$date}, after you opened it.`,modified:`This entry has been changed in the repository after you opened it.`,deleted:`This entry has been deleted from the repository after you opened it.`,overwrite_warning:`If you save now, their changes will be lost.`,recreate_warning:`If you save now, the entry will be created again.`,reload_warning:`As the entry is stored in the same file as other entries, it can’t be saved over the change. Cancel editing, then open the entry again from the list and make your edits.`,save_anyway:`Save Anyway`,branch_moved:`The repository has been updated by someone else while saving. Please try again.`,array_item_changed:`An entry stored in the same file has been changed by someone else. Please try again.`,array_file_invalid:`The {$path} file can’t be updated, as it doesn’t contain a valid list of entries.`},remote_change:{reload_entry:`Reload Entry`,confirm_reloading_entry:`Are you sure you want to reload the entry? Your unsaved changes will be lost.`},viewing_x_asset_details:`You’re viewing the details of the “{$name}” asset.`,asset_editor:`Asset Editor`,previous_asset:`Previous Asset`,next_asset:`Next Asset`,preview_unavailable:`Preview Unavailable.`,public_urls:`.input {$count :integer} .match $count one {{Public URL}} * {{Public URLs}}`,file_paths:`.input {$count :integer} .match $count one {{File Path}} * {{File Paths}}`,file_ids:`.input {$count :integer} .match $count one {{File ID}} * {{File IDs}}`,file_data:`File Data`,asset_info:`Asset Info`,select_asset_show_info:`Select an asset to show its info.`,kind:`Kind`,size:`Size`,dimensions:`Dimensions`,duration:`Duration`,used_in:`Used in`,created_date:`Created Date`,location:`Location`,map_lat_lng:`Map showing latitude {$latitude}, longitude {$longitude}`,remove_this_item:`Remove This Item`,move_up:`Move Up`,move_down:`Move Down`,reorder_options:`Reorder Options`,move_to_top:`Move to Top`,move_to_bottom:`Move to Bottom`,move_to:`Move to…`,move_to_description:`Enter a position from 1 to {$count}.`,move_to_position:`Position`,reorder_item:`Reorder Item`,list_item_value:`Item Value`,list_item_position:`Item {$position} of {$count}`,item_removed:`Item removed.`,add_x:`Add {$name}`,list_item_options:`List Item Options`,add_item_above:`Add Item Above`,add_item_below:`Add Item Below`,paste_item_above:`Paste Item Above`,paste_item_below:`Paste Item Below`,paste_item_to_replace:`Paste to Replace`,paste_item:`Paste Item`,list_item_copied:`Item copied.`,no_list_item_to_paste:`There’s no copied item to paste. To copy one, open an item’s ⋮ (List Item Options) menu and select Copy.`,list_item_not_compatible:`The copied item doesn’t fit in this list.`,list_item_pasted_without_values:`.input {$count :integer} .match $count one {{Item pasted. A value this list doesn’t take was left out.}} * {{Item pasted. {$count} values this list doesn’t take were left out.}}`,list_item_pasted_without_files:`.input {$count :integer} .match $count one {{Item pasted, but a file it uses couldn’t be found. Check the file fields in the item.}} * {{Item pasted, but {$count} files it uses couldn’t be found. Check the file fields in the item.}}`,select_list_type:`Select List Type`,unknown_variable_type:`This item can’t be displayed due to an unknown type. Check the browser console for details.`,opacity:`Opacity`,unselected_option:`(None)`,relation_field:{save_together_hint:`The new {$name} will be saved along with the entry you’re editing.`,add_failed:`The {$name} couldn’t be added. Check the browser console for details.`,edit_entry_title:`Editing {$name}`,edit_together_hint:`Your changes to the {$name} will be saved along with the entry you’re editing.`,edit_failed:`The changes to the {$name} couldn’t be applied. Check the browser console for details.`,move_unsupported:`These changes would move the {$name} to another location, which can only be done by editing it on its own.`,edit_conflict:`“{$name}” has been changed by someone else since you edited it. Open it again from the field to review your changes against the latest version.`,edit_deleted:`“{$name}” has been deleted by someone else since you edited it. Remove it from the field to save the entry.`,select_entry_to_edit:`Select an Entry to Edit`,edited_with_entry:`Changes to this entry are waiting to be published along with “{$name}”. If you save it now, the two sets of changes will be combined when that entry is published, which may fail if they overlap.`,changed_since_edit:`This {$name} has been changed by someone else since you edited it. Your changes are shown on top of the latest version. Review them before updating.`},assets_dialog:{title:{file:`Select File`,image:`Select Image`,folder:`Select Folder`},search_for_file:`Search for Files`,search_for_image:`Search for Images`,locations:`Locations`,selected_folder:`Selected folder: {$path}`,selected_folders:`.input {$count :integer} .match $count one {{{$count} folder selected}} * {{{$count} folders selected}}`,no_subfolders:`This folder has no subfolders.`,prefix_unresolved:`Fill in the fields this location depends on to browse and upload its files.`,folder:{field:`Field Assets`,entry:`Entry Assets`,file:`File Assets`,collection:`Collection Assets`,global:`Global Assets`},error:{invalid_key:`Your API key is invalid or expired. Please double-check and try again.`,search_fetch_failed:`There was an error while searching assets. Please try again later.`,image_fetch_failed:`There was an error while downloading the selected asset. Please try again later.`},available_images:`Available Images`,available_files:`Available Files`,enter_url:`Enter URL`,enter_file_url:`Enter URL of the file:`,enter_image_url:`Enter URL of the image:`,large_file:{title:`Large File`},invalid_file:{title:`Invalid File`},rejected_files:{title:`Files Cannot Be Uploaded`},photo_credit:{title:`Photo Credit`,description:`Use the following credit if possible:`,insert_to_field:`Insert to {$field}`,copy_as_markdown:`Copy as Markdown`},unsaved:`Unsaved`},character_counter:{min_max:`.input {$count :integer} .match $count 0 {{No character entered. Minimum: {$min}. Maximum: {$max}.}} one {{{$count} character entered. Minimum: {$min}. Maximum: {$max}.}} * {{{$count} characters entered. Minimum: {$min}. Maximum: {$max}.}}`,min:`.input {$count :integer} .match $count 0 {{No character entered. Minimum: {$min}.}} one {{{$count} character entered. Minimum: {$min}.}} * {{{$count} characters entered. Minimum: {$min}.}}`,max:`.input {$count :integer} .match $count 0 {{No character entered. Maximum: {$max}.}} one {{{$count} character entered. Maximum: {$max}.}} * {{{$count} characters entered. Maximum: {$max}.}}`},youtube_video_player:`YouTube video player`,today:`Today`,now:`Now`,editor_components:{image:`Image`,src:`Source`,alt:`Alt Text`,title:`Title`,link:`Link`,caption:`Caption`},key_value:{key:`Key`,value:`Value`,action:`Action`,empty_key:`Key is required.`,duplicate_key:`Key must be unique.`},find_place:`Find a Place`,use_your_location:`Use Your Location`,geolocation_error_title:`Geolocation Error`,geolocation_error_body:`There was an error while retrieving your location.`,geolocation_unsupported:`Geolocation API is not supported by this browser.`,boolean:{true:`Yes`,false:`No`},cloud_storage:{invalid:`The service is not configured properly.`,auth:{api_key:{key_label:`API Key`,initial:`Enter your {$key} for {$service}.`,requested:`Validating…`,error:`The provided {$key} is invalid. Please double-check and try again.`},password:{initial:`Enter your password for {$service}.`,requested:`Signing in…`,error:`Username or password is incorrect. Please double-check and try again.`}},s3:{auth_key_label:`Secret Access Key`},cloudinary:{iframe_title:`Cloudinary media library`,activate:{button_label:`Activate Cloudinary`,description:`After signing in, click the Sign In button again to continue.`},auth_key_label:`API Secret`,open_library:`Open Cloudinary`},uploadcare:{auth_key_label:`API Secret Key`},azure_blob_storage:{auth_key_label:`SAS Token`},backblaze_b2:{auth_key_label:`Application Key`},bunny_storage:{auth_key_label:`Storage Zone Password`}},config:{errors:`.input {$count :integer} .match $count one {{There is an error in the CMS configuration. Please solve the issue and try again.}} * {{There are errors in the CMS configuration. Please solve the issues and try again.}}`,error_locator:{collection:`{$collection} collection`,file:`{$file} file`,component:`{$component} component`,field:"`{$field}` field"},error:{no_secure_context:`Sveltia CMS only works with HTTPS or localhost URLs.`,insecure_urls:`.input {$count :integer} .match $count one {{The configuration file URL must use HTTPS protocol or a localhost address.}} * {{The configuration file URLs must use HTTPS protocol or localhost addresses.}}`,fetch_failed:`The configuration file could not be retrieved.`,fetch_failed_not_ok:`HTTP response returned with status {$status}.`,fetch_failed_with_manual_init:"The configuration file could not be retrieved. To prevent the `config.yml` file from loading, add <a>`load_config_file: false`</a> to the configuration object passed to `CMS.init()`.",parse_failed:`The configuration file could not be parsed.`,parse_failed_invalid_object:`The configuration file is not a valid JavaScript object.`,parse_failed_unsupported_type:`The configuration file is not a valid file type. Only YAML, TOML and JSON are supported.`,no_collection:`Collections are not defined.`,no_visible_collection:"At least one collection must be visible. Check the `hide` option.",missing_backend:`The backend is not defined.`,missing_backend_name:`The backend name is not defined.`,unsupported_known_backend:`The {$name} backend is <a>not supported</a> in Sveltia CMS.`,unsupported_deprecated_backend:`The deprecated {$name} backend is <a>not supported</a> in Sveltia CMS.`,unsupported_custom_backend:`Custom backends are <a>not supported</a> in Sveltia CMS.`,unsupported_backend_suggestion:`Use one of the <a>supported backends</a> instead.`,missing_repository:`The repository is not defined.`,invalid_repository:`The configured repository is invalid. It must be in “owner/repo” format.`,missing_api_root:"The `api_root` option is not defined. It’s required for the Forgejo backend.",invalid_root_dir:`The root directory is invalid. It must be a path within the repository, without “..”.`,invalid_root_dir_branch:"The root directory can’t be used in the branch names of the `editorial_workflow` and `preview` publish modes. No part of its path can start with a dot, end with “.lock” or contain a space or a special character such as a colon or an asterisk.",path_outside_root_dir:`The path “{$path}” leads outside the root directory, where the CMS can’t list files.`,oauth_implicit_flow:`The configured authentication method (implicit flow) is not supported in Sveltia CMS. Use a different <a>authentication method</a> instead.`,github_pkce_unsupported:`PKCE authorization is not yet supported due to GitHub’s limitations. Use a different <a>authentication method</a> instead.`,oauth_no_app_id:`OAuth application ID is not defined.`,open_authoring_no_workflow:"The `open_authoring` option requires the `editorial_workflow` or `preview` publish mode. See the <a>documentation</a> for details.",no_auth_methods:"The `auth_methods` option must contain at least one method.",auth_scope_no_repo:"The `auth_scope` option must include `repo` or `public_repo`.",missing_media_folder:`The media folder is not defined.`,public_folder_relative_path:`The configured public folder is invalid. It must be an absolute path starting with “/”.`,public_folder_absolute_url:`An absolute URL for the public folder option is not supported in Sveltia CMS.`,unsupported_folder_template_tag:"The `{$option}` option contains the `{$tag}` template tag, which isn’t supported there. Only the slug template tags, such as `\\{\\{slug\\}\\}` and `\\{\\{year\\}\\}`, and the `\\{\\{dirname\\}\\}`, `\\{\\{filename\\}\\}`, `\\{\\{extension\\}\\}`, `\\{\\{media_folder\\}\\}` and `\\{\\{public_folder\\}\\}` tags can be used.",global_folder_template_tag:"The `{$option}` option contains the `{$tag}` template tag, which can only be used in the option of a collection, a collection file or a field, where there is an entry to fill it in with.",invalid_sanitize_replacement:"The `sanitize_replacement` option is set to `{$replacement}`, but it contains a character that can’t be used in a slug, so it can’t stand in for one.",invalid_url_option:"The `{$option}` option is set to `{$url}`, but it must be an absolute URL starting with `https://` or `http://`.",invalid_publish_mode_stages:"The `stages` option of `publish_mode` must start with `draft` and list the stages in the order `draft`, `pending_review`, `pending_publish`, without repeating any.",i18n_no_locales:"The `i18n.locales` option must list at least one locale.",i18n_invalid_default_locale:"The `default_locale` option is set to `{$locale}`, but it’s not one of the `locales`.",i18n_invalid_initial_locale:"The `initial_locales` option contains `{$locale}`, but it’s not one of the `locales`.",i18n_no_collections:"The `i18n` option is configured at the top level, but none of the collections or singletons have the `i18n` option, so no content can be translated. Add `i18n: true` to the collections and singletons to translate.",invalid_transformation_key:"The `transformations` option contains an unsupported `{$key}` key. It must be `raster_image`, `svg` or a supported raster image format.",invalid_transformation_quality:"The `quality` option for the `{$key}` transformation is invalid. It must be an integer between 0 and 100.",invalid_transformation_size:"The `{$prop}` option for the `{$key}` transformation is invalid. It must be a positive integer.",missing_asset_collection_name:"The asset collection {$count} must have the `name` option defined as a non-empty string.",invalid_asset_collection_name:"The asset collection name `{$name}` is invalid. It must not contain special characters.",duplicate_asset_collection_name:"Asset collection names must be unique, but `{$name}` is used more than once.",invalid_collection_no_options:"The collection must have either the `folder`, `file`, `files` or `divider` option defined.",invalid_collection_multiple_options:"The collection cannot have more than one of the `folder`, `file`, `files` and `divider` options.",file_format_mismatch:"The `{$extension}` extension doesn’t match the `{$format}` format.",front_matter_body_field_not_text:"The `{$name}` field is saved as the body below the front matter, which can only hold text, not a number, a boolean, a list or an object as a `{$widget}` field does. Use a field type holding text, or rename the field.",invalid_collection_data_file:"The `file` option `{$file}` is invalid. It must be the path to a JSON file, without the `\\{\\{locale\\}\\}` placeholder.",unsupported_collection_data_file_option:"The `{$prop}` option is not supported in a collection with the `file` option.",collection_data_file_workflow:"Editorial Workflow and Preview Workflow, including Open Authoring, are not supported in a collection with the `file` option. Set the collection’s `publish_mode` option to `simple`.",collection_data_file_slug_tag:"The `{$prop}` option can’t contain the `\\{\\{slug\\}\\}` tag in a collection with the `file` option, as an entry’s slug is its position, which changes when the entries are reordered or deleted. Use a field with a unique value instead.",invalid_slug_slash:"The slug template `{$slug}` is invalid as it cannot contain slashes. To organize entries in subfolders, use the `path` option instead of `slug`.",invalid_identifier_field:"The `identifier_field` option refers to `{$name}`, but no such field is defined in the collection.",invalid_filter_field:"The `filter` option refers to `{$name}`, but no such field is defined in the collection.",invalid_filter_no_condition:"The `filter` option must have either the `value` or `pattern` option to match entries against.",option_field_not_found:"The `{$option}` option refers to `{$name}`, but no such field is defined.",thumbnail_field_not_media:"The `thumbnail` option refers to `{$name}`, but it must be an Image or File field, not a `{$widget}` field.",invalid_inline_component_fields:"The `inline` mode requires a single Boolean, Color, DateTime, Number, Relation, Select or String field. A Relation or Select field can’t have the `multiple` option enabled.",invalid_regex:"The `{$option}` option contains an invalid regular expression `{$pattern}`, which is ignored.",invalid_reorder_group:"The `reorder` option refers to a view group named `{$name}`, but no such group is defined in the `view_groups` option.",invalid_bulk_edit_field:"The `fields` list of the `bulk_edit` option refers to a field named `{$name}`, but no such top-level field is defined in the collection.",unsupported_bulk_edit_field:"The `{$name}` field in the `fields` list of the `bulk_edit` option can’t be edited in bulk. Only a Boolean, Color, DateTime, Number, Relation, Select or String field that isn’t read-only, doesn’t have the `multiple` option enabled and isn’t set automatically on save is supported.",invalid_sortable_field:"The `sortable_fields` option refers to a field named `{$name}`, but no such field is defined in the collection.",multiple_sortable_field_defaults:"Only one item in the `sortable_fields` option can have the `default_sort` option.",invalid_table_column_field:"The `{$option}` option refers to a field named `{$name}`, but no such field is defined in the collection.",invalid_view_group_field:"The `view_groups` option refers to a field named `{$name}`, but no such field is defined in the collection.",invalid_view_filter_field:"The `view_filters` option refers to a field named `{$name}`, but no such field is defined in the collection.",missing_view_group_name:"The view group {$count} must have the `name` option defined as a non-empty string.",invalid_view_group_name:"The view group name `{$name}` is invalid. It must not contain special characters.",duplicate_view_group_name:"View group names must be unique, but `{$name}` is used more than once.",missing_view_filter_name:"The view filter {$count} must have the `name` option defined as a non-empty string.",invalid_view_filter_no_condition:"The view filter {$count} must have the `pattern` option or a comparison option such as `eq` or `gte` to match entries against.",invalid_view_filter_name:"The view filter name `{$name}` is invalid. It must not contain special characters.",duplicate_view_filter_name:"View filter names must be unique, but `{$name}` is used more than once.",invalid_view_group_default:"The `default` option of `view_groups` is set to `{$name}`, but no view group has that name.",invalid_view_filter_default:"The `default` option of `view_filters` is set to `{$name}`, but no view filter has that name.",missing_collection_name:"The collection {$count} must have the `name` option defined as a non-empty string.",invalid_collection_name:"The collection name `{$name}` is invalid. It must not contain special characters.",duplicate_collection_name:"Collection names must be unique, but `{$name}` is used more than once.",missing_collection_file_name:"The collection file {$count} must have the `name` option defined as a non-empty string.",invalid_collection_file_name:"The collection file name `{$name}` is invalid. It must not contain special characters.",duplicate_collection_file_name:"Collection file names must be unique, but `{$name}` is used more than once.",collection_no_fields:"The collection must have the `fields` option defined with at least one field.",collection_file_no_fields:"The collection file must have the `fields` option defined with at least one field.",collection_folder_i18n_required:"The collection must have the `i18n` option defined if the `locale` placeholder is used in the `folder` path.",invalid_collection_folder_locale:"The `folder` path `{$folder}` is invalid. The `locale` placeholder must be used only once as a whole folder name, like `content/\\{\\{locale\\}\\}/posts`.",collection_file_i18n_required:"The collection file must have the `i18n` option defined if the `locale` placeholder is used in the `file` path.",collection_i18n_no_fields:"The collection has the `i18n` option, but none of its fields have the `i18n` option, so no field can be translated. Add `i18n: true` or `i18n: duplicate` to the fields to translate.",collection_i18n_no_files:"The collection has the `i18n` option, but none of its files have the `i18n` option, so no file can be translated. Add `i18n: true` to the files to translate.",collection_file_i18n_no_fields:"The collection file has the `i18n` option, but none of its fields have the `i18n` option, so no field can be translated. Add `i18n: true` or `i18n: duplicate` to the fields to translate.",missing_field_name:"The field {$count} must have the `name` option defined as a non-empty string.",invalid_field_name:"The field name `{$name}` is invalid. It must not contain special characters. If you want to nest fields, <a>use Object fields instead of dot notation</a>.",duplicate_field_name:"Field names must be unique, but `{$name}` is used more than once.",missing_variable_type:"The variable type {$count} must have the `name` option defined as a non-empty string.",invalid_variable_type:"The variable type name `{$name}` is invalid. It must not contain special characters.",duplicate_variable_type:"Variable type names must be unique, but `{$name}` is used more than once.",date_field_type:"The deprecated Date field type is not supported in Sveltia CMS. Use the DateTime field type with the `type: date` option instead.",hidden_field_locale_without_i18n:"The `default` option of a Hidden field uses the `\\{\\{locale\\}\\}` placeholder, but i18n isn’t enabled for the collection, so the content has no locale to fill it with.",invalid_timezone:"Invalid timezone: {$timeZone}. Must be a valid IANA timezone identifier like `America/New_York` or `Asia/Tokyo`.",unsupported_deprecated_option:"The deprecated `{$prop}` option is not supported in Sveltia CMS. Use the `{$newProp}` option instead.",allow_multiple:"The `allow_multiple` option is not supported in Sveltia CMS. Use the `multiple` option instead, which defaults to `false`.",invalid_list_field:"The List field cannot have the `field`, `fields` and `types` options together.",invalid_list_variable_type:"The List field’s variable type is invalid. The `widget` option is set to `{$widget}` but it must be `object`.",invalid_object_field:"The Object field cannot have the `fields` and `types` options together.",invalid_range_options:"The `{$min}` option must not be greater than the `{$max}` option.",invalid_step:"The `step` option is set to `{$step}`, but it must be greater than zero, or `-1` to turn stepping off.",select_field_no_options:"The Select field must have at least one item in the `options` option.",select_field_duplicate_option:"The Select field’s `options` must be unique, but `{$value}` is used more than once.",select_field_invalid_default:"The Select field’s `default` option is set to `{$value}`, but it’s not one of the `options`.",list_field_no_subfields:"The List field’s `fields` or `types` option must have at least one item. Omit the option for a list of plain values.",list_field_invalid_default_object:"The List field’s `default` option contains an object, but each item must be a plain value because the field has no `fields` or `types`.",list_field_invalid_default_item:"The List field’s `default` option contains `{$value}`, but each item must be an object because the field has `fields` or `types`.",list_field_invalid_default_key:"The List field’s `default` option contains an item with the `{$key}` property, but no subfield has that name.",list_field_default_missing_type:"The List field’s `default` option contains an item without the `{$typeKey}` property, which identifies one of the `types`.",list_field_invalid_default_type:"The List field’s `default` option contains an item whose `{$typeKey}` property is `{$value}`, but it’s not one of the `types`.",list_field_map_key_no_subfields:"The List field’s `map_key_field` option requires the `fields` or `types` option, as each key is taken from a subfield.",list_field_map_key_not_found:"The List field’s `map_key_field` option refers to `{$name}`, but no subfield has that name.",list_field_map_key_missing_in_type:"The List field’s `map_key_field` option refers to `{$name}`, but the `{$type}` type has no subfield with that name.",list_field_map_key_invalid_type:"The List field’s `map_key_field` option refers to `{$name}`, but it must be a String, Relation or Select field, not a `{$widget}` field.",list_field_map_key_multiple:"The List field’s `map_key_field` option refers to `{$name}`, but the subfield can’t take multiple values, as each item needs a single key. Remove its `multiple` option.",list_field_map_key_option_not_string:"The List field’s `map_key_field` option refers to `{$name}`, but the subfield’s options must have string values, as each key is stored as a string.",list_field_map_key_not_required:"The List field’s `map_key_field` option refers to `{$name}`, but the subfield can’t be optional, as each item needs a key. Remove its `required` option.",list_field_map_key_not_localized:"The List field’s `map_key_field` option refers to `{$name}`, but the subfield can’t have `i18n: false`, as the items need a key in every locale. Use `i18n: duplicate` or remove the option.",duplicate_if_empty_multiple:"The `i18n: duplicate_if_empty` option is not supported for a field with the `multiple` option, so the field works like one with `i18n: true`.",invalid_default_multiple:"The `default` option must be an array because the `multiple` option is `true`.",invalid_default_single:"The `default` option must be a single value, not an array, because the `multiple` option is not `true`.",object_field_invalid_default_key:"The Object field’s `default` option has the `{$key}` property, but no subfield has that name.",object_field_default_missing_type:"The Object field’s `default` option doesn’t have the `{$typeKey}` property, which identifies one of the `types`.",object_field_invalid_default_type:"The `{$typeKey}` property of the Object field’s `default` option is `{$value}`, but it’s not one of the `types`.",code_field_invalid_default_object:"The Code field’s `default` option must be a string because the `output_code_only` option is `true`.",code_field_invalid_default_key:"The Code field’s `default` option has the `{$key}` property, but the `keys` option only allows `{$code}` and `{$lang}`.",compute_field_invalid_expression:"The Compute field’s `value` option must be a valid arithmetic expression, like `\\{\\{fields.price\\}\\} * \\{\\{fields.quantity\\}\\}`, because the `value_type` option is `{$valueType}`.",compute_field_uuid_in_expression:"The Compute field’s `value` option can’t use a UUID tag like `\\{\\{uuid\\}\\}` because the `value_type` option is `{$valueType}`, which makes it an arithmetic expression.",number_field_default_not_integer:"The Number field’s `default` option is set to `{$value}`, but it must be an integer because the `value_type` option is `{$valueType}`.",number_field_default_not_number:"The Number field’s `default` option is set to `{$value}`, but it must be a number because the `value_type` option is `{$valueType}`.",object_field_no_subfields:"The Object field’s `fields` or `types` option must have at least one item.",relation_field_invalid_collection:"The referenced `{$collection}` collection is invalid or not defined.",relation_field_invalid_collection_file:"The referenced `{$file}` file is invalid or not defined.",relation_field_missing_file_name:"The `file` option must be defined for a relation to a file collection.",relation_field_invalid_value_field:"The referenced value field `{$field}` is invalid or not defined.",relation_field_array_file_slug:"The relation to the `{$collection}` collection can’t store the `\\{\\{slug\\}\\}` value, as an entry’s slug in a collection with the `file` option is its position, which changes when the entries are reordered or deleted. Set the `value_field` option to a field with a unique value instead.",relation_field_array_file_workflow:"A collection with the `file` option can’t have a relation to the `{$collection}` collection, which uses Editorial Workflow or Preview Workflow, as the references to an entry renamed or deleted there can’t be updated in the file.",relation_field_invalid_display_field:"The referenced display field `{$field}` is invalid or not defined.",relation_field_invalid_search_field:"The referenced search field `{$field}` is invalid or not defined.",relation_field_invalid_filter_field:"The referenced filter field `{$field}` is invalid or not defined.",relation_field_invalid_sort_field:"The referenced sort field `{$field}` is invalid or not defined.",relation_field_sort_by_file_ignored:"The `sort_by` option doesn’t apply to a relation to a file, whose options follow the order of the list items. It will be ignored.",unexpected:`Unexpected error`,schema_invalid_type:"The `{$option}` option must be {$type}.",schema_invalid_enum:"The `{$option}` option must be one of these values: {$values}.",schema_invalid_const:"The `{$option}` option must be `{$value}`.",schema_invalid_empty_value:"The `{$option}` option must be an empty string.",schema_invalid_item_count:"The `{$option}` option must be an array of {$count} items.",schema_invalid_value:"The `{$option}` option has an invalid value.",schema_missing_option:"The `{$option}` option is required.",schema_missing_one_of:`One of these options is required: {$options}.`,schema_value_type:{string:`a string`,number:`a number`,integer:`an integer`,boolean:`a boolean`,array:`an array`,object:`an object`,null:`empty`}},warning:{oauth_no_app_id:`OAuth application ID is not defined. Users are required to provide an access token to sign in.`,site_library_prefix_template:"The `prefix` option of a media library contains template tags, which are only supported at the field level, as there is no entry to fill them with at the top level.",unsupported_ignored_option:"The `{$prop}` option is not supported in Sveltia CMS. It will be ignored.",publish_mode_stages_ignored:"The `stages` option of `publish_mode` only applies to the `editorial_workflow` publish mode, so it’s ignored with `{$type}`.",inline_component_multiline_pattern:"The `pattern` of this inline component has the `m` or `s` flag or matches line breaks, but an inline component is only matched within a paragraph.",single_line_block_item:"The `{$name}` item of the `{$option}` option is ignored, as a field with `multiline: false` can only hold inline content.",conflicting_timezone_options:"Both `picker_utc` and newer timezone options (`input_timezone` or `output_utc`) are set. The new options take precedence. Consider removing `picker_utc` from your configuration.",localize_format_without_format:"The `localize_format` option has no effect, because the field has no `format` option and its value is stored in the ISO 8601 format.",compute_field_wildcard_without_item:"The Compute field’s `value` option refers to `{$name}`, but the field isn’t in an item of the list that `*` stands for, so it resolves to nothing. Only an aggregate function like `sum()` can use every item of a list.",compute_field_self_reference:"The Compute field’s `value` option refers to the field itself as `{$name}`, so its value changes every time it’s computed and never settles.",compute_field_reference_cycle:"The Compute field’s `value` option refers to `{$name}`, another Compute field that refers back to this field, directly or through other fields, so their values never settle.",localize_format_without_i18n:"The `localize_format` option is `true`, but i18n isn’t enabled for the collection, so the value is written in English. Set the option to a locale code like `de` instead.",localize_format_unsupported_locale:"The `localize_format` option is set to `{$locale}`, which isn’t a supported locale, so the value is written in English.",preview_path_no_date_field:"The `preview_path` option uses date and time tags, but the collection has no DateTime field to read them from, so the preview link won’t be shown.",preview_path_date_field_not_found:"The `preview_path_date_field` option refers to a field named `{$name}`, but no DateTime field with that name is defined, so the preview link won’t be shown.",preview_path_field_not_found:"The `preview_path` option refers to `{$name}`, but no such field is defined in the collection, so the preview link won’t be shown.",missing_identifier_field:"The collection has no `{$name}` field to name new entries with, so each new entry gets a random slug. Add a `{$name}` field, or set the `identifier_field` or `slug` option.",slug_i18n_ineffective:"The `i18n` option of `slug` has no effect, because the collection doesn’t use the `multiple_files`, `multiple_folders` or `multiple_root_folders` i18n structure, where each locale has a file of its own.",slug_template_ignored:"The `template` option of `slug` is ignored, because the `auto_increment` option numbers the slugs instead.",locale_not_omitted_from_file_path:"The `locale` placeholder can’t be removed from the `file` path `{$file}`, so the default locale is kept in it despite the `omit_default_locale_from_file_path` i18n option. To leave the locale out, use the placeholder as a whole folder name, like `\\{\\{locale\\}\\}/about.md`, or between the file name and the extension, like `about.\\{\\{locale\\}\\}.md`. To keep it, set the option to `false` in the file’s `i18n` option.",i18n_not_configured:"The `i18n` option is enabled, but i18n is not configured at the top level of the configuration or in the collection, so the option has no effect.",empty_public_folder:"The `public_folder` option is an empty string, so the `media_folder` path is used for the asset paths saved in entries instead. Remove the option, or set it to the path you want to use, such as `/images`.",schema_unknown_option:"The `{$option}` option is not defined in the Sveltia CMS configuration schema. It will be ignored. Check for a typo or a syntax mistake.",default_localized_without_i18n:"The `default_localized` option has no effect, because i18n isn’t enabled for the collection. Use the `default` option instead.",default_localized_unknown_locale:"The `default_localized` option has a value for `{$locale}`, which isn’t one of the collection’s locales, so the value is never used."},compatibility_link:`See the compatibility notes for details: {$link}`,schema_tip:`For a better developer experience, you can validate your configuration file against the JSON schema of Sveltia CMS. See {$link} for details.`},local_workflow:{indicator:`Local`,unsupported_browser:`Local Workflow is not supported in your browser. Please use Chrome or Edge instead.`,disabled:`Local Workflow is disabled in your browser. <a>Here’s how to enable it</a>.`},viewing_editorial_workflow:`You’re now viewing the Editorial Workflow board. Drafts: {$draft}. In Review: {$review}. Ready: {$ready}. Pending Deletion: {$deletion}.`,viewing_open_authoring_workflow:`You’re now viewing the Editorial Workflow board. Drafts: {$draft}. In Review: {$review}. Pending Deletion: {$deletion}.`,viewing_editorial_workflow_without_review:`You’re now viewing the Editorial Workflow board. Drafts: {$draft}. Ready: {$ready}. Pending Deletion: {$deletion}.`,viewing_preview_workflow:`You’re now viewing the Drafts page. Drafts: {$draft}. Pending Deletion: {$deletion}.`,status:{draft:`Draft`,drafts:`Drafts`,in_review:`In Review`,ready:`Ready`,pending_deletion:`Pending Deletion`,deploying:`Deploying`},workflow:{cancel_deletion:`Cancel Deletion`,confirm_cancelling_deletion:`Are you sure you want to cancel this deletion? The entry will remain published.`,confirm_completing_deletion:`Are you sure you want to delete this entry? It will be removed right away.`,deletion_pending:`.input {$count :integer} .match $count one {{Entry marked for deletion.}} * {{{$count} entries marked for deletion.}}`,changes_discarded:`.input {$count :integer} .match $count one {{Changes discarded.}} * {{Changes to {$count} entries discarded.}}`,cancelling_deletion:`Cancelling Deletion…`,deletion_cancelled:`Deletion cancelled.`,cancelling_deletion_failed:`Couldn’t cancel the deletion. Please try again.`,unpublished_entries:`Unpublished Entries`,published_entries:`Published Entries`,entry_status_value:`Status: {$status}`,change_entry_status:`Change Entry Status`,changing_status:`Changing Status…`,updating_status:`Updating Status…`,status_updated:`Status updated.`,status_change_failed:`Couldn’t change the status. Please try again.`,refresh:`Refresh`,refreshing:`Refreshing…`,refreshed:`The board is up to date.`,refresh_failed:`Couldn’t refresh the board. Please try again.`,status_change_blocked:`The entry has errors. Please correct them before changing the status.`,publish_blocked:`The entry has errors. Please correct them before publishing it.`,send_for_review:`Send for Review`,confirm_sending_for_review:`Your changes have been saved as a draft. Send the entry for review so someone can look at it and publish it?`,mark_as_ready:`Mark as Ready`,confirm_marking_as_ready:`Your changes have been saved as a draft. Mark the entry as ready so it can be published?`,publish_entry:`Publish Entry`,discard_changes:`Discard Changes`,confirm_deleting_published_entry:`Are you sure you want to delete this entry? It won’t be removed until the deletion is published. Until then you’ll still find it in the entry list, marked Pending Deletion.`,confirm_deleting_unpublished_entry:`This entry hasn’t been published yet, so deleting it will discard it completely.`,confirm_discarding_entry_changes:`This entry has unpublished changes. Discarding them will restore the published version. The entry itself won’t be deleted.`,deleting_unpublished_note_all:`.input {$count :integer} .match $count one {{It hasn’t been published yet, so your unpublished changes will be discarded. Any published version will remain published.}} * {{They haven’t been published yet, so your unpublished changes will be discarded. Any published versions will remain published.}}`,deleting_unpublished_note_some:`.input {$count :integer} .match $count one {{One of them hasn’t been published yet, so your unpublished changes will be discarded. Any published version will remain published.}} * {{{$count} of them haven’t been published yet, so your unpublished changes will be discarded. Any published versions will remain published.}}`,confirm_publishing_entry_after_build:`Are you sure you want to publish this entry? Your changes will go live once your site has been rebuilt.`,publishing_entry:`Publishing Entry…`,entry_published:`Entry published.`,deleting_entry:`Deleting Entry…`,discarding_changes:`Discarding Changes…`,entry_deleted:`Entry deleted.`,publishing_entry_failed:`Couldn’t publish the entry. Please try again.`,publish_refused_other_changes:`This entry can’t be published here, because it comes with other changes the CMS can’t show you. Ask a developer to review it.`,publish_refused_entry_changed:`The entry has been changed since you opened it. Reload the page to review the latest version before publishing it.`,branch_in_use:`Another request ({$number}) is already open for this entry outside the CMS. Ask a developer to close it first.`,no_entries:`No entries.`,drag_entry:`Drag to change the status`,deploying_deletion:`Deletion`,companion_entries:`Also adds {$entries}`,edited_companion_entries:`Also changes {$entries}`,companion_entry:`{$collection}: {$title}`},commit_message:{title:`Commit Message`,description_replace:`Describe your changes. The message is recorded in the history along with them.`,description_addition:`Add a note to the message recorded in the history along with your changes, such as an issue number. It can be left empty.`,message:`Commit message`,addition:`Note`,preview:`Message: {$message}`},open_authoring:{fork_repository:`Fork Repository`,fork:`Fork`,confirm_forking_repository:`To suggest changes to “{$repo}”, a fork of the repository has to be created on your account. Your changes are saved to that fork, and a maintainer reviews them before they go live.`,fork_declined:`You need a fork of the repository on your account to suggest changes.`,fork_failed:`Couldn’t create a fork of the “{$repo}” repository on your account.`,fork_branch_missing:`Your “{$fork}” fork doesn’t have the “{$branch}” branch. Update the fork from the “{$repo}” repository, then sign in again.`,permission_check_failed:`Couldn’t check your access to the “{$repo}” repository. Please try again in a moment.`,forking_disabled:`The “{$repo}” repository doesn’t allow forks. Ask a maintainer to enable forking for it.`,invitation_pending:`You have a pending invitation to the “{$repo}” repository. Accept it on GitHub, then sign in again.`,private_repo_scope_required:`Your sign-in doesn’t include access to private repositories, so the “{$repo}” repository can’t be read. Ask a maintainer to check the CMS authentication settings.`,publish_unsupported:`Only a maintainer can publish changes to this site. Mark your entry as In Review instead, and someone will take a look.`,entry_already_published:`A maintainer has already published this entry, so there’s nothing left to review.`,direct_commit_unsupported:`This change can’t be made directly. Only edits to entries can be suggested for review.`,contributing_via_fork:`Your changes are saved to your fork of this repository at “{$repo}” and reviewed before they go live.`,view_fork:`View Fork`},categories:`Categories`,site_configuration_editor:`Site Configuration Editor`,prefs:{changes:{api_key_saved:`API key saved.`,api_key_removed:`API key removed.`,api_key_invalid:`The provided API key is invalid. Please double-check and try again.`},error:{permission_denied:`Cookie storage access has been denied. Please check your browser permissions and try again.`},appearance:{title:`Appearance`,theme:`Theme`,select_theme:`Select Theme`},theme:{dark:`Dark`,light:`Light`},language:{title:`Language`,ui_language:{title:`User Interface Language`,select_language:`Select Language`}},contents:{title:`Contents`,editor:{title:`Editor`,use_draft_backup:{switch_label:`Automatically back up entry drafts`},close_on_save:{switch_label:`Close the editor after saving a draft`},close_with_escape:{switch_label:`Close the editor with the Escape key`}}},i18n:{title:`Internationalization`,translators:{default:{title:`Default Translation Service`,select_service:`Select Service`},api_keys:{title:`Translation Service API Keys`,description:`Manage API keys for <a>translation services</a>. API keys for generic AI services can be managed in the AI settings.`},field_label:`{$service} Key`,description:`Sign up for <a {$homeHref}>{$service}</a> and enter <a {$apiKeyHref}>your API Key</a> here to enable quick translation of text entry fields.`}},media:{title:`Media`,stock_photos:{api_keys:{title:`Stock Photo Service API Keys`,description:`Manage API keys for <a>stock photo services</a>.`},field_label:`{$service} API Key`,description:`Sign up for <a {$homeHref}>{$service} API</a> and enter <a {$apiKeyHref}>your API Key</a> here to insert free stock photos to image entry fields.`,credit:`Photos provided by {$service}`,no_services:`No <a>stock photo services</a> are configured.`},cloud_storage:{api_keys:{title:`Cloud Storage Service API Keys`,description:`Manage API keys for <a>cloud storage services</a>.`},field_label:`{$service} API Key`,no_services:`No <a>cloud storage services</a> are configured.`}},ai:{title:`AI`,api_keys:{title:`AI Service API Keys`,description:`Manage API keys for AI services.`},field_label:`{$service} API Key`},accessibility:{title:`Accessibility`,underline_links:{title:`Underline Links`,description:`Show underline for links in the entry preview and user interface labels.`,switch_label:`Always Underline Links`}},data:{title:`Data Management`,clear_data:{title:`Clear Data`,file_cache:{description:`Delete the locally cached file contents and image thumbnails to free up storage space or resolve issues caused by stale data.`,button_label:`Clear File Cache`,confirmation:`The locally cached file contents and image thumbnails will be deleted. Your unsaved drafts and settings will be kept, and any deleted data will be downloaded or generated again as needed. The CMS will be reloaded once done.`},all_data:{description:`Delete everything the CMS keeps in this browser, including the cached files, unsaved drafts and settings. Anything already saved to your repository won’t be affected.`,button_label:`Erase All Data`,confirmation:`All the data stored in this browser will be deleted, including the cached file contents, image thumbnails, unsaved drafts, settings and sign-in state. Your repository won’t be affected, but any change you haven’t saved will be lost, and you’ll have to sign in again. The CMS will be reloaded once done.`}}},developer:{title:`Developer`,developer_mode:{title:`Developer Mode`,description:`Enable some developer-oriented features, including detailed console logs and native context menus.`,switch_label:`Enable Developer Mode`},local_git:{title:`Git Commits`,description:`Commit your changes to the current branch of your local repository whenever you save them, as the CMS does when you work with a remote repository. You can then review and push the commits with your usual Git tools.`,switch_label:`Commit Changes to Git`,checking:`Checking the repository…`,ready:`Changes will be committed to the {$branch} branch as {$name} ({$email}).`,not_ready:`Changes can’t be committed right now. {$reason}`},deploy_hook:{title:`Deploy Hook`,description:`Enter a webhook URL to be called when you manually trigger a deployment by selecting Publish Changes. This can be left blank if you’re using GitHub Actions or GitLab CI/CD.`,url:{field_label:`Hook URL`,saved:`Hook URL saved.`,removed:`Hook URL removed.`},auth:{field_label:`Authorization header (e.g., Bearer <token>) (optional)`,saved:`Authorization header saved.`,removed:`Authorization header removed.`}}}},keyboard_shortcuts_:{view_content_library:`View Content Library`,view_asset_library:`View Asset Library`,search:`Search for entries and assets`,create_entry:`Create a new entry`,save_entry:`Save an entry`,cancel_editing:`Cancel entry editing`},file_type_labels:{avif:`AVIF image`,bmp:`Bitmap image`,gif:`GIF image`,heic:`HEIC image`,heif:`HEIF image`,ico:`Icon`,jpeg:`JPEG image`,jpg:`JPEG image`,png:`PNG image`,svg:`SVG image`,tif:`TIFF image`,tiff:`TIFF image`,webp:`WebP image`,avi:`AVI video`,m4v:`MP4 video`,mov:`QuickTime video`,mp4:`MP4 video`,mpeg:`MPEG video`,mpg:`MPEG video`,ogg:`Ogg video`,ogv:`Ogg video`,ts:`MPEG video`,webm:`WebM video`,"3gp":`3GPP video`,"3g2":`3GPP2 video`,aac:`AAC audio`,mid:`MIDI`,midi:`MIDI`,m4a:`MP4 audio`,mp3:`MP3 audio`,oga:`Ogg audio`,opus:`OPUS audio`,wav:`WAV audio`,weba:`WebM audio`,csv:`CSV spreadsheet`,doc:`Word document`,docx:`Word document`,odp:`OpenDocument presentation`,ods:`OpenDocument spreadsheet`,odt:`OpenDocument text`,pdf:`PDF document`,ppt:`PowerPoint presentation`,pptx:`PowerPoint presentation`,rtf:`Rich text document`,xls:`Excel spreadsheet`,xlsx:`Excel spreadsheet`,html:`HTML text`,js:`JavaScript`,json:`JSON text`,md:`Markdown text`,toml:`TOML text`,yaml:`YAML text`,yml:`YAML text`},file_size_units:{b:`{$size} bytes`,kb:`{$size} KB`,mb:`{$size} MB`,gb:`{$size} GB`,tb:`{$size} TB`}},d5=`en-US`,f5=`ar,bg,ca,cs,da,de,el,en-CA,en-GB,en-US,en-ZA,es-CO,es-ES,fa,fi,fr,he,hr,it,ja,ko,nl,pl,pt-BR,pt-PT,ru,sk,sv,tr,uk,vi,zh-CN,zh-TW`.split(`,`),t9e=()=>{let e=Qne();return e&&f5.includes(e)?e:d5},n9e=`https://unpkg.com/@sveltia/cms@0.266.0/locales`,r9e=5e3,p5=`sveltia-cms.locale`,m5=new Map,h5=tl(),g5=tl(),_5=rl(()=>Intl.NumberFormat(Ec.current)),i9e=()=>!0,a9e=async e=>{if(i9e())try{let{_locale:t,_version:n,...r}=await _u.get(p5)??{};if(t===e&&n===`0.266.0`&&Object.keys(r).length)return r}catch{}},o9e=async(e,t)=>{if(i9e())try{await _u.set(p5,{_locale:e,_version:`0.266.0`,...t})}catch{}},s9e=async()=>{try{await _u.delete(p5)}catch{}},c9e=async e=>{let t=await fetch(`${n9e}/${e}.json`,{signal:AbortSignal.timeout(r9e)});if(!t.ok)throw Error(`Failed to load the ${e} locale strings`,{cause:t});return t.json()},l9e=async e=>{let t=await a9e(e);if(t)return m5.set(e,t),t;h5.current=e;try{let t=await c9e(e);return m5.set(e,t),await o9e(e,t),t}catch(t){throw g5.current={locale:e},t}finally{h5.current===e&&(h5.current=void 0)}},u9e=async e=>{let t=m5.get(e);t?await a9e(e)||await o9e(e,t):e===d5&&m5.size&&await s9e()},d9e=()=>{try{let{locale:e}=JSON.parse(globalThis.localStorage.getItem(`sveltia-cms.prefs`)||`{}`)??{};return f5.includes(e)?e:void 0}catch{return}},f9e=()=>{xc(d5,{...e9e,_sui:GOe}),f5.filter(e=>e!==d5).forEach(e=>{Zne(e,()=>l9e(e))}),Cu.current=t9e(),window.addEventListener(`languagechange`,()=>{Cu.current=t9e()}),$ne({fallbackLocale:d5,initialLocale:d9e()??Cu.current}),ol(()=>{u9e(Ec.current)})};function p9e(e,t){O(t,!0);let n=j(!1);L(()=>{g5.current&&M(n,!0)});var r=H(),i=P(r),a=e=>{let t=A(()=>g5.current);fC(e,{get show(){return z(n)},set show(e){M(n,e,!0)},children:(e,n)=>{bx(e,{status:`error`,children:(e,n)=>{Ur();var r=V();R(e=>W(r,e),[()=>Y(`locale_load_failed`,{values:{locale:Of(z(t).locale)??z(t).locale}})]),U(e,r)},$$slots:{default:!0}})},$$slots:{default:!0}})};G(i,e=>{g5.current&&e(a)}),U(e,r),k()}var m9e=B(`<div role="figure" class="markdown svelte-1rq7jer"></div>`),h9e=B(`<pre role="figure" class="svelte-1rq7jer"> </pre>`),g9e={hash:`svelte-1rq7jer`,code:`.markdown.svelte-1rq7jer {
/* Make the preview the containing block of any positioned element in the content, so an element
with \`position: fixed\` from an inline style can’t cover the rest of the app */translate:0;}pre.svelte-1rq7jer,
.markdown.svelte-1rq7jer {display:block;margin:0;padding:16px;width:100%;height:100%;overflow:auto;}pre.svelte-1rq7jer {white-space:pre-wrap;}`};function _9e(e,t){O(t,!0),K(e,g9e);var n=H(),r=P(n),i=e=>{var n=H();Do(P(n),()=>pr(t.text,{breaks:!0,async:!0}),null,(e,t)=>{var n=m9e();Lo(n,()=>Km(z(t),{ADD_TAGS:[]}),!0),D(n),U(e,n)},e=>{var n=h9e(),r=F(n,!0);R(()=>W(r,t.text)),U(e,n)}),U(e,n)},a=A(()=>t.name.endsWith(`.md`)),o=e=>{var n=h9e(),r=F(n,!0);R(()=>W(r,t.text)),U(e,n)};G(r,e=>{z(a)?e(i):e(o,-1)}),U(e,n),k()}var v5=B(`<span role="alert"> </span>`),v9e=B(`<iframe sandbox="allow-scripts"></iframe>`);function y9e(e,t){O(t,!0);let n=J(t,`asset`,3,void 0),r=J(t,`pending`,3,!1),i=A(()=>n()?void 0:t.src);var a=H(),o=P(a),s=e=>{{let r=A(()=>[`image`,`video`].includes(t.kind)),a=A(()=>t.kind===`image`),o=A(()=>t.kind===`image`?t.name:void 0),s=A(()=>[`audio`,`video`].includes(t.kind));k0(e,{get kind(){return t.kind},get asset(){return n()},get src(){return z(i)},get blurBackground(){return z(r)},get checkerboard(){return z(a)},get alt(){return z(o)},get controls(){return z(s)},loading:`eager`,dissolve:!1,holdTransition:!0})}},c=A(()=>t.kind&&xp(t.kind)),l=e=>{dH(e,{children:(e,t)=>{var n=v5(),r=F(n,!0);R(e=>W(r,e),[()=>Y(`loading`)]),U(e,n)},$$slots:{default:!0}})},u=e=>{var n=v9e();R(()=>{q(n,`src`,t.src),q(n,`title`,t.name)}),U(e,n)},d=e=>{var n=H();Do(P(n),()=>t.getText(),e=>{dH(e,{children:(e,t)=>{var n=v5(),r=F(n,!0);R(e=>W(r,e),[()=>Y(`loading`)]),U(e,n)},$$slots:{default:!0}})},(e,n)=>{_9e(e,{get text(){return z(n)},get name(){return t.name}})},e=>{dH(e,{children:(e,t)=>{var n=v5(),r=F(n,!0);R(e=>W(r,e),[()=>Y(`preview_unavailable`)]),U(e,n)},$$slots:{default:!0}})}),U(e,n)},f=A(()=>t.type&&Hc(t.type)),p=e=>{dH(e,{children:(e,t)=>{var n=v5(),r=F(n,!0);R(e=>W(r,e),[()=>Y(`preview_unavailable`)]),U(e,n)},$$slots:{default:!0}})};G(o,e=>{z(c)?e(s):r()?e(l,1):t.type===`application/pdf`?e(u,2):z(f)?e(d,3):e(p,-1)}),U(e,a),k()}var b9e=B(`<li class="svelte-4yt8tl"><span class="entry svelte-4yt8tl"><bdi> </bdi></span> <span class="field svelte-4yt8tl"><bdi> </bdi> </span></li>`),x9e=B(`<div role="alert" class="svelte-4yt8tl"> </div> <ul class="blockers svelte-4yt8tl"></ul>`,1),S9e=B(`<div class="svelte-4yt8tl"> </div>`),C9e={hash:`svelte-4yt8tl`,code:`div.svelte-4yt8tl {margin-top:8px;}.blockers.svelte-4yt8tl {margin:8px 0 0;border-radius:var(--sui-control-medium-border-radius);padding:12px;background-color:var(--sui-tertiary-background-color);font-size:var(--sui-font-size-default);list-style:none;li:where(.svelte-4yt8tl) {margin:0;padding:0;&:not(:first-child) {margin-top:8px;}}span:where(.svelte-4yt8tl) {display:block;}.field:where(.svelte-4yt8tl) {color:var(--sui-secondary-foreground-color);}}`};function y5(e,t){O(t,!0),K(e,C9e);let n=J(t,`kind`,3,`entry`);var r=H(),i=P(r),a=e=>{var r=x9e(),i=P(r),a=F(i,!0),o=I(i,2);No(o,21,()=>t.plan.blockers,e=>`${e.entry.id}:${e.keyPath}`,(e,t)=>{var n=b9e(),r=N(n),i=F(N(r));D(r);var a=I(r,2),o=N(a),s=F(o,!0),c=I(o);D(a),D(n),R(e=>{W(i,`${z(t).collectionLabel??``} › ${z(t).summary??``}`),W(s,z(t).fieldLabel),W(c,`: ${e??``}`)},[()=>z(t).messages.join(` `)]),U(e,n)}),D(o),R(e=>W(a,e),[()=>Y(n()===`asset`?`cannot_delete_referenced_assets`:`cannot_delete_referenced_entries`,{values:{count:t.count}})]),U(e,r)},o=e=>{var r=S9e(),i=F(r,!0);R(e=>W(i,e),[()=>Y(n()===`asset`?`deleting_referenced_assets_note`:`deleting_referenced_entries_note`,{values:{count:t.plan.targets.length}})]),U(e,r)};G(i,e=>{t.plan.blockers.length?e(a):t.plan.targets.length&&e(o,1)}),U(e,r),k()}var w9e=B(`<div role="alert"> </div>`),T9e=B(`<!> <!>`,1);function b5(e,t){O(t,!0);let n=J(t,`assets`,19,()=>[]),r=J(t,`disabled`,3,!1),i=J(t,`planDeletion`,3,void 0),a=J(t,`listedCount`,3,void 0),o=J(t,`onDelete`,3,void 0),s=J(t,`useButton`,3,!0),c=j(!1),l=j(void 0),u=j(!1),d=j(void 0),f=A(()=>n().length),p=A(()=>a()===void 0?Y(`delete_assets`,{values:{count:1}}):Y(`delete_selected_assets`,{values:{count:z(f)}})),m=A(()=>a()===void 0?Y(`confirm_deleting_this_asset`):Y(z(f)>1&&z(f)===a()?`confirm_deleting_all_assets`:`confirm_deleting_selected_assets`,{values:{count:z(f)}})),h=A(()=>r()||!z(f)),g=A(()=>!!z(l)?.blockers.length);L(()=>{if(!z(c)||!i())return;let e=n();M(l,void 0),M(u,!1),i()(e).then(t=>{z(c)&&n()===e&&M(l,t,!0)},t=>{console.error(t),z(c)&&n()===e&&M(u,!0)})}),pa(()=>{z(h)&&document.activeElement===z(d)&&Za().then(()=>jJ())});var _=T9e(),v=P(_),y=e=>{{let t=A(()=>Y(`delete`));Xx(e,{variant:`ghost`,get disabled(){return z(h)},get label(){return z(t)},get"aria-label"(){return z(p)},onclick:()=>{M(c,!0)},get element(){return z(d)},set element(e){M(d,e,!0)}})}},b=e=>{{let t=A(()=>Y(`delete`));JS(e,{variant:`ghost`,get disabled(){return z(h)},get label(){return z(t)},get"aria-label"(){return z(p)},onclick:()=>{M(c,!0)}})}};G(v,e=>{s()?e(y):e(b,-1)});var x=I(v,2);{let e=A(()=>Y(`delete_assets`,{values:{count:z(f)}})),r=A(()=>Y(`delete`)),a=A(()=>!!i()&&(!z(l)||z(g)));wS(x,{get title(){return z(e)},get okLabel(){return z(r)},get okDisabled(){return z(a)},onOk:async()=>{await t.deleteAssets(n())!==!1&&o()?.()},get open(){return z(c)},set open(e){M(c,e,!0)},children:(e,t)=>{var n=T9e(),r=P(n),i=e=>{var t=w9e(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`checking_asset_references_failed`,{values:{count:z(f)}})]),U(e,t)},a=e=>{var t=V();R(()=>W(t,z(m))),U(e,t)};G(r,e=>{z(u)?e(i):z(g)||e(a,1)});var o=I(r,2),s=e=>{y5(e,{get plan(){return z(l)},kind:`asset`,get count(){return z(f)}})};G(o,e=>{z(l)&&e(s)}),U(e,n)},$$slots:{default:!0}})}U(e,_),k()}function x5(e,t){O(t,!0);let n=J(t,`useShortcut`,3,!1),r=J(t,`onclick`,3,void 0);{let i=e=>{{let t=A(()=>Tc()?`arrow_forward`:`arrow_back`);gx(e,{get name(){return z(t)}})}},a=A(()=>t[`aria-label`]??Y(`back`)),o=A(()=>n()?`Escape`:void 0);Xx(e,{variant:`ghost`,iconic:!0,get"aria-label"(){return z(a)},get keyShortcuts(){return z(o)},class:`back`,get onclick(){return r()},startIcon:i,$$slots:{startIcon:!0}})}k()}var E9e=`input, textarea, select, audio, video, [role="grid"], [role="listbox"], [role="menu"], [role="menubar"], [role="radiogroup"], [role="slider"], [role="tablist"]`,D9e=(e,{container:t,rtl:n})=>{let{key:r,ctrlKey:i,metaKey:a,altKey:o,shiftKey:s,target:c}=e;if(!(![`ArrowLeft`,`ArrowRight`].includes(r)||i||a||o||s)&&c instanceof HTMLElement&&(c===document.body||t?.contains(c))&&!c.isContentEditable&&!c.closest(E9e))return r===(n?`ArrowRight`:`ArrowLeft`)?`previous`:`next`},O9e=e=>!(e instanceof Element&&e.closest(`audio, video, input, [role="slider"]`)),k9e=({start:e,end:t,rtl:n})=>{let r=t.x-e.x,i=t.y-e.y;if(!(Math.abs(r)<50||Math.abs(r)<Math.abs(i)))return(n?r<0:r>0)?`previous`:`next`},A9e=B(`<bdi> </bdi>`),j9e=B(`<!> <h2 role="none"><!></h2> <!> <!>`,1),M9e=B(`<div role="none" class="preview svelte-1g7r4za"><!></div>`),N9e=B(`<div role="group" class="wrapper svelte-1g7r4za"><!> <div role="none" class="row svelte-1g7r4za"><div role="none" class="main svelte-1g7r4za"><!> <!> <!></div> <!></div></div>`),P9e={hash:`svelte-1g7r4za`,code:`
@keyframes svelte-1g7r4za-slide-out-to-left {
to {
transform: translateX(-100%);
}
}
@keyframes svelte-1g7r4za-slide-out-to-right {
to {
transform: translateX(100%);
}
}
@keyframes svelte-1g7r4za-slide-in-from-left {
from {
transform: translateX(-100%);
}
}
@keyframes svelte-1g7r4za-slide-in-from-right {
from {
transform: translateX(100%);
}
}
/*
* Slide the preview sideways when moving between the listed assets, as if they were laid out in
* a row: the next asset comes in from the end of the line, the previous one from the start. The
* toolbar, navigation buttons and info panel aren’t part of the transition, so they stay put and
* the info panel simply dissolves.
*/html:active-view-transition-type(next),
html:active-view-transition-type(previous) {
/* Keep the sliding snapshots within the preview area, off the info panel and the buttons */&::view-transition-image-pair(asset-details) {overflow:clip;}&::view-transition-old(asset-details),
&::view-transition-new(asset-details) {animation-duration:200ms;animation-timing-function:ease-out;animation-fill-mode:both;
@media (prefers-reduced-motion) {
animation: none;
}}}html:active-view-transition-type(next) {&::view-transition-old(asset-details) {
animation-name: svelte-1g7r4za-slide-out-to-left;}&::view-transition-new(asset-details) {
animation-name: svelte-1g7r4za-slide-in-from-right;}&:dir(rtl) {&::view-transition-old(asset-details) {
animation-name: svelte-1g7r4za-slide-out-to-right;}&::view-transition-new(asset-details) {
animation-name: svelte-1g7r4za-slide-in-from-left;}}}html:active-view-transition-type(previous) {&::view-transition-old(asset-details) {
animation-name: svelte-1g7r4za-slide-out-to-right;}&::view-transition-new(asset-details) {
animation-name: svelte-1g7r4za-slide-in-from-left;}&:dir(rtl) {&::view-transition-old(asset-details) {
animation-name: svelte-1g7r4za-slide-out-to-left;}&::view-transition-new(asset-details) {
animation-name: svelte-1g7r4za-slide-in-from-right;}}}
/*
* The preview and the navigation buttons are named only for the previous/next transition: the
* buttons to be layered above the sliding preview, and the preview to slide on its own. During
* the page transitions, e.g. when the overlay is opened or closed on a small screen, they must
* stay unnamed to move along with the rest of the page.
*/html:is(:active-view-transition-type(next), :active-view-transition-type(previous)) {.preview.svelte-1g7r4za {view-transition-name:asset-details;}.row.svelte-1g7r4za .nav-button.previous {view-transition-name:asset-nav-previous;}.row.svelte-1g7r4za .nav-button.next {view-transition-name:asset-nav-next;}}.wrapper.svelte-1g7r4za {position:fixed;inset:0;z-index:100;display:flex;flex-direction:column;background-color:var(--sui-secondary-background-color);.row:where(.svelte-1g7r4za) {flex:auto;display:flex;overflow:hidden;
@media (width < 768px) {flex-direction:column;.main:where(.svelte-1g7r4za) {flex:none;aspect-ratio:1 / 1;}.detail {flex:auto;border-block-start:var(--area-border);width:auto;}
}
@media (768px <= width) {.detail {border-inline-start:var(--area-border);}
}.main:where(.svelte-1g7r4za) {position:relative;flex:auto;display:flex;overflow:hidden;}.preview:where(.svelte-1g7r4za) {flex:auto;overflow:hidden;iframe {display:block;width:100%;height:100%;}}.nav-button {position:absolute;top:50%;translate:0 -50%;margin:0;border-radius:50%;opacity:0.5;&:hover,
&:focus-visible {opacity:1;}&.previous {inset-inline-start:16px;}&.next {inset-inline-end:16px;}}.detail {background-color:var(--sui-primary-background-color);}}}`};function F9e(e,t){O(t,!0),K(e,P9e);let n=e=>{var n=H(),r=P(n),i=e=>{var n=H();xo(P(n),()=>t.actions,()=>!1),U(e,n)};G(r,e=>{PY.isSmallScreen&&e(i)}),U(e,n)},r=J(t,`title`,3,void 0),i=J(t,`contentKey`,3,void 0),a=J(t,`onPrevious`,3,void 0),o=J(t,`onNext`,3,void 0),s=J(t,`info`,3,void 0),c=j(void 0),l;L(()=>{V1.current&&MJ(()=>z(c))}),So(kJ);let u=e=>e===`previous`?a():e===`next`?o():void 0,d=e=>{let t=u(D9e(e,{container:z(c),rtl:Tc()}));t&&(e.preventDefault(),t())},f=({touches:e,target:t})=>{let{clientX:n,clientY:r}=e[0];l=O9e(t)?{x:n,y:r}:void 0},p=({changedTouches:e})=>{if(!l)return;let{clientX:t,clientY:n}=e[0],r=k9e({start:l,end:{x:t,y:n},rtl:Tc()});l=void 0,u(r)?.()};var m=N9e();oo(`keydown`,$i,d);var h=N(m);Oo(h,i,e=>{{let i=A(()=>Y(`primary`));IV(e,{variant:`primary`,get ariaLabel(){return z(i)},children:(e,i)=>{var a=j9e(),o=P(a);{let e=A(()=>Y(`cancel_editing`));x5(o,{get"aria-label"(){return z(e)},useShortcut:!0,get onclick(){return t.onBack}})}var s=I(o,2);Nx(N(s),{children:(e,t)=>{var n=A9e(),i=F(n,!0);R(()=>W(i,r())),U(e,n)},$$slots:{default:!0}}),D(s);var c=I(s,2),l=e=>{var n=H();xo(P(n),()=>t.actions,()=>!0),U(e,n)};G(c,e=>{PY.isSmallScreen||e(l)}),xo(I(c,2),()=>t.editOptions,()=>n),U(e,a)},$$slots:{default:!0}})}});var g=I(h,2),_=N(g),v=N(_);Oo(v,i,e=>{var n=M9e();xo(N(n),()=>t.preview),D(n),U(e,n)});var y=I(v,2);{let e=e=>{{let t=A(()=>Tc()?`arrow_forward`:`arrow_back`);gx(e,{get name(){return z(t)}})}},t=A(()=>Y(`previous_asset`)),n=A(()=>!a());Xx(y,{variant:`tertiary`,iconic:!0,class:`nav-button previous`,get"aria-label"(){return z(t)},get disabled(){return z(n)},onclick:()=>a()?.(),startIcon:e,$$slots:{startIcon:!0}})}var b=I(y,2);{let e=e=>{{let t=A(()=>Tc()?`arrow_back`:`arrow_forward`);gx(e,{get name(){return z(t)}})}},t=A(()=>Y(`next_asset`)),n=A(()=>!o());Xx(b,{variant:`tertiary`,iconic:!0,class:`nav-button next`,get"aria-label"(){return z(t)},get disabled(){return z(n)},onclick:()=>o()?.(),startIcon:e,$$slots:{startIcon:!0}})}D(_),Oo(I(_,2),i,e=>{var t=H();xo(P(t),()=>s()??Cr),U(e,t)}),D(g),D(m),gs(m,e=>M(c,e),()=>z(c)),R(e=>q(m,`aria-label`,e),[()=>Y(`asset_editor`)]),so(`touchstart`,g,f,void 0,!0),so(`touchend`,g,p),U(e,m),k()}co([`touchstart`,`touchend`]);var I9e=B(`<!> <!>`,1);function S5(e,t){O(t,!0);let n=J(t,`assets`,19,()=>[]),r=J(t,`useButton`,3,!0),i=Xi({show:!1,status:`success`}),a=A(()=>r()?Xx:JS),o=async()=>{try{for(let e of n())bre(await t.getBlob(e),t.getName(e)),await Iu(300);i.status=`success`}catch(e){i.status=`error`,console.error(e)}finally{i.show=!0}};var s=I9e(),c=P(s);{let e=A(()=>!n().length),t=A(()=>Y(`download`));Ro(c,()=>z(a),(n,r)=>{r(n,{variant:`ghost`,get disabled(){return z(e)},get label(){return z(t)},onclick:()=>{o()}})})}fC(I(c,2),{get show(){return i.show},set show(e){i.show=e},children:(e,t)=>{bx(e,{get status(){return i.status},children:(e,t)=>{var r=H(),a=P(r),o=e=>{var t=V();R(e=>W(t,e),[()=>Y(`assets_downloaded`,{values:{count:n().length}})]),U(e,t)},s=e=>{var t=V();R(e=>W(t,e),[()=>Y(`assets_dialog.error.image_fetch_failed`)]),U(e,t)};G(a,e=>{i.status===`success`?e(o):e(s,-1)}),U(e,r)},$$slots:{default:!0}})},$$slots:{default:!0}}),U(e,s),k()}var L9e=B(`<!> <!>`,1);function R9e(e,t){O(t,!0);let n=e=>{var n=H();No(P(n),17,()=>t.items,e=>e.label,(e,t)=>{JS(e,{get label(){return z(t).label},get disabled(){return z(t).disabled},onclick:()=>{a(z(t))}})}),U(e,n)},r=J(t,`useButton`,3,!0),i=Xi({show:!1,text:``,status:`success`}),a=async({copy:e,toastKey:n})=>{try{await e(),i.status=`success`,i.text=Y(n,{values:{count:t.count}})}catch(e){i.status=`error`,i.text=Y(`clipboard_error`),console.error(e)}finally{i.show=!0}};var o=L9e(),s=P(o),c=e=>{{let r=e=>{{let t=A(()=>Y(`copy_options`));qS(e,{get ariaLabel(){return z(t)},children:(e,t)=>{n(e)},$$slots:{default:!0}})}},i=A(()=>!t.count),a=A(()=>Y(`copy`));hS(e,{variant:`ghost`,get disabled(){return z(i)},get label(){return z(a)},popupPosition:`bottom-right`,popup:r,$$slots:{popup:!0}})}},l=e=>{{let r=e=>{n(e)},i=A(()=>!t.count),a=A(()=>Y(`copy`));JS(e,{get disabled(){return z(i)},get label(){return z(a)},popupPosition:`left-top`,items:r,$$slots:{items:!0}})}};G(s,e=>{r()?e(c):e(l,-1)}),fC(I(s,2),{get show(){return i.show},set show(e){i.show=e},children:(e,t)=>{bx(e,{get status(){return i.status},children:(e,t)=>{Ur();var n=V();R(()=>W(n,i.text)),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),U(e,o),k()}var z9e=e=>Hc(e)?!0:Iq.includes(e)?typeof navigator.clipboard.write==`function`:!1,B9e=(e,{isImage:t=!1}={})=>{let n=gp.getType(e);return n?z9e(n):t},V9e=async e=>{let{type:t}=e;if(Hc(t))await navigator.clipboard.writeText(await e.text());else{if(!Iq.includes(t))throw Error(`Unsupported type`);await navigator.clipboard.write([new ClipboardItem({"image/png":t===`image/png`?e:await eJ(e)})])}};function H9e(e,t){O(t,!0);let n=J(t,`assets`,19,()=>[]),r=J(t,`useButton`,3,!0),i=A(()=>n().length===1&&B9e(n()[0].fileName,{isImage:n()[0].kind===`image`})),a=async()=>{await navigator.clipboard.writeText(n().map(e=>e.downloadURL).join(`
`))},o=async()=>{await navigator.clipboard.writeText(n().map(e=>e.description).join(`
`))},s=async()=>{await navigator.clipboard.writeText(n().map(e=>e.id).join(`
`))},c=A(()=>n().some(e=>e.description!==e.downloadURL)),l=A(()=>n().some(e=>e.id!==e.downloadURL)),u=A(()=>[{label:Y(`public_urls`,{values:{count:n().length}}),copy:a,toastKey:`asset_urls_copied`},z(c)&&{label:Y(`file_paths`,{values:{count:n().length}}),copy:o,toastKey:`asset_paths_copied`},z(l)&&{label:Y(`file_ids`,{values:{count:n().length}}),copy:s,toastKey:`asset_ids_copied`},{label:Y(`file_data`),disabled:!z(i),copy:async()=>{await V9e(await W2(n()[0]))},toastKey:`asset_data_copied`}].filter(e=>!!e));R9e(e,{get items(){return z(u)},get count(){return n().length},get useButton(){return r()}}),k()}var U9e=B(`<!> <!>`,1),W9e=B(`<!> <!> <!> <!> <!>`,1);function G9e(e,t){O(t,!0);let n=J(t,`readOnly`,3,!1),r=J(t,`canEdit`,3,!1),i=J(t,`canRename`,3,!1),a=J(t,`canReplace`,3,!1),o=J(t,`onEdit`,3,void 0),s=J(t,`onRename`,3,void 0),c=J(t,`onReplace`,3,void 0),l=J(t,`extraItems`,3,void 0),u=J(t,`moreItems`,3,void 0);{let t=e=>{{let t=A(()=>Y(`edit_options`));qS(e,{get ariaLabel(){return z(t)},children:(e,t)=>{var d=W9e(),f=P(d);xo(f,()=>l()??Cr);var p=I(f,2),m=e=>{{let t=A(()=>Y(`edit`)),i=A(()=>Y(`edit_asset`)),a=A(()=>n()||!r());JS(e,{variant:`ghost`,get label(){return z(t)},get"aria-label"(){return z(i)},get disabled(){return z(a)},get onclick(){return o()}})}};G(p,e=>{o()&&e(m)});var h=I(p,2),g=e=>{{let t=A(()=>Y(`rename`)),r=A(()=>Y(`rename_asset`)),a=A(()=>n()||!i());JS(e,{variant:`ghost`,get label(){return z(t)},get"aria-label"(){return z(r)},get disabled(){return z(a)},get onclick(){return s()}})}};G(h,e=>{s()&&e(g)});var _=I(h,2),v=e=>{{let t=A(()=>Y(`replace`)),r=A(()=>Y(`replace_asset`)),i=A(()=>n()||!a());JS(e,{variant:`ghost`,get label(){return z(t)},get"aria-label"(){return z(r)},get disabled(){return z(i)},get onclick(){return c()}})}};G(_,e=>{c()&&e(v)});var y=I(_,2),b=e=>{var t=U9e(),n=P(t);FS(n,{}),xo(I(n,2),u),U(e,t)};G(y,e=>{u()&&e(b)}),U(e,d)},$$slots:{default:!0}})}},d=A(()=>Y(`show_edit_options`));hS(e,{variant:`ghost`,iconic:!0,popupPosition:`bottom-right`,get"aria-label"(){return z(d)},popup:t,$$slots:{popup:!0}})}k()}var K9e=B(`<!> <!>`,1);function q9e(e,t){O(t,!0);let n=J(t,`extraItems`,3,void 0),r=j(void 0),i=A(()=>g1.current),a=e=>{t.asset&&(R2.current={files:[e],originalAsset:t.asset})};var o=K9e(),s=P(o);{let e=A(()=>!!t.asset),a=A(()=>!!t.asset),o=A(()=>z(i)?.rename?()=>{M1.current=t.asset}:void 0),c=A(()=>z(i)?.replace?()=>{z(r)?.open()}:void 0);G9e(s,{get canRename(){return z(e)},get canReplace(){return z(a)},get onRename(){return z(o)},get onReplace(){return z(c)},get extraItems(){return n()}})}gs(RS(I(s,2),{onSelect:({file:e})=>{a(e)}}),e=>M(r,e,!0),()=>z(r)),U(e,o),k()}var J9e=e=>Number.isFinite(e)?new Date(e*1e3).toISOString().substr(11,8):`–`,Y9e=B(`<section><h4> </h4> <p><!></p></section>`),X9e=B(`<section><h4> </h4> <p> </p></section>`),Z9e=B(`<section><h4> </h4> <p> </p></section> <!> <!> <!>`,1);function Q9e(e,t){O(t,!0);let n=J(t,`size`,3,void 0),r=J(t,`hasDimensions`,3,!1),i=J(t,`dimensions`,3,void 0),a=J(t,`duration`,3,void 0),o=A(()=>Uc(t.fileName)),s=A(()=>Tr(z(o).extension,``));var c=Z9e(),l=P(c),u=N(l),d=F(u,!0),f=F(I(u,2),!0);D(l);var p=I(l,2),m=e=>{var t=Y9e(),r=N(t),i=F(r,!0),a=I(r,2);Oo(N(a),()=>Ec.current,e=>{var t=V();R(e=>W(t,e),[()=>I0(n())]),U(e,t)}),D(a),D(t),R(e=>W(i,e),[()=>Y(`size`)]),U(e,t)};G(p,e=>{n()&&e(m)});var h=I(p,2),g=e=>{var t=X9e(),n=N(t),r=F(n,!0),a=F(I(n,2),!0);D(t),R(e=>{W(r,e),W(a,i()?`${i().width}×${i().height}`:`–`)},[()=>Y(`dimensions`)]),U(e,t)};G(h,e=>{r()&&e(g)});var _=I(h,2),v=e=>{var t=X9e(),n=N(t),r=F(n,!0),i=F(I(n,2),!0);D(t),R((e,t)=>{W(r,e),W(i,t)},[()=>Y(`duration`),()=>a()?J9e(a()):`–`]),U(e,t)},y=A(()=>[`audio`,`video`].includes(t.kind));G(_,e=>{z(y)&&e(v)}),R((e,t)=>{W(d,e),W(f,t)},[()=>Y(`kind`),()=>L0(t.fileName,{fallback:gp.getType(t.fileName)??(z(s)?z(s).toUpperCase():Y(t.kind))})]),U(e,c),k()}var $9e=B(`<div role="none" class="preview svelte-173w06p"><!></div>`),eet=B(`<div role="none" class="detail svelte-173w06p"><!> <!></div>`),tet={hash:`svelte-173w06p`,code:`.detail.svelte-173w06p {flex:none;overflow-x:hidden;overflow-y:auto;padding:16px;width:320px;.preview:where(.svelte-173w06p) {overflow:hidden;margin:0 0 16px;border-radius:var(--sui-control-large-border-radius);background-color:var(--sui-content-background-color);aspect-ratio:1 / 1;}section {&:not(:last-child) {margin:0 0 16px;}& > * {margin:0 0 4px;word-break:break-all;}}h4 {font-size:var(--sui-font-size-small);font-weight:var(--sui-font-weight-bold);color:var(--sui-secondary-foreground-color);}}`};function C5(e,t){K(e,tet);let n=J(t,`preview`,3,void 0);var r=eet(),i=N(r),a=e=>{var t=$9e();xo(N(t),n),D(t),U(e,t)};G(i,e=>{n()&&e(a)}),xo(I(i,2),()=>t.children),D(r),U(e,r)}var net=(e,t)=>{let n=()=>(t?.()).link,r=()=>(t?.()).collectionLabel,i=()=>(t?.()).entryLabel;var a=iet();Xx(N(a),{role:`link`,variant:`link`,onclick:()=>x0(n(),{transitionType:`forwards`}),children:(e,t)=>{var n=ret(),a=F(n);R(()=>W(a,`${r()??``} › ${i()??``}`)),U(e,n)},$$slots:{default:!0}}),D(a),U(e,a)},ret=B(`<span role="none"> </span>`),iet=B(`<p><!></p>`),aet=B(`<p> </p>`),oet=B(`<section><h4> </h4> <!></section>`);function set(e,t){O(t,!0);let n=A(()=>t.entries?.map(e=>({entry:e,collections:$U(e)})).filter(({collections:e})=>e.length));var r=oet(),i=N(r),a=F(i,!0),o=I(i,2),s=e=>{var t=aet(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`loading`)]),U(e,t)},c=e=>{var t=H();No(P(t),17,()=>z(n),({entry:e,collections:t})=>e.id,(e,t)=>{let n=()=>z(t).entry,r=()=>z(t).collections;var i=H();No(P(i),17,r,e=>e.name,(e,t)=>{var r=H();Oo(P(r),()=>Ec.current,e=>{let r=A(()=>qf(z(t)));var i=H();No(P(i),17,()=>qp(z(t),n()),e=>e.name,(e,n)=>{{let i=A(()=>({link:c0(z(t).name,z(n).name),collectionLabel:z(r),entryLabel:Kp(z(n))}));net(e,()=>z(i))}},e=>{{let i=A(()=>({link:c0(z(t).name,n().subPath),collectionLabel:z(r),entryLabel:wW(z(t),n(),{useTemplate:!0})}));net(e,()=>z(i))}}),U(e,i)}),U(e,r)}),U(e,i)},e=>{var t=aet(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`sort_keys.none`)]),U(e,t)}),U(e,t)};G(o,e=>{z(n)?e(c,-1):e(s)}),D(r),R(e=>W(a,e),[()=>Y(`used_in`)]),U(e,r),k()}var cet=B(`<div role="none" class="unavailable svelte-3zctzm"><!></div>`),uet=B(`<section><h4> </h4> <p><bdi dir="ltr"> </bdi></p></section>`),det=B(`<section><h4> </h4> <p> </p></section>`),fet=B(`<!> <!> <section><h4> </h4> <p><a dir="ltr" target="_blank" rel="noopener noreferrer"> </a></p></section> <!> <!> <!>`,1),pet={hash:`svelte-3zctzm`,code:`.unavailable.svelte-3zctzm {margin:0 0 16px;}`};function met(e,t){O(t,!0),K(e,pet);let n=e=>{{let t=A(()=>z(l)===`image`?z(s):z(c)),n=A(()=>z(l)===`image`),r=A(()=>[`audio`,`video`].includes(z(l)));k0(e,{get kind(){return z(l)},get src(){return z(t)},get alt(){return z(a)},variant:`tile`,get checkerboard(){return z(n)},get controls(){return z(r)}})}},r=j(Xi({})),i=j(void 0),a=A(()=>t.asset.fileName),o=A(()=>t.asset.description),s=A(()=>t.asset.previewURL),c=A(()=>t.asset.downloadURL),l=A(()=>t.asset.kind),u=A(()=>t.asset.size),d=A(()=>t.asset.lastModified),f=A(()=>z(r).dimensions),p=A(()=>z(r).duration),m=A(()=>xp(z(l))),h=A(()=>o1.current[t.asset.id]===!1),g=Zv(),_=async e=>{let t=g.next();M(r,{},!0),M(i,void 0);try{let n=await i1(e);if(!t())return;M(r,n,!0)}catch{}try{let n=await a1(e);t()&&M(i,n,!0)}catch(e){console.error(e),t()&&M(i,[],!0)}};L(()=>{_(t.asset)});{let t=A(()=>z(m)?n:void 0);C5(e,{get preview(){return z(t)},children:(e,t)=>{var n=fet(),r=P(n),s=e=>{var t=cet();bx(N(t),{status:`error`,ariaLive:`off`,children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(`file_unavailable_description`)]),U(e,n)},$$slots:{default:!0}}),D(t),U(e,t)};G(r,e=>{z(h)&&e(s)});var g=I(r,2);Q9e(g,{get fileName(){return z(a)},get kind(){return z(l)},get size(){return z(u)},get hasDimensions(){return z(m)},get dimensions(){return z(f)},get duration(){return z(p)}});var _=I(g,2),v=N(_),y=F(v,!0),b=I(v,2),x=N(b),S=F(x,!0);D(b),D(_);var C=I(_,2),w=e=>{var t=uet(),n=N(t),r=F(n,!0),i=I(n,2),a=N(i),s=F(a,!0);D(i),D(t),R(e=>{W(r,e),W(s,z(o)),a.dir=a.dir},[()=>Y(`file_paths`,{values:{count:1}})]),U(e,t)};G(C,e=>{z(o)&&z(o)!==z(a)&&z(o)!==z(c)&&e(w)});var T=I(C,2);set(T,{get entries(){return z(i)}});var ee=I(T,2),E=e=>{var t=det(),n=N(t),r=F(n,!0),i=F(I(n,2),!0);D(t),R((e,t)=>{W(r,e),W(i,t)},[()=>Y(`sort_keys.last_modified`),()=>bU(z(d),Ec.current)]),U(e,t)};G(ee,e=>{z(d)&&e(E)}),R(e=>{W(y,e),q(x,`href`,z(c)),W(S,z(c)),x.dir=x.dir},[()=>Y(`public_urls`,{values:{count:1}})]),U(e,n)},$$slots:{default:!0}})}k()}var het=B(`<span role="none"> </span> <!>`,1);function w5(e,t){O(t,!0);let n=J(t,`backPath`,3,`/collections`),r=()=>!0;dH(e,{children:(e,i)=>{var a=het(),o=P(a),s=F(o,!0);Xx(I(o,2),{variant:`primary`,onclick:()=>{S0(n(),{returnTo:r})},children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(`back`)]),U(e,n)},$$slots:{default:!0}}),R(()=>W(s,t.message)),U(e,a)},$$slots:{default:!0}}),k()}var get=B(`<!> <!> <!>`,1),_et=B(`<span role="alert"> </span>`);function vet(e,t){O(t,!0);let n=A(()=>g1.current),r=A(()=>!!_1.current),i=A(()=>_1.current?.find(({id:e})=>e===j1.current)),a=A(()=>z(i)?.kind),o=A(()=>z(i)?.fileName??``),s=A(()=>z(i)?.downloadURL??``),c=A(()=>gp.getType(z(o))),l=A(()=>z(i)?[z(i)]:[]),u=A(()=>f1(z(n))),d=A(()=>Y1(n4.current,({id:e})=>e===z(i)?.id,m1)),f=A(()=>z(d).previous),p=A(()=>z(d).next),m=(e,t)=>{x0(p1(z(n),e),{replaceState:!0,transitionType:t})};{let t=(e,t=Cr)=>{var r=get(),i=P(r);H9e(i,{get assets(){return z(l)},get useButton(){return t()}});var a=I(i,2);S5(a,{get assets(){return z(l)},getName:e=>e.fileName,get getBlob(){return W2},get useButton(){return t()}});var o=I(a,2),s=e=>{b5(e,{get assets(){return z(l)},get deleteAssets(){return kHe},onDelete:()=>{S0(z(u))},get useButton(){return t()}})};G(o,e=>{z(n).delete&&e(s)}),U(e,r)},d=(e,t=Cr)=>{var r=H(),a=P(r),o=e=>{q9e(e,{get asset(){return z(i)},get extraItems(){return t()}})};G(a,e=>{(z(n).rename||z(n).replace||PY.isSmallScreen)&&e(o)}),U(e,r)},h=e=>{var t=H(),n=P(t),l=e=>{dH(e,{children:(e,t)=>{var n=_et(),r=F(n,!0);R(e=>W(r,e),[()=>Y(`loading`)]),U(e,n)},$$slots:{default:!0}})},d=e=>{{let t=A(()=>Y(`file_not_found`));w5(e,{get message(){return z(t)},get backPath(){return z(u)}})}},f=e=>{y9e(e,{get kind(){return z(a)},get name(){return z(o)},get type(){return z(c)},get src(){return z(s)},getText:()=>W2(z(i)).then(e=>e.text())})};G(n,e=>{z(r)?!z(i)||!z(a)?e(d,1):e(f,-1):e(l)}),U(e,t)},g=e=>{var t=H(),n=P(t),r=e=>{met(e,{get asset(){return z(i)}})};G(n,e=>{z(i)&&e(r)}),U(e,t)},_=A(()=>z(i)?.id),v=A(()=>z(f)?()=>m(z(f),`previous`):void 0),y=A(()=>z(p)?()=>m(z(p),`next`):void 0);F9e(e,{get title(){return z(o)},get contentKey(){return z(_)},onBack:()=>{S0(z(u))},get onPrevious(){return z(v)},get onNext(){return z(y)},actions:t,editOptions:d,preview:h,info:g,$$slots:{actions:!0,editOptions:!0,preview:!0,info:!0}})}k()}var yet=new Set([`$$slots`,`$$events`,`$$legacy`,`children`]),bet=B(`<div><!></div>`),xet={hash:`svelte-1sdsl2g`,code:`.list-container.svelte-1sdsl2g {--icon-size: 36px;flex:auto;position:relative;height:100%;overflow-x:hidden;overflow-y:auto;overscroll-behavior-y:contain;}`};function T5(e,t){K(e,xet);let n=J(t,`children`,3,void 0),r=vs(t,yet);var i=bet();fs(i,()=>({role:`group`,class:`list-container`,...r}),void 0,void 0,void 0,`svelte-1sdsl2g`),xo(N(i),()=>n()??Cr),D(i),U(e,i)}var Cet=new Set([`$$slots`,`$$events`,`$$legacy`,`viewType`,`aria-label`,`scrollKey`,`children`]),wet=B(`<div role="none"><!></div>`),Tet={hash:`svelte-1sfbolp`,code:`:is(.grid-view.svelte-1sfbolp, .list-view.svelte-1sfbolp, .table-view.svelte-1sfbolp) {display:block;padding:0 16px 16px;height:100%;overflow-y:auto;}.grid-view.svelte-1sfbolp {
@media (width < 768px) {padding:4px;
}.row-group-caption {display:block;grid-column:1 / -1; /* span the entire row */th {display:block;}}.row-group:not(:first-child) .row-group-caption {margin-top:16px;}.grid-body {display:grid;grid-template-columns:repeat(auto-fill, minmax(var(--grid-size, 200px), 1fr));gap:16px;border-width:0;
@media (width < 768px) {grid-template-columns:repeat(auto-fill, minmax(var(--grid-size, 160px), 1fr));gap:8px;
}}.grid-row {display:block;position:relative;overflow:hidden;height:auto;text-align:start;.grid-cell {display:block;&.image:empty {aspect-ratio:1 / 1;}}.checkbox {position:absolute;inset-block-start:4px;inset-inline-start:4px;z-index:2;}.title {.label {overflow:hidden;margin:12px;height:calc(var(--sui-line-height-compact) * 2);line-height:var(--sui-line-height-compact);}}
/* Editorial Workflow status, shown below the title on a tile */.status {margin:-4px 12px 12px;}&[tabindex] {border-radius:var(--sui-control-large-border-radius);background-color:var(--sui-secondary-background-color);cursor:pointer;transition:background-color 200ms;&:is(:hover, :focus, :active) {background-color:var(--sui-hover-background-color);}}}}:is(.list-view.svelte-1sfbolp, .table-view.svelte-1sfbolp) {
@media (width < 768px) {padding:0;
}[role='grid'] {
@media (width < 768px) {width:100%;--sui-focus-ring-width: 0;
}.row-group {.row-group-caption + .grid-row {.grid-cell {border-top-width:0 !important;}}.row-group-caption ~ .grid-row:last-child {.grid-cell {border-bottom-width:0 !important;}}}.grid-row {transition-property:background-color, outline-color;transition-duration:200ms;&[tabindex] {cursor:pointer;}&:hover {background-color:var(--sui-hover-background-color);}&:last-child .grid-cell {border-width:1px 0;}}.grid-cell {overflow:hidden;border-width:1px 0 0;border-color:var(--sui-secondary-border-color);padding:0 16px 0 0;height:40px;max-width:100%;color:var(--sui-secondary-foreground-color);white-space:nowrap;vertical-align:middle;
@media (width < 768px) {border-width:0 !important;height:64px;
}&.checkbox {padding-inline-start:8px !important;width:44px;}&.title {width:100%; /* flex: auto */color:var(--sui-primary-foreground-color);}
/*
* The column is as wide as the widest Editorial Workflow status badge, so align the
* badges to the end of the row rather than letting the narrower ones float mid-column
*/&.status {text-align:end;}&:first-child {padding-inline-start:16px;}.label {overflow:hidden;
@media (width < 768px) {white-space:normal;line-height:var(--sui-line-height-compact);
}}&.image {width:48px;&:empty::before {display:block;border-radius:var(--sui-control-medium-border-radius);width:var(--icon-size);height:var(--icon-size);background-color:var(--sui-secondary-background-color);content:'';}}}}}
/* The table view is a list view with more columns, only shown on a large screen */.table-view.svelte-1sfbolp {[role='grid'] {
/* The header row can be focused, but it doesn’t open anything */.grid-head .grid-row {cursor:default;&:hover {background-color:transparent;}}.grid-col-header {position:sticky;inset-block-start:0;z-index:1;border-bottom:1px solid var(--sui-secondary-border-color);padding:0 16px 0 0;height:40px;background-color:var(--sui-primary-background-color);color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);font-weight:var(--sui-font-weight-bold);text-align:start;white-space:nowrap;vertical-align:middle;&:first-child {padding-inline-start:16px;}}
/* Each column is as wide as its content, up to a limit; the text is truncated beyond */.grid-cell.title {width:auto;.label {width:max-content;min-width:160px;max-width:400px;}}.grid-cell.column .label {width:max-content;max-width:320px;}
/* The last column takes up the rest of the width, so the others are as wide as their
content */:is(.grid-cell, .grid-col-header).status {width:100%;}}}`};function E5(e,t){O(t,!0),K(e,Tet);let n=J(t,`aria-label`,3,void 0),r=J(t,`scrollKey`,3,void 0),i=J(t,`children`,3,void 0),a=vs(t,Cet),o;L(()=>{r(),o&&(o.scrollTop=0)});var s=wet();Do(N(s),Iu,null,e=>{wpe(e,ys({multiple:!0,clickToSelect:!1,get ariaLabel(){return n()}},()=>a,{children:(e,t)=>{var n=H();xo(P(n),()=>i()??Cr),U(e,n)},$$slots:{default:!0}}))}),D(s),qo(s,()=>e=>{o=e}),R(()=>$o(s,1,`${t.viewType??``}-view`,`svelte-1sfbolp`)),U(e,s),k()}var Eet=B(`<!> <!>`,1),Det=B(`<span role="none"> </span> <!>`,1),Oet={hash:`svelte-1lyfhki`,code:`
/* Keep the compact folder tiles apart from the asset tiles below them */.grid-view .grid-body.subfolders:not(:last-child) {margin-bottom:16px;}`};function ket(e,t){O(t,!0),K(e,Oet);let n=J(t,`onBlankClick`,3,void 0),r=J(t,`subfolders`,3,void 0),i=J(t,`hasSubfolders`,3,!1),a=J(t,`emptyAction`,3,void 0),o=A(()=>Object.values(t.groups).some(e=>e.length));{let s=A(()=>Y(`asset_list`));T5(e,{get"aria-label"(){return z(s)},onclick:e=>{e.target.closest(`[role="row"], button, [role="menu"]`)||n()?.()},children:(e,n)=>{z0(e,{get disabled(){return t.uploadDisabled},multiple:!0,onDrop:({files:e})=>{t.onDrop(e)},children:(e,n)=>{var s=H(),c=P(s),l=e=>{{let n=A(()=>Y(`assets`));E5(e,{id:`asset-list`,get viewType(){return t.viewType},get"aria-label"(){return z(n)},get"aria-rowcount"(){return t.totalCount},children:(e,n)=>{var a=Eet(),o=P(a),s=e=>{zS(e,{class:`subfolders`,children:(e,t)=>{var n=H();xo(P(n),()=>r()??Cr),U(e,n)},$$slots:{default:!0}})};G(o,e=>{i()&&e(s)}),No(I(o,2),17,()=>Object.entries(t.groups),([e,t])=>e,(e,n)=>{var r=A(()=>Er(z(n),2));let i=()=>z(r)[0],a=()=>z(r)[1];var o=H();Do(P(o),Iu,null,e=>{{let n=A(()=>i()===`*`?void 0:qW(i())),r=A(()=>i()!==`*`),o=A(()=>!nG(R1.current,i()));zS(e,{get label(){return z(n)},get collapsible(){return z(r)},get expanded(){return z(o)},onChange:({detail:{expanded:e}})=>{R1.current=iG(R1.current,i(),!e)},children:(e,n)=>{tC(e,{get items(){return a()},get itemKey(){return t.itemKey},get renderItem(){return t.renderItem}})},$$slots:{default:!0}})}}),U(e,o)}),U(e,a)},$$slots:{default:!0}})}},u=e=>{dH(e,{children:(e,n)=>{var r=Det(),i=P(r),o=F(i,!0),s=I(i,2),c=e=>{var t=H();xo(P(t),()=>a()??Cr),U(e,t)};G(s,e=>{t.uploadDisabled||e(c)}),R(e=>W(o,e),[()=>Y(`no_files_found`)]),U(e,r)},$$slots:{default:!0}})};G(c,e=>{z(o)||i()?e(l):e(u,-1)}),U(e,s)},$$slots:{default:!0}})},$$slots:{default:!0}})}k()}var Aet=B(`<bdi> </bdi>`),jet=B(`<div role="none" class="label svelte-17zk54k"><!></div>`),Met=B(`<!> <!>`,1),Net=B(`<!> <!> <!>`,1),Pet={hash:`svelte-17zk54k`,code:`.label.svelte-17zk54k {word-break:break-all;}`};function Fet(e,t){O(t,!0),K(e,Pet);let n=J(t,`asset`,3,void 0),r=J(t,`src`,3,void 0),i=J(t,`status`,3,void 0),a=()=>{t.canPreview&&t.onPreview()};{let o=A(()=>t.rowIndex>=0?t.rowIndex+1:void 0);US(e,{get"aria-rowindex"(){return z(o)},get"aria-label"(){return t.name},onChange:e=>{t.onSelectionChange(e.detail.selected)},get onfocus(){return t.onFocus},onclick:e=>{FY(e)&&a()},ondblclick:a,children:(e,a)=>{var o=Net(),s=P(o),c=e=>{VS(e,{class:`checkbox`,children:(e,n)=>{{let n=A(()=>Y(`select_item`,{values:{name:t.name}}));vS(e,{tabindex:`-1`,get ariaLabel(){return z(n)},get checked(){return t.selected},onChange:({detail:{checked:e}})=>{t.onSelectionChange(e)}})}},$$slots:{default:!0}})};G(s,e=>{PY.isSmallScreen||PY.isMediumScreen||e(c)});var l=I(s,2);VS(l,{class:`image`,children:(e,i)=>{{let i=A(()=>r()?t.name:``),a=A(()=>t.viewType===`list`?`icon`:`tile`),o=A(()=>t.kind===`image`);k0(e,{get kind(){return t.kind},get asset(){return n()},get src(){return r()},get alt(){return z(i)},get variant(){return z(a)},get cover(){return PY.isSmallScreen},get checkerboard(){return z(o)}})}},$$slots:{default:!0}});var u=I(l,2),d=e=>{var n=Met(),r=P(n);VS(r,{class:`title`,children:(e,n)=>{var r=jet();Nx(N(r),{lines:2,children:(e,n)=>{var r=Aet(),i=F(r,!0);R(()=>W(i,t.name)),U(e,r)},$$slots:{default:!0}}),D(r),U(e,r)},$$slots:{default:!0}});var a=I(r,2),o=e=>{VS(e,{class:`status`,children:(e,t)=>{var n=H();xo(P(n),i),U(e,n)},$$slots:{default:!0}})};G(a,e=>{i()&&e(o)}),U(e,n)};G(u,e=>{PY.isSmallScreen&&t.viewType!==`list`||e(d)}),U(e,o)},$$slots:{default:!0}})}k()}var Iet=B(`<span role="none" class="badge svelte-57ciq1"> </span>`),Let={hash:`svelte-57ciq1`,code:`
/*
* Filled pill following the same background/foreground/border recipe as the Alert and Infobar
* components, so the colors adapt to both the light and dark themes.
*/.badge.svelte-57ciq1 {display:inline-block;border-width:1px;border-style:solid;border-radius:12px;border-color:var(--sui-error-border-color);padding:1px 6px;background-color:var(--sui-error-background-color);color:var(--sui-error-foreground-color);font-size:var(--sui-font-size-x-small);line-height:var(--sui-line-height-compact);white-space:nowrap;}`};function Ret(e,t){O(t,!0),K(e,Let);var n=Iet(),r=F(n,!0);R(e=>W(r,e),[()=>Y(`file_unavailable`)]),U(e,n),k()}function zet(e,t){O(t,!0);let n=e=>{var t=H(),n=P(t),r=e=>{Ret(e,{})};G(n,e=>{z(a)&&e(r)}),U(e,t)},r=A(()=>lBe.current.has(t.asset.id)),i=A(()=>g1.current?.serviceId===`linked`),a=A(()=>o1.current[t.asset.id]===!1),o=A(()=>v1(g1.current)&&!$2.current?t.asset.description:t.asset.fileName),s=()=>{let e=g1.current;e&&x0(p1(e,t.asset),{transitionType:`forwards`})},c=e=>{O1.current=Hb(O1.current,t.asset,e,(e,t)=>e.id===t.id)};{let a=A(()=>iUe.current.get(t.asset.id)??-1),l=A(()=>m1(t.asset)),u=A(()=>z(i)?n:void 0);Fet(e,{get name(){return z(o)},get kind(){return t.asset.kind},get src(){return t.asset.previewURL},get rowIndex(){return z(a)},get viewType(){return t.viewType},get selected(){return z(r)},get canPreview(){return z(l)},onSelectionChange:c,onFocus:()=>{k1.current=t.asset,x1.current=void 0},onPreview:()=>{s()},get status(){return z(u)}})}k()}var Bet=B(`<div role="none" class="preview svelte-g07uie"><!></div>`),Vet=B(`<bdi> </bdi>`),Het=B(`<!> <!>`,1),Uet=B(`<div role="none" class="menu svelte-g07uie"><!></div>`),Wet=B(`<div role="none" class="title-inner svelte-g07uie"><div role="none" class="label svelte-g07uie"><!></div> <!></div>`),Get=B(`<!> <!> <!>`,1),Ket={hash:`svelte-g07uie`,code:`.preview.svelte-g07uie {display:inline-flex;align-items:center;justify-content:center;color:var(--sui-secondary-foreground-color);.sui.icon {font-size:24px;}}.title-inner.svelte-g07uie {display:flex;align-items:center;gap:8px;}.label.svelte-g07uie {flex:auto;min-width:0;word-break:break-all;}.menu.svelte-g07uie {flex:none;}
/* A folder is a compact tile in the grid view, with the icon, the name and the menu in a row,
unlike an asset, which needs the room for its thumbnail. The selectors are specific enough to
win over the tile styles of the listing grid */.grid-view .grid-body .grid-row.subfolder {display:flex;align-items:center;gap:12px;padding:8px 8px 8px 16px;.grid-cell.image {flex:none;display:flex;aspect-ratio:auto;}.grid-cell.title {flex:auto;min-width:0;.label {margin:0;height:auto;}}}.list-view .grid-body .grid-row.subfolder {
/* The icon sits in a box the size of an asset thumbnail, so the two line up */.preview {width:var(--icon-size);height:var(--icon-size);}.grid-cell.title {padding-inline-end:8px;}}`};function qet(e,t){O(t,!0),K(e,Ket);let n=J(t,`hasCheckboxColumn`,3,!1),r=J(t,`onFocus`,3,void 0),i=J(t,`onRename`,3,void 0),a=J(t,`onDelete`,3,void 0),o=J(t,`actionsDisabled`,3,!1),s=e=>{e.stopPropagation()};{let c=A(()=>t.rowIndex+1),l=A(()=>Y(`folder`));US(e,{class:`subfolder`,get"aria-rowindex"(){return z(c)},get"aria-label"(){return t.subfolder.name},get"aria-description"(){return z(l)},onfocus:()=>{r()?.()},onclick:e=>{FY(e)&&t.onOpen()},get ondblclick(){return t.onOpen},children:(e,r)=>{var c=Get(),l=P(c),u=e=>{VS(e,{class:`checkbox`})};G(l,e=>{t.viewType===`list`&&n()&&e(u)});var d=I(l,2);VS(d,{class:`image`,children:(e,t)=>{var n=Bet();gx(N(n),{name:`folder`}),D(n),U(e,n)},$$slots:{default:!0}}),VS(I(d,2),{class:`title`,children:(e,n)=>{var r=Wet(),c=N(r),l=N(c);{let e=A(()=>t.viewType===`list`?1:2);Nx(l,{get lines(){return z(e)},children:(e,n)=>{var r=Vet(),i=F(r,!0);R(()=>W(i,t.subfolder.name)),U(e,r)},$$slots:{default:!0}})}D(c);var u=I(c,2),d=e=>{var t=Uet(),n=N(t);{let e=e=>{{let t=A(()=>Y(`folder_options`));qS(e,{get ariaLabel(){return z(t)},children:(e,t)=>{var n=Het(),r=P(n),s=e=>{{let t=A(()=>Y(`rename`)),n=A(()=>Y(`rename_folder`));JS(e,{variant:`ghost`,get label(){return z(t)},get"aria-label"(){return z(n)},get disabled(){return o()},get onclick(){return i()}})}};G(r,e=>{i()&&e(s)});var c=I(r,2),l=e=>{{let t=A(()=>Y(`delete`)),n=A(()=>Y(`delete_folder`));JS(e,{variant:`ghost`,get label(){return z(t)},get"aria-label"(){return z(n)},get disabled(){return o()},get onclick(){return a()}})}};G(c,e=>{a()&&e(l)}),U(e,n)},$$slots:{default:!0}})}},t=A(()=>Y(`show_folder_options`));hS(n,{variant:`ghost`,iconic:!0,size:`small`,popupPosition:`bottom-right`,get"aria-label"(){return z(t)},popup:e,$$slots:{popup:!0}})}D(t),so(`click`,t,s),so(`dblclick`,t,s),U(e,t)};G(u,e=>{(i()||a())&&e(d)}),D(r),U(e,r)},$$slots:{default:!0}}),U(e,c)},$$slots:{default:!0}})}k()}co([`click`,`dblclick`]);function Jet(e,t){O(t,!0);let n=A(()=>g1.current),r=A(()=>!!z(n).move&&!!z(n).createFolder&&!!z(n).deleteFolder),i=A(()=>!!z(n).delete&&!!z(n).deleteFolder);{let n=A(()=>!(PY.isSmallScreen||PY.isMediumScreen)),a=A(()=>z(r)?()=>{C1.current=t.subfolder}:void 0),o=A(()=>z(i)?()=>{w1.current=t.subfolder}:void 0);qet(e,{get subfolder(){return t.subfolder},get rowIndex(){return t.rowIndex},get viewType(){return t.viewType},get hasCheckboxColumn(){return z(n)},onOpen:()=>{I1(t.subfolder.path)},onFocus:()=>{x1.current=t.subfolder,k1.current=void 0},get onRename(){return z(a)},get onDelete(){return z(o)}})}k()}function Yet(e,t){O(t,!0);let n=J(t,`label`,3,void 0),r=J(t,`disabled`,3,!1);{let i=e=>{gx(e,{name:`cloud_upload`})},a=A(()=>!n()),o=A(()=>Y(`upload_assets`));Xx(e,{variant:`primary`,get iconic(){return z(a)},get disabled(){return r()},get label(){return n()},get"aria-label"(){return z(o)},get onclick(){return t.onclick},startIcon:i,$$slots:{startIcon:!0}})}k()}var Xet=B(`<!> <!>`,1);function Zet(e,t){O(t,!0);let n=J(t,`label`,3,void 0),r=j(void 0),i=A(()=>g1.current),a=A(()=>!z(i)?.upload||!F1(z(i)));var o=Xet(),s=P(o);Yet(s,{get label(){return n()},get disabled(){return z(a)},onclick:()=>{z(r)?.open()}}),gs(RS(I(s,2),{multiple:!0,onSelect:({files:e})=>{R2.current={files:e}}}),e=>M(r,e,!0),()=>z(r)),U(e,o),k()}var Qet=B(`<span role="alert"> </span>`);function $et(e,t){O(t,!0);let n=A(()=>g1.current),r=A(()=>R1.current.type),i=A(()=>!z(n).upload),a=A(()=>e4.current.length);var o=H(),s=P(o),c=e=>{{let t=A(()=>Y(`asset_list`));T5(e,{get"aria-label"(){return z(t)},children:(e,t)=>{var r=H(),i=P(r),a=e=>{Eq(e,{onSelect:()=>void 0})};G(i,e=>{z(n).serviceId===`cloudinary`&&e(a)}),U(e,r)},$$slots:{default:!0}})}},l=e=>{{let t=A(()=>Y(`asset_list`));T5(e,{get"aria-label"(){return z(t)},children:(e,t)=>{{let t=A(()=>E1.current?Y(`assets_dialog.error.${E1.current}`):void 0);N0(e,{get serviceProps(){return z(n)},get error(){return z(t)}})}},$$slots:{default:!0}})}},u=A(()=>!F1(z(n))||E1.current),d=e=>{{let t=A(()=>Y(`asset_list`));T5(e,{get"aria-label"(){return z(t)},children:(e,t)=>{dH(e,{children:(e,t)=>{var n=Qet(),r=F(n,!0);R(e=>W(r,e),[()=>Y(`loading`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}})}},f=e=>{{let t=e=>{var t=H();No(P(t),19,()=>e4.current,e=>e.path,(e,t,n)=>{Jet(e,{get subfolder(){return z(t)},get rowIndex(){return z(n)},get viewType(){return z(r)}})}),U(e,t)},n=(e,t=Cr)=>{zet(e,{get asset(){return t()},get viewType(){return z(r)}})},o=e=>{{let t=A(()=>Y(`upload_assets`));Zet(e,{get label(){return z(t)}})}},s=A(()=>z(a)+t4.current.length),c=A(()=>!!z(a));ket(e,{get groups(){return n4.current},itemKey:`id`,get totalCount(){return z(s)},get hasSubfolders(){return z(c)},get viewType(){return z(r)},get uploadDisabled(){return z(i)},onDrop:e=>{R2.current={files:e}},onBlankClick:()=>{k1.current=void 0,x1.current=void 0},subfolders:t,renderItem:n,emptyAction:o,$$slots:{subfolders:!0,renderItem:!0,emptyAction:!0}})}};G(s,e=>{z(n).authType===`widget`?e(c):z(u)?e(l,1):_1.current?e(f,-1):e(d,2)}),U(e,o),k()}function ett(e,t){O(t,!0);let n=A(()=>w1.current),r=A(()=>!!z(n)),i=A(()=>z(n)?.name??``),a=A(()=>z(n)?K2(z(n).path).length:0);{let t=A(()=>Y(`delete_folder`)),o=A(()=>Y(`delete`));wS(e,{get title(){return z(t)},get okLabel(){return z(o)},onOk:()=>{z(n)&&PHe(z(n))},onClose:()=>{w1.current=void 0},get open(){return z(r)},set open(e){M(r,e)},children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(`confirm_deleting_folder`,{values:{name:z(i),count:z(a)}})]),U(e,n)},$$slots:{default:!0}})}k()}var ttt=e=>{var t=ntt();gx(N(t),{name:`folder`}),D(t),U(e,t)},ntt=B(`<div role="none" class="folder-preview svelte-mzxrkp"><!></div>`),rtt=B(`<section><h4> </h4> <p><bdi dir="ltr"> </bdi></p></section>`),itt=B(`<p> </p>`),att=B(`<section><h4> </h4> <p><bdi> </bdi></p></section> <!> <section><h4> </h4> <!> <p> </p></section>`,1),ott={hash:`svelte-mzxrkp`,code:`.folder-preview.svelte-mzxrkp {display:flex;align-items:center;justify-content:center;height:100%;color:var(--sui-secondary-foreground-color);.sui.icon {font-size:96px;}}`};function stt(e,t){O(t,!0),K(e,ott);let n=J(t,`path`,3,void 0),r=J(t,`folderCount`,3,void 0);C5(e,{get preview(){return ttt},children:(e,i)=>{var a=att(),o=P(a),s=N(o),c=F(s,!0),l=I(s,2),u=F(N(l),!0);D(l),D(o);var d=I(o,2),f=e=>{var t=rtt(),r=N(t),i=F(r,!0),a=I(r,2),o=N(a),s=F(o,!0);D(a),D(t),R(e=>{W(i,e),W(s,`/${n()}`),o.dir=o.dir},[()=>Y(`folder_path`)]),U(e,t)};G(d,e=>{n()!==void 0&&e(f)});var p=I(d,2),m=N(p),h=F(m,!0),g=I(m,2),_=e=>{var t=itt(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`x_folders`,{values:{count:r()}})]),U(e,t)};G(g,e=>{r()!==void 0&&e(_)});var v=F(I(g,2),!0);D(p),R((e,n,r)=>{W(c,e),W(u,t.name),W(h,n),W(v,r)},[()=>Y(`folder`),()=>Y(`folder_contents`),()=>Y(`x_assets`,{values:{count:t.assetCount}})]),U(e,a)},$$slots:{default:!0}}),k()}function ctt(e,t){O(t,!0);let n=A(()=>rUe.current);stt(e,{get name(){return z(n).name},get path(){return z(n).path},get folderCount(){return z(n).folderCount},get assetCount(){return z(n).assetCount}}),k()}function ltt(e,t){O(t,!0);let n=A(()=>g1.current),r=A(()=>vJ({subfolders:e4.current,fileNames:t4.current.map(({fileName:e})=>e)})),i=A(()=>$He({dirPath:b1.current,serviceLabel:z(n).serviceLabel}));{let t=A(()=>Y(`new_folder`)),n=A(()=>Y(`new_folder_create`)),a=A(()=>Y(`new_folder_description`,{values:{folder:z(i)}}));FJ(e,{get title(){return z(t)},get okLabel(){return z(n)},get description(){return z(a)},get takenNames(){return z(r)},onSubmit:e=>{MHe(e)},get open(){return S1.current},set open(e){S1.current=e}})}k()}function utt(e,t){O(t,!0);var n=H(),r=P(n),i=e=>{_3(e,{onclick:()=>{S1.current=!0}})};G(r,e=>{$2.current&&g1.current?.createFolder&&e(i)}),U(e,n),k()}function dtt(e,t){O(t,!0);let n=J(t,`path`,3,void 0),r=J(t,`disabled`,3,!1),i=J(t,`state`,3,void 0);{let t=A(()=>r()||!n()),a=A(()=>Y(`preview`)),o=A(()=>Y(`show_preview`));Xx(e,{variant:`ghost`,get disabled(){return z(t)},get label(){return z(a)},get"aria-label"(){return z(o)},onclick:()=>{x0(n(),{transitionType:`forwards`,state:i()})}})}k()}var ftt=B(`<bdi class="svelte-1okrlal"> </bdi>`),ptt=B(`<!> <h2 role="none" class="svelte-1okrlal"><!></h2> <!> <!>`,1),mtt={hash:`svelte-1okrlal`,code:`
/* Two floating buttons — New Folder and Upload — sit side by side on a small screen */.asset-library-toolbar .floating-action-button-wrapper {
@media (width < 768px) {display:flex;gap:12px;
}}h2.svelte-1okrlal {
/* A long name is cut short rather than wrapped, so the toolbar stays one line tall */& > bdi:where(.svelte-1okrlal) {overflow:hidden;min-width:0;white-space:nowrap;text-overflow:ellipsis;}
/* An ancestor folder in the breadcrumb reads as part of the heading, only dimmed to tell it
from the current folder. The class is repeated to make the selectors specific enough to exempt
the labels and the separators from the small type the toolbar gives any \`<span>\` in the
heading, which is a rule with a scoping class of its own */.breadcrumb.breadcrumb.breadcrumb {
/* Take the whole heading, so the trail is measured against the room it can actually use */flex:auto;font-size:inherit;.sui.button.crumb .label,
.sui.icon.separator,
span.current {font-size:inherit;opacity:1;}.sui.button.crumb .label {font-weight:var(--sui-font-weight-normal, normal);}span.current {font-weight:inherit;}}}`};function htt(e,t){O(t,!0),K(e,mtt);let n=J(t,`subfolderNames`,19,()=>[]),r=J(t,`actions`,3,void 0),i=J(t,`fab`,3,void 0),a=A(()=>n().at(-1)??t.rootLabel),o=A(()=>xJ({rootLabel:t.rootLabel,subfolderNames:n(),onBrowse:({depth:e})=>{t.onBrowse(e,!1)}}));{let s=A(()=>Y(`folder`));IV(e,{variant:`primary`,class:`asset-library-toolbar`,get ariaLabel(){return z(s)},children:(e,s)=>{var c=ptt(),l=P(c),u=e=>{{let r=A(()=>Y(n().length?`back_to_parent_folder`:`back_to_asset_folder_list`));x5(e,{get"aria-label"(){return z(r)},onclick:()=>{n().length?t.onBrowse(n().length-1,!0):S0(`/assets`)}})}};G(l,e=>{PY.isSmallScreen&&e(u)});var d=I(l,2),f=N(d),p=e=>{Aq(e,{get items(){return z(o)}})},m=e=>{var t=ftt(),n=F(t,!0);R(()=>W(n,z(a))),U(e,t)};G(f,e=>{!PY.isSmallScreen&&z(o).length?e(p):e(m,-1)}),D(d);var h=I(d,2),g=e=>{var t=H();xo(P(t),()=>r()??Cr),U(e,t)};G(h,e=>{PY.isSmallScreen||PY.isMediumScreen||e(g)}),Qx(I(h,2),{children:(e,t)=>{var n=H();xo(P(n),()=>i()??Cr),U(e,n)},$$slots:{default:!0}}),U(e,c)},$$slots:{default:!0}})}k()}var gtt=B(`<!> <!> <!> <!> <!>`,1),_tt=B(`<!> <!>`,1);function vtt(e,t){O(t,!0);let n=A(()=>g1.current),r=A(()=>k1.current),i=A(()=>$2.current&&b1.current?b1.current.split(`/`):[]),a=A(()=>uBe.current);htt(e,{get rootLabel(){return z(n).serviceLabel},get subfolderNames(){return z(i)},onBrowse:e=>{I1(z(i).slice(0,e).join(`/`))},actions:e=>{var t=gtt(),i=P(t);{let e=A(()=>z(r)?p1(z(n),z(r)):void 0),t=A(()=>!z(r)||!m1(z(r)));dtt(i,{get path(){return z(e)},get disabled(){return z(t)}})}var o=I(i,2);{let e=A(()=>z(r)?[z(r)]:[]);H9e(o,{get assets(){return z(e)}})}var s=I(o,2);S5(s,{get assets(){return z(a)},getName:e=>e.fileName,get getBlob(){return W2}});var c=I(s,2),l=e=>{b5(e,{get assets(){return z(a)},get deleteAssets(){return kHe},get listedCount(){return t4.current.length}})};G(c,e=>{z(n).delete&&e(l)});var u=I(c,2),d=e=>{q9e(e,{get asset(){return z(r)}})};G(u,e=>{(z(n).rename||z(n).replace)&&e(d)}),U(e,t)},fab:e=>{var t=_tt(),r=P(t);utt(r,{});var i=I(r,2),a=e=>{{let t=A(()=>PY.isSmallScreen?void 0:Y(`upload`));Zet(e,{get label(){return z(t)}})}};G(i,e=>{z(n).upload&&(!PY.isSmallScreen||_1.current?.length)&&e(a)}),U(e,t)},$$slots:{actions:!0,fab:!0}}),k()}var ytt=B(`<!> <!>`,1);function btt(e,t){O(t,!0);let n=J(t,`open`,15,!1),r=J(t,`folderNames`,19,()=>[]),i=J(t,`fileNames`,19,()=>[]),a=J(t,`usedEntryCount`,3,0),o=J(t,`warning`,3,void 0),s=J(t,`blockedMessage`,3,void 0),c=J(t,`slugificationEnabled`,3,!1),l=J(t,`onClose`,3,void 0),u=A(()=>Y(`rename_x`,{values:{name:t.name}})),d=j(!1),f=j(void 0),p=!1,m=j(``),h=A(()=>Uc(t.name)),g=A(()=>z(h).extension),_=A(()=>z(m).trim()),v=A(()=>z(_)?IQ(z(_),{slugificationEnabled:c()}):``),y=A(()=>Uc(z(v)).extension),b=A(()=>!Ql(z(g),z(y))),x=A(()=>CRe({name:z(_),fileName:z(v),otherNames:t.otherNames,folderNames:r(),fileNames:i()})),S=A(()=>!!z(x)),C=async()=>{await Za(),z(f)&&(z(f).focus(),z(f).setSelectionRange(0,Uc(z(f).value).filename.length))};L(()=>{n()&&(p||M(m,t.name,!0),p=!1)}),L(()=>{V1.current||(n(!1),M(d,!1),l()?.())});var w=ytt(),T=P(w);{let e=A(()=>Y(`rename`)),r=A(()=>!!s()||z(v)===t.name||z(S)),i=A(()=>Y(`enter_new_name_for_asset`,{values:{count:a()}})),c=A(()=>!z(S)&&z(v)!==z(_)?Y(`file_will_be_saved_as`,{values:{name:z(v)}}):void 0),p=A(()=>z(S)?Y(`enter_new_name_for_asset_error.${z(x)}`):void 0);PJ(T,{get title(){return z(u)},get okLabel(){return z(e)},get okDisabled(){return z(r)},onOk:()=>{z(b)?M(d,!0):t.onRename(z(v))},onClose:()=>{z(d)||l()?.()},onOpen:()=>{C()},get description(){return z(i)},get warning(){return o()},get blockedMessage(){return s()},get ariaLabel(){return z(u)},get note(){return z(c)},get error(){return z(p)},get open(){return n()},set open(e){n(e)},get value(){return z(m)},set value(e){M(m,e,!0)},get element(){return z(f)},set element(e){M(f,e,!0)}})}var ee=I(T,2);{let e=A(()=>Y(`rename`));jYe(ee,{get oldExtension(){return z(g)},get newExtension(){return z(y)},get okLabel(){return z(e)},onOk:()=>{t.onRename(z(v)),l()?.()},onCancel:()=>{p=!0,n(!0)},get open(){return z(d)},set open(e){M(d,e,!0)}})}U(e,w),k()}function xtt(e,t){O(t,!0);let n=A(()=>M1.current),r=A(()=>!!z(n)),i=A(()=>Uc(z(n)?.id??``)),a=A(()=>z(i).dirname),o=A(()=>_1.current??[]),s=A(()=>z(o).filter(e=>e.id!==z(n)?.id&&Uc(e.id).dirname===z(a)).map(e=>e.fileName)),c=j(0),l=async e=>{if(M(c,0),!e)return;let t=await a1(e);z(n)===e&&M(c,t.length,!0)};L(()=>{l(z(n))});let u=async e=>{let t=g1.current;if(!z(n)||!t)return;let r=z(n).id,i=await AHe(z(n),e);i&&j1.current===r&&(j1.current=i.id,await x0(p1(t,i),{replaceState:!0,notifyChange:!1}))};{let t=A(()=>z(n)?.fileName??``),i=A(()=>z(c)?Y(`renaming_external_asset_breaks_links`,{values:{count:z(c)}}):void 0);btt(e,{get name(){return z(t)},get otherNames(){return z(s)},get warning(){return z(i)},onRename:u,onClose:()=>{M1.current=void 0},get open(){return z(r)},set open(e){M(r,e)}})}k()}function Stt(e,t){O(t,!0);let n=A(()=>C1.current),r=A(()=>!!z(n)),i=A(()=>z(n)?.name??``),a=A(()=>z(n)?K2(z(n).path):[]),o=j(0),s=async e=>{M(o,0);let t=await Qze(e);z(a)===e&&M(o,t.length,!0)};L(()=>{s(z(a))});let c=A(()=>vJ({subfolders:e4.current,fileNames:t4.current.map(({fileName:e})=>e),exclude:z(i)}));{let t=A(()=>Y(`rename_x`,{values:{name:z(i)}})),s=A(()=>Y(`rename`)),l=A(()=>Y(`enter_new_name_for_external_folder`,{values:{count:z(a).length}})),u=A(()=>z(o)?Y(`renaming_external_folder_breaks_links`,{values:{count:z(o)}}):void 0);FJ(e,{get title(){return z(t)},get okLabel(){return z(s)},get description(){return z(l)},get warning(){return z(u)},get name(){return z(i)},get takenNames(){return z(c)},onSubmit:e=>{z(n)&&NHe(z(n),e)},onClose:()=>{C1.current=void 0},get open(){return z(r)},set open(e){M(r,e)}})}k()}var Ctt=B(`<span role="none"> </span>`);function wtt(e,t){O(t,!0);let n=J(t,`fallback`,3,void 0);var r=H(),i=P(r),a=e=>{{let r=A(()=>Y(`asset_info`));fH(e,{id:`asset-info`,class:`secondary-sidebar`,get ariaLabel(){return z(r)},children:(e,r)=>{var i=H(),a=P(i),o=e=>{var n=H();xo(P(n),()=>t.children,()=>t.asset),U(e,n)},s=e=>{var t=H();xo(P(t),n),U(e,t)},c=e=>{dH(e,{children:(e,t)=>{var n=Ctt(),r=F(n,!0);R(e=>W(r,e),[()=>Y(`select_asset_show_info`)]),U(e,n)},$$slots:{default:!0}})};G(a,e=>{t.asset?e(o):n()?e(s,1):e(c,-1)}),U(e,i)},$$slots:{default:!0}})}};G(i,e=>{PY.isLargeScreen&&R1.current.showInfo&&e(a)}),U(e,r),k()}var Ttt=B(`<!> <!>`,1);function Ett(e,t){O(t,!0);let n=J(t,`currentView`,7),r=J(t,`noneLabel`,3,``),i=J(t,`options`,19,()=>[]),a=A(()=>n().current[t.viewKey]);var o=Ttt(),s=P(o);{let e=A(()=>r()||Y(`sort_keys.none`)),i=A(()=>!z(a));XS(s,{get label(){return z(e)},get checked(){return z(i)},onSelect:()=>{n().current={...n().current,[t.viewKey]:t.noneValue}}})}No(I(s,2),17,i,e=>KW(WW(e)),(e,r)=>{let i=A(()=>WW(z(r)));{let o=A(()=>!!z(a)&&KW(z(a))===KW(z(i)));XS(e,{get label(){return z(r).label},get checked(){return z(o)},onSelect:()=>{n().current={...n().current,[t.viewKey]:z(i)}}})}}),U(e,o),k()}function Dtt(e,t){O(t,!0);let n=J(t,`currentView`,7),r=J(t,`label`,3,``),i=J(t,`disabled`,3,!1),a=J(t,`multiple`,3,!1),o=J(t,`noneLabel`,3,``),s=J(t,`filters`,19,()=>[]);{let c=e=>{{let r=A(()=>Y(`filtering_options`));qS(e,{get ariaLabel(){return z(r)},get"aria-controls"(){return t[`aria-controls`]},children:(e,t)=>{var r=H(),i=P(r),c=e=>{var t=H();No(P(t),17,s,e=>KW(WW(e)),(e,t)=>{let r=A(()=>{let{label:e}=z(t);return{_label:e}}),i=A(()=>WW(z(t))),a=A(()=>KW(z(i))),o=A(()=>(n().current.filters||[]).findIndex(e=>KW(e)===z(a)));{let t=A(()=>z(o)>-1);YS(e,{get label(){return z(r)._label},get checked(){return z(t)},onChange:()=>{let e=n().current,t=e.filters?[...e.filters]:[];z(o)>-1?t.splice(z(o),1):t.push(z(i)),n().current={...e,filters:t}}})}}),U(e,t)},l=e=>{Ett(e,{get currentView(){return n()},viewKey:`filter`,noneValue:void 0,get noneLabel(){return o()},get options(){return s()}})};G(i,e=>{a()?e(c):e(l,-1)}),U(e,r)},$$slots:{default:!0}})}},l=A(()=>r()||Y(`filter`));hS(e,{variant:`ghost`,get label(){return z(l)},get disabled(){return i()},popupPosition:`bottom-right`,popup:c,$$slots:{popup:!0}})}k()}var Ott=B(`<!> <!> <!> <!>`,1);function ktt(e,t){O(t,!0);let n=J(t,`currentView`,7),r=J(t,`label`,3,``),i=J(t,`disabled`,3,!1),a=J(t,`noneLabel`,3,``),o=J(t,`groups`,19,()=>[]),s=J(t,`groupNames`,19,()=>[]),c=A(()=>rje(s())),l=A(()=>eG(o(),n().current.group)),u=A(()=>z(c).some(e=>nG(n().current,e,z(l)))),d=A(()=>z(c).some(e=>!nG(n().current,e,z(l))));{let s=e=>{{let r=A(()=>Y(`grouping_options`));qS(e,{get ariaLabel(){return z(r)},get"aria-controls"(){return t[`aria-controls`]},children:(e,t)=>{var r=Ott(),i=P(r);Ett(i,{get currentView(){return n()},viewKey:`group`,noneValue:null,get noneLabel(){return a()},get options(){return o()}});var s=I(i,2);FS(s,{});var f=I(s,2);{let e=A(()=>Y(`expand_all`)),t=A(()=>!z(u));JS(f,{get label(){return z(e)},get disabled(){return z(t)},onclick:()=>{n().current=aG(n().current,z(c),!1,z(l))}})}var p=I(f,2);{let e=A(()=>Y(`collapse_all`)),t=A(()=>!z(d));JS(p,{get label(){return z(e)},get disabled(){return z(t)},onclick:()=>{n().current=aG(n().current,z(c),!0,z(l))}})}U(e,r)},$$slots:{default:!0}})}},f=A(()=>r()||Y(`group`));hS(e,{variant:`ghost`,get label(){return z(f)},get disabled(){return i()},popupPosition:`bottom-right`,popup:s,$$slots:{popup:!0}})}k()}var Att=B(`<span role="none" class="svelte-1sd2xgz"> </span>`),jtt=B(`<div role="none" class="wrapper svelte-1sd2xgz"><!> <!></div>`),Mtt={hash:`svelte-1sd2xgz`,code:`.wrapper.svelte-1sd2xgz {display:flex;align-items:center;gap:4px;margin-inline:20px;}span.svelte-1sd2xgz {color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);}`};function Ntt(e,t){O(t,!0),K(e,Mtt);let n=J(t,`selectedItems`,7),r=A(()=>t.allItems.length),i=A(()=>n().current.length),a=A(()=>!!z(i)),o=A(()=>z(a)&&z(i)===z(r));var s=jtt(),c=N(s);{let e=A(()=>!z(r)),i=A(()=>Y(`select_all`)),s=A(()=>z(a)&&!z(o)?`mixed`:z(a));vS(c,{get disabled(){return z(e)},get ariaLabel(){return z(i)},get checked(){return z(s)},onChange:()=>{n().current=z(o)?[]:[...t.allItems]}})}var l=I(c,2),u=e=>{var t=Att(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`x_of_x_selected`,{values:{total:z(r),selected:z(i)}})]),U(e,t)};G(l,e=>{z(a)&&e(u)}),D(s),U(e,s),k()}var Ptt=B(`<!> <!>`,1);function Ftt(e,t){O(t,!0);let n=J(t,`currentView`,7),r=J(t,`label`,3,``),i=J(t,`disabled`,3,!1),a=J(t,`sortKeys`,19,()=>[]),o=J(t,`collectionName`,3,void 0),s=({key:e,label:t,type:n},r)=>Y(`${r}${n===`date`||dje.includes(e)||o()&&lh({collectionName:o(),keyPath:e})?.widget===`datetime`?`_date`:n===`number`?`_number`:``}`,{values:{label:t}});{let o=e=>{{let r=A(()=>Y(`sorting_options`));qS(e,{get ariaLabel(){return z(r)},get"aria-controls"(){return t[`aria-controls`]},children:(e,t)=>{var r=H();No(P(r),17,a,e=>e.key,(e,t)=>{let r=A(()=>z(t));var i=Ptt(),o=P(i);No(o,16,()=>uje,e=>e,(e,i)=>{{let a=A(()=>s(z(t),i)),o=A(()=>n().current.sort?.key===z(r).key&&n().current.sort.order===i);XS(e,{get label(){return z(a)},get checked(){return z(o)},onSelect:()=>{n().current={...n().current,sort:{key:z(r).key,order:i}}}})}});var c=I(o,2),l=e=>{FS(e,{})};G(c,e=>{z(r).key===`_summary`&&a().length>1&&e(l)}),U(e,i)}),U(e,r)},$$slots:{default:!0}})}},c=A(()=>r()||Y(`sort`));hS(e,{variant:`ghost`,get label(){return z(c)},get disabled(){return i()},popupPosition:`bottom-right`,popup:o,$$slots:{popup:!0}})}k()}var Itt=B(`<!> <!>`,1),Ltt=B(`<!> <!> <!> <!> <!> <!> <!> <!>`,1);function Rtt(e,t){O(t,!0);let n=J(t,`groups`,19,()=>[]),r=J(t,`groupNames`,19,()=>[]),i=J(t,`searchTerms`,7,void 0),a=A(()=>!!t.totalCount),o=A(()=>t.totalCount>1);{let s=A(()=>Y(`asset_list`));IV(e,{variant:`secondary`,get ariaLabel(){return z(s)},children:(e,s)=>{var c=Ltt(),l=P(c),u=e=>{Ntt(e,{get allItems(){return t.allItems},get selectedItems(){return t.selectedItems}})};G(l,e=>{PY.isSmallScreen||PY.isMediumScreen||e(u)});var d=I(l,2);yS(d,{flex:!0});var f=I(d,2),p=e=>{{let t=A(()=>Y(`assets_dialog.search_for_file`));rC(e,{dir:`auto`,get flex(){return PY.isSmallScreen},get ariaLabel(){return z(t)},"aria-controls":`asset-list`,get value(){return i().current},set value(e){i().current=e}})}};G(f,e=>{i()&&e(p)});var m=I(f,2);{let e=A(()=>!z(o));Ftt(m,{get disabled(){return z(e)},get currentView(){return R1},get sortKeys(){return t.sortKeys},"aria-controls":`asset-list`})}var h=I(m,2);{let e=A(()=>Y(`type`)),t=A(()=>!z(o)),n=A(()=>Y(`all`)),r=A(()=>Zae.map(e=>({label:Y(e),field:`fileType`,pattern:e})));Dtt(h,{get label(){return z(e)},get disabled(){return z(t)},get currentView(){return R1},get noneLabel(){return z(n)},get filters(){return z(r)},"aria-controls":`asset-list`})}var g=I(h,2),_=e=>{{let t=A(()=>!z(o));ktt(e,{get disabled(){return z(t)},get currentView(){return R1},get groups(){return n()},get groupNames(){return r()},"aria-controls":`asset-list`})}};G(g,e=>{n().length&&e(_)});var v=I(g,2);{let e=A(()=>!z(a));S3(v,{get disabled(){return z(e)},get currentView(){return R1},"aria-controls":`asset-list`})}var y=I(v,2),b=e=>{var t=Itt(),n=P(t);FS(n,{orientation:`vertical`});var r=I(n,2);{let e=e=>{gx(e,{name:`info`})},t=A(()=>!z(a)),n=A(()=>!!R1.current.showInfo),i=A(()=>R1.current.showInfo?`asset-info`:void 0),o=A(()=>!!R1.current.showInfo),s=A(()=>Y(R1.current.showInfo?`hide_info`:`show_info`));Xx(r,{variant:`ghost`,iconic:!0,get disabled(){return z(t)},get pressed(){return z(n)},get"aria-controls"(){return z(i)},get"aria-expanded"(){return z(o)},get"aria-label"(){return z(s)},onclick:()=>{R1.current={...R1.current,showInfo:!R1.current.showInfo}},startIcon:e,$$slots:{startIcon:!0}})}U(e,t)};G(y,e=>{PY.isSmallScreen||PY.isMediumScreen||e(b)}),U(e,c)},$$slots:{default:!0}})}k()}var ztt,Btt=new Set([`$$slots`,`$$events`,`$$legacy`,`primaryToolbar`,`secondaryToolbar`,`mainContent`,`secondarySidebar`]),Vtt=B(`<main><!> <div role="none" class="main-inner svelte-1x2ldab"><div role="none" class="main-inner-main svelte-1x2ldab"><!> <!></div> <!></div></main>`),Htt={hash:`svelte-1x2ldab`,code:`.wrapper.svelte-1x2ldab {flex:auto;display:flex;flex-direction:column;overflow:hidden;height:100%;background-color:var(--sui-primary-background-color);
@media (768px <= width) {view-transition-name:page-main;
}.sui.toolbar.primary {justify-content:center;
@media (width < 768px) {border-block-end:var(--area-border);background-color:var(--sui-secondary-background-color);
}}}
/* The area sits next to the primary sidebar and below the global toolbar */.resizable-pane > .wrapper.svelte-1x2ldab {border-block-start:var(--area-border);border-inline-start:var(--area-border);border-start-start-radius:16px;}.main-inner.svelte-1x2ldab {flex:auto;display:flex;overflow:hidden;.main-inner-main:where(.svelte-1x2ldab) {flex:auto;display:flex;flex-direction:column;overflow:hidden;}.secondary-sidebar {flex:none;overflow:auto;box-sizing:content-box;width:320px;background-color:var(--sui-secondary-background-color);
@media (768px <= width) {border-block-start:var(--area-border);border-inline-start:var(--area-border);border-start-start-radius:16px;
}[role='listbox'] {padding:12px;}}}`};function D5(e,t){O(t,!0),K(e,Htt);let n=J(t,`primaryToolbar`,3,void 0),r=J(t,`secondaryToolbar`,3,void 0),i=J(t,`mainContent`,3,void 0),a=J(t,`secondarySidebar`,3,void 0),o=vs(t,Btt),s={};L(()=>(ztt=s,f0.current=o[`aria-label`]??``,()=>{ztt===s&&(f0.current=``)}));var c=Vtt();fs(c,()=>({class:`wrapper`,...o}),void 0,void 0,void 0,`svelte-1x2ldab`);var l=N(c);xo(l,()=>n()??Cr);var u=I(l,2),d=N(u),f=N(d);xo(f,()=>r()??Cr),xo(I(f,2),()=>i()??Cr),D(d),xo(I(d,2),()=>a()??Cr),D(u),D(c),U(e,c),k()}var Utt=e=>{ctt(e,{})},Wtt=B(`<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>`,1),Gtt=B(`<!> <!>`,1),Ktt=B(`<!> <!> <!>`,1),qtt=B(`<!> <!> <!> <!> <!>`,1);function Jtt(e,t){O(t,!0);let n=A(()=>g1.current),r=A(()=>z2().max_file_size??1/0),i=j(void 0);L(()=>{let{files:e,originalAsset:t}=R2.current;e.length&&eo(async()=>{R2.current={files:[]},z(i)?.report(await OHe(e,{originalAsset:t}))})});var a=qtt(),o=P(a);{let e=e=>{vtt(e,{})},t=e=>{var t=H(),n=P(t),r=e=>{{let t=A(()=>Object.keys(n4.current));Rtt(e,{get allItems(){return t4.current},get selectedItems(){return O1},get totalCount(){return _1.current.length},get sortKeys(){return GHe.current},get groups(){return ZHe.current},get groupNames(){return z(t)},get searchTerms(){return N1}})}};G(n,e=>{_1.current?.length&&e(r)}),U(e,t)},r=e=>{var t=Gtt(),n=P(t),r=e=>{var t=Wtt(),n=P(t);ko(n,()=>({"--sui-infobar-border-width":`0 0 1px`,"--sui-infobar-message-justify-content":`center`})),Zx(n.lastChild,{status:`warning`,dismissible:!1,children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(`external_assets_truncated`)]),U(e,n)},$$slots:{default:!0}}),D(n),U(e,t)};G(n,e=>{D1.current&&e(r)}),$et(I(n,2),{}),U(e,t)},i=e=>{{let t=(e,t=Cr)=>{met(e,{get asset(){return t()}})},r=A(()=>v1(z(n))&&_1.current?Utt:void 0);wtt(e,{get asset(){return k1.current},get fallback(){return z(r)},children:t,$$slots:{default:!0}})}},a=A(()=>Y(`x_asset_folder`,{values:{folder:z(n).serviceLabel}}));D5(o,{id:`assets-container`,get"aria-label"(){return z(a)},primaryToolbar:e,secondaryToolbar:t,mainContent:r,secondarySidebar:i,$$slots:{primaryToolbar:!0,secondaryToolbar:!0,mainContent:!0,secondarySidebar:!0}})}var s=I(o,2);xtt(s,{});var c=I(s,2),l=e=>{var t=Ktt(),n=P(t);ltt(n,{});var r=I(n,2);Stt(r,{}),ett(I(r,2),{}),U(e,t)},u=A(()=>v1(z(n)));G(c,e=>{z(u)&&e(l)});var d=I(c,2);fC(d,{get show(){return L2.current.show},set show(e){L2.current.show=e},children:(e,t)=>{bx(e,{get status(){return L2.current.status},children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(L2.current.message)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),gs(H0(I(d,2),{get maxSize(){return z(r)}}),e=>M(i,e,!0),()=>z(i)),U(e,a),k()}var O5=tl(null),k5=tl(``),Ytt=/^\/search\/(?<terms>.+)$/,A5=e=>Ytt.test(e),Xtt=e=>{let{groups:t}=e.match(Ytt)??{};if(!t)return!1;let{terms:n}=t;return n&&n!==k5.current&&(k5.current=n),O5.current||=`contents`,!0},Ztt=/^\/assets(?:\/(?<folderPath>.+?)(?:\/(?<fileName>[^/]+\.[A-Za-z0-9]+))?)?$/,Qtt=e=>Sy.current.some(({internalPath:t})=>t===e)||[...Dp.current,...Ip.current].some(t=>t.path.startsWith(`${e}/`)),j5=0,$tt=()=>Ec.current&&wy.current?W1(wy.current):``,M5=()=>({folder:wy.current}),ent=({path:e},{transitionType:t=`forwards`,replaceState:n=!1}={})=>{x0(Kl(`/assets/${e}`),{transitionType:t,replaceState:n,state:M5()})},tnt=()=>{j5+=1},nnt=(e,t,n)=>{let r=cBe(t);return wy.current=void 0,r?(g1.current!==r&&(dBe(),g1.current=r),n?(j1.current=n,V1.current=!0,d0.current=Y(`viewing_x_asset_details`,{values:{name:tu(n)}})):(j1.current=void 0,V1.current=!1,d0.current=Y(`viewing_x_external_location`,{values:{service:r.serviceLabel}})),e):(g1.current=void 0,V1.current=!1,d0.current=Y(`asset_folder_not_found`),{...e,notFound:!0})},rnt=e=>PY.isSmallScreen?(wy.current=void 0,V1.current=!1,d0.current=Y(`viewing_asset_folder_list`),{...e,isIndexPage:!0}):(Sy.current.length?(wy.current=mJ(`-/all`).folder,sJ.current=``,x0(`/assets/-/all`,{replaceState:!0})):x0(f1(d1.current[0]??u1),{replaceState:!0}),e),int=async e=>{await Iu(100),e===j5&&(V1.current=!1,d0.current=Y(`viewing_x_asset_folder`,{values:{folder:$tt(),count:K1.current.length}}))},ant=()=>{let{path:e}=m0(),t=e.match(Ztt),n={isIndexPage:!1,isSearchPage:!1,notFound:!1};j5+=1;let r=j5;if(!t?.groups)return V1.current=!1,{...n,isSearchPage:Xtt(e)};let{folderPath:i,fileName:a}=t.groups;if(i?.startsWith(`-/`)&&i!==`-/all`){let[e,...t]=i.slice(2).split(`/`);return nnt(n,e,[...t,...a?[a]:[]].join(`/`))}if(g1.current=void 0,!i)return rnt(n);if(!a&&Dp.current.some(e=>e.path===i)){let e=i.lastIndexOf(`/`);(e>-1||Sy.current.some(({internalPath:e})=>e===``))&&(a=i.slice(e+1),i=i.slice(0,Math.max(e,0)))}if(a){let e=$l([i,a]);!Dp.current.some(t=>t.path===e)&&Qtt(e)&&(i=e,a=void 0)}let{folder:o,subfolderPath:s=``}=mJ(i,window.history.state?.folder)??{};if(!o&&!a)return wy.current=void 0,sJ.current=``,V1.current=!1,d0.current=Y(`asset_folder_not_found`),{...n,notFound:!0};if(o?((0,Qc.default)(wy.current,o)||(wy.current=o),sJ.current=s):(wy.current=void 0,sJ.current=``),!a)return int(r),n;let c=$l([i,a]);return jp.current=Dp.current.find(e=>e.path===c),d0.current=jp.current?Y(`viewing_x_asset_details`,{values:{name:jp.current.name}}):Y(`file_not_found`),V1.current=!0,n};function ont(e,t){O(t,!0);let n=e=>{kp.current=Hb(kp.current,t.asset,e)};{let r=A(()=>xBe.current.get(t.asset.path)??-1),i=A(()=>noe.current.has(t.asset.path)),a=A(()=>Cp(t.asset));Fet(e,{get name(){return t.asset.name},get kind(){return t.asset.kind},get asset(){return t.asset},get rowIndex(){return z(r)},get viewType(){return t.viewType},get selected(){return z(i)},get canPreview(){return z(a)},onSelectionChange:n,onFocus:()=>{Ap.current=t.asset,cJ.current=void 0},onPreview:()=>{ent(t.asset)}})}k()}function snt(e,t){O(t,!0);let n=()=>{x0(Kl(`/assets/${t.subfolder.path}`),{transitionType:`forwards`,state:{folder:wy.current}})};{let r=A(()=>!(PY.isSmallScreen||PY.isMediumScreen)),i=A(()=>ky.current||!!wy.current?.readonly||yy(t.subfolder.path));qet(e,{get subfolder(){return t.subfolder},get rowIndex(){return t.rowIndex},get viewType(){return t.viewType},get hasCheckboxColumn(){return z(r)},onOpen:n,onFocus:()=>{cJ.current=t.subfolder,Ap.current=void 0},onRename:()=>{lJ.current=t.subfolder},onDelete:()=>{uJ.current=t.subfolder},get actionsDisabled(){return z(i)}})}k()}function cnt(e,t){O(t,!0);let n=J(t,`label`,3,void 0),r=A(()=>ky.current||!Oy(Ty.current)||gJ.current);Yet(e,{get label(){return n()},get disabled(){return z(r)},onclick:()=>{H1.current=!0}}),k()}function lnt(e,t){O(t,!0);let n=A(()=>R1.current.type),r=A(()=>Ty.current),i=A(()=>q1.current.length),a=A(()=>ky.current||!Oy(z(r))||gJ.current);{let t=e=>{var t=H();No(P(t),19,()=>q1.current,e=>e.path,(e,t,r)=>{snt(e,{get subfolder(){return z(t)},get rowIndex(){return z(r)},get viewType(){return z(n)}})}),U(e,t)},o=(e,t=Cr)=>{var r=H();Oo(P(r),()=>t().sha,e=>{ont(e,{get asset(){return t()},get viewType(){return z(n)}})}),U(e,r)},s=e=>{{let t=A(()=>Y(`upload_assets`));cnt(e,{get label(){return z(t)}})}},c=A(()=>z(i)+K1.current.length),l=A(()=>!!z(i));ket(e,{get groups(){return Q1.current},itemKey:`path`,get totalCount(){return z(c)},get viewType(){return z(n)},get uploadDisabled(){return z(a)},get hasSubfolders(){return z(l)},onDrop:e=>{Mp.current={folder:z(r),subfolderPath:sJ.current,files:e}},onBlankClick:()=>{Ap.current=void 0,cJ.current=void 0},subfolders:t,renderItem:o,emptyAction:s,$$slots:{subfolders:!0,renderItem:!0,emptyAction:!0}})}k()}var unt=B(`<!> <!>`,1);function dnt(e,t){O(t,!0);let n=j(!1),r=j(void 0),i=A(()=>uJ.current),a=A(()=>z(i)?.name??``),o=A(()=>z(i)?g3(z(i).path):[]),s=A(()=>!!z(r)?.blockers.length),c=()=>{if(!z(i))return;let{path:e}=z(i);y2(()=>gqe(e),{failure:`deleting_folder_failed`})};L(()=>{if(!z(i))return;let e=z(o);M(r,void 0),M(n,!0),u3(e).then(e=>{uJ.current===z(i)&&M(r,e,!0)})});{let t=A(()=>Y(`delete_folder`)),i=A(()=>Y(`delete`)),l=A(()=>!z(r)||z(s));wS(e,{get title(){return z(t)},get okLabel(){return z(i)},get okDisabled(){return z(l)},onOk:()=>{c()},onClose:()=>{uJ.current=void 0},get open(){return z(n)},set open(e){M(n,e,!0)},children:(e,t)=>{var n=unt(),i=P(n),c=e=>{var t=V();R(e=>W(t,e),[()=>Y(`confirm_deleting_folder`,{values:{name:z(a),count:z(o).length}})]),U(e,t)};G(i,e=>{z(s)||e(c)});var l=I(i,2),u=e=>{y5(e,{get plan(){return z(r)},kind:`asset`,get count(){return z(o).length}})};G(l,e=>{z(r)&&e(u)}),U(e,n)},$$slots:{default:!0}})}k()}var fnt=new Map,N5={publicURL:void 0,repoBlobURL:void 0,dimensions:void 0,duration:void 0,usedEntries:[]},pnt=async e=>{let{kind:t}=e;if(!xp(t))return{};let n=await $X(e);return n?Xze(e,n,t):{}},mnt=e=>{let{sha:t}=e;return t?zl(fnt,t,()=>pnt(e)):pnt(e)},hnt=async e=>{let{path:t}=e,{blobBaseURL:n}=LX.current?.repository??{};return{...await mnt(e).catch(e=>(console.error(e),{})),publicURL:fZ(e),repoBlobURL:n?`${n}/${Kl(t)}`:void 0}},gnt=async e=>{let{url:t}=CUe(e);if(t)return $$(t);let[n]=await t1([{asset:e}]);return n};function _nt(e,t){O(t,!0);let n=J(t,`assets`,19,()=>[]),r=J(t,`useButton`,3,!0),i=j(Xi([])),a=j(!1),o=A(()=>z(i).filter(({publicURL:e})=>!!e).map(({publicURL:e})=>e)),s,c=A(()=>[{label:Y(`public_urls`,{values:{count:n().length}}),disabled:!z(o).length,copy:async()=>{await navigator.clipboard.writeText(z(o).join(`
`))},toastKey:`asset_urls_copied`},{label:Y(`file_paths`,{values:{count:n().length}}),copy:async()=>{await navigator.clipboard.writeText(n().map(({path:e})=>`/${e}`).join(`
`))},toastKey:`asset_paths_copied`},{label:Y(`file_data`),disabled:!z(a),copy:async()=>{await V9e(s)},toastKey:`asset_data_copied`}]);cl(()=>{let e=n();return M(i,[],!0),s=void 0,M(a,!1),Promise.all([Promise.all(e.map(hnt)),e.length===1?QX(e[0]).catch(()=>void 0):void 0])},([e,t])=>{M(i,e,!0),s=t,M(a,!!t&&z9e(t.type),!0)},e=>{console.error(e)}),R9e(e,{get items(){return z(c)},get count(){return n().length},get useButton(){return r()}}),k()}function vnt(e,t){O(t,!0);let n=J(t,`assets`,19,()=>[]),r=J(t,`listedCount`,3,void 0),i=J(t,`onDelete`,3,void 0),a=J(t,`useButton`,3,!0);{let t=A(()=>ky.current||Ay(n()));b5(e,{get assets(){return n()},get disabled(){return z(t)},deleteAssets:async e=>(await y2(()=>nqe(e),{failure:`deleting_assets_failed`})).ok,get planDeletion(){return u3},get listedCount(){return r()},get onDelete(){return i()},get useButton(){return a()}})}k()}function ynt(e,t){O(t,!0);let n=A(()=>LX.current?.repository?.label);var r=H(),i=P(r),a=e=>{{let r=A(()=>z(n)?Y(`view_on_x`,{values:{service:z(n)}}):Y(`view_in_repository`));JS(e,{get disabled(){return t.disabled},get label(){return z(r)},get onclick(){return t.onclick}})}};G(i,e=>{yu.devModeEnabled&&e(a)}),U(e,r),k()}var bnt=(e,{withUsedEntries:t=!1}={})=>{let n=Xi({current:{...N5}});return L(()=>{let r=e(),i=!1;return eo(()=>{n.current=t?{...N5,usedEntries:void 0}:{...N5}}),r&&(async()=>{try{let e=await hnt(r);if(i)return;n.current=e}catch(e){console.error(e)}if(!t||i)return;let e=[];try{e=await gnt(r)}catch(e){console.error(e)}i||(n.current.usedEntries=e)})(),()=>{i=!0}}),n},xnt=B(`<!> <!>`,1);function Snt(e,t){O(t,!0);let n=J(t,`extraItems`,3,void 0),r=bnt(()=>t.asset),i=A(()=>r.current),a=A(()=>z(i).publicURL),o=A(()=>z(i).repoBlobURL);{let r=e=>{var t=xnt(),n=P(t);{let e=A(()=>Y(`view_on_live_site`)),t=A(()=>!z(a));JS(n,{get label(){return z(e)},get disabled(){return z(t)},onclick:()=>{Tq(z(a))}})}var r=I(n,2);{let e=A(()=>!LX.current?.repository||!z(o));ynt(r,{get disabled(){return z(e)},onclick:()=>{Tq(`${z(o)}?plain=1`)}})}U(e,t)},i=A(()=>ky.current||!!t.asset&&Ay([t.asset])),s=A(()=>!!t.asset&&toe(t.asset)),c=A(()=>!!t.asset),l=A(()=>!!t.asset);G9e(e,{get readOnly(){return z(i)},get canEdit(){return z(s)},get canRename(){return z(c)},get canReplace(){return z(l)},onEdit:()=>{Np.current=t.asset},onRename:()=>{Pp.current=t.asset},onReplace:()=>{Mp.current={folder:void 0,files:[],originalAssets:[t.asset]},H1.current=!0},get extraItems(){return n()},moreItems:r,$$slots:{moreItems:!0}})}k()}var Cnt=B(`<a dir="ltr" target="_blank" rel="noopener noreferrer"> </a>`),wnt=B(`<a dir="ltr"> </a>`),Tnt=B(`<bdi dir="ltr"> </bdi>`),P5=B(`<section><h4> </h4> <p> </p></section>`),Ent=B(`<section><h4> </h4> <!></section>`),Dnt=B(`<!> <section><h4> </h4> <p><!></p></section> <section><h4> </h4> <p><!></p></section> <!> <!> <!> <!> <!>`,1);function Ont(e,t){O(t,!0);let n=e=>{{let n=A(()=>z(s)===`image`),r=A(()=>[`audio`,`video`].includes(z(s)));k0(e,{get kind(){return z(s)},get asset(){return t.asset},variant:`tile`,get checkerboard(){return z(n)},get controls(){return z(r)}})}},r=J(t,`showPreview`,3,!1),i=bnt(()=>t.asset,{withUsedEntries:!0}),a=A(()=>t.asset.path),o=A(()=>t.asset.size),s=A(()=>t.asset.kind),c=A(()=>t.asset.commitAuthor),l=A(()=>t.asset.commitDate),u=A(()=>i.current),d=A(()=>z(u).publicURL),f=A(()=>z(u).repoBlobURL),p=A(()=>z(u).dimensions),m=A(()=>z(u).duration),h=A(()=>z(u).createdDate),g=A(()=>z(u).coordinates),_=A(()=>z(u).usedEntries),v=A(()=>xp(z(s))||yp(z(a)));{let t=A(()=>r()&&z(v)?n:void 0);C5(e,{get preview(){return z(t)},children:(e,t)=>{var n=Dnt(),r=P(n);Q9e(r,{get fileName(){return z(a)},get kind(){return z(s)},get size(){return z(o)},get hasDimensions(){return z(v)},get dimensions(){return z(p)},get duration(){return z(m)}});var i=I(r,2),u=N(i),y=F(u,!0),b=I(u,2),x=N(b),S=e=>{var t=Cnt(),n=F(t,!0);R(()=>{q(t,`href`,z(d)),W(n,z(d)),t.dir=t.dir}),U(e,t)},C=e=>{U(e,V(`–`))};G(x,e=>{z(d)?e(S):e(C,-1)}),D(b),D(i);var w=I(i,2),T=N(w),ee=F(T,!0),E=I(T,2),te=N(E),ne=e=>{var t=wnt(),n=F(t);R(()=>{q(t,`href`,z(f)),W(n,`/${z(a)??``}`),t.dir=t.dir}),U(e,t)},re=e=>{var t=Tnt(),n=F(t);R(()=>{W(n,`/${z(a)??``}`),t.dir=t.dir}),U(e,t)};G(te,e=>{z(f)?e(ne):e(re,-1)}),D(E),D(w);var ie=I(w,2);set(ie,{get entries(){return z(_)}});var ae=I(ie,2),oe=e=>{var t=P5(),n=N(t),r=F(n,!0),i=F(I(n,2),!0);D(t),R((e,t)=>{W(r,e),W(i,t)},[()=>Y(`sort_keys.commit_author`),()=>hW(z(c))]),U(e,t)};G(ae,e=>{z(c)&&e(oe)});var se=I(ae,2),ce=e=>{var t=P5(),n=N(t),r=F(n,!0),i=F(I(n,2),!0);D(t),R((e,t)=>{W(r,e),W(i,t)},[()=>Y(`sort_keys.commit_date`),()=>bU(z(l),Ec.current)]),U(e,t)};G(se,e=>{z(l)&&e(ce)});var le=I(se,2),ue=e=>{var t=P5(),n=N(t),r=F(n,!0),i=F(I(n,2),!0);D(t),R((e,t)=>{W(r,e),W(i,t)},[()=>Y(`created_date`),()=>bU(z(h),Ec.current)]),U(e,t)};G(le,e=>{z(h)&&e(ue)});var de=I(le,2),fe=e=>{var t=Ent(),n=N(t),r=F(n,!0);h0e(I(n,2),{get coordinates(){return z(g)}}),D(t),R(e=>W(r,e),[()=>Y(`location`)]),U(e,t)};G(de,e=>{z(g)&&e(fe)}),R((e,t)=>{W(y,e),W(ee,t)},[()=>Y(`public_urls`,{values:{count:1}}),()=>Y(`file_paths`,{values:{count:1}})]),U(e,n)},$$slots:{default:!0}})}k()}var knt=B(`<!> <!> <!>`,1);function Ant(e,t){O(t,!0);let n=j(void 0),r=A(()=>jp.current),i=A(()=>z(n)?.asset!==z(r)),a=A(()=>z(i)?void 0:z(n)?.blob),o=A(()=>z(r)?.kind),s=A(()=>z(r)?.blobURL),c=A(()=>z(r)?.name??``),l=A(()=>z(r)?[z(r)]:[]),u=A(()=>Kl(`/assets/${hJ.current??wy.current?.internalPath??`-/all`}`)),d=A(()=>Y1(Q1.current,e=>e.path===z(r)?.path,Cp)),f=A(()=>z(d).previous),p=A(()=>z(d).next),m=(e,t)=>{ent(e,{replaceState:!0,transitionType:t})};L(()=>{let e=[z(f),z(p)].filter(e=>e?.kind===`image`),t=z(r)?[z(r)]:[];eo(()=>pZ(e,{keep:t}))}),Co(()=>{pZ([])}),L(()=>{let e=z(r);e&&(async()=>{let t;try{t=await QX(e)}catch(e){console.error(e)}jp.current===e&&M(n,{asset:e,blob:t})})()});{let t=(e,t=Cr)=>{var n=knt(),r=P(n);_nt(r,{get assets(){return z(l)},get useButton(){return t()}});var i=I(r,2);S5(i,{get assets(){return z(l)},getName:e=>e.name,get getBlob(){return QX},get useButton(){return t()}}),vnt(I(i,2),{get assets(){return z(l)},onDelete:()=>{S0(z(u),{returnTo:A5,state:M5()})},get useButton(){return t()}}),U(e,n)},n=(e,t=Cr)=>{Snt(e,{get asset(){return z(r)},get extraItems(){return t()}})},d=e=>{var t=H(),n=P(t),l=e=>{{let t=A(()=>Y(`file_not_found`));w5(e,{get message(){return z(t)},get backPath(){return z(u)}})}},d=e=>{{let t=A(()=>z(a)?.type);y9e(e,{get kind(){return z(o)},get name(){return z(c)},get type(){return z(t)},get asset(){return z(r)},get src(){return z(s)},get pending(){return z(i)},getText:()=>z(r).text??z(a).text()})}};G(n,e=>{z(r)?e(d,-1):e(l)}),U(e,t)},h=e=>{var t=H(),n=P(t),i=e=>{Ont(e,{get asset(){return z(r)}})};G(n,e=>{z(r)&&e(i)}),U(e,t)},g=A(()=>z(r)?.sha),_=A(()=>z(f)?()=>m(z(f),`previous`):void 0),v=A(()=>z(p)?()=>m(z(p),`next`):void 0);F9e(e,{get title(){return z(c)},get contentKey(){return z(g)},onBack:()=>{S0(z(u),{returnTo:A5,state:M5()})},get onPrevious(){return z(_)},get onNext(){return z(v)},actions:t,editOptions:n,preview:d,info:h,$$slots:{actions:!0,editOptions:!0,preview:!0,info:!0}})}k()}var jnt=e=>{let{files:t,originalAssets:n,replaceDuplicates:r=!1}=e,{slugify_filename:i=!1}=nJ().config,a=TJ(e),o=a===void 0?[]:OQ(a),s=a===void 0?[]:kQ(a),c=[];return t.map((e,t)=>{let l=n?.[t]??(r?o.find(t=>{let n=t.name.normalize().toLowerCase();return n===e.name.normalize().toLowerCase()&&!c.some(e=>e.toLowerCase()===n)}):void 0),u=l?.name??IQ(e.name,{slugificationEnabled:i,assetNamesInSameFolder:s});return s.includes(u)||s.push(u),c.push(u.normalize()),{action:l?`update`:`create`,name:u,path:l?.path??$l([a,u]),file:e}})},Mnt=({count:e,options:t})=>{f2(e=>e.path),u2.current={...c2,saved:!0,published:G8(t),count:e}},Nnt=async(e,t)=>{let{files:n,folder:r}=e,i=jnt(e);xy(i.map(({path:e})=>e));let a=i.map(({name:e,path:t,file:n})=>({name:e,path:t,size:n.size,kind:Ep(e),folder:r}));await h3({changes:i.map(({action:e,path:t,file:n})=>({action:e,path:t,data:n})),savingAssets:a,options:t}),Mnt({count:n.length,options:t})},Pnt=B(`<div role="none"><!></div>`),Fnt={hash:`svelte-1olui47`,code:`.wrapper.svelte-1olui47 {display:contents;textarea {min-height:40dvh;max-height:80dvh;font-family:var(--sui-font-family-monospace);font-size:var(--sui-font-size-monospace);text-wrap:nowrap;resize:vertical;}&.wrap textarea {text-wrap:wrap;}}`};function Int(e,t){O(t,!0),K(e,Fnt);let n=A(()=>Np.current),r=j(!1),i=j(void 0),a=j(void 0),o=j(void 0),s=j(!1),c=!1,l=!1,u=async()=>{l=eo(()=>V1.current),M(i,await QX(z(n)),!0),M(a,await z(i).text(),!0),M(o,z(a),!0),M(r,!0)},d=()=>{Np.current=void 0,M(i,void 0),M(a,void 0),M(o,void 0)},f=async()=>{if(!z(n)||!z(i)||typeof z(o)!=`string`)return;c=!0;let{folder:e,name:t}=z(n),a=z(o),{type:s}=z(i),{ok:u}=await y2(()=>Nnt({folder:e,files:[new File([a],t,{type:s})],originalAssets:[z(n)]},{commitType:`uploadMedia`}),{failure:`saving_asset_failed`});c=!1,!u&&(!l||V1.current)?M(r,!0):d()},p=A(()=>Y(`edit_x`,{values:{name:z(n)?.name??``}}));L(()=>{z(n)&&z(i)===void 0&&u()}),L(()=>{!V1.current&&l&&M(r,!1)});{let t=e=>{{let t=A(()=>Y(`wrap_long_lines`));aC(e,{get label(){return z(t)},get checked(){return z(s)},set checked(e){M(s,e,!0)}})}},n=A(()=>Y(`save`)),i=A(()=>z(o)===z(a));SS(e,{size:`x-large`,get title(){return z(p)},get okLabel(){return z(n)},get okDisabled(){return z(i)},okShortcuts:`Accel+S`,onOk:()=>{f()},onClose:()=>{c||d()},get open(){return z(r)},set open(e){M(r,e,!0)},footerExtra:t,children:(e,t)=>{var n=Pnt();let r;RV(N(n),{dir:`auto`,flex:!0,get"aria-label"(){return z(p)},get value(){return z(o)},set value(e){M(o,e,!0)}}),D(n),R(()=>r=$o(n,1,`wrapper svelte-1olui47`,null,r,{wrap:z(s)})),U(e,n)},$$slots:{footerExtra:!0,default:!0}})}k()}function Lnt(e,t){O(t,!0);let n=A(()=>J1.current);stt(e,{get name(){return z(n).name},get path(){return z(n).path},get folderCount(){return z(n).folderCount},get assetCount(){return z(n).assetCount}}),k()}function Rnt(e,t){O(t,!0);let n=A(()=>vJ({subfolders:q1.current,fileNames:K1.current.map(({name:e})=>e),dirPath:hJ.current}));{let t=A(()=>hJ.current??``);_qe(e,{get dirPath(){return z(t)},get takenNames(){return z(n)},get open(){return U1.current},set open(e){U1.current=e}})}k()}function znt(e,t){O(t,!0);let n=A(()=>wy.current),r=A(()=>ky.current||!Oy(z(n))||gJ.current);var i=H(),a=P(i),o=e=>{_3(e,{get disabled(){return z(r)},onclick:()=>{U1.current=!0}})},s=A(()=>dJ(z(n)));G(a,e=>{z(s)&&e(o)}),U(e,i),k()}var Bnt=B(`<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>`,1),Vnt=B(`<!> <!> <!> <!> <!>`,1),Hnt=B(`<!> <!>`,1);function Unt(e,t){O(t,!0);let n=A(()=>wy.current),r=A(()=>Ec.current&&z(n)?W1(z(n)):``),i=A(()=>sJ.current?sJ.current.split(`/`):[]),a=A(()=>Ap.current),o=A(()=>roe.current),s=A(()=>!!z(n)?.readonly||!!ul.current),c=A(()=>ky.current||!Oy(Ty.current)||gJ.current),l=(e,t)=>{let r=Kl(`/assets/${$l([z(n)?.internalPath,...z(i).slice(0,e)])}`),a={transitionType:`backwards`,state:{folder:z(n)}};t?S0(r,a):x0(r,a)};var u=Hnt(),d=P(u),f=e=>{var t=Bnt(),r=P(t);ko(r,()=>({"--sui-infobar-border-width":`0 0 1px`,"--sui-infobar-message-justify-content":`center`})),Zx(r.lastChild,{dismissible:!1,children:(e,t)=>{Ur();var r=V();R(e=>W(r,e),[()=>sQ(`asset_folder`,{folder:z(n)})]),U(e,r)},$$slots:{default:!0}}),D(r),U(e,t)};G(d,e=>{z(s)&&e(f)}),htt(I(d,2),{get rootLabel(){return z(r)},get subfolderNames(){return z(i)},onBrowse:l,actions:e=>{var t=Vnt(),n=P(t);{let e=A(()=>z(a)?Kl(`/assets/${z(a).path}`):void 0),t=A(()=>!z(a)||!Cp(z(a))),r=A(M5);dtt(n,{get path(){return z(e)},get disabled(){return z(t)},get state(){return z(r)}})}var r=I(n,2);{let e=A(()=>z(a)?[z(a)]:[]);_nt(r,{get assets(){return z(e)}})}var i=I(r,2);S5(i,{get assets(){return z(o)},getName:e=>e.name,get getBlob(){return QX}});var s=I(i,2);vnt(s,{get assets(){return z(o)},get listedCount(){return K1.current.length}}),Snt(I(s,2),{get asset(){return z(a)}}),U(e,t)},fab:e=>{var t=Hnt(),n=P(t);znt(n,{});var r=I(n,2),i=e=>{{let t=A(()=>PY.isSmallScreen?void 0:Y(`upload`));cnt(e,{get label(){return z(t)}})}};G(r,e=>{(!PY.isSmallScreen||K1.current.length&&!z(c))&&e(i)}),U(e,t)},$$slots:{actions:!0,fab:!0}}),U(e,u),k()}function Wnt(e,t){O(t,!0);let n=j(!1),r=j(Xi([])),i=A(()=>Pp.current),a=A(()=>z(r).filter(e=>a3(e))),o=A(()=>z(a).length?Y(`cannot_move_referenced_asset`,{values:{entries:z(a).map(e=>o3(e)).join(`, `)}}):void 0),s=A(()=>Uc(z(i)?.path??``)),c=A(()=>Tr(z(s).dirname,``)),l=A(()=>Tr(z(s).basename,``)),u=A(()=>z(i)?{otherNames:OQ(z(c)).map(e=>e.name).filter(e=>e!==z(i).name),fileNames:bJ(z(c)),folderNames:yJ(z(c))}:{otherNames:[],fileNames:[],folderNames:[]}),d=A(()=>z(u).otherNames),f=A(()=>z(u).fileNames),p=A(()=>z(u).folderNames),m=async e=>{if(!z(i))return;let t=z(i).path,n=$l([z(c),e]),{ok:r}=await y2(()=>dqe(`rename`,[{asset:z(i),path:n}]),{failure:`renaming_asset_failed`});r&&m0().path===`/assets/${t}`&&await x0(Kl(`/assets/${n}`),{replaceState:!0,notifyChange:!1,state:M5()})};cl(()=>z(i)?gnt(z(i)):void 0,e=>{M(r,e,!0),M(n,!0)});{let t=A(()=>nJ().config.slugify_filename);btt(e,{get name(){return z(l)},get otherNames(){return z(d)},get fileNames(){return z(f)},get folderNames(){return z(p)},get usedEntryCount(){return z(r).length},get blockedMessage(){return z(o)},get slugificationEnabled(){return z(t)},onRename:m,onClose:()=>{Pp.current=void 0},get open(){return z(n)},set open(e){M(n,e,!0)}})}k()}function Gnt(e,t){O(t,!0);let n=A(()=>lJ.current),r=A(()=>!!z(n)),i=A(()=>z(n)?.name??``),a=A(()=>z(n)?g3(z(n).path).length:0),o=A(()=>vJ({subfolders:q1.current,fileNames:K1.current.map(({name:e})=>e),exclude:z(i),dirPath:hJ.current})),s=e=>{if(!z(n))return;let{path:t}=z(n);y2(()=>hqe({dirPath:t,newDirPath:$l([eu(t),e])}),{progress:`renaming_folder`,failure:`renaming_folder_failed`})};{let t=A(()=>Y(`rename_x`,{values:{name:z(i)}})),n=A(()=>Y(`rename`)),c=A(()=>Y(`enter_new_name_for_folder`,{values:{count:z(a)}}));FJ(e,{get title(){return z(t)},get okLabel(){return z(n)},get description(){return z(c)},get name(){return z(i)},get takenNames(){return z(o)},onSubmit:e=>{s(e)},onClose:()=>{lJ.current=void 0},get open(){return z(r)},set open(e){M(r,e)}})}k()}var F5=void 0,Knt=e=>{let t=!!k5.current,{path:n}=m0(),r=A5(n);k5.current=e,e?(r||(F5=n),x0(`/search/${encodeURIComponent(e)}`,{replaceState:r})):t&&r&&(S0(F5??(O5.current===`assets`?`/assets`:`/collections`)),F5=void 0)},qnt=()=>{if(A5(m0().path))return;let e=window.history.state?.from;e&&A5(m0(e).path)||(F5=void 0,k5.current&&=``)},Jnt=B(`<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>`,1),Ynt=B(`<div role="none" class="wrapper svelte-lav5fn"><!></div>`),Xnt={hash:`svelte-lav5fn`,code:`.wrapper.svelte-lav5fn {display:contents;--sui-textbox-border-width: 0;}`};function I5(e,t){O(t,!0),K(e,Xnt);let n=J(t,`onclick`,3,void 0),r=j(``);L(()=>{let e=k5.current;eo(()=>{e!==z(r).trim()&&M(r,e,!0)})});var i=Ynt();oo(`hashchange`,$i,()=>{qnt()});var a=N(i),o=e=>{var t=Jnt(),i=P(t);{let e=A(()=>Y(`search_placeholder_${O5.current}`)),t=A(()=>Y(`search_placeholder_${O5.current}`));ko(i,()=>({"--sui-textbox-placeholder-text-align":`center`})),rC(i.lastChild,{debounce:!0,keyShortcuts:`Accel+F`,get placeholder(){return z(e)},get"aria-label"(){return z(t)},get onclick(){return n()},oninput:({target:e})=>{Knt(e.value.trim())},onClear:()=>{Knt(``)},get value(){return z(r)},set value(e){M(r,e,!0)}}),D(i)}U(e,t)};G(a,e=>{O5.current&&e(o)}),D(i),U(e,i),k()}var Znt=B(`<header><h2> </h2></header> <!>`,1),L5=B(`<span class="count"> </span>`),Qnt=B(`<!> <!>`,1),$nt=B(`<!> <!>`,1),ert=B(`<nav class="primary-sidebar"><!> <!></nav>`);function trt(e,t){O(t,!0);let n=J(t,`isSearchPage`,3,!1),r=e=>Ec.current?W1(e):``,i=A(()=>[...Sy.current.filter(({typedKeyPath:e,isAssetCollection:t})=>!t&&e===void 0).sort((e,t)=>Yp(e.collectionName,e.fileName)-Yp(t.collectionName,t.fileName)).sort((e,t)=>_ae(e.collectionName)-_ae(t.collectionName)),...Sy.current.filter(({isAssetCollection:e})=>e)]),a=e=>z(i)[e].collectionName===void 0&&z(i)[e+1]?.collectionName!==void 0||!z(i)[e].isAssetCollection&&!!z(i)[e+1]?.isAssetCollection;var o=ert(),s=N(o),c=e=>{var t=Znt(),n=P(t),r=F(N(n),!0);D(n),I5(I(n,2),{onclick:e=>{e.preventDefault(),x0(`/search`)}}),R(e=>W(r,e),[()=>Y(`assets`)]),U(e,t)};G(s,e=>{PY.isSmallScreen&&e(c)});var l=I(s,2);{let e=A(()=>Y(`asset_folder_list`)),t=A(()=>n()||PY.isSmallScreen?void 0:`assets-container`);WS(l,{get ariaLabel(){return z(e)},get"aria-controls"(){return z(t)},children:(e,t)=>{var o=Qnt(),s=P(o),c=e=>{{let t=A(()=>Y(`asset_location.repository`));GS(e,{get label(){return z(t)},children:(e,t)=>{var o=H();No(P(o),19,()=>z(i),e=>Yle(e),(e,t,i)=>{var o=Qnt(),s=P(o);Do(s,Iu,null,e=>{let i=A(()=>z(t)),a=A(()=>z(i).collectionName?Kf(z(i).collectionName):void 0),o=A(()=>z(a)&&z(i).fileName?Wp(z(a),z(i).fileName):void 0),s=A(()=>!Oy(z(t))),c=A(()=>(0,Qc.default)(wy.current,z(t)));{let l=e=>{{let n=A(()=>z(t).icon||z(o)?.icon||z(a)?.icon||`folder`);gx(e,{get name(){return z(n)}})}},u=e=>{var n=H();Oo(P(n),()=>Dp.current,e=>{var n=H();Do(P(n),Iu,null,e=>{let n=A(()=>z(i).internalPath===void 0?Dp.current.length:xRe(z(t)));var r=L5(),a=F(r,!0);R((e,t)=>{q(r,`aria-label`,`(${e??``})`),W(a,t)},[()=>Y(`x_assets`,{values:{count:z(n)}}),()=>_5.current.format(z(n))]),U(e,r)}),U(e,n)}),U(e,n)},d=A(()=>PY.isSmallScreen||n()?!1:z(c)),f=A(()=>r(z(t)));KS(e,{get selected(){return z(d)},get label(){return z(f)},onSelect:()=>{x0(Kl(`/assets/${z(i).internalPath??`-/all`}`),{transitionType:`forwards`,state:{folder:z(t)}})},onclick:()=>{z(c)&&sJ.current&&x0(Kl(`/assets/${z(i).internalPath}`),{transitionType:`backwards`,state:{folder:z(t)}})},ondragover:e=>{e.preventDefault(),z(s)||(z(i).internalPath===void 0||z(c)?e.dataTransfer.dropEffect=`none`:(e.dataTransfer.dropEffect=`move`,e.target.classList.add(`dragover`)))},ondragleave:e=>{e.preventDefault(),z(s)||e.target.classList.remove(`dragover`)},ondragend:e=>{e.preventDefault(),z(s)||e.target.classList.remove(`dragover`)},ondrop:e=>{e.preventDefault(),z(s)||e.target.classList.remove(`dragover`)},startIcon:l,endIcon:u,$$slots:{startIcon:!0,endIcon:!0}})}});var c=I(s,2),l=e=>{FS(e,{})},u=A(()=>a(z(i)));G(c,e=>{z(u)&&e(l)}),U(e,o)}),U(e,o)},$$slots:{default:!0}})}};G(s,e=>{z(i).length&&e(c)});var l=I(s,2),u=e=>{{let t=A(()=>Y(`asset_location.external`));GS(e,{get label(){return z(t)},children:(e,t)=>{let r=A(()=>l1.current.length);var i=$nt(),a=P(i);No(a,17,()=>d1.current,e=>e.serviceId,(e,t)=>{let r=A(()=>z(t)),i=A(()=>T1.current[z(r).serviceId]);{let a=e=>{gx(e,{name:`cloud`})},o=e=>{var t=H(),n=P(t),r=e=>{var t=L5(),n=F(t,!0);R((e,r)=>{q(t,`aria-label`,`(${e??``})`),W(n,r)},[()=>Y(`x_assets`,{values:{count:z(i)}}),()=>_5.current.format(z(i))]),U(e,t)};G(n,e=>{z(i)!==void 0&&e(r)}),U(e,t)},s=A(()=>PY.isSmallScreen||n()?!1:g1.current?.serviceId===z(r).serviceId);KS(e,{get selected(){return z(s)},get label(){return z(r).serviceLabel},onSelect:()=>{x0(f1(z(t)),{transitionType:`forwards`})},startIcon:a,endIcon:o,$$slots:{startIcon:!0,endIcon:!0}})}});var o=I(a,2);{let e=e=>{gx(e,{name:`link_2`})},t=e=>{var t=L5(),n=F(t,!0);R((e,r)=>{q(t,`aria-label`,`(${e??``})`),W(n,r)},[()=>Y(`x_assets`,{values:{count:z(r)}}),()=>_5.current.format(z(r))]),U(e,t)},i=A(()=>PY.isSmallScreen||n()?!1:g1.current?.serviceId===u1.serviceId);KS(o,{get selected(){return z(i)},get label(){return u1.serviceLabel},onSelect:()=>{x0(f1(u1),{transitionType:`forwards`})},startIcon:e,endIcon:t,$$slots:{startIcon:!0,endIcon:!0}})}U(e,i)},$$slots:{default:!0}})}};G(l,e=>{(d1.current.length||l1.current.length)&&e(u)}),U(e,o)},$$slots:{default:!0}})}D(o),R(e=>q(o,`aria-label`,e),[()=>Y(`assets`)]),U(e,o),k()}var R5,z5=()=>{let e=LX.current?.repository,t=e?.databaseName;if(!t)R5=void 0;else return R5?.databaseName!==t&&(R5={databaseName:t,db:Sb(e,`ui-settings`)}),R5.db},nrt=async e=>{try{let t=(await z5()?.get(e))?.sidebarWidth;if(typeof t==`number`&&Number.isFinite(t))return t}catch{}return 240},rrt=async(e,t)=>{let n=z5();if(n)try{await n.set(e,{...await n.get(e),sidebarWidth:t})}catch{}},irt=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`uiSettingsKey`,`primarySidebar`,`main`]),art=B(`<!> <!>`,1),ort=B(`<!> <!> <!>`,1),srt=B(`<div><!></div>`),crt={hash:`svelte-1kkfo1f`,code:`.outer.svelte-1kkfo1f {flex:auto;display:flex;overflow:hidden;&[inert] {display:none;}.primary-sidebar {display:flex;flex-direction:column;flex:none;overflow-y:auto;height:100%;
@media (width < 768px) {flex:auto;width:auto;background-color:var(--sui-primary-background-color);
}
/* Mobile header */header {display:flex;align-items:center;justify-content:space-between;padding:0 10px;height:var(--sui-primary-toolbar-size);h2 {padding:0 10px;font-size:var(--sui-font-size-x-large);}}.sui.search-bar {margin-inline:12px;--sui-textbox-background-color: var(--sui-tertiary-background-color);}[role='radiogroup'] {width:100%;}[role='listbox'] {margin:8px;border-width:0;background-color:transparent;button {display:flex;justify-content:flex-start;border-radius:var(--sui-control-medium-border-radius);width:100%;text-align:start;
@media (pointer: coarse) {height:48px;
}&:not(:first-child) {margin-top:4px;}&:not(:focus) {border-color:transparent;}span {flex:none;}.label {flex:auto;overflow:hidden;}.icon {transition:color 200ms;}.icon.check {display:none;}.count {padding:2px;color:var(--sui-tertiary-foreground-color);font-size:var(--sui-font-size-small);transition:color 200ms;}}[role='option'][aria-selected='true'] {color:var(--sui-highlight-foreground-color);background-color:var(--sui-selected-background-color);.count {color:var(--sui-highlighted-foreground-color);}}[role='option'].dragover {color:var(--sui-primary-accent-color-inverted) !important;background-color:var(--sui-primary-accent-color) !important;}}
/* Styled like the listbox above, so the two sidebars look alike */[role='tree'] {margin:8px;border-width:0;background-color:transparent;
/* No item can expand, so the space kept for the chevrons is dropped */&.flat .chevron.placeholder {display:none;}[role='treeitem'] {> .row {border-radius:var(--sui-control-medium-border-radius);
@media (pointer: coarse) {min-height:48px;
}.icon {flex:none;transition:color 200ms;}.count {flex:none;padding:2px;color:var(--sui-tertiary-foreground-color);font-size:var(--sui-font-size-small);transition:color 200ms;}}&[aria-selected='true'] > .row .count {color:var(--sui-highlighted-foreground-color);}&.dragover > .row {color:var(--sui-primary-accent-color-inverted) !important;background-color:var(--sui-primary-accent-color) !important;}}}.sui.divider {margin:8px 0;}}}`};function B5(e,t){O(t,!0),K(e,crt);let n=J(t,`class`,3,``),r=J(t,`uiSettingsKey`,3,void 0),i=J(t,`primarySidebar`,3,void 0),a=J(t,`main`,3,void 0),o=vs(t,irt),s=j(void 0),c=j(void 0),l=async()=>{r()&&M(c,await nrt(r()),!0)},u=async e=>{let{clientWidth:t}=z(s);await rrt(r(),Math.round(e/100*t))};pa(()=>{l0.current,window.requestAnimationFrame(()=>{l0.current||l()})});var d=srt();fs(d,()=>({role:`group`,id:`page-container`,class:`outer ${n()??``}`,inert:l0.current,...o}),void 0,void 0,void 0,`svelte-1kkfo1f`);var f=N(d),p=e=>{var t=art(),n=P(t);xo(n,()=>i()??Cr),xo(I(n,2),()=>a()??Cr),U(e,t)},m=e=>{vme(e,{onResize:({sizes:e})=>{u(e[0])},children:(e,t)=>{var n=ort(),r=P(n);eC(r,{get defaultSize(){return`${z(c)??``}px`},minSize:`160px`,maxSize:`480px`,children:(e,t)=>{var n=H();xo(P(n),i),U(e,n)},$$slots:{default:!0}});var o=I(r,2);mme(o,{}),eC(I(o,2),{children:(e,t)=>{var n=H();xo(P(n),a),U(e,n)},$$slots:{default:!0}}),U(e,n)},$$slots:{default:!0}})};G(f,e=>{PY.isSmallScreen||!i()||!a()?e(p):z(c)!==void 0&&e(m,1)}),D(d),gs(d,e=>M(s,e),()=>z(s)),U(e,d),k()}var lrt=B(`<bdi> </bdi>`),urt=B(`<div role="none" class="label"><!></div>`),drt=B(`<!> <!> <!>`,1);function frt(e,t){O(t,!0);let n=A(()=>t.asset.path),r=A(()=>t.asset.name),i=A(()=>t.asset.folder),a=A(()=>t.asset.kind);US(e,{onclick:()=>{x0(Kl(`/assets/${z(n)}`),{transitionType:`forwards`})},children:(e,n)=>{var o=drt(),s=P(o);VS(s,{class:`image`,children:(e,n)=>{k0(e,{get kind(){return z(a)},get asset(){return t.asset},variant:`icon`,cover:!0})},$$slots:{default:!0}});var c=I(s,2);VS(c,{class:`collection`,children:(e,t)=>{var n=H();Oo(P(n),()=>Ec.current,e=>{var t=lrt(),n=F(t,!0);R(e=>W(n,e),[()=>W1(z(i))]),U(e,t)}),U(e,n)},$$slots:{default:!0}}),VS(I(c,2),{class:`title`,children:(e,t)=>{var n=urt();Nx(N(n),{lines:2,children:(e,t)=>{var n=lrt(),i=F(n,!0);R(()=>W(i,z(r))),U(e,n)},$$slots:{default:!0}}),D(n),U(e,n)},$$slots:{default:!0}}),U(e,o)},$$slots:{default:!0}}),k()}var prt=B(`<span role="none" hidden=""></span> <!>`,1);function V5(e,t){O(t,!0);let n=j(void 0),r=j(void 0),i=A(()=>z(r)?.entry===t.entry?z(r).src:void 0);L(()=>{let e=z(n)?.parentElement;if(!e)return;let i=t.collection,a=t.entry,o,s=D0(e,()=>{o=zGe(i,a,e=>{M(r,{entry:a,src:e})})});return()=>{s(),o?.()}});var a=prt(),o=P(a);gs(o,e=>M(n,e),()=>z(n));var s=I(o,2),c=e=>{P0(e,{get src(){return z(i)},get variant(){return t.variant},cover:!0,loading:`eager`})};G(s,e=>{z(i)&&e(c)}),U(e,a),k()}var mrt=B(`<bdi> </bdi>`),hrt=B(`<bdi><!></bdi>`),grt=B(`<div role="none" class="label"><!></div>`),_rt=B(`<!> <!> <!>`,1);function vrt(e,t){O(t,!0);let n=(e,t)=>{let n=()=>(t?.()).collection,s=()=>(t?.()).collectionFile;US(e,{onclick:()=>{x0(c0(n().name,s()?.name||z(o)),{state:{highlight:{locale:z(i),keyPath:z(a)}},transitionType:`forwards`})},children:(e,t)=>{var i=_rt(),a=P(i);VS(a,{class:`image`,children:(e,t)=>{var i=H(),a=P(i),o=e=>{V5(e,{get collection(){return n()},get entry(){return z(r)},variant:`icon`})};G(a,e=>{n()._type===`entry`&&e(o)}),U(e,i)},$$slots:{default:!0}});var o=I(a,2);VS(o,{class:`collection`,children:(e,t)=>{var r=H();Oo(P(r),()=>Ec.current,e=>{var t=mrt(),r=F(t,!0);R(e=>W(r,e),[()=>qf(n())]),U(e,t)}),U(e,r)},$$slots:{default:!0}}),VS(I(o,2),{class:`title`,children:(e,t)=>{var i=grt();Nx(N(i),{lines:2,children:(e,t)=>{var i=hrt(),a=N(i),o=e=>{var t=V();R(e=>W(t,e),[()=>Kp(s())]),U(e,t)},c=e=>{var t=H();Oo(P(t),()=>Ec.current,e=>{var t=H();Lo(P(t),()=>wW(n(),z(r),{useTemplate:!0,allowMarkdown:!0})),U(e,t)}),U(e,t)};G(a,e=>{s()?e(o):e(c,-1)}),D(i),U(e,i)},$$slots:{default:!0}}),D(i),U(e,i)},$$slots:{default:!0}}),U(e,i)},$$slots:{default:!0}})},r=A(()=>t.result.entry),i=A(()=>t.result.locale),a=A(()=>t.result.keyPath),o=A(()=>z(r).subPath);var s=H();No(P(s),17,()=>$U(z(r)),e=>e.name,(e,t)=>{var i=H();Do(P(i),Iu,null,e=>{var i=H();No(P(i),17,()=>qp(z(t),z(r)),e=>e.name,(e,r)=>{var i=H();Do(P(i),Iu,null,e=>{n(e,()=>({collection:z(t),collectionFile:z(r)}))}),U(e,i)},e=>{n(e,()=>({collection:z(t)}))}),U(e,i)}),U(e,i)}),U(e,s),k()}var yrt=B(`<span role="none"> </span>`),brt=B(`<div role="none"><!></div>`);function xrt(e,t){O(t,!0),L(()=>{d0.current=Y(t.statusMessageKey,{values:{terms:k5.current,count:t.items.length}})}),fH(e,{get ariaLabel(){return t.label},children:(e,n)=>{var r=brt(),i=N(r),a=e=>{E5(e,{viewType:`list`,get"aria-label"(){return t.label},get"aria-rowcount"(){return t.items.length},children:(e,n)=>{var r=H();Oo(P(r),()=>k5.current,e=>{tC(e,{get items(){return t.items},get itemKey(){return t.itemKey},get renderItem(){return t.renderItem}})}),U(e,r)},$$slots:{default:!0}})},o=e=>{dH(e,{children:(e,n)=>{var r=yrt(),i=F(r,!0);R(()=>W(i,t.emptyMessage)),U(e,r)},$$slots:{default:!0}})};G(i,e=>{t.items.length?e(a):k5.current&&e(o,1)}),D(r),U(e,r)},$$slots:{default:!0}}),k()}var Srt=({assets:e,terms:t})=>{let n=VHe(t);return!e.length||!n.length?[]:e.filter(e=>HHe({value:e.name,tokens:n,normalizedValueCache:J2(e)}))},Crt=rl(()=>Srt({assets:Op.current,terms:k5.current})),wrt=({entry:e,terms:t,normalizedValueCache:n=void 0})=>{let r=0,i,a,o=$U(e);if(!o.length)return{id:e.id,entry:e,points:0,locale:i,keyPath:a};o.forEach(i=>{X2({value:i.label||i.name,terms:t,normalizedValueCache:n})&&(r+=10),r+=qp(i,e).filter(e=>X2({value:e.label||e.name,terms:t,normalizedValueCache:n})).length});let s=wW(o[0],e,{useTemplate:!0}),c=J2(e);return X2({value:s,terms:t,normalizedValueCache:c})&&(r+=10),Object.entries(e.locales).forEach(([e,{content:n}])=>{r+=Object.entries(n).filter(([n,r])=>{let o=typeof r==`string`&&!!r&&X2({value:r,terms:t,normalizedValueCache:c})||typeof r==`number`&&X2({value:String(r),terms:t,normalizedValueCache:c});return o&&!i&&!a&&(i=e,a=n),o}).length}),{id:e.id,entry:e,points:r,locale:i,keyPath:a}},Trt=({entries:e,terms:t})=>{if(t=Y2(t),!e.length||!t)return[];let n=new Map;return e.map(e=>wrt({entry:e,terms:t,normalizedValueCache:n})).filter(({points:e})=>e>0).sort((e,t)=>t.points-e.points)},Ert=rl(()=>Trt({entries:QZ(Vp.current,OZ.current),terms:k5.current})),Drt=B(`<h2 role="none"> </h2>`),Ort=B(`<div role="none" class="wrapper svelte-1p7vfqa"><!> <div role="none" class="results svelte-1p7vfqa"><!> <!></div></div>`),krt={hash:`svelte-1p7vfqa`,code:`.wrapper.svelte-1p7vfqa {flex:auto;display:flex;flex-direction:column;overflow:hidden;width:100%;background-color:var(--sui-primary-background-color);}.results.svelte-1p7vfqa {flex:auto;overflow:auto;& > .sui.group {display:contents;& > .inner > div {display:contents;}}h3 {flex:none;margin:16px;color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-large);& + div {overflow:auto;flex:auto;}
@media (width < 768px) {display:none;
}}}`};function Art(e,t){O(t,!0),K(e,krt);var n=Ort(),r=N(n),i=e=>{IV(e,{variant:`primary`,children:(e,t)=>{var n=Drt(),r=F(n,!0);R(e=>W(r,e),[()=>Y(`search_results`)]),U(e,n)},$$slots:{default:!0}})};G(r,e=>{PY.isSmallScreen||e(i)});var a=I(r,2),o=N(a),s=e=>{{let t=(e,t=Cr)=>{vrt(e,{get result(){return t()}})},n=A(()=>Y(`entries`)),r=A(()=>Y(`no_entries_found`));xrt(e,{get items(){return Ert.current},itemKey:`id`,get label(){return z(n)},get emptyMessage(){return z(r)},statusMessageKey:`viewing_entry_search_results`,renderItem:t,$$slots:{renderItem:!0}})}};G(o,e=>{O5.current===`contents`&&e(s)});var c=I(o,2),l=e=>{{let t=(e,t=Cr)=>{frt(e,{get asset(){return t()}})},n=A(()=>Y(`assets`)),r=A(()=>Y(`no_files_found`));xrt(e,{get items(){return Crt.current},itemKey:`path`,get label(){return z(n)},get emptyMessage(){return z(r)},statusMessageKey:`viewing_asset_search_results`,renderItem:t,$$slots:{renderItem:!0}})}};G(c,e=>{O5.current===`assets`&&e(l)}),D(a),D(n),U(e,n),k()}var jrt=B(`<!> <div role="search" class="svelte-1476at1"><!></div>`,1),Mrt={hash:`svelte-1476at1`,code:`[role='search'].svelte-1476at1 {display:contents;.sui.search-bar {flex:auto;}}`};function H5(e,t){O(t,!0),K(e,Mrt),D5(e,{primaryToolbar:e=>{var t=H(),n=P(t),r=e=>{IV(e,{variant:`primary`,children:(e,t)=>{var n=jrt(),r=P(n);{let e=A(()=>Y(O5.current===`assets`?`back_to_asset_folder_list`:`back_to_collection_list`));x5(r,{get"aria-label"(){return z(e)},onclick:()=>{k5.current=``,x0(O5.current===`assets`?`/assets`:`/collections`,{transitionType:`backwards`})}})}var i=I(r,2);I5(N(i),{}),D(i),U(e,n)},$$slots:{default:!0}})};G(n,e=>{PY.isSmallScreen&&e(r)}),U(e,t)},mainContent:e=>{Art(e,{})},$$slots:{primaryToolbar:!0,mainContent:!0}}),k()}var Nrt=rl(()=>{let{current:e}=Dp,t=[`name`];return e.every(e=>!!e.commitAuthor)&&t.push(`commit_author`),e.every(e=>!!e.commitDate)&&t.push(`commit_date`),t.map(e=>({key:e,label:Y(`sort_keys.${e}`)}))}),Prt=e=>{Lnt(e,{})},Frt=B(`<!> <!> <!> <!> <!> <!> <!>`,1);function Irt(e,t){O(t,!0);let n=j(!1),r=j(!1),i=j(!1),a=A($tt),o=()=>{(e=>{M(n,e.isIndexPage,!0),M(r,e.isSearchPage,!0),M(i,e.notFound,!0)})(ant())};L(()=>{let e=g1.current;e&&e.authType!==`widget`&&F1(e)&&(e.serviceId===`linked`&&l1.current,eo(()=>{G2(e)}))}),So(()=>(o(),()=>{tnt(),V1.current=!1}));var s=Frt();oo(`hashchange`,$i,e=>{b0(e,o,Ztt)});var c=P(s);{let e=e=>{var t=H(),i=P(t),a=e=>{trt(e,{get isSearchPage(){return z(r)}})};G(i,e=>{(!PY.isSmallScreen||z(n))&&e(a)}),U(e,t)},t=e=>{var t=H(),o=P(t),s=e=>{H5(e,{})},c=e=>{{let t=e=>{{let t=A(()=>Y(`asset_folder_not_found`));w5(e,{get message(){return z(t)},backPath:`/assets`})}},n=A(()=>Y(`asset_library`));D5(e,{id:`assets-container`,get"aria-label"(){return z(n)},mainContent:t,$$slots:{mainContent:!0}})}},l=e=>{Jtt(e,{})},u=e=>{{let t=e=>{Unt(e,{})},n=e=>{var t=H(),n=P(t),r=e=>{{let t=A(()=>Object.values(Q1.current).flat(1));Rtt(e,{get allItems(){return z(t)},get selectedItems(){return kp},get totalCount(){return K1.current.length},get sortKeys(){return Nrt.current}})}};G(n,e=>{K1.current.length&&e(r)}),U(e,t)},r=e=>{lnt(e,{})},i=e=>{{let t=(e,t=Cr)=>{Ont(e,{get asset(){return t()},showPreview:!0})},n=A(()=>J1.current?Prt:void 0);wtt(e,{get asset(){return Ap.current},get fallback(){return z(n)},children:t,$$slots:{default:!0}})}},o=A(()=>Y(`x_asset_folder`,{values:{folder:z(a)}}));D5(e,{id:`assets-container`,get"aria-label"(){return z(o)},primaryToolbar:t,secondaryToolbar:n,mainContent:r,secondarySidebar:i,$$slots:{primaryToolbar:!0,secondaryToolbar:!0,mainContent:!0,secondarySidebar:!0}})}};G(o,e=>{z(r)?e(s):z(i)?e(c,1):g1.current?e(l,2):PY.isSmallScreen&&z(n)||e(u,3)}),U(e,t)},o=A(()=>Y(`asset_library`));B5(c,{uiSettingsKey:`assets-page`,get"aria-label"(){return z(o)},primarySidebar:e,main:t,$$slots:{primarySidebar:!0,main:!0}})}var l=I(c,2),u=e=>{var t=H(),n=P(t),r=e=>{vet(e,{})},i=e=>{Ant(e,{})};G(n,e=>{g1.current?e(r):e(i,-1)}),U(e,t)};G(l,e=>{V1.current&&e(u)});var d=I(l,2);Int(d,{});var f=I(d,2);Wnt(f,{});var p=I(f,2);Rnt(p,{});var m=I(p,2);Gnt(m,{}),dnt(I(m,2),{}),U(e,s),k()}var Lrt=B(`<iframe id="cloudinary-iframe" allow="camera; storage-access" sandbox="allow-same-origin allow-scripts allow-popups allow-forms
allow-storage-access-by-user-activation" class="svelte-1y1y5aq"></iframe>`),Rrt={hash:`svelte-1y1y5aq`,code:`iframe.svelte-1y1y5aq {display:block;width:calc(100% - 32px);height:calc(100% - 32px);border:none;}
/* Avoid scrolling issue https://github.com/sveltia/sveltia-cms/issues/824 */dialog[inert] > iframe.svelte-1y1y5aq {display:none;}`};function zrt(e,t){O(t,!0),K(e,Rrt);let n=j(``),r=j(``),i=e=>{wq(e)?.type===`consoleLoaded`&&(vq.current=!0)};So(()=>{vq.current=!1;let e=FMe();if(!e)return;let{cloud_name:t,api_key:i}=e.config??{};if(!t||!i)return;M(r,window.crypto.randomUUID(),!0);let a=new URLSearchParams({...Object.fromEntries(Object.entries(e.config).filter(([e])=>NMe.includes(e))),ml_id:z(r),pmHost:window.location.origin,new_cms:`true`});M(n,`https://console.cloudinary.com/console/media_library/cms?${a}`)});var a=H();oo(`message`,$i,i);var o=P(a),s=e=>{qx(e,{keepContent:!0,get open(){return yq.current},set open(e){yq.current=e},children:(e,t)=>{var i=Lrt();R(e=>{q(i,`src`,z(n)),q(i,`title`,e),q(i,`data-ml-id`,z(r))},[()=>Y(`cloud_storage.cloudinary.iframe_title`)]),U(e,i)},$$slots:{default:!0}})};G(o,e=>{z(n)&&e(s)}),U(e,a),k()}var Brt=B(`<!> <!> <!> <!> <!> <!> <!> <!> <!>`,1);function Vrt(e,t){O(t,!0);var n=Brt(),r=P(n);fC(r,{get show(){return u2.current.saved},set show(e){u2.current.saved=e},children:(e,t)=>{bx(e,{status:`success`,children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(u2.current.published?`assets_saved_and_published`:`assets_saved`,{values:{count:u2.current.count}})]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}});var i=I(r,2);fC(i,{get show(){return u2.current.moved},set show(e){u2.current.moved=e},children:(e,t)=>{bx(e,{status:`success`,children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(`assets_moved`,{values:{count:u2.current.count}})]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}});var a=I(i,2);fC(a,{get show(){return u2.current.renamed},set show(e){u2.current.renamed=e},children:(e,t)=>{bx(e,{status:`success`,children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(`assets_renamed`,{values:{count:u2.current.count}})]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}});var o=I(a,2);fC(o,{get show(){return u2.current.folderCreated},set show(e){u2.current.folderCreated=e},children:(e,t)=>{bx(e,{status:`success`,children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(`folder_created`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}});var s=I(o,2);fC(s,{get show(){return u2.current.folderRenamed},set show(e){u2.current.folderRenamed=e},children:(e,t)=>{bx(e,{status:`success`,children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(`folder_renamed`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}});var c=I(s,2);fC(c,{get show(){return u2.current.folderDeleted},set show(e){u2.current.folderDeleted=e},children:(e,t)=>{bx(e,{status:`success`,children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(`folder_deleted`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}});var l=I(c,2);fC(l,{get show(){return u2.current.deleted},set show(e){u2.current.deleted=e},children:(e,t)=>{bx(e,{status:`success`,children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(`assets_deleted`,{values:{count:u2.current.count}})]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}});var u=I(l,2);{let e=A(()=>d2.current.pending>0);fC(u,{get show(){return z(e)},duration:0,children:(e,t)=>{bx(e,{status:`info`,children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(d2.current.progress)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}})}fC(I(u,2),{get show(){return d2.current.failed},set show(e){d2.current.failed=e},children:(e,t)=>{bx(e,{status:`error`,children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(d2.current.failure)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),U(e,n),k()}var Hrt=B(`<div role="status"> </div>`),Urt=B(`<div role="group" class="section uploading svelte-96nj3d"><div role="none"><!></div> <!></div>`),Wrt=B(`<div role="group" class="section oversized svelte-96nj3d"><!> <!></div>`),Grt=B(`<div role="group" class="section invalid svelte-96nj3d"><!> <!></div>`),Krt=B(`<div role="group" class="section mismatched svelte-96nj3d"><!> <!></div>`),qrt=B(`<!> <!>`,1),Jrt=B(`<div role="group" class="section svelte-96nj3d"> <!></div>`),Yrt=B(`<!> <!> <!> <!> <!> <!>`,1),Xrt={hash:`svelte-96nj3d`,code:`.section.svelte-96nj3d {display:flex;flex-direction:column;gap:12px;&:not(:first-child) {margin-top:16px;}& > * {flex:none;}&.oversized .files,
&.invalid .files,
&.mismatched .files {opacity:0.5;}}`};function Zrt(e,t){O(t,!0),K(e,Xrt);let n=A(()=>Mp.current),r=A(()=>z(n).files),i=A(()=>z(n).folder),a=A(()=>z(n).subfolderPath),o=A(()=>z(n).originalAssets),s=A(()=>z(o)?.[0]),c=A(()=>C2.current),l=A(()=>z(c).processing),u=A(()=>z(c).validFiles),d=A(()=>z(c).oversizedFiles),f=A(()=>z(c).invalidFiles),p=A(()=>z(c).transformedFileMap),m=A(()=>nJ().config),h=A(()=>z(m).max_file_size),g=A(()=>TJ(Mp.current)),_=A(()=>z(s)||z(g)===void 0?[]:OQ(z(g))),v=A(()=>z(s)?z(u).filter(e=>!Ql(Uc(e.name).extension,Uc(z(s).name).extension)):[]),y=A(()=>z(u).filter(e=>!z(v).includes(e))),b=A(()=>z(y)),x=A(()=>(z(y),!0)),S=A(()=>AQ(z(b),z(_))),C=A(()=>z(S).length);L(()=>{V1.current||(Mp.current={folder:void 0,files:[]})});{let t=A(()=>Y(z(s)?`replace_asset`:`upload_assets`)),n=A(()=>Y(z(s)?`replace`:`upload`)),c=A(()=>!z(b).length);wS(e,{get open(){return gBe.current},get title(){return z(t)},get okLabel(){return z(n)},get okDisabled(){return z(c)},onOk:()=>{let e=z(s)?{files:z(b),folder:z(i),originalAssets:z(o)}:{files:z(b),folder:z(i),subfolderPath:z(a),replaceDuplicates:z(x)};Mp.current={folder:void 0,files:[]},y2(()=>Nnt(e,{commitType:`uploadMedia`}),{progress:`uploading_files_progress`,failure:`uploading_files_failed`})},onCancel:()=>{Mp.current={folder:void 0,files:[]}},children:(e,t)=>{var n=Yrt(),i=P(n),a=e=>{var t=Hrt(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`processing_files`,{values:{count:z(r).length}})]),U(e,t)};G(i,e=>{z(l)&&e(a)});var o=I(i,2),c=e=>{var t=Urt(),n=N(t),r=N(n),i=e=>{var t=V();R(e=>W(t,e),[()=>Y(`confirm_replacing_file`,{values:{name:z(s).name}})]),U(e,t)},a=e=>{var t=V();R(e=>W(t,e),[()=>Y(`confirm_uploading_files`,{values:{count:z(b).length,folder:`/${z(g)}`}})]),U(e,t)};G(r,e=>{z(s)?e(i):e(a,-1)}),D(n),R0(I(n,2),{get transformedFileMap(){return z(p)},get files(){return z(b)},set files(e){M(b,e)}}),D(t),R(e=>q(t,`aria-label`,e),[()=>Y(`uploading_files`)]),U(e,t)};G(o,e=>{z(b).length&&e(c)});var u=I(o,2),m=e=>{var t=Wrt(),n=N(t);bx(n,{status:`warning`,children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(`warning_oversized_files`,{values:{count:z(d).length,size:I0(z(h))}})]),U(e,n)},$$slots:{default:!0}}),R0(I(n,2),{get files(){return z(d)},get transformedFileMap(){return z(p)},removable:!1}),D(t),R(e=>q(t,`aria-label`,e),[()=>Y(`oversized_files`)]),U(e,t)};G(u,e=>{z(d).length&&e(m)});var _=I(u,2),y=e=>{var t=Grt(),n=N(t);bx(n,{status:`warning`,children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(`warning_invalid_files`,{values:{count:z(f).length}})]),U(e,n)},$$slots:{default:!0}}),R0(I(n,2),{get files(){return z(f)},removable:!1,showThumbnail:!1}),D(t),R(e=>q(t,`aria-label`,e),[()=>Y(`invalid_files`)]),U(e,t)};G(_,e=>{z(f).length&&e(y)});var S=I(_,2),w=e=>{var t=Krt(),n=N(t);bx(n,{status:`warning`,children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(`warning_mismatched_files`,{values:{count:z(v).length,name:z(s)?.name}})]),U(e,n)},$$slots:{default:!0}}),R0(I(n,2),{get files(){return z(v)},get transformedFileMap(){return z(p)},removable:!1}),D(t),R(e=>q(t,`aria-label`,e),[()=>Y(`mismatched_files`)]),U(e,t)};G(S,e=>{z(v).length&&e(w)});var T=I(S,2),ee=e=>{var t=Jrt(),n=N(t),r=I(n);{let e=A(()=>Y(`file_name_conflict_resolution`));eme(r,{get ariaLabel(){return z(e)},onChange:({detail:e})=>{M(x,e.value===`replace`)},children:(e,t)=>{var n=qrt(),r=P(n);ZS(r,{value:`replace`,get checked(){return z(x)},children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(`replace`)]),U(e,n)},$$slots:{default:!0}});var i=I(r,2);{let e=A(()=>!z(x));ZS(i,{value:`keep`,get checked(){return z(e)},children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(`keep_both`)]),U(e,n)},$$slots:{default:!0}})}U(e,n)},$$slots:{default:!0}})}D(t),R(e=>W(n,`${e??``} `),[()=>Y(`file_name_conflict_confirmation`,{values:{count:z(C)}})]),U(e,t)};G(T,e=>{z(C)&&e(ee)}),U(e,n)},$$slots:{default:!0}})}k()}function Qrt(e,t){O(t,!0);let n=j(void 0),r=A(()=>Mp.current),i=A(()=>z(r).originalAssets),a=A(()=>z(i)?.[0]),o=A(()=>!z(a)),s=A(()=>z(a)?gp.getType(z(a).name)??void 0:void 0),c=e=>{e.length&&(Mp.current=z(a)?{folder:z(a).folder,files:e,originalAssets:z(i)}:{folder:Ty.current,subfolderPath:sJ.current,files:e},H1.current=!1)};L(()=>{!PY.hasMouse&&H1.current&&z(n)?.open()}),L(()=>{V1.current||(H1.current=!1)}),L(()=>{H1.current||eo(()=>{!Mp.current.files.length&&Mp.current.originalAssets&&(Mp.current={folder:void 0,files:[]})})});var l=H(),u=P(l),d=e=>{{let t=A(()=>z(a)?Y(`replace_x`,{values:{name:z(a).name}}):Y(`upload_assets`));SS(e,{get title(){return z(t)},showOk:!1,get open(){return H1.current},set open(e){H1.current=e},children:(e,t)=>{z0(e,{showUploadButton:!0,get accept(){return z(s)},get multiple(){return z(o)},filterDroppedFiles:!1,onDrop:({files:e})=>{c(e)}})},$$slots:{default:!0}})}},f=e=>{gs(RS(e,{get accept(){return z(s)},get multiple(){return z(o)},onSelect:({files:e})=>{c(e)},onCancel:()=>{H1.current=!1}}),e=>M(n,e,!0),()=>z(n))};G(u,e=>{PY.hasMouse?e(d):e(f,-1)}),U(e,l),k()}var $rt=B(`<div role="blockquote" class="svelte-2picl5"><pre class="svelte-2picl5"> </pre></div>`),eit={hash:`svelte-2picl5`,code:`div.svelte-2picl5 {flex:auto;overflow:auto;}pre.svelte-2picl5 {margin:0;padding:16px;width:100%;min-width:fit-content;min-height:-moz-available;min-height:-webkit-fill-available;min-height:stretch;background-color:var(--sui-primary-background-color);}`};function tit(e,t){O(t,!0),K(e,eit);{let t=e=>{var t=$rt(),n=F(N(t),!0);D(t),R((e,r)=>{q(t,`aria-label`,e),W(n,r)},[()=>Y(`cms_config`),()=>bce(Ol)]),U(e,t)},n=A(()=>Y(`site_configuration_editor`));B5(e,{get"aria-label"(){return z(n)},main:t,$$slots:{main:!0}})}k()}var nit=({timestamp:e,locale:t,now:n=new Date})=>{let r=n.getFullYear()===e.getFullYear(),i=r&&n.getMonth()===e.getMonth()&&n.getDate()===e.getDate();return e.toLocaleString(t,{year:r?void 0:`numeric`,month:i?void 0:`short`,day:i?void 0:`numeric`,hour:`numeric`,minute:`numeric`})},rit=B(`<!> <!> <!> <!>`,1);function iit(e,t){O(t,!0);let n=A(()=>U6.current),r=A(()=>z(n).resolve),i=A(()=>{let{timestamp:e}=U6.current;return e?nit({timestamp:e,locale:Ec.current}):void 0});L(()=>{$1.current||J6()});var a=rit(),o=P(a);{let e=A(()=>Y(`restore_backup_title`)),t=A(()=>Y(`restore`)),n=A(()=>Y(`discard`));wS(o,{modal:!1,showBackdrop:!0,movable:!0,get title(){return z(e)},get okLabel(){return z(t)},get cancelLabel(){return z(n)},onOk:()=>{z(r)?.(!0)},onCancel:()=>{z(r)?.(!1)},get open(){return U6.current.show},set open(e){U6.current.show=e},children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(`restore_backup_description`,{values:{datetime:z(i)}})]),U(e,n)},$$slots:{default:!0}})}var s=I(o,2);fC(s,{get show(){return W6.current.saved},set show(e){W6.current.saved=e},children:(e,t)=>{bx(e,{status:`info`,children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(`draft_backup_saved`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}});var c=I(s,2);fC(c,{get show(){return W6.current.restored},set show(e){W6.current.restored=e},children:(e,t)=>{bx(e,{status:`success`,children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(`draft_backup_restored`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),fC(I(c,2),{get show(){return W6.current.deleted},set show(e){W6.current.deleted=e},children:(e,t)=>{bx(e,{status:`info`,children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(`draft_backup_deleted`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),U(e,a),k()}var ait=({collectionName:e,fileName:t})=>wie.get(t??e),oit=({lang:e,dir:t,styleURLs:n,origin:r})=>`
<!DOCTYPE html>
<html${e?` lang="${Gu(e)}"`:``}${t?` dir="${t}"`:``}>
<head>
<meta charset="UTF-8">
<base href="${Gu(r)}" target="_blank">
${n.map(e=>`<link rel="stylesheet" href="${Gu(e)}">`).join(`
`)}
</head>
<body></body>
</html>
`,sit=B(`<iframe class="preview svelte-1k58u5t" sandbox="allow-same-origin allow-scripts allow-popups allow-forms"></iframe>`),cit={hash:`svelte-1k58u5t`,code:`iframe.svelte-1k58u5t {display:block;border:none;width:100%;height:100%;}`};function lit(e,t){O(t,!0),K(e,cit);let n=LK(),r=j(!1),i=j(void 0),a=j(void 0),o,s=A(()=>Ef(t.locale)),c=A(()=>t.locale===`_default`?void 0:Df(t.locale)),l=()=>{let e=z(i)?.contentDocument?.body;e&&(o=go(Gx,{target:e,context:RK(n),props:{children:t.children}}))},u=()=>{let{contentDocument:e,contentWindow:n}=z(i);if(!z(a)||!t.reactComponent||!t.reactProps||!e||!n)return;let r={...t.reactProps,document:e,window:n};z(a).render((0,mr.createElement)(t.reactComponent,r))},d=async()=>{if(!t.reactComponent)return;let{createRoot:e}=await A3(),n=z(i)?.contentDocument,r=n?.body;if(!n||!r)return;let o=e=>{q$e({event:e,locale:t.locale})};n.addEventListener(`click`,o),n.addEventListener(`keydown`,o),M(a,e(r),!0)},f=e=>{console.error(e)},p=()=>{if(!z(i)||z(r))return;let e=t.reactComponent?d:l,n=oit({lang:z(s),dir:z(c),styleURLs:t.styleURLs,origin:window.location.origin}),a=URL.createObjectURL(new Blob([n],{type:`text/html`}));z(i).addEventListener(`load`,async()=>{try{await e()}catch(e){f(e)}URL.revokeObjectURL(a),M(r,!0),t.onLoad?.(z(i))},{once:!0}),z(i).src=a};L(()=>{z(i)&&!z(r)&&p()}),L(()=>{let e=z(r)?z(i)?.contentDocument?.documentElement:void 0;e&&(z(s)?e.lang=z(s):e.removeAttribute(`lang`),z(c)?e.dir=z(c):e.removeAttribute(`dir`))}),L(()=>{x4.current,z(r)&&z(a)&&t.reactComponent&&t.reactProps&&u()}),L(()=>()=>{z(a)?.unmount(),o&&yo(o)});var m=sit();gs(m,e=>M(i,e),()=>z(i)),R(e=>q(m,`title`,e),[()=>Y(`content_preview`)]),U(e,m),k()}var uit=({collectionName:e,fileName:t})=>[...new Set([...Wd].filter(({collection:n,file:r})=>(n===void 0||n===e)&&(r===void 0||r===t)).map(({url:e})=>e))],dit=({target:e,entryDraft:t,locale:n,keyPath:r,fieldConfig:i})=>go(L6,{target:e,context:RK(t),props:{keyPath:r,typedKeyPath:``,locale:n,fieldConfig:i,showLabel:!1}}),fit=({entryDraft:e,locale:t,keyPath:n,fieldConfig:r})=>{let i=(0,mr.useRef)(null);return(0,mr.useLayoutEffect)(()=>{let a=dit({target:i.current,entryDraft:e,locale:t,keyPath:n,fieldConfig:r});return()=>{yo(a)}},[e,t,n,r]),(0,mr.createElement)(`div`,{ref:i})},pit=({entryDraft:e,locale:t,getFieldArgs:n})=>r=>{let i=lh({...n,keyPath:r});return i?(0,mr.createElement)(fit,{entryDraft:e,locale:t,keyPath:r,fieldConfig:i}):null},mit=(e,t,n)=>b4().Map(Object.fromEntries(Object.keys(e).map(e=>[e,n(`${t}.${e}`)]).filter(([,e])=>e!==null))),hit=(e,t)=>n=>{let r=e[n];if(r==null)return r;let{fromJS:i,Map:a}=b4();return Array.isArray(r)?r.map((e,r)=>{let o=typeof e==`object`&&!!e;return a({data:i(e),widgets:o?mit(e,`${n}.${r}`,t):a({})})}):typeof r==`object`?a({data:i(r),widgets:mit(r,n,t)}):r},git=async(e,t)=>{let n=Kf(e);if(!n)throw Error(`Collection "${e}" not found`);let{defaultLocale:r}=n._i18n,i=rW(e),a={locale:r,collectionName:e,associatedAssets:DWe({collectionName:e})},o=e=>vWe({...a,entry:e});return t?o(i.find(e=>e.slug===t)):i.map(o)},_it=({entryDraft:e,draft:t,locale:n})=>{let{entryMap:r,valueMap:i,getFieldArgs:a,fieldsMetaData:o,getAsset:s}=OWe({draft:t,locale:n}),c=pit({entryDraft:e,locale:n,getFieldArgs:a});return{entry:r,widgetFor:c,widgetsFor:hit(Sm(i),c),getAsset:s,getCollection:git,fieldsMetaData:o}},vit=B(`<div role="none"><!></div>`),yit=B(`<div role="document" class="svelte-17akd4q"><!></div>`),bit={hash:`svelte-17akd4q`,code:`[role='document'].svelte-17akd4q {--entry-preview-padding-block: 8px;--entry-preview-padding-inline: 16px;padding-block:var(--entry-preview-padding-block);padding-inline:var(--entry-preview-padding-inline);
/* Keep the content written by other users within the preview, even if it’s positioned */contain:paint;}`};function xit(e,t){O(t,!0),K(e,bit);let n=e=>{var n=H();No(P(n),17,()=>z(s),e=>e.name,(e,n)=>{var r=vit();pH(N(r),{children:(e,r)=>{L6(e,{get keyPath(){return z(n).name},get typedKeyPath(){return z(n).name},get locale(){return t.locale},get fieldConfig(){return z(n)}})},$$slots:{default:!0}}),D(r),R(()=>q(r,`data-lazy-key-path`,z(n).name)),U(e,r)}),U(e,n)},r=LK(),i=A(()=>r.current??{}),a=A(()=>z(i).collectionName),o=A(()=>z(i).fileName),s=A(()=>Tr(z(i).fields,()=>[],!0)),c=A(()=>uit({collectionName:z(a),fileName:z(o)})),l=A(()=>ait({collectionName:z(a),fileName:z(o)})),u=A(()=>r.current&&z(l)&&_4.current?_it({entryDraft:r,draft:{...r.current,currentValues:AK(r.current)},locale:t.locale}):void 0);L(()=>{z(l)&&v4().catch(e=>{console.error(e)})}),pH(e,{children:(e,r)=>{var i=H(),a=P(i),o=e=>{lit(e,{get locale(){return t.locale},get styleURLs(){return z(c)},get reactComponent(){return z(l)},get reactProps(){return z(u)},get onLoad(){return t.onFrameLoad}})},s=e=>{lit(e,{get locale(){return t.locale},get styleURLs(){return z(c)},get children(){return n},get onLoad(){return t.onFrameLoad}})},d=e=>{var t=yit(),r=N(t);n(r),D(t),R(e=>q(t,`aria-label`,e),[()=>Y(`content_preview`)]),U(e,t)};G(a,e=>{z(l)&&z(u)?e(o):z(c).length?e(s,1):e(d,-1)}),U(e,i)},$$slots:{default:!0}}),k()}var U5,Sit=Zv(),W5={capture:!0,passive:!0},Cit={passive:!0},wit=e=>{if(e===e.ownerDocument.documentElement)return{x:0,y:0};let{left:t,top:n}=e.getBoundingClientRect();return{x:t,y:n}},Tit=e=>wit(e).y,Eit=(e,t)=>t.getBoundingClientRect().top-Tit(e)+e.scrollTop,Dit=(e,t,n=!1)=>{let{top:r,height:i}=t.getBoundingClientRect(),{scrollTop:a,clientHeight:o}=e;return Q$e({viewTop:Tit(e),viewHeight:o,scrollTop:a,top:r,height:i,always:n})},Oit=e=>{let t,n,r=()=>{window.requestAnimationFrame(()=>{let{contentArea:t}=e,{thisPaneContentArea:n}=e,{thatPaneContentArea:r}=e;if(!e.syncScrolling||!t||!n||!r)return;let{x:i,y:a}=wit(n),{ownerDocument:o,scrollTop:s,scrollHeight:c,clientHeight:l}=n;if(s<=0){r.scrollTop=0;return}let u=o.elementsFromPoint(i+80,a).findLast(e=>e.matches(`[data-key-path]`));if(!u){r.scrollTop=J$e({scrollTop:s,scrollHeight:c,clientHeight:l,targetScrollHeight:r.scrollHeight,targetClientHeight:r.clientHeight});return}let{keyPath:d}=u.dataset,{top:f,height:p}=u.getBoundingClientRect(),m=r.querySelector(`[data-key-path="${CSS.escape(d)}"]`),h=m?Y$e({y:a,top:f,height:p,targetTop:Eit(r,m),targetHeight:m.getBoundingClientRect().height}):void 0;h!==void 0&&(r.scrollTop=h)})},i=()=>{U5=e.thisPaneContentArea,Sit.next()},a=()=>{U5===e.thisPaneContentArea&&r()},o=async t=>{let{thisPaneContentArea:n}=e,{thatPaneContentArea:r}=e;if(!e.syncScrolling||!n||!r||!t.isConnected)return;let i=Sit.next(),a=r,{scrollTop:o}=a,{keyPath:s}=t.dataset,c=await Z$e({container:a,keyPath:s,scrollTo:e=>{let{scrollTop:t}=a;return U5=n,a.scrollTo({top:Dit(a,e,!0),behavior:`instant`}),Math.abs(a.scrollTop-t)>=1},isOutdated:()=>!i()||!e.syncScrolling});if(!c){i()&&e.syncScrolling&&a.scrollTop!==o&&(U5=n,a.scrollTo({top:o,behavior:`instant`}));return}let l=Dit(a,c);l!==void 0&&(U5=n,a.scrollTo({top:l,behavior:`smooth`}))};return{initialize:()=>{let{contentArea:r}=e;if(!r)return;let o=e.thisPaneContentArea;o&&(o.removeEventListener(`wheel`,i,W5),o.removeEventListener(`touchstart`,i,W5),t?.removeEventListener(`scroll`,a,Cit)),n&&!r.contains(n)&&(n=void 0);let s=n?.contentDocument?.documentElement??void 0,c=s??r;e.thisPaneContentArea=c,t=s?s.ownerDocument:r,c.scrollTop=0,c.addEventListener(`wheel`,i,W5),c.addEventListener(`touchstart`,i,W5),t.addEventListener(`scroll`,a,Cit)},setPreviewFrame:e=>{n=e},onFocusIn:t=>{let n=t.target.closest(`.field[data-key-path]`);e.mode===`edit`&&n&&window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{o(n)})})},destroy:()=>{U5===e.thisPaneContentArea&&(U5=void 0)}}},kit=B(`<div role="none" class="content svelte-1vy4qxn"><!></div>`),Ait=B(`<span role="alert"> </span> <!>`,1),jit=B(`<div role="none" class="wrapper svelte-1vy4qxn"><!></div>`),Mit={hash:`svelte-1vy4qxn`,code:`.wrapper.svelte-1vy4qxn {display:contents;}.content.svelte-1vy4qxn {--field-editor-padding: 16px;flex:auto;overflow-y:auto;scroll-behavior:auto; /* Don’t use smooth scroll for syncing */overscroll-behavior-y:contain;
@media (width < 768px) {--field-editor-padding: 12px;
}}`};function Nit(e,t){O(t,!0),K(e,Mit);let n=LK(),r=J(t,`thisPaneContentArea`,15),i=J(t,`thatPaneContentArea`,3,void 0),a=A(()=>i8.current??{}),o=A(()=>z(a).syncScrolling),s=A(()=>t.thisPane.current?.locale),c=A(()=>t.thisPane.current?.mode),l=A(()=>!!z(s)&&!!n.current?.currentValues[z(s)]),u=A(()=>oQ(n.current)||GZ(n.current?.originalEntry)),d=A(()=>({values:{locale:z(s)?Of(z(s))??z(s):``}})),f=j(void 0),p=Oit({get syncScrolling(){return z(o)},get mode(){return z(c)},get contentArea(){return z(f)},get thisPaneContentArea(){return r()},set thisPaneContentArea(e){r(e)},get thatPaneContentArea(){return i()}});L(()=>{t.thisPane.current?.mode,z(f),eo(()=>p.initialize())}),L(()=>()=>{p.destroy()});var m=jit(),h=N(m),g=e=>{var t=kit(),n=N(t),r=e=>{xit(e,{get locale(){return z(s)},onFrameLoad:e=>{p.setPreviewFrame(e),p.initialize()}})},i=e=>{n2e(e,{get locale(){return z(s)}})};G(n,e=>{z(c)===`preview`?e(r):e(i,-1)}),D(t),gs(t,e=>M(f,e),()=>z(f)),so(`focusin`,t,function(...e){p.onFocusIn?.apply(this,e)}),U(e,t)},_=e=>{dH(e,{children:(e,t)=>{var r=Ait(),i=P(r),a=F(i,!0),o=I(i,2),c=e=>{{let t=A(()=>Y(z(l)?`reenable_x_locale`:`enable_x_locale`,z(d)));Xx(e,{variant:`tertiary`,get label(){return z(t)},onclick:()=>{z(s)&&n.current&&sYe({draft:n.current,locale:z(s)})}})}};G(o,e=>{z(u)||e(c)}),R(e=>W(a,e),[()=>Y(z(l)?`locale_x_now_disabled`:`locale_x_has_been_disabled`,z(d))]),U(e,r)},$$slots:{default:!0}})};G(h,e=>{z(s)&&n.current?.currentLocales[z(s)]?e(g):z(c)===`edit`&&e(_,1)}),D(m),R(()=>q(m,`id`,t.id)),U(e,m),k()}co([`focusin`]);function Pit(e,t){O(t,!0);let n=LK(),r=J(t,`open`,15,!1),i=J(t,`locale`,3,void 0),a=J(t,`onClose`,3,void 0),o=A(()=>JQe(t.action,i()?`locale`:`entry`));wS(e,{get title(){return z(o)},get okLabel(){return z(o)},onOk:()=>{let e=n.current;e&&(t.action===`revert`?d$e({draft:e,locale:i()}):a$e({draft:e,locale:i(),restore:t.action===`restore`}))},onClose:()=>{a()?.()},get open(){return r()},set open(e){r(e)},children:(e,n)=>{Ur();var r=V();R(e=>W(r,e),[()=>YQe(t.action,i())]),U(e,r)},$$slots:{default:!0}}),k()}function Fit(e,t){O(t,!0);let n=J(t,`thisPane`,7);{let t=e=>{gx(e,{name:`visibility`})},r=A(()=>Y(`preview`)),i=A(()=>n().current?.mode===`preview`);Xx(e,{variant:`ghost`,iconic:!0,get"aria-label"(){return z(r)},get pressed(){return z(i)},onclick:()=>{JK(()=>{n().current={mode:n().current?.mode===`preview`?`edit`:`preview`,locale:n().current?.locale??``}})},startIcon:t,$$slots:{startIcon:!0}})}k()}var Iit=(e,t)=>e===`error`||!t||t===`unknown`?e:t===`ready`?`ready`:e===`ready`?`pending`:e,Lit=({entry:e,locale:t,collection:n,collectionFile:r,pullRequest:i,deployments:a,productionSHA:o,pollTimedOut:s=!1})=>{let c=(i,a=!1)=>dHe(e,t,n,r,{baseURL:i,fallbackToRoot:a});if(i){let e=i.headSHA?a[i.headSHA]:void 0,t=e?.url?c(e.url,!0):void 0;if(e&&t)return{url:t,state:e.state,isDeployPreview:!0,awaitingPreview:!1,pingable:!0};let n=c();if(!n)return;let r=e?.state??`unknown`;return{url:n,state:r,isDeployPreview:!1,awaitingPreview:!s&&(r===`checking`||r===`pending`),pingable:!1}}let l=o?a[o]:void 0,u=c()??c(l?.url);if(u)return{url:u,state:l?.state??`unknown`,isDeployPreview:!1,awaitingPreview:!1,pingable:!0}},Rit=B(`<div role="none" class="icon-wrapper svelte-13aw5dy"><!></div>`),zit={hash:`svelte-13aw5dy`,code:`.icon-wrapper.svelte-13aw5dy {display:contents;& .spinning {
animation: svelte-13aw5dy-spin 1.6s linear infinite;}
@media (prefers-reduced-motion: reduce) {& .spinning {
animation: none;}
}}
@keyframes svelte-13aw5dy-spin {
to {
transform: rotate(360deg);
}
}`};function G5(e,t){O(t,!0),K(e,zit);let n=J(t,`as`,3,`button`),r=J(t,`variant`,3,`ghost`),i=J(t,`size`,3,`medium`),a=J(t,`iconic`,3,!1),o=A(()=>Lit({entry:t.entry,locale:t.locale,collection:t.collection,collectionFile:t.collectionFile,pullRequest:t.pullRequest,deployments:Vy.current,productionSHA:Hy.current,pollTimedOut:Wy.current})),s=A(()=>z(o)?.url),c=A(()=>z(o)?Iit(z(o).state,z(s)?V8.current[z(s)]:void 0):void 0),l=A(()=>z(o)?.isDeployPreview??!1),u=A(()=>z(o)?.pingable??!1),d=A(()=>z(o)?.awaitingPreview??!1),f=A(()=>z(d)||!z(s)||z(l)&&z(c)===`error`),p=A(()=>z(d)?Y(`deploy_preview.awaiting`):z(l)?Y(`deploy_preview.view`):Y(`view_on_live_site`)),m=A(()=>z(c)===`error`?Y(`deploy_preview.failed`):z(c)===`checking`?Y(`deploy_preview.checking`):z(c)===`pending`?Y(`deploy_preview.building`):void 0),h=()=>{z(s)&&Tq(z(s))};L(()=>{let e=z(u),t=z(s),n=z(o)?.state===`ready`;e&&t&&L5e(t,{recheckPending:n})});var g=H(),_=P(g),v=e=>{var t=H(),o=P(t),s=e=>{JS(e,{get label(){return z(p)},get disabled(){return z(f)},get"aria-description"(){return z(m)},onclick:h})},c=e=>{{let t=e=>{var t=Rit(),n=N(t);{let e=A(()=>z(d)?`spinning`:void 0),t=A(()=>z(d)?`progress_activity`:`open_in_new`);gx(n,{get class(){return z(e)},get name(){return z(t)}})}D(t),U(e,t)},n=A(()=>a()?void 0:z(p)),o=A(()=>a()?z(p):void 0);Xx(e,{get variant(){return r()},get size(){return i()},get iconic(){return a()},get label(){return z(n)},get"aria-label"(){return z(o)},get disabled(){return z(f)},get"aria-description"(){return z(m)},onclick:h,endIcon:t,$$slots:{endIcon:!0}})}};G(o,e=>{n()===`menuitem`?e(s):e(c,-1)}),U(e,t)};G(_,e=>{z(o)&&e(v)}),U(e,g),k()}var Bit={edit_x_locale:`edit_content`,preview_x_locale:`preview_content`,show_content_options_x_locale:`show_content_options`,content_options_x_locale:`content_options`},K5=(e,t)=>t===`_default`?Y(Bit[e]):Y(e,{values:{locale:Of(t)??t}}),Vit=({collection:e,collectionFile:t})=>t?.name?[e?.name,t.name].join(`|`):e?.name,Hit=({firstPane:e,secondPane:t})=>!e&&!t?[0,0,0]:!e||!t?[e?100:0,t?100:0,0]:typeof e.width==`number`&&typeof t.width==`number`&&e.width>=30&&t.width>=30&&e.width+t.width===100?[e.width,t.width,30]:[50,50,30],Uit=({savedPanes:e=[null,null],editorLocale:t,allLocales:n,defaultLocale:r,canPreview:i,showPreview:a,showSecondPane:o})=>{let[s,c]=t?[{mode:`edit`,locale:t},{mode:`preview`,locale:t}]:e;if(s&&c&&(!s.locale||n.includes(s.locale))&&(!c.locale||n.includes(c.locale))&&o&&(a&&i||s.mode!==`preview`&&c.mode!==`preview`)&&(t||n.length!==2||s.locale===r))return[s,c]},Wit=({editorLocale:e,currentLocale:t,defaultLocale:n,allLocales:r,i18nEnabled:i,canPreview:a,showPreview:o,showSecondPane:s,singlePane:c})=>{let l=(e&&r.includes(e)?e:void 0)??t??n,u={mode:`edit`,locale:l};if(c||!s)return[u,null];if(!o||!a){let e=i?r.find(e=>e!==l):void 0;return[u,e?{mode:`edit`,locale:e}:null]}return[u,{mode:`preview`,locale:l}]},Git=({firstPane:e,secondPane:t,locale:n})=>{let r={mode:`edit`,locale:n};if(!(e?.mode===`edit`&&e.locale===n||t?.mode===`edit`&&t.locale===n))return t?.mode===`preview`?[e,r]:e?.mode===`preview`?[r,t]:t?[e,r]:[r,t]},Kit=(e,t)=>{let n=eo(()=>i8.current);i8.current={...n,paneStates:{...n?.paneStates,[e]:t}}},q5=0,J5=0,Y5=0,X5=0,Z5=void 0,Q5=``,$5=0,qit=()=>{let e=Vy.current;return X8.current.every(({sha:t})=>{let n=e[t]?.state;return n===`ready`||n===`error`||n===`unknown`})},Jit=(e,t)=>{if(!e.length)return;yu.devModeEnabled&&console.info(`deployPreview: ${t}`,{shas:e,remaining:6e4-(Date.now()-Y5)});let n=Vy.current;Vy.current={...n,...Object.fromEntries(e.map(e=>[e,{...n[e],state:`checking`}]))}},Yit=e=>{if(Date.now()-Y5>=6e4)return;let t=Vy.current;Jit(X8.current.map(({sha:e})=>e).filter(n=>{if(t[n]?.state!==`unknown`)return!1;let r=e[n];return!r||r.state===`checking`||r.state===`unknown`&&r.checkedTime>=Y5}),`nothing reported yet, still waiting`)},Xit=()=>{let e=Vy.current,t=Date.now();Jit(X8.current.map(({sha:e})=>e).filter(n=>{let r=e[n];return r?.state===`unknown`&&t-r.checkedTime<6e4}),`concluded only moments ago, waiting a little longer`)},Zit=()=>X8.current.map(({sha:e})=>e).join(`,`),e7=()=>{globalThis.clearTimeout(q5),q5=0,$5+=1},t7=()=>{e7(),B5e()},Qit=()=>{if(!J5||!Z8()||qit()){yu.devModeEnabled&&console.info(`deployPreview: not re-checking`,{watchers:J5,canResolve:Z8(),settled:qit(),attempts:X5}),t7();return}if(Date.now()-Y5>6e5){Wy.current=!0,t7();return}let e=$5;q5=globalThis.setTimeout(async()=>{q5=0,X5+=1;let t=Vy.current;await Q8({pendingOnly:!0}),Yit(t),e===$5&&Qit()},5e3)},n7=()=>{e7(),X5=0,Y5=Date.now(),Wy.current=!1,Z8()&&(U5e(),Xit()),Qit()},$it=()=>{J5+=1,J5===1&&(Q5=Zit(),Z5=ol(()=>{let e=Zit();e!==Q5&&(Q5=e,eo(n7))}),n7());let e=!1;return()=>{e||(e=!0,--J5,J5||(Z5?.(),Z5=void 0,t7()))}},eat=()=>eo($it),tat=async()=>{e7(),Wy.current=!1,await Q8({force:!0}),n7()},r7=B(`<!> <!>`,1),nat=B(`<h3 role="none"> </h3>`),rat=B(`<!> <!> <!>`,1),iat=B(`<!> <!> <!> <!>`,1),aat=B(`<div role="none" class="header svelte-uj56is"><!></div> <!>`,1),oat={hash:`svelte-uj56is`,code:`.header.svelte-uj56is {flex:none !important;& > .sui.toolbar {margin-inline:auto;max-width:800px;
@media (width < 768px) {padding:0;
}h3 {margin:0 8px;font-size:var(--sui-font-size-default);}}}`};function sat(e,t){O(t,!0),K(e,oat);let n=LK(),r=J(t,`thatPane`,19,()=>tl(null)),i=A(()=>n.current?.collection),a=A(()=>n.current?.collectionFile),o=A(()=>n.current?.originalEntry),s=A(()=>n.current?.originalValues??{}),c=A(()=>Rf(n.current)),l=A(()=>z(c).i18nEnabled),u=A(()=>z(c).saveAllLocales),d=A(()=>z(c).allLocales),f=A(()=>z(c).defaultLocale),p=A(()=>n.current?.currentLocales[t.thisPane.current?.locale??``]),m=A(()=>Object.values(n.current?.currentLocales??{}).filter(e=>e).length===1),h=A(()=>z(l)?z(d).filter(e=>e!==t.thisPane.current?.locale):[]),g=A(()=>!!z(h).length),_=A(()=>GZ(n.current?.originalEntry)),v=A(()=>oQ(n.current)),y=A(()=>!!t.thisPane.current?.locale&&bK(z(s)[t.thisPane.current.locale]??{},kK(n.current,t.thisPane.current.locale))),b=S6(()=>{let e=n.current,r=t.thisPane.current?.locale;if(e&&r)return{restore:b6({draft:e,locale:r,restore:!0}),clear:b6({draft:e,locale:r})}}),x=j(void 0),S=A(()=>n.current?.canPreview??!0),C=A(()=>!(PY.isSmallScreen||PY.isMediumScreen)&&!r().current&&z(S)&&!!i8.current?.showPreview),w=A(()=>EZ.current&&n.current?UZ(n.current)?.workflow.pullRequest:void 0),T=A(()=>z(o)&&z(i)&&t.thisPane.current?Lit({entry:z(o),locale:t.thisPane.current.locale,collection:z(i),collectionFile:z(a),pullRequest:z(w),deployments:Vy.current,productionSHA:Hy.current,pollTimedOut:Wy.current}):void 0),ee=A(()=>!!z(o)&&!!z(i)&&!!(z(T)||Wy.current||yu.devModeEnabled));var E=aat(),te=P(E),ne=N(te);{let e=A(()=>Y(`secondary`));IV(ne,{variant:`secondary`,get ariaLabel(){return z(e)},children:(e,s)=>{var c=rat(),T=P(c),E=e=>{var n=r7(),i=P(n);i4e(i,{get id(){return t.id},get thisPane(){return t.thisPane},get thatPane(){return r()},get previewInThisPane(){return z(C)}});var a=I(i,2),o=e=>{Fit(e,{get thisPane(){return t.thisPane}})};G(a,e=>{(PY.isSmallScreen||PY.isMediumScreen)&&z(S)&&e(o)}),U(e,n)},te=e=>{var n=nat(),r=F(n,!0);R(e=>W(r,e),[()=>t.thisPane.current?.mode===`preview`?Y(`preview`):Y(`edit`)]),U(e,n)},ne=e=>{Fit(e,{get thisPane(){return t.thisPane}})};G(T,e=>{z(l)&&z(d).length>1||z(C)?e(E):PY.isSmallScreen||PY.isMediumScreen?z(S)&&e(ne,2):e(te,1)});var re=I(T,2);yS(re,{flex:!0});var ie=I(re,2),ae=e=>{let r=A(()=>t.thisPane.current.locale),s=A(()=>Of(z(r))??z(r));var c=r7(),l=P(c),d=e=>{ZQe(e,{get locale(){return t.thisPane.current.locale},get otherLocales(){return z(h)}})};G(l,e=>{z(g)&&!z(v)&&e(d)});var S=I(l,2),C=e=>{{let c=e=>{{let c=A(()=>K5(`content_options_x_locale`,z(r)));qS(e,{get ariaLabel(){return z(c)},children:(e,r)=>{var c=r7(),l=P(c),d=e=>{var r=rat(),i=P(r),a=e=>{g6(e,{get locale(){return t.thisPane.current.locale},get otherLocales(){return z(h)},submenu:!0})};G(i,e=>{z(g)&&t.thisPane.current?.locale&&e(a)});var o=I(i,2);{let e=A(()=>({revert:!!z(y),...b.availability}));v6(o,{scope:`locale`,get separator(){return z(g)},get available(){return z(e)},get onSelect(){return b.select}})}var c=I(o,2),l=e=>{var r=r7(),i=P(r);FS(i,{});var a=I(i,2);{let e=A(()=>Y(z(p)?`disable_x_locale`:n.current?.currentValues[t.thisPane.current.locale]?`reenable_x_locale`:`enable_x_locale`,{values:{locale:z(s)}})),r=A(()=>t.thisPane.current.locale===z(f)||z(p)&&z(m));JS(a,{get label(){return z(e)},get disabled(){return z(r)},onclick:()=>{n.current&&sYe({draft:n.current,locale:t.thisPane.current?.locale??``})}})}U(e,r)};G(c,e=>{!z(u)&&t.thisPane.current?.locale&&e(l)}),U(e,r)};G(l,e=>{z(v)||e(d)});var _=I(l,2),x=e=>{var n=iat(),r=P(n),s=e=>{FS(e,{})};G(r,e=>{!z(v)&&z(ee)&&e(s)});var c=I(r,2);G5(c,{as:`menuitem`,get entry(){return z(o)},get locale(){return t.thisPane.current.locale},get collection(){return z(i)},get collectionFile(){return z(a)},get pullRequest(){return z(w)}});var l=I(c,2),u=e=>{{let t=A(()=>Y(`deploy_preview.check_again`));JS(e,{get label(){return z(t)},onclick:()=>{tat()}})}};G(l,e=>{Wy.current&&e(u)});var d=I(l,2);{let e=A(()=>!LX.current?.repository?.blobBaseURL);ynt(d,{get disabled(){return z(e)},onclick:()=>{z(o)&&t.thisPane.current&&Tq(fHe(z(o),t.thisPane.current.locale))}})}U(e,n)};G(_,e=>{z(o)&&z(i)&&t.thisPane.current&&e(x)}),U(e,c)},$$slots:{default:!0}})}},l=A(()=>K5(`show_content_options_x_locale`,z(r)));gs(hS(e,{variant:`ghost`,iconic:!0,get disabled(){return z(_)},popupPosition:`bottom-right`,get"aria-label"(){return z(l)},get onclick(){return b.update},get onkeydown(){return b.update},popup:c,$$slots:{popup:!0}}),e=>M(x,e,!0),()=>z(x))}};G(S,e=>{(!z(v)||z(ee))&&e(C)}),U(e,c)};G(ie,e=>{t.thisPane.current?.mode===`edit`&&e(ae)}),U(e,c)},$$slots:{default:!0}})}D(te);var re=I(te,2);{let e=A(()=>t.thisPane.current?.locale);Pit(re,{get action(){return b.action},get locale(){return z(e)},onClose:()=>{z(x)?.focus()},get open(){return b.dialogOpen},set open(e){b.dialogOpen=e}})}R(()=>q(te,`id`,t.id)),U(e,E),k()}var cat=B(`<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>`,1);function lat(e,t){O(t,!0);let n=LK(),r=A(()=>Z4e(n.current));var i=H(),a=P(i),o=e=>{var t=cat(),n=P(t);ko(n,()=>({"--sui-infobar-message-justify-content":`center`})),Zx(n.lastChild,{status:`warning`,children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(`relation_field.edited_with_entry`,{values:{name:z(r)}})]),U(e,n)},$$slots:{default:!0}}),D(n),U(e,t)};G(a,e=>{z(r)!==void 0&&e(o)}),U(e,i),k()}var uat=async({entryDraft:e,entry:t})=>{let n=e.current,{collectionName:r,collection:i,collectionFile:a,expanderStates:o}=n;return Y6(),await G6(r,q6(n)),e8({entryDraft:e,collection:i,collectionFile:a,originalEntry:t,expanderStates:o})},dat=(e,t)=>e.current===t&&!t.interacted&&!SK(t),fat=async e=>{let t=e.current;if(!t||t.isNew||!t.originalEntry||WZ(t))return;try{await m3({maxAge:1e4})}catch(e){console.error(`Failed to check the repository for changes.`,e);return}if(!dat(e,t))return;let n=f8(t.originalEntry);if(n?.type!==`modified`||!n.canOverwrite)return;let{collectionName:r,collection:i,collectionFile:a,expanderStates:o}=t;await K6(r,q6(t))||dat(e,t)&&e8({entryDraft:e,collection:i,collectionFile:a,originalEntry:n.entry,expanderStates:o})},pat=B(` <!>`,1),mat=B(`<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>`,1),hat=B(`<!> <!>`,1);function gat(e,t){O(t,!0);let n=LK(),r=A(()=>n.current),i=A(()=>z(r)&&!z(r).isNew&&!WZ(z(r))?z(r).originalEntry:void 0),a=A(()=>z(i)?f8(z(i)):void 0),o=j(void 0),s=j(!1),c=A(()=>!!z(a)&&z(o)!==(z(a).entry??`deleted`)),l=async()=>{z(a)?.entry&&await uat({entryDraft:n,entry:z(a).entry})},u=()=>{SK(z(r))||z(r).restorePending?M(s,!0):l()};var d=hat(),f=P(d),p=e=>{let t=A(()=>m4e(z(a),Ec.current));var n=mat(),r=P(n);ko(r,()=>({"--sui-infobar-message-justify-content":`center`})),Zx(r.lastChild,{status:`warning`,onDismiss:()=>{M(o,z(a).entry??`deleted`)},children:(e,n)=>{Ur();var r=pat(),i=P(r),o=I(i),s=e=>{{let t=A(()=>Y(`remote_change.reload_entry`));Xx(e,{variant:`link`,get label(){return z(t)},onclick:u})}};G(o,e=>{z(a).type===`modified`&&z(a).canOverwrite&&e(s)}),R(()=>W(i,`${z(t).description??``}
${z(t).warning??``} `)),U(e,r)},$$slots:{default:!0}}),D(r),U(e,n)};G(f,e=>{z(a)&&z(c)&&e(p)});var m=I(f,2);{let e=A(()=>Y(`remote_change.reload_entry`)),t=A(()=>Y(`remote_change.reload_entry`));wS(m,{get title(){return z(e)},get okLabel(){return z(t)},onOk:async()=>{await l()},get open(){return z(s)},set open(e){M(s,e,!0)},children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(`remote_change.confirm_reloading_entry`)]),U(e,n)},$$slots:{default:!0}})}U(e,d),k()}var _at=B(`<section role="group" class="panel svelte-1bq1or9"><header class="svelte-1bq1or9"><h3 class="svelte-1bq1or9"> </h3> <!></header> <div class="svelte-1bq1or9"><!></div></section>`),vat={hash:`svelte-1bq1or9`,code:`section.svelte-1bq1or9 {overflow:hidden;height:100%;display:flex;flex-direction:column;}header.svelte-1bq1or9 {flex:none;display:flex;align-items:center;gap:8px;border-bottom:1px solid var(--sui-secondary-border-color);padding:0 16px;height:var(--sui-primary-toolbar-size);}h3.svelte-1bq1or9 {flex:auto;font-size:var(--sui-font-size-x-large);}div.svelte-1bq1or9 {flex:auto;overflow:auto;h4 {display:flex;align-items:center;padding:12px 12px 8px;font-size:var(--sui-font-size-large);}& > .empty {padding:16px;}.empty {color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);}.sui.button.ref {display:flex;justify-content:flex-start;gap:8px;padding:8px;width:-moz-available;width:-webkit-fill-available;width:stretch;height:auto;}}`};function i7(e,t){let n=mo();K(e,vat);let r=J(t,`actions`,3,void 0),i=J(t,`children`,3,void 0);var a=_at(),o=N(a),s=N(o),c=F(s,!0);xo(I(s,2),()=>r()??Cr),D(o);var l=I(o,2);xo(N(l),()=>i()??Cr),D(l),D(a),R(()=>{q(a,`aria-labelledby`,`panel-${n}-label`),q(s,`id`,`panel-${n}-label`),W(c,t.title)}),U(e,a)}var a7=e=>e==null,yat=({collection:e,collectionFile:t,componentName:n,isIndexFile:r,typedKeyPath:i=``})=>{let a=i.split(`.`);if(!a.includes(`*`))return i;let o={collectionName:e?.name,fileName:t?.name,componentName:n,isIndexFile:r},s=[];for(let e=0;e<a.length;e+=1){let t=a[e];if(t===`*`&&s.length){let n=lh({...o,keyPath:s.join(`.`)}),{field:r}=n??{};s.push(t),n?.widget===`list`&&r?.name===a[e+1]&&(e+=1)}else s.push(t)}return s.join(`.`)},bat=({fieldConfig:e,context:t})=>{let n=yat(t).replace(/<[^>]+>/g,``)||e.name;if(!n.includes(`*`))return{keyPath:n,valuePattern:void 0};let r=e.multiple?`\\.\\d+`:``;return{keyPath:n,valuePattern:RegExp(`^${em(n)}${r}$`)}},o7=({content:e,keyPath:t,valuePattern:n,multiple:r=!1})=>n?Object.keys(e).filter(t=>n.test(t)&&!a7(e[t])):r?sm(e,t).filter(t=>!a7(e[t])):a7(e[t])?[]:[t],xat=e=>o7(e).map(t=>e.content[t]),s7=({fieldConfig:e,entry:t,locale:n})=>FG({locale:n,fieldConfig:e,refEntry:t}).map(({value:e})=>e),c7=({collectionName:e,fileName:t})=>[...Ml.relationFields].filter(({fieldConfig:n})=>n.collection===e&&!(t&&n.file&&n.file!==t)).map(e=>{let{fieldConfig:t,context:n}=e,r=n.collection?.name,i=r?Kf(r):void 0;if(!i)return;let a=n.collectionFile?.name;return{fieldConfig:t,sourceCollection:i,sourceCollectionFile:a?Wp(i,a):void 0,...bat(e),multiple:!!t.multiple}}).filter(e=>!!e),Sat=({collectionName:e,fileName:t,entry:n})=>{let r=new Set,i=c7({collectionName:e,fileName:t}).flatMap(({fieldConfig:e,sourceCollection:t,sourceCollectionFile:i,keyPath:a,valuePattern:o,multiple:s})=>{let c=(i??t)._i18n.defaultLocale,l=new Set(s7({fieldConfig:e,entry:n,locale:c}));if(!l.size)return[];let u=t.name,d=i?.name;return rW(u).filter(e=>e.id!==n.id&&!r.has(e.id)&&(!d||e.slug===d)).map(n=>{let i=Zp(n,{locale:c})?.content;if(i&&xat({content:i,keyPath:a,valuePattern:o,multiple:s}).some(e=>l.has(e)))return r.add(n.id),{collectionName:u,collectionLabel:t.label||u,fileName:d,fieldLabel:vG({config:e}),entry:n,summary:wW(t,n,{fileName:d})}}).filter(e=>!!e)}),a=[...new Set(i.map(e=>e.collectionName))];return i.sort((e,t)=>a.indexOf(e.collectionName)-a.indexOf(t.collectionName)||Bc(e.summary,t.summary))},Cat=B(`<span class="summary"><bdi> </bdi></span>`),wat=B(`<section class="collection svelte-1lhuwki" role="group"><h4> </h4> <!></section>`),Tat=B(`<div class="empty"> </div>`),Eat={hash:`svelte-1lhuwki`,code:`.collection.svelte-1lhuwki {padding:4px;&:not(:first-child) {border-top:2px solid var(--sui-secondary-background-color);}}`};function Dat(e,t){let n=mo();O(t,!0),K(e,Eat);let r=LK(),i=A(()=>{let e=r.current;return e?.originalEntry?Sat({collectionName:e.collectionName,fileName:e.fileName,entry:e.originalEntry}):[]}),a=A(()=>{let e=[];return z(i).forEach(t=>{let n=e.find(e=>e.collectionLabel===t.collectionLabel);n?n.items.push(t):e.push({collectionLabel:t.collectionLabel,items:[t]})}),e});{let t=A(()=>Y(`entry_sidebar.backlinks.title`));i7(e,{get title(){return z(t)},children:(e,t)=>{var r=H(),o=P(r),s=e=>{var t=H();No(P(t),19,()=>z(a),({collectionLabel:e,items:t})=>e,(e,t,r)=>{let i=()=>z(t).collectionLabel,a=()=>z(t).items;var o=wat(),s=N(o),c=F(s,!0);No(I(s,2),17,a,e=>e.entry.id,(e,t)=>{Xx(e,{class:`ref`,variant:`ghost`,onclick:()=>{x0(c0(z(t).collectionName,z(t).fileName??z(t).entry.subPath),{transitionType:`forwards`})},children:(e,n)=>{var r=Cat(),i=F(N(r),!0);D(r),R(()=>W(i,z(t).summary)),U(e,r)},$$slots:{default:!0}})}),D(o),R(()=>{q(o,`aria-labelledby`,`${n}-${z(r)??``}-label`),q(s,`id`,`${n}-${z(r)??``}-label`),W(c,i())}),U(e,o)}),U(e,t)},c=e=>{var t=Tat(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`entry_sidebar.backlinks.no_entries`)]),U(e,t)};G(o,e=>{z(i).length>0?e(s):e(c,-1)}),U(e,r)},$$slots:{default:!0}})}k()}var l7=new Map,Oat=async e=>{let{id:t}=e,n=l7.get(t);if(n)return n;let r=LX.current;if(!r?.fetchFileCommits)return{commits:[],loading:!1,error:!1};let i=Qp(e);try{let e={commits:await r.fetchFileCommits(i),loading:!1,error:!1};return l7.set(t,e),e}catch{let e={commits:[],loading:!1,error:!0};return l7.set(t,e),e}},kat=e=>{l7.delete(e)},u7=B(`<div class="empty"> </div>`),Aat=B(`<img class="avatar svelte-14rpg2i" alt="" width="24" height="24" loading="lazy"/>`),jat=B(`<span class="avatar placeholder svelte-14rpg2i" aria-hidden="true"></span>`),Mat=B(`<span class="message svelte-14rpg2i"><bdi> </bdi></span>`),Nat=B(`<!> <span class="details svelte-14rpg2i"><!> <span><span class="author svelte-14rpg2i"><bdi> </bdi></span> <span class="date svelte-14rpg2i"> </span></span></span>`,1),Pat=B(`<div role="listitem"><!></div>`),Fat=B(`<div role="list" class="commits svelte-14rpg2i"></div>`),Iat={hash:`svelte-14rpg2i`,code:`.commits.svelte-14rpg2i {padding:4px;}.avatar.svelte-14rpg2i {flex:none;width:24px;height:24px;border-radius:50%;background-color:var(--sui-secondary-background-color);}.details.svelte-14rpg2i {display:flex;flex-direction:column;gap:2px;overflow:hidden;font-size:var(--sui-font-size-small);}.message.svelte-14rpg2i,
.author.svelte-14rpg2i {overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.meta.svelte-14rpg2i {display:flex;flex-direction:column;gap:2px;overflow:hidden;&.secondary {flex-direction:row;gap:8px;color:var(--sui-tertiary-foreground-color);font-size:var(--sui-font-size-x-small);}}.date.svelte-14rpg2i {flex:none;color:var(--sui-tertiary-foreground-color);}`};function Lat(e,t){O(t,!0),K(e,Iat);let n=LK(),r=j(Xi([])),i=j(!1),a=j(!1),o=A(()=>!!JVe()),s=A(()=>n.current?.originalEntry),c=async e=>{M(i,!0);let t=await Oat(e);e===z(s)&&(M(r,t.commits,!0),M(a,t.error,!0),M(i,!1))};L(()=>{if(!z(s))return;let e=z(s);eo(()=>c(e))});{let t=A(()=>Y(`entry_sidebar.history.title`));i7(e,{get title(){return z(t)},children:(e,t)=>{var n=H(),s=P(n),c=e=>{var t=u7(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`loading`)]),U(e,t)},l=e=>{var t=u7(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`entry_sidebar.history.fetch_failed`)]),U(e,t)},u=e=>{var t=Fat();No(t,21,()=>z(r),e=>e.sha,(e,t)=>{let n=A(()=>LX.current?.repository?.commitBaseURL?`${LX.current.repository.commitBaseURL}/${z(t).sha}`:void 0),r=A(()=>z(o)?z(t).message:``);var i=Pat(),a=N(i);{let e=A(()=>!z(n));Xx(a,{class:`ref`,variant:`ghost`,role:`link`,get disabled(){return z(e)},onclick:()=>{Tq(z(n))},children:(e,n)=>{var i=Nat(),a=P(i),o=e=>{var n=Aat();R(()=>q(n,`src`,z(t).authorAvatarURL)),U(e,n)},s=e=>{U(e,jat())};G(a,e=>{z(t).authorAvatarURL?e(o):e(s,-1)});var c=I(a,2),l=N(c),u=e=>{var t=Mat(),n=F(N(t),!0);D(t),R(()=>{q(t,`title`,z(r)),W(n,z(r))}),U(e,t)};G(l,e=>{z(r)&&e(u)});var d=I(l,2);let f;var p=N(d),m=F(N(p),!0);D(p);var h=F(I(p,2),!0);D(d),D(c),R(e=>{f=$o(d,1,`meta svelte-14rpg2i`,null,f,{secondary:!!z(r)}),W(m,z(t).authorName),W(h,e)},[()=>bU(z(t).date,Ec.current)]),U(e,i)},$$slots:{default:!0}})}D(i),U(e,i)}),D(t),U(e,t)},d=e=>{var t=u7(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`entry_sidebar.history.no_history`)]),U(e,t)};G(s,e=>{z(i)?e(c):z(a)?e(l,1):z(r).length>0?e(u,2):e(d,-1)}),U(e,n)},$$slots:{default:!0}})}k()}var Rat=B(`<h4 class="svelte-1twofal"> </h4>`),zat=B(`<span hidden=""> </span>`),Bat=B(`<section class="section svelte-1twofal"><!> <div role="none" class="content svelte-1twofal"><!></div></section>`),Vat={hash:`svelte-1twofal`,code:`.section.svelte-1twofal {padding:4px;&:not(:first-child) {border-top:2px solid var(--sui-secondary-background-color);}}h4.svelte-1twofal {margin:0 !important;padding:12px;}.content.svelte-1twofal {padding:4px 8px 8px;}`};function d7(e,t){let n=mo();K(e,Vat);let r=J(t,`showLabel`,3,!0),i=`${n}-label`;var a=Bat(),o=N(a),s=e=>{var n=Rat(),r=F(n,!0);R(()=>{q(n,`id`,i),W(r,t.label)}),U(e,n)},c=e=>{var n=zat(),r=F(n,!0);R(()=>{q(n,`id`,i),W(r,t.label)}),U(e,n)};G(o,e=>{r()?e(s):e(c,-1)});var l=I(o,2);xo(N(l),()=>t.children,()=>i),D(l),D(a),R(()=>{q(a,`role`,r()?`group`:`none`),q(a,`aria-labelledby`,r()?i:void 0)}),U(e,a)}var Hat=({draft:e,ownFolderPaths:t})=>{let n=D2(e.collection),r=e=>(t?!n:[`_`,`_default`].includes(e))?{label:Y(t?`folder`:`slug`),showLabel:!1}:{label:Of(e)??e,showLabel:!0};return t?Object.entries(t).map(([e,t])=>({locale:e,...r(e),value:tu(t)})):Object.entries(e.currentSlugs).filter(([,e])=>e!==void 0).map(([e,t])=>({locale:e,...r(e),value:t}))},Uat=({draft:e,ownFolderPaths:t,takenFolderNames:n,takenSlugs:r,locale:i,text:a})=>{if(t){let e=LH({takenNames:n[i],name:a});return e?Y(`new_parent_folder_error.${e}`):void 0}let{pattern:o}=E2(e.collection),s=I4({slug:a,pattern:o,takenSlugs:r[i],locale:i});return s?L4({error:s,pattern:o}):void 0},Wat=B(`<!> <p class="error svelte-1woercx"><!></p>`,1),Gat={hash:`svelte-1woercx`,code:`p.error.svelte-1woercx:empty {display:none;}p.error.svelte-1woercx {margin:0;padding:0 4px;color:var(--sui-error-foreground-color);font-size:var(--sui-font-size-small);}`};function Kat(e,t){O(t,!0),K(e,Gat);let n=LK(),r=A(()=>n.current),i=A(()=>L2e(z(r))),a=A(()=>F4(z(r))),o=A(()=>z(i)?R2e({draft:z(r),ownFolderPaths:z(i)}):{}),s=A(()=>Hat({draft:z(r),ownFolderPaths:z(i)})),c=Xi({}),l=Xi({}),u=e=>{if(c[e])return Uat({draft:z(r),ownFolderPaths:z(i),takenFolderNames:z(o),takenSlugs:z(a),locale:e,text:l[e]})},d=({locale:e,value:t},n)=>!u(e)&&(n!==t&&(z(i)?z2e({draft:z(r),ownFolderPaths:z(i),folderNames:{[e]:n}}):I2e({draft:z(r),slugs:{[e]:n}})),!0);var f=H();No(P(f),17,()=>z(s),e=>e.locale,(e,t)=>{let n=A(()=>z(t)),r=A(()=>u(z(n).locale));d7(e,{get label(){return z(n).label},get showLabel(){return z(n).showLabel},children:(e,a=Cr)=>{var o=Wat(),s=P(o);{let e=A(()=>z(i)?Y(`rename_folder`):Y(`edit_slug`)),o=A(()=>!!z(r)),u=A(()=>!!z(r));J3(s,{get id(){return`${a()??``}-value`},get value(){return z(n).value},get editLabel(){return z(e)},get invalid(){return z(o)},get applyDisabled(){return z(u)},get ariaLabelledby(){return a()},get ariaErrormessage(){return`${a()??``}-error`},onApply:e=>d(z(t),e),get editing(){return c[z(n).locale]},set editing(e){c[z(n).locale]=e},get text(){return l[z(n).locale]},set text(e){l[z(n).locale]=e}})}var u=I(s,2),f=N(u),p=e=>{var t=V();R(()=>W(t,z(r))),U(e,t)};G(f,e=>{z(r)&&e(p)}),D(u),R(()=>q(u,`id`,`${a()??``}-error`)),U(e,o)},$$slots:{default:!0}})}),U(e,f),k()}var qat=B(`<div class="empty svelte-ka7cth"> </div>`),Jat=B(`<p class="hint svelte-ka7cth"> </p>`),Yat=B(`<div role="none" class="editor svelte-ka7cth"><!></div>`),Xat=B(`<p class="note svelte-ka7cth"> </p>`),Zat=B(`<!> <!>`,1),Qat={hash:`svelte-ka7cth`,code:`.editor.svelte-ka7cth {
/* The section has padding of its own */--field-editor-padding: 0;}.hint.svelte-ka7cth,
.empty.svelte-ka7cth {margin:0;padding:12px 16px;}.hint.svelte-ka7cth {color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);}.note.svelte-ka7cth {margin:0;padding:0 16px 16px;color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);}`};function $at(e,t){O(t,!0),K(e,Qat);let n=LK(),r=A(()=>n.current),i=A(()=>t8(z(r))),a=A(()=>N2e(z(r))),o=A(()=>z(i)&&z(r)?E2(z(r).collection).hint:void 0),s=A(()=>z(i)&&!!z(r)&&D2(z(r).collection)),c=A(()=>Object.entries(z(r)?.slugEditor??{}).filter(([e,t])=>t===!0&&!!z(r)?.currentLocales[e]).map(([e])=>e)),l=A(()=>Object.entries(z(r)?.isNew?F2e(z(r)):z(r)?.currentSlugs??{}).filter(([e,t])=>t!==void 0&&(e===`_`||!!z(r)?.currentLocales[e]))),u=e=>z(s)&&![`_`,`_default`].includes(e)?{label:Of(e)??e,showLabel:!0}:{label:Y(`slug`),showLabel:!1};{let t=A(()=>Y(`entry_sidebar.slug.title`));i7(e,{get title(){return z(t)},children:(e,t)=>{var n=H(),s=P(n),d=e=>{var t=qat(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`entry_sidebar.slug.unavailable`)]),U(e,t)},f=e=>{var t=Zat(),n=P(t),i=e=>{var t=Jat(),n=F(t,!0);R(()=>W(n,z(o))),U(e,t)};G(n,e=>{z(o)&&e(i)});var s=I(n,2),d=e=>{var t=H();No(P(t),16,()=>z(c),e=>e,(e,t)=>{{let n=(e,n=Cr)=>{var r=Yat();U2e(N(r),{get locale(){return t},get ariaLabelledby(){return n()}}),D(r),U(e,r)},r=A(()=>u(t));d7(e,ys(()=>z(r),{children:n,$$slots:{default:!0}}))}}),U(e,t)},f=e=>{Kat(e,{})},p=e=>{var t=Zat(),n=P(t);No(n,17,()=>z(l),([e,t])=>e,(e,t)=>{var n=A(()=>Er(z(t),2));let r=()=>z(n)[0],i=()=>z(n)[1];{let t=(e,t=Cr)=>{J3(e,{get id(){return`${t()??``}-value`},get value(){return i()},canEdit:!1,get ariaLabelledby(){return t()}})},n=A(()=>u(r()));d7(e,ys(()=>z(n),{children:t,$$slots:{default:!0}}))}});var i=I(n,2),a=e=>{var t=Xat(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`entry_sidebar.slug.generated_on_save`)]),U(e,t)};G(i,e=>{z(r)?.isNew&&e(a)}),U(e,t)};G(s,e=>{z(r)?.isNew&&z(c).length?e(d):z(a)?e(f,1):e(p,-1)}),U(e,t)};G(s,e=>{z(i)?e(f,-1):e(d)}),U(e,n)},$$slots:{default:!0}})}k()}var f7=tl(null),eot=e=>{let{collectionName:t,fileName:n,isNew:r=!0}=e??{};return[{key:`slug`,icon:`anchor`,disabled:!t8(e)},{key:`validation`,icon:`check_circle`,disabled:!1},{key:`history`,icon:`history`,disabled:!LX.current?.isGit||r},{key:`backlinks`,icon:`article_shortcut`,disabled:!t||!c7({collectionName:t,fileName:n}).length}]},p7=e=>{PY.isSmallScreen?f7.current=e:i8.current={...i8.current,sidebarPanel:e}},tot=B(`<h4 class="svelte-mwf2jd"> </h4>`),m7=B(`<span class="summary svelte-mwf2jd"> </span> <!>`,1),not=B(`<!> <!> <!>`,1),rot=B(`<div class="empty svelte-mwf2jd"> </div>`),iot=B(`<section class="locale svelte-mwf2jd" role="group"><!> <!></section>`),aot=B(`<div class="empty"> </div>`),oot={hash:`svelte-mwf2jd`,code:`.locale.svelte-mwf2jd {padding:4px;&:not(:first-child) {border-top:2px solid var(--sui-secondary-background-color);}h4:where(.svelte-mwf2jd),
.empty:where(.svelte-mwf2jd) {margin:0 !important;padding:12px;}.summary:where(.svelte-mwf2jd) {display:block;color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);font-weight:var(--sui-heading-font-weight);}.sui.button.ref {flex-direction:column;align-items:flex-start;gap:4px;}}`};function sot(e,t){O(t,!0),K(e,oot);let n=J(t,`onSelectField`,3,k6),r=LK(),i=A(()=>r.current??{}),a=A(()=>z(i).validationMessages),o=A(()=>z(i).validities),s=A(()=>Object.values(z(o)??{}).some(e=>!!Object.keys(e).length)),c=j(!1),l=e=>{let t=r.current,{_slug:n,_path:i}=t.validities[e];return{slugValidity:n?.valid===!1?n:void 0,pathMessages:HWe(e===t.defaultLocale?i:void 0),invalidFields:UWe({draft:t,locale:e})}},u=async()=>{let e=r.current;e&&!z(c)&&(M(c,!0),await r8({draft:e,awaitFieldUpdates:!1}),M(c,!1))};{let t=e=>{{let t=A(()=>Y(`entry_sidebar.validation.validate`)),n=A(()=>!r.current||z(c));Xx(e,{variant:`tertiary`,size:`small`,get label(){return z(t)},get disabled(){return z(n)},onclick:()=>{u()}})}},i=A(()=>Y(`entry_sidebar.validation.title`));i7(e,{get title(){return z(i)},actions:t,children:(e,t)=>{var r=H(),i=P(r),o=e=>{var t=H();No(P(t),16,()=>Object.keys(z(a)),e=>e,(e,t)=>{let r=A(()=>Of(t)),i=A(()=>l(t));var a=iot(),o=N(a),s=e=>{var t=tot(),n=F(t,!0);R(()=>W(n,z(r))),U(e,t)};G(o,e=>{z(r)&&e(s)});var c=I(o,2),u=e=>{var r=not(),a=P(r),o=e=>{Xx(e,{class:`ref`,variant:`ghost`,onclick:()=>{p7(`slug`)},children:(e,t)=>{var n=m7(),r=P(n),a=F(r,!0);a6(I(r,2),{live:`off`,children:(e,t)=>{Ur();var n=V();R(()=>W(n,z(i).slugValidity.customErrorMessage)),U(e,n)},$$slots:{default:!0}}),R(e=>W(a,e),[()=>Y(`slug`)]),U(e,n)},$$slots:{default:!0}})};G(a,e=>{z(i).slugValidity&&e(o)});var s=I(a,2),c=e=>{Xx(e,{class:`ref`,variant:`ghost`,onclick:()=>{n()({locale:t,keyPath:`_path`})},children:(e,t)=>{var n=m7(),r=P(n),a=F(r,!0);No(I(r,2),17,()=>z(i).pathMessages,Ao,(e,t)=>{a6(e,{live:`off`,children:(e,n)=>{Ur();var r=V();R(()=>W(r,z(t))),U(e,r)},$$slots:{default:!0}})}),R(e=>W(a,e),[()=>Y(`entry_parent_folder`)]),U(e,n)},$$slots:{default:!0}})};G(s,e=>{z(i).pathMessages.length&&e(c)}),No(I(s,2),17,()=>z(i).invalidFields,({keyPath:e,label:t,messages:n})=>e,(e,r)=>{let i=()=>z(r).keyPath,a=()=>z(r).label,o=()=>z(r).messages;Xx(e,{class:`ref`,variant:`ghost`,onclick:()=>{n()({locale:t,keyPath:i()})},children:(e,t)=>{var n=m7(),r=P(n),i=F(r,!0);No(I(r,2),17,o,Ao,(e,t)=>{a6(e,{live:`off`,children:(e,n)=>{Ur();var r=V();R(()=>W(r,z(t))),U(e,r)},$$slots:{default:!0}})}),R(()=>W(i,a())),U(e,n)},$$slots:{default:!0}})}),U(e,r)},d=e=>{var t=rot(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`entry_sidebar.validation.no_errors_found`)]),U(e,t)};G(c,e=>{z(i).slugValidity||z(i).pathMessages.length||z(i).invalidFields.length?e(u):e(d,-1)}),D(a),U(e,a)}),U(e,t)},c=e=>{var t=aot(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`entry_sidebar.validation.placeholder`)]),U(e,t)};G(i,e=>{z(s)?e(o):e(c,-1)}),U(e,r)},$$slots:{actions:!0,default:!0}})}k()}function cot(e,t){let n=J(t,`onSelectField`,3,void 0);var r=H(),i=P(r),a=e=>{$at(e,{})},o=e=>{Lat(e,{})},s=e=>{Dat(e,{})},c=e=>{sot(e,{get onSelectField(){return n()}})};G(i,e=>{t.key===`slug`?e(a):t.key===`history`?e(o,1):t.key===`backlinks`?e(s,2):e(c,-1)}),U(e,r)}var lot={hash:`svelte-1n87oxn`,code:`.entry-sidebar-sheet {--sui-drawer-bottom-content-border-start-start-radius: 16px;--sui-drawer-bottom-content-border-start-end-radius: 16px;
/* The panel scrolls its own content below the header */--sui-drawer-main-padding: 0;}`};function uot(e,t){O(t,!0),K(e,lot);let n=j(null),r,i=A(()=>z(n)??f7.current),a=A(()=>!!f7.current&&!z(n)),o=()=>{M(n,f7.current,!0),f7.current=null};So(()=>()=>{f7.current=null});var s=()=>z(a),c=o;{let t=e=>{},a=A(()=>z(i)?Y(`entry_sidebar.${z(i)}.title`):``);ape(e,{get open(){return s()},set open(e){c(e)},class:`entry-sidebar-sheet`,position:`bottom`,size:`medium`,swipeDismiss:!0,get title(){return z(a)},onClose:()=>{M(n,null),r&&!f7.current&&k6(r),r=void 0},header:t,children:(e,t)=>{var n=H(),a=P(n),s=e=>{cot(e,{get key(){return z(i)},onSelectField:e=>{r=e,o()}})};G(a,e=>{z(i)&&e(s)}),U(e,n)},$$slots:{header:!0,default:!0}})}k()}var dot=B(`<div role="none" class="content svelte-19e8zut" id="entry-sidebar-content"><!></div>`),fot=B(`<div role="none" class="sidebar svelte-19e8zut"><!> <!></div>`),pot={hash:`svelte-19e8zut`,code:`.sidebar.svelte-19e8zut {flex:none;display:flex;flex-direction:row-reverse;.tabs {flex:none;display:flex;flex-direction:column;align-items:center;gap:8px;margin:0;padding:8px 0;width:48px;button {border-radius:4px !important;}}}.content.svelte-19e8zut {flex:none;width:320px;margin-inline-start:8px;border:var(--area-border);border-block-end:0;border-radius:16px 16px 0 0;background-color:var(--sui-primary-background-color);}`};function mot(e,t){O(t,!0),K(e,pot);let n=LK(),r=A(()=>eot(n.current)),i=A(()=>i8.current?.sidebarPanel??null),a=j(null),o,s=A(()=>z(a)??(z(i)?z(r).find(e=>e.key===z(i))?.key??`validation`:null));sl(()=>[n.current?.id,z(i)],()=>{let e=n.current;e?.id===o?M(a,null):(o=e?.id,M(a,P2e(e)?`slug`:null,!0))});var c=fot(),l=N(c);{let e=A(()=>Y(`entry_sidebar.sidebar_panels`)),t=A(()=>z(s)?`entry-sidebar-content`:void 0);pS(l,{class:`tabs`,get ariaLabel(){return z(e)},get"aria-controls"(){return z(t)},children:(e,t)=>{var n=H();No(P(n),17,()=>z(r),({key:e,icon:t,disabled:n})=>e,(e,t)=>{let n=()=>z(t).key,r=()=>z(t).icon,i=()=>z(t).disabled;{let t=A(()=>Y(`entry_sidebar.${n()}.title`)),o=A(()=>z(s)===n());mS(e,{iconic:!0,get"aria-label"(){return z(t)},get selected(){return z(o)},get disabled(){return i()},onclick:()=>{let e=z(s)===n()?null:n();M(a,null),i8.current={...i8.current,sidebarPanel:e}},children:(e,t)=>{gx(e,{get name(){return r()}})},$$slots:{default:!0}})}}),U(e,n)},$$slots:{default:!0}})}var u=I(l,2),d=e=>{var t=dot();cot(N(t),{get key(){return z(s)}}),D(t),U(e,t)};G(u,e=>{z(s)&&e(d)}),D(c),U(e,c),k()}var hot=B(`<!> <!> <!> <!>`,1);function got(e,t){O(t,!0);let n=LK(),r=A(()=>Rf(n.current)),i=A(()=>z(r).i18nEnabled),a=A(()=>z(r).allLocales),o=A(()=>n.current?.canPreview??!0),s=A(()=>n.current?.canShowSecondPane??!0),c=A(()=>z(s)&&(i8.current?.showSecondPane??!0)),l=A(()=>z(s)&&(z(i)&&z(a).length>1||z(o))),u=A(()=>z(o)&&!!i8.current?.showPreview),d=A(()=>Object.keys(n.current?.currentValues??{}).length===1);var f=hot(),p=P(f);FS(p,{});var m=I(p,2);{let e=A(()=>Y(`show_second_pane`)),t=A(()=>!z(l));YS(m,{get label(){return z(e)},get checked(){return z(c)},get disabled(){return z(t)},onChange:()=>{a8(`showSecondPane`,!0)}})}var h=I(m,2);{let e=A(()=>Y(`show_preview`)),t=A(()=>i8.current?.showPreview),n=A(()=>!z(o));YS(h,{get label(){return z(e)},get checked(){return z(t)},get disabled(){return z(n)},onChange:()=>{a8(`showPreview`)}})}var g=I(h,2);{let e=A(()=>Y(`sync_scrolling`)),t=A(()=>i8.current?.syncScrolling),n=A(()=>!z(c)||!z(u)&&z(d));YS(g,{get label(){return z(e)},get checked(){return z(t)},get disabled(){return z(n)},onChange:()=>{a8(`syncScrolling`)}})}U(e,f),k()}var _ot=({relation:e,excludeIds:t})=>{let{sourceCollection:n,sourceCollectionFile:r}=e,i=r?.name;return rW(n.name).filter(e=>!t.has(e.id)&&(!i||e.slug===i))},vot=({relation:e,excludeIds:t,targets:n,getLocaleValues:r,getContentUpdater:i})=>{let{sourceCollection:a,sourceCollectionFile:o}=e,{allLocales:s}=o?._i18n??a._i18n,c=new Map(s.map(e=>[e,r(e)]));[...c.values()].some(({size:e})=>e>0)&&_ot({relation:e,excludeIds:t}).forEach(e=>{let t=n.get(e.id)?.entry??e,s={},l=i(e);Object.entries(t.locales).forEach(([e,t])=>{let{content:n}=t;if(!n)return;let i=Nl(c,e,()=>r(e));if(!i.size)return;let a=l({locale:e,content:n,values:i});a&&(s[e]={...t,content:a})}),Object.keys(s).length&&n.set(e.id,{entry:{...t,locales:{...t.locales,...s}},collection:a,collectionFile:o})})},yot=({fieldConfig:e,entries:t,locale:n})=>new Set(t.flatMap(t=>s7({fieldConfig:e,entry:t,locale:n}))),bot=({content:e,relation:t,values:n})=>{let{keyPath:r,valuePattern:i,multiple:a}=t,o=o7({content:e,keyPath:r,valuePattern:i,multiple:a}).filter(t=>n.has(e[t]));if(!o.length)return;let s={...e};if(!a)return o.forEach(t=>{s[t]=typeof e[t]==`number`?null:``}),{content:s,fieldKeyPaths:o};let c=Ac(o.map(e=>e.replace(im,``))),l=(e,t)=>n.has(t);return c.forEach(e=>{TKe({content:s,listKeyPath:e,isStale:l})}),{content:s,fieldKeyPaths:c}},xot=({draft:e,entry:t,relation:n,locale:r,content:i,fieldKeyPaths:a})=>EKe({draft:e,entry:t,collection:n.sourceCollection,collectionFile:n.sourceCollectionFile,locale:r,content:i,fields:new Map(a.map(e=>[e,n.fieldConfig]))}),Sot=({relation:e,entries:t,deletedIds:n,targets:r,blockers:i})=>{let{fieldConfig:a,sourceCollection:o,sourceCollectionFile:s}=e;vot({relation:e,excludeIds:n,targets:r,getLocaleValues:e=>yot({fieldConfig:a,entries:t,locale:e}),getContentUpdater:t=>{let n=r3({collection:o,collectionFile:s,isIndexFile:cf(o,t)});return({locale:r,content:a,values:o})=>{let s=bot({content:a,relation:e,values:o});if(s)return i.push(...xot({draft:n,entry:t,relation:e,locale:r,content:s.content,fieldKeyPaths:s.fieldKeyPaths})),s.content}}})},Cot=e=>{let t=e.flatMap(t=>{let n=$Z(t);return n&&!e.includes(n)?[n]:[]});return t.length?[...e,...new Set(t)]:e},wot={targets:[],blockers:[]},h7=({collection:e,collectionFile:t,entries:n})=>{let r=new Map,i=[];if(n.length){let a=Cot(n),o=new Set(a.map(({id:e})=>e));c7({collectionName:e.name,fileName:t?.name}).forEach(e=>{Sot({relation:e,entries:a,deletedIds:o,targets:r,blockers:i})})}return{targets:[...r.values()],blockers:DKe(i)}},g7=(e,t)=>{let{targets:n,blockers:r}=h7(e);if(r.length)throw Error(t,{cause:r});return n},Tot=async({targets:e,cacheDB:t})=>s3({targets:e,cacheDB:t}),Eot=B(`<!> <!>`,1);function Dot(e,t){O(t,!0);let n=LK(),r=J(t,`open`,15,!1),i=A(()=>n.current?.collection),a=A(()=>n.current?.collectionFile),o=A(()=>n.current?.originalEntry),s=A(()=>r()&&z(i)&&z(o)&&!t.discardsDraft?h7({collection:z(i),collectionFile:z(a),entries:[z(o)]}):wot);{let n=A(()=>Y(`delete_entries`,{values:{count:1}})),i=A(()=>Y(`delete`)),a=A(()=>!!z(s).blockers.length);wS(e,{get title(){return z(n)},get okLabel(){return z(i)},get okDisabled(){return z(a)},get onOk(){return t.onOk},get onClose(){return t.onClose},get open(){return r()},set open(e){r(e)},children:(e,n)=>{var r=H(),i=P(r),a=e=>{y5(e,{get plan(){return z(s)},count:1})},o=e=>{var n=Eot(),r=P(n),i=e=>{var t=V();R(e=>W(t,e),[()=>Y(`workflow.confirm_deleting_unpublished_entry`)]),U(e,t)},a=e=>{var t=V();R(e=>W(t,e),[()=>Y(`workflow.confirm_deleting_published_entry`)]),U(e,t)},o=e=>{var n=V();R(e=>W(n,e),[()=>Y(t.withAssets?`confirm_deleting_this_entry_with_assets`:`confirm_deleting_this_entry`)]),U(e,n)};G(r,e=>{t.discardsDraft?e(i):t.useWorkflow?e(a,1):e(o,-1)}),y5(I(r,2),{get plan(){return z(s)},count:1}),U(e,n)};G(i,e=>{z(s).blockers.length?e(a):e(o,-1)}),U(e,r)},$$slots:{default:!0}})}k()}var Oot=async({collection:e,changes:t,savingEntries:n})=>{if(!t.length)return 0;let r={commitType:`update`,collection:e};return await h3({changes:t,savingEntries:n,options:r}),l2.current={...c2,saved:!0,published:G8(r),count:n.length},n.length},kot=(e,t,n)=>{let r=Object.fromEntries(Object.entries(e.locales).map(([e,r])=>[e,r.content?{...r,content:{...r.content,[t]:n}}:{...r}]));return{...e,locales:r}},Aot=async(e,t,{cacheDB:n}={})=>{let r=sW(e);if(!r)return{changes:[],savingEntries:[]};let{_i18n:{defaultLocale:i}}=e,a=p4(n),o=[];for(let[e,n]of t.entries()){let t=e+1,a=Zp(n,{defaultLocale:i})?.content?.[r];Number(a)!==t&&o.push(kot(n,r,t))}let s=r3({collection:e});return{changes:(await Promise.all(o.map(t=>i3({collection:e,entry:t,draft:s,cacheDB:a})))).flat(),savingEntries:o}},jot=(e,t)=>{let n=t.map(({arrayIndex:e})=>e).sort((e,t)=>e-t),r=t.filter(({arrayIndex:e},t)=>e!==n[t]);return r.length?{changes:[{action:`update`,path:e._file.fullPath,arrayOrder:t.map(({arrayIndex:e,locales:t})=>({index:e,locales:t}))}],savingEntries:r}:{changes:[],savingEntries:[]}},Mot=async(e,t)=>{if(rQ({collection:e}))return 0;let{changes:n,savingEntries:r}=jd(e)?jot(e,t):await Aot(e,t);return Oot({collection:e,changes:n,savingEntries:r})},Not=(e,{excludeIds:t,updatedEntries:n}={})=>uW(rW(e.name).filter(n=>!cf(e,n)&&!(t&&t.has(n.id))).map(e=>n?.get(e.id)??e),e),Pot=async(e,{excludeIds:t,updatedEntries:n,cacheDB:r}={})=>!e||e._type!==`entry`||!sW(e)?{changes:[],savingEntries:[]}:Aot(e,Not(e,{excludeIds:t,updatedEntries:n}),{cacheDB:r}),Fot=({ids:e,assetPaths:t})=>{let n=Vp.current,r=new Set(e);if(Vp.current=n.filter(e=>!r.has(e.id)),l2.current={...c2,deleted:!0,count:e.length},t.length){let e=new Set(t);Dp.current=Dp.current.filter(t=>!e.has(t.path))}},Iot=async(e,t=[])=>{let n=Uf.current,r=n?g7({collection:n,entries:e},`Cannot delete entries that other entries require`):[],i=p4(),a=[],o=`delete`,s=await Promise.all(e.map(async e=>{let{id:t,slug:n}=e,r=Qp(e);return await Promise.all(r.map(async t=>{let r=await m4({cacheDB:i,previousPath:t});a.push({action:o,slug:n,path:t,previousSha:r,...t3(e)})})),t})),c=t.map(({path:e,sha:t})=>(a.push({action:o,path:e,previousSha:t}),e)),{changes:l,savingEntries:u}=await Pot(n,{excludeIds:new Set(s),updatedEntries:new Map(r.map(({entry:e})=>[e.id,e])),cacheDB:i}),d=new Set(u.map(({id:e})=>e)),{changes:f,savingEntries:p}=await Tot({targets:r.filter(({entry:e})=>!d.has(e.id)),cacheDB:i});a.push(...l,...f),await h3({changes:a,savingEntries:[...u,...p],options:{commitType:`delete`,collection:Uf.current}}),Fot({ids:s,assetPaths:c})},Lot=(e,{oldDir:t,newDir:n})=>{let r=e.slice(t.length+1);return n?`${n}/${r}`:r},Rot=({entry:e,dirMove:t,localeDirMoves:n})=>{let{subPath:r}=e,i=Lot(r,t),a=!1,o=Object.fromEntries(Object.entries(e.locales).map(([e,t])=>{let{slug:r,path:i}=t,o=n[e];if(!r||!Sf(o.oldDir,r))return[e,t];let s=Lot(r,o);if(s===r)return[e,t];let c=i.lastIndexOf(r);return c===-1?[e,t]:(a=!0,[e,{...t,slug:s,path:`${i.slice(0,c)}${s}${i.slice(c+r.length)}`}])}));if(a)return{...e,slug:i,subPath:i,locales:o}},zot=({collection:e,entry:t})=>{if(!D2(e))return t;let{_i18n:{defaultLocale:n,canonicalSlug:{key:r,value:i}}}=e,{subPath:a,locales:o}=t,s=i===`{{slug}}`?a:nQ(i,{collection:e,locale:n,content:o[n]?.content??{},currentSlug:a});return OUe(t,({localizedEntry:{content:e}})=>({...e,[r]:s}))},Bot=async({collection:e,originalEntry:t,movedEntry:n,draft:r,cacheDB:i})=>{let{defaultLocale:a}=e._i18n;return h4({draft:r,config:e,_file:Pf({collection:e,isIndexFile:r.isIndexFile}),entry:n,cacheDB:i,planChange:e=>{if(e===void 0){let{path:e}=Zp(t,{defaultLocale:a}),{slug:r,path:i}=Zp(n,{defaultLocale:a});return{action:`move`,slug:r,path:i,previousPath:e,currentPath:e}}let r=n.locales[e];if(!r?.content)return;let i=t.locales[e],{path:o}=i,s=o!==r.path;if(s||!(0,Qc.default)(r.content,i.content))return{action:s?`move`:`update`,slug:r.slug,path:r.path,previousPath:s?o:void 0,currentPath:o}}})},Vot=async({collection:e,originalEntry:t,savingEntry:n,cacheDB:r})=>{let i={changes:[],savingEntries:[]},a=vf(e);if(!t||!a||tu(t.subPath)!==a)return i;let o=xf(t.subPath),s=xf(n.subPath);if(!o||Sf(o,s))return i;let c=rW(e.name).filter(e=>e.id!==t.id&&Sf(o,e.subPath));if(!c.length)return i;let{_i18n:{allLocales:l}}=e,u={oldDir:o,newDir:s},d=Object.fromEntries(l.map(e=>[e,{oldDir:xf(t.locales[e]?.slug??``)||o,newDir:xf(n.locales[e]?.slug??``)||s}])),f=c.flatMap(t=>{let n=Rot({entry:t,dirMove:u,localeDirMoves:d});return n?[{originalEntry:t,movedEntry:c4({collection:e,entry:zot({collection:e,entry:n})})}]:[]});if(!f.length)return i;let p=p4(r),m=r3({collection:e});return{changes:(await Promise.all(f.map(({originalEntry:t,movedEntry:n})=>Bot({collection:e,originalEntry:t,movedEntry:n,draft:m,cacheDB:p})))).flat(),savingEntries:f.map(({movedEntry:e})=>e)}},Hot=({collection:e,originalEntry:t,savingEntry:n})=>{let r=new Map;return Object.entries(n.locales).forEach(([n,{path:i}])=>{let a=t.locales[n]?.path;if(!a)return;let o=IJ(e,a),s=IJ(e,i);o&&s&&o!==s&&r.set(o,s)}),r},Uot=async({collection:e,fileName:t,originalEntry:n,savingEntry:r,changes:i})=>{let a={changes:[],savingAssets:[]};if(!n||!Ey({collectionName:e.name,fileName:t})?.entryRelative)return a;let o=Hot({collection:e,originalEntry:n,savingEntry:r});if(!o.size)return a;let s=new Set(i.map(({path:e})=>e)),c=Dp.current.map(e=>q4(e,n)).filter(Boolean),l=[],u=[];return await Promise.all([...o].map(async([e,t])=>Promise.all(c.filter(({path:t})=>t.startsWith(`${e}/`)).map(async n=>{let r=`${t}${n.path.slice(e.length)}`;s.has(r)?l.push({action:`delete`,path:n.path,previousSha:n.sha}):(l.push(await rqe(n,r)),u.push({...n,path:r}))})))),{changes:l,savingAssets:u}},Wot=({originalEntry:e,savingEntry:t,canonicalSlugKey:n})=>({...e,slug:t.slug,locales:Object.fromEntries(Object.entries(e.locales).map(([e,r])=>{let{slug:i,content:a}=t.locales[e]??{},o=n?a?.[n]:void 0;return[e,{...r,slug:i??r.slug,content:n&&o!==void 0&&r.content?{...r.content,[n]:o}:r.content}]}))}),Got=({fieldConfig:e,originalEntry:t,renamedEntry:n,locale:r})=>{let i={fieldConfig:e,locale:r},a=s7({...i,entry:t}),o=s7({...i,entry:n}),s=new Map;return a.length===o.length&&a.forEach((e,t)=>{e!==o[t]&&s.set(e,o[t])}),s},Kot=({content:e,relation:t,replacements:n})=>{let{keyPath:r,valuePattern:i,multiple:a}=t,o=o7({content:e,keyPath:r,valuePattern:i,multiple:a}).filter(t=>n.has(e[t]));if(!o.length)return;let s={...e};return o.forEach(t=>{s[t]=n.get(e[t])}),s},qot=({collection:e,collectionFile:t,originalEntry:n,savingEntry:r})=>{if(!n||n.slug===r.slug)return[];let i=c7({collectionName:e.name,fileName:t?.name});if(!i.length)return[];let{_i18n:{canonicalSlug:{key:a}}}=t??e,o=Wot({originalEntry:n,savingEntry:r,canonicalSlugKey:a}),s=new Map;return i.forEach(e=>{let{fieldConfig:t}=e;vot({relation:e,excludeIds:new Set([n.id]),targets:s,getLocaleValues:e=>Got({fieldConfig:t,originalEntry:n,renamedEntry:o,locale:e}),getContentUpdater:()=>({content:t,values:n})=>Kot({content:t,relation:e,replacements:n})})}),[...s.values()]},Jot=async({collection:e,collectionFile:t,originalEntry:n,savingEntry:r,cacheDB:i})=>{let a={changes:[],savingEntries:[]},o=qot({collection:e,collectionFile:t,originalEntry:n,savingEntry:r});if(!o.length)return a;let s=o.filter(e=>rQ({collection:e.collection,collectionFile:e.collectionFile})||a3(e.entry));if(s.length){let e=s.map(e=>o3(e.entry,e.collection)).join(`, `);throw Error(Y(`cannot_rename_referenced_entry`,{values:{entries:e}}))}return s3({targets:o,cacheDB:i})},Yot=[`100644`,`100755`],Xot=e=>e.flatMap(({path:e,status:t,previousPath:n,mode:r})=>t===`renamed`?[...n?[{path:n,change:`removed`}]:[],{path:e,change:`added`,mode:r}]:[{path:e,change:t,mode:r}]),Zot=e=>{let{entryFiles:t,assetFiles:n}=My([fy(e)]);if(t.length)return{type:`entry`,collectionName:t[0].folder.collectionName};if(n.length)return{type:`asset`}},Qot=e=>{let t=Hp(Qp(e));if(t)return t;let n=e=>e.subPath.split(`/`).length;return(e.workflow.previousPaths??[]).map(e=>Hp([e])).filter(e=>!!e).reduce((e,t)=>!e||n(t)<n(e)?t:e,void 0)},$ot=({entry:e,collection:t,updatedEntry:n,deletion:r})=>{let{fileName:i}=e.workflow,a=i?Wp(t,i):void 0;return r?h7({collection:t,collectionFile:a,entries:KZ(e)}).targets:qot({collection:t,collectionFile:a,originalEntry:n,savingEntry:e})},est=async({entry:e,collection:t,updatedEntry:n,deletion:r,moved:i})=>{let a=new Map;if(!t)return a;let[{changes:o},{changes:s}]=await Promise.all([s3({targets:$ot({entry:e,collection:t,updatedEntry:n,deletion:r})}),i?Vot({collection:t,originalEntry:n,savingEntry:e}):{changes:[]}]);return[...o,...s].forEach(({path:e,previousPath:t,data:n})=>{t&&a.set(t,null),a.set(e,n)}),a},tst=({entry:e,collection:t,updatedEntry:n})=>{let{fileName:r}=e.workflow,i=new Set,a=new Map;if(!t||!Ey({collectionName:t.name,fileName:r})?.entryRelative)return{removedPaths:i,addedSHAs:a};let o=Hot({collection:t,originalEntry:n,savingEntry:e}),s=Dp.current.map(e=>q4(e,n)).filter(Boolean);return o.forEach((e,t)=>{s.filter(({path:e})=>e.startsWith(`${t}/`)).forEach(({path:n,sha:r})=>{i.add(n),a.set(`${e}${n.slice(t.length)}`,r)})}),{removedPaths:i,addedSHAs:a}},nst=async(e,t)=>{let{collectionName:n,fileName:r,pullRequest:i}=e.workflow,a=Kf(n),o=Qot(e),s=e.workflow.status===`pending_deletion`,c=Qp(e),l=o?Qp(o):[],u=new Set([...c,...l]),d=new Map(i.files.map(e=>[e.path,e])),{companions:f=[]}=e.workflow,p=new Set(f.flatMap(({entry:e,edited:t})=>t?[]:Qp(e))),{paths:m,publishedPaths:h}=IZ(f),g=new Set([...m,...h]),_=!s&&!!o&&o.subPath!==e.subPath,v=await est({entry:e,collection:a,updatedEntry:o,deletion:s,moved:_}),{removedPaths:y,addedSHAs:b}=_?tst({entry:e,collection:a,updatedEntry:o}):{removedPaths:new Set,addedSHAs:new Map},x=new Set(s&&o?QGe({entry:o,collectionName:n,fileName:r}).map(({path:e})=>e):[]),S=Xot(t).map(e=>({...e,kind:Zot(e.path)})),C=s?new Set:J4(e,f,S.filter(({change:e,kind:t})=>e!==`removed`&&t?.type===`asset`).map(({path:e})=>e)),w=({path:e,change:t,mode:n,kind:r})=>{if(t!==`removed`&&!Yot.includes(n))return!1;if(u.has(e))return!0;if(p.has(e))return t===`added`;if(g.has(e))return t!==`added`||!h.has(e);if(!r)return!1;if(r.type===`asset`){if(by(e))return!1;if(t===`removed`)return x.has(e)||y.has(e);let n=b.get(e);return C.has(e)||n!==void 0&&d.get(e)?.sha===n}if(!v.has(e))return!1;let i=v.get(e);return t===`removed`?i===null:typeof i==`string`&&d.get(e)?.text===i};return[...new Set(S.filter(e=>!w(e)).map(({path:e})=>e))]},_7=e=>Error(`publish_refused`,{cause:e}),rst=async(e,t,n)=>{let{headSHA:r}=e.workflow.pullRequest;if(!t.onConfiguredBranches||!t.complete)throw _7({reason:`other_changes`,paths:[]});if(!r||t.headSHA!==r)throw _7({reason:`entry_changed`,paths:[]});let i=await nst(e,t.files);if(!i.length)return;let a=new Set(await n({headSHA:r,paths:i})),o=i.filter(e=>!a.has(e));if(o.length)throw _7({reason:`other_changes`,paths:o})},ist=(e,t)=>{if(e.workflow.pullRequest.headSHA!==t)throw _7({reason:`entry_changed`,paths:[]})},v7=(e,t)=>e?.message===`publish_refused`?Y(e.cause.reason===`entry_changed`?`workflow.publish_refused_entry_changed`:`workflow.publish_refused_other_changes`):xl(e,t),y7=()=>{let e=LX.current?.workflow;if(!e)throw Error(`Editorial Workflow is not supported by the current backend`);return e},ast=e=>{let{collectionName:t,fileName:n}=e.workflow,r=Kf(t);if(r)return{entry:e,collection:r,collectionFile:n?Wp(r,n):void 0}},ost=e=>(e.workflow.companions??[]).flatMap(({collectionName:e,entry:t})=>{let n=Kf(e);return n?[{entry:t,collection:n}]:[]}),sst=({collectionName:e,slug:t,entry:n})=>{let r=n?.workflow?.pullRequest.branch,i=(r?HZ(r):void 0)??BZ({collectionName:e,slug:t,entry:n});return{existingEntry:i,branch:i?.workflow.pullRequest.branch??Hue({collectionName:e,slug:t})}},cst=(e,t)=>e?.workflow.previousPaths?.length?e.workflow.previousPaths:t,lst=(e,t,n)=>{let r=new Map(e.map(e=>[e.path,e])),i=e=>{r.set(e,{path:e,sha:``,size:0,deleted:!0})};return t.forEach(({action:e,path:t,previousPath:a,data:o})=>{if(a&&i(a),e===`delete`){i(t);return}let s=typeof o==`string`?o:void 0;r.set(t,{path:t,sha:n.files[t]?.sha??``,size:typeof o==`string`?new Blob([o]).size:o?.size??0,text:s,deleted:!1})}),[...r.values()]},b7=e=>{let{branch:t}=e.workflow.pullRequest,n=OZ.current,r=n.findIndex(e=>e.workflow.pullRequest.branch===t);OZ.current=r===-1?[...n,e]:n.with(r,e)},ust=e=>{OZ.current=OZ.current.filter(t=>t.workflow.pullRequest.branch!==e)},dst=(e,{pullRequest:t,collectionName:n,fileName:r,previousPaths:i,companions:a})=>{let o={...e,workflow:N8({pullRequest:t,collectionName:n,fileName:r,previousPaths:i,companions:a})};return b7(o),o},fst=(e,t)=>{ust(e.branch),t(e.branch),cue([e.headSHA])},pst=e=>{e.size&&(Dp.current=Dp.current.flatMap(t=>e.has(t.path)?t.workflow?[{...t,workflow:{branch:t.workflow.branch}}]:[]:[t]))},mst=(e,{deletion:t=!1,cascadedEntries:n=new Map,removedPaths:r=new Set}={})=>{let{workflow:i,...a}=e,o=t?[]:(i.companions??[]).map(({entry:e})=>e),s=new Set([a,...o].flatMap(e=>Qp(e,{includePrevious:!0}))),c=Vp.current.filter(e=>!Object.values(e.locales).some(({path:e})=>s.has(e))).map(e=>n.get(e.id)??e);Vp.current=t?c:[...c,a,...o],fst(i.pullRequest,FGe),pst(r)},hst=(e,t)=>{let n=new Set(t.flatMap(({entry:e})=>Qp(e)));return[...e.filter(({entry:e})=>!Qp(e).some(e=>n.has(e))),...t]},gst=e=>{let t=Dp.current.find(t=>t.path===e);return t?.workflow?t.workflow.replacedAsset:t},_st=async({path:e,deleted:t},n,r)=>{let i=await r?.get(e),a=gst(e);if(!t&&!i&&!a&&!Hp([e]))return{action:`delete`,slug:n,path:e};let o=t?`create`:`update`;if(i?.text!==void 0)return{action:o,slug:n,path:e,data:i.text};if(a)return{action:o,slug:n,path:e,data:await QX(a)};throw Error(`The published version of ${e} could not be found.`)},vst=async({existingEntry:e,savingEntry:t,companions:n,changes:r,slug:i})=>{let a=new Set(r.flatMap(({path:e,previousPath:t})=>t?[e,t]:[e])),o=e.workflow.pullRequest.files.filter(({path:e,deleted:t})=>!t&&!a.has(e)),{assetFiles:s}=My(o.map(({path:e})=>fy(e))),c=J4(e,e.workflow.companions??[],s.map(({path:e})=>e)),l=J4(t,n,[...c]),u=p4();return(await Promise.all(o.filter(({path:e})=>c.has(e)&&!l.has(e)).map(async e=>{try{return await _st(e,i,u)}catch(e){console.error(e);return}}))).filter(Boolean)},yst=async({changes:e,savingEntry:t,savingAssets:n=[],options:r,collectionName:i,fileName:a,slug:o,originalEntry:s,companions:c=[]})=>{let l=y7(),u=await _2(e,r),{existingEntry:d,branch:f}=sst({collectionName:i,slug:o,entry:s}),p=hst(d?.workflow.companions??[],c),m=d?await vst({existingEntry:d,savingEntry:t,companions:p,changes:e,slug:o}):[],h=[...e,...m],{commit:g,pullRequest:_}=await l.savePullRequest({changes:h,options:u,branch:f,title:np(mu(e),u),status:`draft`,pullRequest:d?.workflow.pullRequest}),v=QKe(),{date:y}=g,b=cst(d,s?Qp(s):[]),x=n.map(e=>({...e,sha:g.files[e.path]?.sha??e.sha,commitAuthor:v,commitDate:y,workflow:{branch:f}})),S=dst({...t,id:d?.id??t.id,commitAuthor:v,commitDate:y},{pullRequest:{..._,headSHA:g.sha,files:lst(_.files,h,g)},collectionName:i,fileName:a,previousPaths:b,companions:p});return PGe(f,new Set(m.map(({path:e})=>e))),Y4(x),{commit:{...g,author:v},savedEntries:[S],savedAssets:x}},bst=async(e,t)=>{let{number:n,author:r}=e;if(Yf.current||n===void 0||r?.login&&r.login===Fu.account?.login)return;let i=y7();try{await(t?i.approve(e):i.withdrawApproval(e))}catch(e){console.warn(`Failed to ${t?`approve`:`withdraw the approval of`} the pull request.`,e)}},x7=async(e,t)=>{let n=y7(),{pullRequest:r}=e.workflow;b7({...e,workflow:{...e.workflow,status:t,pullRequest:{...r,status:t}}});let i;try{i=await n.updateStatus(r,t)}catch(t){throw vae(t)?mst(e):b7(e),t}let a={...e,workflow:{...e.workflow,pullRequest:i,status:t}};b7(a);let{status:o}=e.workflow,s=[`draft`,`pending_review`];return t===`pending_publish`&&s.includes(o)?await bst(i,!0):o===`pending_publish`&&s.includes(t)&&await bst(i,!1),a},xst=new Map,Sst=async e=>{let t=y7(),{status:n}=e.workflow,{pullRequest:r}=e.workflow,i=n===`pending_deletion`,a=ast(e),o=i?[]:ost(e),[s,c]=i?[`preUnpublish`,`postUnpublish`]:[`prePublish`,`postPublish`],l=await t.fetchMergeState(r);await rst(e,l,t.fetchUnchangedPaths),a&&await Z4({...a,type:s}),await Promise.all(o.map(e=>Z4({...e,type:s}))),n===`draft`&&({pullRequest:r}=(await x7(e,`pending_publish`)).workflow),await t.publish(r),mst(e,{deletion:i,cascadedEntries:new Map(i&&a?h7({collection:a.collection,collectionFile:a.collectionFile,entries:KZ(e)}).targets.map(({entry:e})=>[e.id,e]):[]),removedPaths:new Set(l.files.flatMap(({status:e,path:t,previousPath:n})=>e===`removed`?[t]:e===`renamed`&&n?[n]:[]))}),await W5e(),Z5e(e),a&&await Z4({...a,type:c}),await Promise.all(o.map(e=>Z4({...e,type:c})))},Cst=async e=>{let{branch:t}=e.workflow.pullRequest;return Rl(xst,t,()=>{let n=Sst(e).finally(()=>{jZ.current=jZ.current.filter(e=>e!==t)});return jZ.current=[...jZ.current,t],n})},wst=async(e,t)=>(ist(e,t?.workflow?.pullRequest.headSHA),Cst(e)),S7=async e=>{let t=y7(),{pullRequest:n}=e.workflow;await t.discard(n),fst(n,X4)},Tst=e=>[{action:`delete`,slug:e.slug,path:Qp(e)[0]}],Est=async(e,t)=>{let{companions:n=[],pullRequest:r}=e.workflow,i=new Set(r.files.map(({path:e})=>e)),{paths:a,publishedPaths:o}=IZ(n),s=p4();return Promise.all(Ac([...a,...o]).filter(e=>i.has(e)).map(async e=>{if(!o.has(e))return{action:`delete`,slug:t,path:e};let n=(await s?.get(e))?.text;if(n===void 0)throw Error(`The published version of ${e} could not be found.`);return{action:a.includes(e)?`update`:`create`,slug:t,path:e,data:n}}))},Dst=async({unpublishedEntry:e,slug:t,handledPaths:n})=>{let r=e.workflow.pullRequest.files.filter(({path:e})=>!n.has(e));if(!r.length)return[];let{entryFiles:i,assetFiles:a}=My(r.map(({path:e})=>fy(e))),o=new Set([...i,...a].map(({path:e})=>e)),s=p4();return Promise.all(r.filter(({path:e})=>o.has(e)).map(e=>_st(e,t,s)))},Ost=async(e,t,n,r=[],{targets:i=void 0,userMessage:a=void 0,deletionGroup:o=void 0}={})=>{if(Yf.current)throw bl(`Cannot delete a published entry as an Open Authoring contributor`,`open_authoring.direct_commit_unsupported`);i??=g7({collection:t,collectionFile:n,entries:[e]},`Cannot delete an entry that other entries require`);let s=y7(),c=t.name,{slug:l}=e,{existingEntry:u,branch:d}=sst({collectionName:c,slug:l,entry:e}),f=Qp(e),p=Tst(e),m=await _2(p,{commitType:`delete`,collection:t,userMessage:a}),h=Ac(r.map(({path:e})=>e)),g=(u?.workflow.companions??[]).flatMap(({entry:e,edited:t})=>t?[]:Qp(e)),_=u?await Est(u,l):[],{changes:v}=await Tot({targets:i}),y=cst(u,f),b=u?await Dst({unpublishedEntry:u,slug:l,handledPaths:new Set([...f,...y,...h,...g,...[..._,...v].map(({path:e})=>e)])}):[],x=[...[...f,...h,...g].map(e=>({action:`delete`,slug:l,path:e})),..._.filter(({path:e})=>!v.some(t=>t.path===e)),...b,...v],{commit:S,pullRequest:C}=await s.savePullRequest({changes:x,options:m,branch:d,title:np(mu(p),m),status:`pending_deletion`,pullRequest:u?.workflow.pullRequest,deletionGroup:o}),w=lst(C.files,x,S);u&&X4(d);let T=t=>dst(e,{pullRequest:{...t,headSHA:S.sha,files:w},collectionName:c,fileName:n?.name,previousPaths:y,companions:[]});return C.status===`pending_deletion`?T(C):(T(C),T(await s.updateStatus(C,`pending_deletion`)))},kst=async e=>{await Ed(e,S7)},Ast=async e=>{let t=({collection:e,collectionFile:t})=>`${e.name}\0${t?.name??``}`,n=Map.groupBy(e,t),r=new Map;n.forEach((e,t)=>{let[{collection:n,collectionFile:i}]=e;r.set(t,{targets:g7({collection:n,collectionFile:i,entries:e.map(({entry:e})=>e)},`Cannot delete entries that other entries require`),deletionGroup:e.length>1?jc():void 0})});let[{entry:i,collection:a}]=e,{userMessage:o}=await _2(Tst(i),{commitType:`delete`,collection:a});await Ed(e,async e=>{let{entry:n,collection:i,collectionFile:a,assets:s}=e;await Ost(n,i,a,s,{...r.get(t(e)),userMessage:o})})},C7=async({entries:e,collection:t,collectionFile:n})=>{Y6(),t&&await Promise.all(e.map(async({subPath:e})=>{try{await G6(t.name,n?.name??e)}catch(e){console.error(e)}}))},jst=async({drafts:e=[],items:t=[],collection:n=void 0,collectionFile:r=void 0,useWorkflow:i})=>{let a=async()=>{e.length&&(await kst(e),await C7({entries:e,collection:n,collectionFile:r}))};if(t.length){let e=t.map(({entry:e})=>e);if(i&&n)return await Ast(t.map(({entry:e,assets:t})=>({entry:e,collection:n,collectionFile:r,assets:t}))),await C7({entries:e,collection:n,collectionFile:r}),await a(),{deleted:!0,deletionPending:!0,count:t.length};await Iot(e,t.flatMap(({assets:e})=>e)),await C7({entries:e,collection:n,collectionFile:r}),await a()}else return await a(),e.length?{deleted:!0,count:e.length}:void 0},w7=({pendingDeletion:e,publishedVersionExists:t})=>e?{label:Y(`workflow.cancel_deletion`),title:Y(`workflow.cancel_deletion`),message:Y(`workflow.confirm_cancelling_deletion`)}:t?{label:Y(`discard`),title:Y(`workflow.discard_changes`),message:Y(`workflow.confirm_discarding_entry_changes`)}:{label:Y(`delete`),title:Y(`delete_entries`,{values:{count:1}}),message:Y(`workflow.confirm_deleting_unpublished_entry`)},Mst=({deletion:e})=>e?{label:Y(`delete`),title:Y(`delete_entries`,{values:{count:1}}),message:Y(`workflow.confirm_completing_deletion`)}:{label:Y(`publish`),title:Y(`workflow.publish_entry`),message:Y(`workflow.confirm_publishing_entry_after_build`)},Nst=B(`<!> <!> <!> <!>`,1);function Pst(e,t){O(t,!0);let n=LK(),r=J(t,`deleting`,15,!1),i=j(!1),a=j(!1),o=j(!1),s=j(``),c=j(``),l=A(()=>w7({pendingDeletion:t.pendingDeletion,publishedVersionExists:!0})),u=()=>{M(i,!0)},d=()=>{M(a,!0)},f=async(e,i)=>{let a=n.current;M(c,i,!0),r(!0);let{ok:l,cancelled:u,result:d,error:f}=await g2(e);r(!1),l?(d&&(l2.current={...c2,count:1,...d}),n.current===a&&t.onDone()):u||(M(s,xl(f,`deleting_entry_failed`),!0),M(o,!0))},p=async()=>{await f(()=>jst({drafts:t.discardsDraft?[t.unpublishedEntry]:[],items:t.discardsDraft?[]:[{entry:t.originalEntry,assets:t.associatedAssets}],collection:t.collection,collectionFile:t.collectionFile,useWorkflow:t.useWorkflow}),`workflow.deleting_entry`)},m=async()=>{await f(async()=>(t.unpublishedEntry&&await S7(t.unpublishedEntry),t.pendingDeletion?{deletionCancelled:!0}:{discarded:!0}),t.pendingDeletion?`workflow.cancelling_deletion`:`workflow.discarding_changes`)};var h={confirmDelete:u,confirmDiscard:d},g=Nst(),_=P(g);{let e=A(()=>!!t.associatedAssets.length);Dot(_,{get discardsDraft(){return t.discardsDraft},get useWorkflow(){return t.useWorkflow},get withAssets(){return z(e)},onOk:async()=>{await p()},get onClose(){return t.onClose},get open(){return z(i)},set open(e){M(i,e,!0)}})}var v=I(_,2);wS(v,{get title(){return z(l).title},get okLabel(){return z(l).label},onOk:async()=>{await m()},get onClose(){return t.onClose},get open(){return z(a)},set open(e){M(a,e,!0)},children:(e,t)=>{Ur();var n=V();R(()=>W(n,z(l).message)),U(e,n)},$$slots:{default:!0}});var y=I(v,2),b=e=>{fC(e,{get id(){return z(c)},get show(){return r()},duration:0,children:(e,t)=>{bx(e,{status:`info`,children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(z(c))]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}})};return G(y,e=>{z(c)&&e(b)}),fC(I(y,2),{get show(){return z(o)},set show(e){M(o,e,!0)},children:(e,t)=>{bx(e,{status:`error`,children:(e,t)=>{Ur();var n=V();R(()=>W(n,z(s))),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),U(e,g),k(h)}function Fst(e,t){O(t,!0);let n=e=>{var n=H(),r=P(n),i=e=>{let n=A(()=>m4e(t.conflict,Ec.current));var r=V();R(()=>W(r,`${z(n).description??``}
${z(n).warning??``}`)),U(e,r)};G(r,e=>{t.conflict&&e(i)}),U(e,n)},r=J(t,`open`,15,!1);var i=H(),a=P(i),o=e=>{{let i=A(()=>Y(`save_conflict.title`));CS(e,{get title(){return z(i)},get onClose(){return t.onClose},get open(){return r()},set open(e){r(e)},children:(e,t)=>{n(e)},$$slots:{default:!0}})}},s=e=>{{let i=A(()=>Y(`save_conflict.title`)),a=A(()=>Y(`save_conflict.save_anyway`));wS(e,{get title(){return z(i)},get okLabel(){return z(a)},get onOk(){return t.onOverwrite},get onClose(){return t.onClose},get open(){return r()},set open(e){r(e)},children:(e,t)=>{n(e)},$$slots:{default:!0}})}};G(a,e=>{t.conflict?.canOverwrite===!1?e(o):e(s,-1)}),U(e,i),k()}var Ist=B(`<span role="none"> </span>`),Lst={hash:`svelte-1sst490`,code:`
/*
* Filled pill following the same background/foreground/border recipe as the Alert and Infobar
* components, so the colors adapt to both the light and dark themes. The border does most of the
* work in dark mode, where the alert background is nearly the same as the row background.
*/.status-pill.svelte-1sst490 {display:inline-block;border-width:1px;border-style:solid;border-radius:12px;padding:1px 6px;font-size:var(--sui-font-size-x-small);line-height:var(--sui-line-height-compact);white-space:nowrap;&.info {border-color:var(--sui-info-border-color);background-color:var(--sui-info-background-color);color:var(--sui-info-foreground-color);}&.warning {border-color:var(--sui-warning-border-color);background-color:var(--sui-warning-background-color);color:var(--sui-warning-foreground-color);}&.success {border-color:var(--sui-success-border-color);background-color:var(--sui-success-background-color);color:var(--sui-success-foreground-color);}&.error {border-color:var(--sui-error-border-color);background-color:var(--sui-error-background-color);color:var(--sui-error-foreground-color);}}`};function Rst(e,t){K(e,Lst);let n=J(t,`class`,3,``);var r=Ist(),i=F(r,!0);R(()=>{$o(r,1,Yo([`status-pill`,t.tone,n()]),`svelte-1sst490`),W(i,t.label)}),U(e,r)}function T7(e,t){O(t,!0);let n={draft:`info`,pending_review:`warning`,pending_publish:`success`,pending_deletion:`error`};{let r=A(()=>Y(nx[t.status]));Rst(e,{get tone(){return n[t.status]},get label(){return z(r)},get class(){return`status-badge ${t.status??``}`}})}k()}var zst=({entryDraft:e,branch:t,collectionName:n})=>{(e.current?.originalEntry)?.workflow?.pullRequest.branch===t&&(e.current=null,S0(`/collections/${n}`))},Bst=(e,{entryDraft:t,branch:n,collectionName:r})=>vae(e)?(t.modified||zst({entryDraft:t,branch:n,collectionName:r}),l2.current={...c2,alreadyPublished:!0},!0):!1,Vst=async({entry:e,entryDraft:t,valid:n,action:r,failure:i,closeOnSuccess:a=!1,handleAlreadyPublished:o=!1})=>{if(!n)return{blocked:!0,errorMessage:void 0};let{collectionName:s,pullRequest:c}=e.workflow,l={entryDraft:t,branch:c.branch,collectionName:s};try{await r(),a&&zst(l)}catch(e){if(!o||!Bst(e,l))return console.error(e),{blocked:!1,errorMessage:v7(e,i)}}return{blocked:!1,errorMessage:void 0}},Hst=({entry:e,draft:t})=>{if(t?.originalEntry?.id===e.id)return X2e({draft:t});let{collectionName:n,fileName:r}=e.workflow,i=Gp(n,r);if(!i)return!0;let{collection:a,collectionFile:o}=i;return n8({draft:$6({collection:a,collectionFile:o,originalEntry:e})}).valid},Ust=({entry:e,status:t,draft:n})=>t===`draft`||Hst({entry:e,draft:n}),Wst=({entry:e,draft:t})=>e.workflow.status===`pending_deletion`||Hst({entry:e,draft:t}),Gst=B(`<!> <!> <!>`,1);function Kst(e,t){O(t,!0);let n=LK(),r=J(t,`disabled`,3,!1),i=j(!1),a=j(!1),o=j(``),s=j(!1),c=j(0),l=A(()=>xZ(t.entry)),u=A(()=>SZ(t.entry)),d=A(()=>Y(nx[z(u)])),f=A(()=>Y(`workflow.entry_status_value`,{values:{status:z(d)}})),p=async e=>{if(e===z(u)||z(i))return;let{blocked:r,errorMessage:l}=await Vst({entry:t.entry,entryDraft:n,valid:Ust({entry:t.entry,status:e,draft:n.current}),action:()=>(M(i,!0),x7(t.entry,e)),failure:`workflow.status_change_failed`,handleAlreadyPublished:!0});if(M(i,!1),r)M(s,!0);else if(l)M(o,l,!0),M(a,!0);else return;M(c,z(c)+1)};var m=Gst(),h=P(m),g=e=>{T7(e,{get status(){return z(u)}})},_=e=>{{let t=e=>{{let t=A(()=>Y(`workflow.change_entry_status`));qS(e,{get ariaLabel(){return z(t)},children:(e,t)=>{var n=H();Oo(P(n),()=>z(c),e=>{var t=H();No(P(t),16,()=>z(l),e=>e,(e,t)=>{{let n=A(()=>Y(nx[t])),r=A(()=>t===z(u));XS(e,{get label(){return z(n)},get checked(){return z(r)},onChange:()=>{p(t)}})}}),U(e,t)}),U(e,n)},$$slots:{default:!0}})}},n=A(()=>z(i)?Y(`workflow.changing_status`):PY.isLargeScreen?z(f):z(d)),a=A(()=>r()||z(i)),o=A(()=>z(i)?Y(`workflow.changing_status`):z(f));hS(e,{variant:`ghost`,get label(){return z(n)},get disabled(){return z(a)},popupPosition:`bottom-right`,get"aria-label"(){return z(o)},popup:t,$$slots:{popup:!0}})}};G(h,e=>{z(l).length===1?e(g):e(_,-1)});var v=I(h,2);fC(v,{get show(){return z(a)},set show(e){M(a,e,!0)},children:(e,t)=>{bx(e,{status:`error`,children:(e,t)=>{Ur();var n=V();R(()=>W(n,z(o))),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),fC(I(v,2),{get show(){return z(s)},set show(e){M(s,e,!0)},children:(e,t)=>{bx(e,{status:`error`,children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(`workflow.status_change_blocked`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),U(e,m),k()}var qst=B(`<!> <!> <!> <!>`,1);function Jst(e,t){O(t,!0);let n=LK(),r=J(t,`disabled`,3,!1),i=J(t,`modified`,3,!1),a=j(!1),o=j(!1),s=j(``),c=j(!1),l=A(()=>t.entry.workflow.status===`pending_deletion`),u=A(()=>Mst({deletion:z(l)})),d=A(()=>jZ.current.includes(t.entry.workflow.pullRequest.branch)),f=A(()=>XZ(t.entry,Kf(t.entry.workflow.collectionName))),p=async()=>{let{blocked:e,errorMessage:r}=await Vst({entry:t.entry,entryDraft:n,valid:Wst({entry:t.entry,draft:n.current}),action:()=>wst(t.entry,n.current?.originalEntry),failure:`workflow.publishing_entry_failed`,closeOnSuccess:!0});e?M(c,!0):r&&(M(s,r,!0),M(o,!0))};var m=qst(),h=P(m),g=e=>{{let t=A(()=>z(d)&&!z(l)?Y(`publishing`):z(u).label),n=A(()=>r()||i()&&!z(l)||z(d));Xx(e,{variant:`primary`,get label(){return z(t)},get"aria-label"(){return z(u).title},get disabled(){return z(n)},onclick:()=>{M(a,!0)}})}};G(h,e=>{z(f)&&e(g)});var _=I(h,2);wS(_,{get title(){return z(u).title},get okLabel(){return z(u).label},onOk:()=>{p()},get open(){return z(a)},set open(e){M(a,e,!0)},children:(e,t)=>{Ur();var n=V();R(()=>W(n,z(u).message)),U(e,n)},$$slots:{default:!0}});var v=I(_,2);fC(v,{get show(){return z(o)},set show(e){M(o,e,!0)},children:(e,t)=>{bx(e,{status:`error`,children:(e,t)=>{Ur();var n=V();R(()=>W(n,z(s))),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),fC(I(v,2),{get show(){return z(c)},set show(e){M(c,e,!0)},children:(e,t)=>{bx(e,{status:`error`,children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(`workflow.publish_blocked`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),U(e,m),k()}var E7=(e,t)=>e.find(e=>e.name===t),Yst=e=>b8([e])&&!e.readonly&&!(e.widget===`number`&&e.auto_increment)&&!z4(e),Xst=e=>e?._type===`entry`&&!!e.bulk_edit,Zst=e=>{if(!e||!Xst(e))return[];let{bulk_edit:t}=e,n=X(t)&&Array.isArray(t.fields)?t.fields:void 0;return(n?n.map(t=>E7(e.fields,t)):e.fields).filter(e=>!!e&&Yst(e))},Qst=/^\d{4}-\d{2}-\d{2}$/,D7=e=>Array.isArray(e)?e.some(D7):typeof e==`string`&&tf(e),$st=e=>!!e&&(D7(e.pattern)||UW.some(t=>D7(e[t]))),O7=(e,t=new Date)=>{if(typeof e!=`string`||!tf(e))return e;if(e===`{{now}}`)return t;let{year:n,month:r,day:i,hour:a,minute:o,second:s}=CU({date:t}),c=`${n}-${r}-${i}`,l={year:n,month:r,day:i,hour:a,minute:o,second:s};return e.replace(qd,(e,t)=>t===`now`?`${c}T${a}:${o}:${s}`:t===`today`?c:Jd.includes(t)?l[t]:e)},ect=e=>{let{format:t,dateOnly:n,timeOnly:r,utc:i}=BH(e);return!t&&!n&&!r&&!i},k7=(e,t,n)=>{if(e instanceof Date)return qH(e)?e:void 0;if(e==null||e===``)return;if(Qst.test(String(e))&&(!t||ect(t))){let[t,n,r]=String(e).split(`-`).map(Number);return new Date(t,n-1,r)}if(t)return aU(String(e),t,n);let r=new Date(e);return qH(r)?r:void 0},tct=e=>typeof e==`number`&&Number.isFinite(e)||typeof e==`string`&&e.trim()!==``&&Number.isFinite(Number(e)),nct=({value:e,target:t,dateFieldConfig:n,locale:r})=>{if(e==null||t==null)return;if(n||e instanceof Date||t instanceof Date){let i=k7(e,n,r),a=k7(t,n,r);return i&&a?i.getTime()-a.getTime():void 0}if(tct(e)&&tct(t))return Number(e)-Number(t);let i=String(e),a=String(t);return i<a?-1:+(i>a)},A7=(e,t)=>e===t||e!=null&&t!==void 0&&String(e)===String(t),rct=(e,{dateFieldConfig:t,now:n=new Date,locale:r=void 0}={})=>{let i=O7(e.pattern,n),a=UW.filter(t=>e[t]!==void 0).map(i=>{let a=e[i];if(i===`empty`)return{operator:i,target:a};if(i===`in`||i===`not_in`)return{operator:i,target:(Array.isArray(a)?a:[a]).map(e=>O7(e,n))};let o=O7(a,n);return t&&i!==`eq`&&i!==`ne`?{operator:i,target:k7(o,t,r)}:{operator:i,target:o}});return{pattern:i,regex:XU(i),comparisons:a,dateFieldConfig:t,locale:r}},ict=({rawValue:e,refValue:t,conditions:n})=>{let{pattern:r,regex:i,comparisons:a,dateFieldConfig:o,locale:s}=n,c=[e].flat().filter(e=>e!==void 0),l=[...new Set([...c,...[t].flat().filter(e=>e!==void 0)])];return r!==void 0&&!l.some(e=>XW(e,r,i))?!1:a.every(({operator:t,target:n})=>{switch(t){case`eq`:return l.some(e=>A7(e,n));case`ne`:return!l.some(e=>A7(e,n));case`in`:return l.some(e=>n.some(t=>A7(e,t)));case`not_in`:return!l.some(e=>n.some(t=>A7(e,t)));case`empty`:return[e].flat().every(Cm)===n;default:return c.some(e=>{let r=nct({value:e,target:n,dateFieldConfig:o,locale:s});return r===void 0?!1:t===`lt`?r<0:t===`lte`?r<=0:t===`gt`?r>0:r>=0})}})},act=e=>sG(e,`filters`),oct=({collectionName:e,locale:t,conditions:n,now:r})=>{let{field:i}=n,a=lh({collectionName:e,keyPath:i}),o=rct(n,{dateFieldConfig:a?.widget===`datetime`?a:void 0,now:r,locale:t});return n=>{let r={entry:n,locale:t,collectionName:e,key:i};return ict({rawValue:qU({...r,resolveRef:!1}),refValue:qU(r),conditions:o})}},sct=e=>rl(()=>{let t=Uf.current;return t?._type===`entry`?sG(t[`view_${e}`],e).options:[]}),cct=(e,t,n,r=new Date)=>{let{name:i,view_filters:a=[],_i18n:{defaultLocale:o}}=t,{options:s}=act(a),c=s.map(e=>KW(WW(e))),l=n.filter(e=>e.field!==void 0&&c.includes(KW(e))).map(e=>oct({collectionName:i,locale:o,conditions:e,now:r}));return e.filter(e=>l.every(t=>t(e)))},lct=sct(`filters`),j7=e=>sG(e,`groups`),uct=e=>{if(e?._type!==`entry`)return;let t=cW(e);if(!t)return;let n=j7(e.view_groups).options.find(e=>e.name===t);return n?WW(n):void 0},dct=(e,t,n,r)=>{let{name:i,view_groups:a,_i18n:{defaultLocale:o}}=t,{field:s}=n,c=KW(n),l=oct({collectionName:i,locale:o,conditions:n,now:r}),u=j7(a).options.find(e=>KW(WW(e))===c)?.label||s,d=[],f=[];return e.forEach(e=>{(l(e)?d:f).push(e)}),[{name:u,entries:d},{name:`*other`,entries:f}].filter(e=>e.entries.length)},fct=(e,t,n,r=new Date,i=void 0)=>{let{field:a,pattern:o}=n??{field:``,pattern:void 0};if(!a)return e.length?[{name:`*`,entries:e}]:[];if(GW(n))return dct(e,t,n,r);let{name:s,_i18n:{defaultLocale:c}}=t,l=JW(e,o,e=>JU(qU({entry:e,locale:c,collectionName:s,key:a}))).map(([e,t])=>({name:e,entries:t}));return i?.key===a&&i.order===`descending`&&l.reverse(),l},M7=sct(`groups`),N7=tl(!1),P7=tl([]),F7=tl(!1),I7=tl(!1),L7=tl({}),R7=tl(!1),z7=tl([]),B7=tl({}),pct=()=>N7.current||I7.current,mct=6e4,V7=tl(new Date),hct=rl(()=>{let{filters:e=[],group:t}=b3.current;return e.some($st)||$st(t)}),H7=il(()=>b3.current.sort),U7=il(()=>b3.current.filters),gct=il(()=>b3.current.group),W7=rl(()=>{let{current:e}=Vp,{current:t}=Uf,{current:n}=mf;if(!e||!t)return[];let r=e=>Hie({collection:t,entries:e,dirPath:n}),i=rW(t.name);return pct()?r(i):r(ZZ(i,OZ.current.filter(({workflow:e})=>e.collectionName===t.name)))}),_ct=rl(()=>{let{current:e}=Uf;if(e?._type!==`entry`||pct())return[];let t=new Set(W7.current);return Hie({collection:e,entries:OZ.current.filter(n=>n.workflow.collectionName===e.name&&!t.has(n)),dirPath:mf.current})}),G7=rl(()=>{let e=_ct.current;if(!e.length)return[];let t=Uf.current,{current:n}=H7,{current:r}=U7;return n&&(e=OG(e,t,n)),r&&(e=cct(e,t,r,V7.current)),e}),K7=rl(()=>W7.current.length+_ct.current.length),vct=5,q7=rl(()=>{let{current:e}=Uf,t=!!e&&iQ({collection:e});if(e?._type===`entry`){let n=(e.create??!0)&&e.limit!==0,r=!t&&(e.delete??!0),i=!t&&!Yf.current&&!ul.current,a=i&&oW(e),o=i&&!!Zst(e).length,s=e?.limit??1/0,c=u8(e.name),l=s<1/0?s-c:1/0;return{isEntryCollection:!0,readonly:t,canCreate:n,canDelete:r,canReorder:a,canBulkEdit:o,quota:s,remaining:l,nearingQuota:l>0&&l<=vct,creationDisabled:!n||t||l<=0}}return{isEntryCollection:!1,readonly:t,canCreate:!1,canDelete:!1,canReorder:!1,canBulkEdit:!1,quota:1/0,remaining:1/0,nearingQuota:!1,creationDisabled:!1}}),yct=rl(()=>{let e=Uf.current,{current:t}=W7,{current:n}=H7;return n?OG(t,e,n):t}),bct=rl(()=>{let e=Uf.current,{current:t}=yct,{current:n}=U7;return n?cct(t,e,n,V7.current):t}),J7=rl(()=>{let e=Uf.current,{current:t}=W7;if(!t.length||qp(e,t[0]).length)return[];let{current:n}=gct;return fct(bct.current,e,n,V7.current,H7.current)}),xct=rl(()=>new Set([...G7.current,...J7.current.flatMap(({entries:e})=>e)])),Sct=rl(()=>new Map([...xct.current].map((e,t)=>[e.id,t]))),Cct=(e,t)=>{let{view_filters:n,view_groups:r}=e,i={...y3.current?.[e.name]},{default:a}=CG({collection:e,isCommitAuthorAvailable:t.some(e=>!!e.commitAuthor),isCommitDateAvailable:t.some(e=>!!e.commitDate)}),{keys:o}=CG({collection:e,isCommitAuthorAvailable:!0,isCommitDateAvailable:!0}),{default:s}=act(n),{options:c,default:l}=j7(r);i.sort?.key!==void 0&&!o.includes(i.sort.key)&&delete i.sort,i.group&&!c.some(e=>KW(WW(e))===KW(i.group))&&delete i.group,i.sort===void 0&&a&&(i.sort=a),i.filters===void 0&&s&&(i.filters=[s]),i.group===void 0&&l&&(i.group=l),(0,Qc.default)(i,b3.current)||(b3.current=i)},Y7=e=>{if(!e){P7.current=[],F7.current=!1,x3.current&&=(b3.current=x3.current.view,void 0),N7.current=!1;return}let t=b3.current,n=uct(Uf.current);x3.current={collectionName:Uf.current?.name,view:t};let r={};t.sort?.key!==`_manual`&&(r.sort={key:`_manual`,order:`ascending`}),t.filters?.length&&(r.filters=[]),n?$W(t.group)!==$W(n)&&(r.group=n):t.group&&(r.group=null),Object.keys(r).length&&(b3.current={...t,...r}),N7.current=!0},X7=e=>{L7.current={},B7.current={},z7.current=[],I7.current=e};ol(()=>{let e=Uf.current,{current:t}=Vp;e?._type===`entry`&&eo(()=>{x3.current?.collectionName!==e.name&&Cct(e,t)})}),ol(()=>{if(!hct.current)return;V7.current=new Date;let e=setInterval(()=>{V7.current=new Date},mct);return()=>{clearInterval(e)}}),ol(()=>{let{current:e}=LX;e&&!eo(()=>y3.current)&&jqe(e)}),ol(()=>{let e=W7.current;U7.current,ZU.current=[],eo(()=>yu.devModeEnabled)&&console.info(`listedEntries`,e)}),ol(()=>{let e=ZU.current;if(!e.length)return;let{current:t}=xct;e.some(e=>!t.has(e))&&(ZU.current=e.filter(e=>t.has(e)))}),ol(()=>{let e=Uf.current;eo(()=>{x3.current=void 0,N7.current&&Y7(!1),I7.current&&X7(!1)}),e&&eo(()=>yu.devModeEnabled)&&console.info(`selectedCollection`,e)});var wct=[...Ld,...Rd],Tct=async({draft:e,currentValues:t})=>{let{originalEntry:n,collection:r,collectionName:i,fileName:a,isIndexFile:o}=e,s={};if(!n)return s;let{defaultLocale:c}=e,l=Zp(n,{defaultLocale:c})?.path,u=!!l&&!!IJ(r,l),d=n1e({files:s}),f=async({value:e,folder:t,typedKeyPath:r,locale:o})=>{let s=q4(TQ({value:e,entry:n,collectionName:i,fileName:a,typedKeyPath:r,locale:o}),n);if(s&&Dy(s.path).some(e=>e.collectionName===i&&e.fileName===a&&e.entryRelative))return d(s.path,async()=>{try{return await t1e(s)}catch{return}},t)},p=async({valueMap:t,locale:n,keyPath:r})=>{let s=t[r];if(typeof s!=`string`||!s)return;let c=ch(e,{valueMap:t,keyPath:r}),l=lh(c),{widget:d=`string`}=l??{};if(!wct.includes(d))return;let p=uh(c),m=w3({collectionName:i,fileName:a,typedKeyPath:p,isIndexFile:o});if(!m?.entryRelative||!(u||m.hasTemplateTags))return;let h=await i1e({value:s,format:Ld.includes(d)?void 0:T$(l),rewrite:e=>f({value:e,folder:m,typedKeyPath:p,locale:n})});h!==void 0&&(t[r]=h)};return await Promise.all(Object.entries(t).flatMap(([e,t])=>Object.keys(t).map(n=>p({valueMap:t,locale:e,keyPath:n})))),s},Ect=({keyPath:e,...t})=>{let n=e.split(`.`);for(let e=1;e<=n.length;e+=1){let r=n.slice(0,e).join(`.`),i=lh({...t,keyPath:r});if(i?.widget===`hidden`)return{fieldConfig:i,keyPath:r}}},Dct=({getFieldArgs:e,locale:t,defaultLocale:n,valueMap:r,canonicalSlugKey:i,aliasesKey:a,orderFieldKey:o})=>{let s=new Set,c=new Map;delete r[i],DUe(r,a),o&&delete r[o];let l={...e,valueMap:r},u=new Map;return Object.keys(r).forEach(e=>{let i=Ect({...l,keyPath:e}),a=i?.fieldConfig??lh({...l,keyPath:e});a&&(t===n||NW(a.i18n)?i?(delete r[e],u.set(i.keyPath,i.fieldConfig)):r[e]=L3({fieldConfig:a,keyPath:e,value:r[e],locale:t,defaultLocale:n}):(i||a.widget===`uuid`)&&RW({fieldConfig:a,getFieldArgs:{...l,keyPath:i?.keyPath??e}})&&(i?(delete r[e],s.add(i.keyPath)):(r[e]=``,c.set(e,a))))}),u.forEach((e,i)=>{r[i]=L3({fieldConfig:e,keyPath:i,locale:t,defaultLocale:n})}),{duplicatedHiddenKeyPaths:s,clearedUuidFields:c}},Oct=({currentValues:e,defaultLocale:t,getFieldArgs:n,duplicatedHiddenFieldMap:r,clearedUuidFieldMap:i})=>{let a=e[t];r.forEach((t,n)=>{t.forEach(t=>{t in a&&(e[n][t]=structuredClone(a[t]))})}),zJe({contentMap:e,defaultLocale:t,getFieldArgs:n}),i.forEach((t,n)=>{t.forEach((t,r)=>{e[n][r]||(e[n][r]=I3(t))})})},kct=({draft:e,currentValues:t,files:n})=>{let{collection:r,collectionFile:i,currentPath:a}=e,o=a!==void 0&&vf(r)?xf(a):a,s=$c({...e,id:crypto.randomUUID(),createdAt:Date.now(),isNew:!0,originalEntry:void 0,originalSlugs:{},currentSlugs:{},originalPath:o,currentPath:o,originalLocales:el(e.currentLocales),currentLocales:el(e.currentLocales),originalValues:structuredClone(t),currentValues:{},files:n,validities:Object.fromEntries(Object.keys(e.validities).map(e=>[e,{}])),slugEditor:O2e({collection:r,collectionFile:i,originalSlugs:{}}),interacted:!1},fK);return Object.entries(t).forEach(([e,t])=>{s.currentValues[e]=F3({draft:s,locale:e,target:t})}),s},Act=async e=>{let t=e.current,{collection:n,fields:r}=t,{defaultLocale:i,canonicalSlug:{key:a}}=Rf(t),o=ch(t),s=sW(n),c=i4({collection:n,fields:r}),l=Object.fromEntries(Object.entries(t.currentValues).map(([e,t])=>[e,el(t)])),u=new Map,d=new Map;Object.entries(l).forEach(([e,t])=>{let{duplicatedHiddenKeyPaths:n,clearedUuidFields:r}=Dct({getFieldArgs:o,locale:e,defaultLocale:i,valueMap:t,canonicalSlugKey:a,aliasesKey:c,orderFieldKey:s});u.set(e,n),d.set(e,r)}),Oct({currentValues:l,defaultLocale:i,getFieldArgs:o,duplicatedHiddenFieldMap:u,clearedUuidFieldMap:d});let f={...t.files,...await Tct({draft:t,currentValues:l})};if(e.current!==t)return;let p=kct({draft:t,currentValues:l,files:f});return e.current=p,e0.current=!0,p},jct=async e=>{let{isNew:t,originalEntry:n,collectionName:r,fileName:i}=e,{branch:a,headSHA:o}=n?.workflow?.pullRequest??{},s=LX.current?.workflow;if(t||!n||!a||!o||!s)return;let c;try{c=await s.fetchBranchHead(a)}catch(e){console.error(`Failed to check the workflow branch for changes.`,e);return}if(c!==o){try{await R8({fresh:!0})}catch(e){console.error(`Failed to reload the unpublished entries.`,e)}if(c)return d8(n,UZ({collectionName:r,fileName:i,originalEntry:n}))}},Mct=({useWorkflow:e,skipCI:t,count:n})=>{l2.current={...c2,saved:!0,published:!e&&G8({skipCI:t}),count:n}},Nct=async({draft:e,slugs:t,recreate:n})=>{let{collection:r,fileName:i,originalEntry:a}=e;try{let{savingEntry:o,changes:s,savingAssets:c}=await n3({draft:e,slugs:t,recreate:n}),{changes:l,savingEntries:u}=await Jot({collection:r,collectionFile:e.collectionFile,originalEntry:a,savingEntry:o});s.push(...l);let{changes:d,savingEntries:f}=await Vot({collection:r,originalEntry:a,savingEntry:o});s.push(...d);let{changes:p,savingAssets:m}=await Uot({collection:r,fileName:i,originalEntry:n?void 0:a,savingEntry:o,changes:s});return s.push(...p),c.push(...m),{savingEntry:xKe(o),changes:s,savingAssets:c,cascadeEntries:u,movedEntries:f}}catch(e){throw console.error(e),Error(`saving_failed`,{cause:e})}},Pct=async(e,{remoteChecked:t})=>{let n=vH(e);if(n.length){if(!t)try{await m3()}catch(e){console.error(`Failed to check the repository for changes.`,e)}for(let{collectionName:t,entry:r,baseEntry:i}of n){let n=M4e(e,i);if(n){let e=wW(Kf(t),r);throw Error(`saving_failed`,{cause:Error(Y(n.type===`deleted`?`relation_field.edit_deleted`:`relation_field.edit_conflict`,{values:{name:e}}))})}}}},Fct=async({draft:e,useWorkflow:t,overwrite:n,publish:r})=>{if(oQ(e)){let{collection:t,collectionFile:n}=e;throw Error(`saving_failed`,{cause:Error(sQ(`entry`,{collection:t,collectionFile:n}))})}if(!await r8({draft:e,enforceRequired:r||lGe(e)}))throw Error(`validation_failed`);let i=t?await jct(e):await p4e(e);if(i&&!n)throw Error(`save_conflict`,{cause:i});return await Pct(e,{remoteChecked:!t&&!e.isNew&&!!e.originalEntry}),i},Ict=async e=>{let t=[];for(let n of QOe(e))t.push(await wKe(n));return t},Lct=async({draft:e,useWorkflow:t,changes:n,savingEntry:r,otherSavingEntries:i,pendingEntries:a,savingAssets:o,options:s})=>{let{collectionName:c,fileName:l,originalEntry:u}=e;try{return t?await yst({changes:n,savingEntry:r,savingAssets:o,options:s,collectionName:c,fileName:l,slug:r.slug,originalEntry:u,companions:a.map(({collectionName:e,entry:t,baseEntry:n})=>({collectionName:e,entry:t,...n&&Vp.current.some(({id:e})=>e===t.id)?{edited:!0}:{}}))}):await h3({changes:n,savingEntries:[r,...i],savingAssets:o,options:s})}catch(e){throw h2(e)?e:(console.error(e.cause??e),Error(`saving_failed`,{cause:e.cause??e}))}},Rct=async({draft:e,savingEntry:t,pendingEntries:n,useWorkflow:r,skipCI:i,count:a})=>{let{isNew:o,collection:s,collectionName:c,originalEntry:l}=e;Y6();try{await G6(c,q6(e))}catch(e){console.error(e)}await Z4({type:`postSave`,entry:t,collection:s,collectionFile:e.collectionFile,isNew:o}),await Promise.all(n.map(({collectionName:e,entry:t,baseEntry:n})=>Z4({type:`postSave`,entry:t,collection:Kf(e),isNew:!n}))),Mct({useWorkflow:r,skipCI:i,count:a}),[l,...n.map(({baseEntry:e})=>e)].forEach(e=>{e&&kat(e.id)})},zct=async({draft:e,skipCI:t=void 0,overwrite:n=!1,publish:r=!1})=>{let i=r?!!UZ(e):WZ(e),a=await Fct({draft:e,useWorkflow:i,overwrite:n,publish:r});h4e(e,gH(e,e.collectionName).length),c8(e);let o=I2({draft:e}),s=a?.type===`deleted`,{savingEntry:c,changes:l,savingAssets:u,cascadeEntries:d,movedEntries:f}=await Nct({draft:e,slugs:o,recreate:s}),p=await Ict(e);l.push(...p.flatMap(e=>e.changes)),u.push(...p.flatMap(e=>e.savingAssets));let m=await Lct({draft:e,useWorkflow:i,changes:l,savingEntry:c,otherSavingEntries:[...d,...f,...p.map(e=>e.entry)],pendingEntries:p,savingAssets:u,options:{commitType:e.isNew||s?`create`:`update`,collection:e.collection,skipCI:t}});return await Rct({draft:e,savingEntry:c,pendingEntries:p,useWorkflow:i,skipCI:t,count:1+d.length+f.length+p.length}),m.savedEntries[0]},Bct=({collection:e,collectionFile:t,isIndexFile:n,readonly:r,creationDisabled:i})=>!r&&!t&&!n&&(e?._type!==`entry`||e.duplicate!==!1)&&!i,Vct=({publishedVersionExists:e,canDeleteEntry:t,isCollectionFile:n,readonly:r,locked:i})=>({discard:!r&&(e||t&&!n),delete:e&&t&&!n&&!i}),Hct=e=>e.message===`validation_failed`?{type:`validation`}:e.message===`save_conflict`?{type:`conflict`,conflict:e.cause}:e.message===`saving_failed`?{type:`error`,message:e.cause?.message??``,unexpected:!1}:{type:`error`,message:``,unexpected:!0},Uct=({collection:e,collectionFile:t,isIndexFile:n,hasPullRequest:r,workflowEnabled:i,publishedVersionExists:a,discardsDraft:o,pendingDeletion:s,readonly:c,openAuthoring:l,creationDisabled:u})=>{let d=r||i,f=(e?._type!==`entry`||e.delete!==!1)&&(o||!l),p=s||c;return{useWorkflow:d,discardsDraft:o,locked:p,canDuplicate:Bct({collection:e,collectionFile:t,isIndexFile:n,readonly:c,creationDisabled:u}),removalMenuItems:Vct({publishedVersionExists:a,canDeleteEntry:f,isCollectionFile:!!t,readonly:c,locked:p})}},Wct=async({entryDraft:e,useWorkflow:t,skipCI:n=void 0,overwrite:r=!1,publish:i=!1,askForReview:a,closeOnSave:o})=>{let s=e.current,{isNew:c,collection:l,collectionFile:u}=s,d=()=>e.current===s;try{if(await qK(),!d()||!c&&!e.modified)return{type:`skipped`};Nre(Object.keys(s.files??{}).length);let f=await zct({draft:s,skipCI:n,overwrite:r,publish:i}),p=f,m;if(i&&p.workflow)try{await Cst(p);let{workflow:e,...t}=p;f=t}catch(e){m=v7(e,`workflow.publishing_entry_failed`),console.error(e)}if(!d())return{type:`saved`,savedEntry:f,statusError:m};let h=!i&&t()&&p.workflow?tRe(p,l):void 0;if(h&&bZ(p,l)===`draft`&&n8({draft:s}).valid&&await a(h))try{await x7(p,h)}catch(e){m=v7(e,`workflow.status_change_failed`),console.error(e)}if(!d())return{type:`saved`,savedEntry:f,statusError:m};let g=c?c0(l.name,u?.name??f.subPath):void 0,_=o()&&m===void 0?`close`:`reset`;return{type:`saved`,savedEntry:f,statusError:m,path:g,next:_}}catch(e){if(h2(e))return{type:`skipped`};let t=Hct(e);return t.type===`validation`?{type:`invalid`,errorCount:Q2e(s.validities)}:t.type===`conflict`?d()?{type:`conflict`,conflict:t.conflict}:{type:`error`,message:``}:(t.unexpected&&console.error(e),{type:`error`,message:t.message})}finally{gl()}},Gct=async e=>{let{collectionName:t}=e.current;return await Act(e)?`/collections/${t}/new`:void 0},Kct=B(`<bdi> </bdi> › <bdi> </bdi>`,1),qct=B(`<h2 role="none"><!></h2>`),Z7=B(`<!> <!>`,1),Jct=B(`<!> <!> <!> <!> <!> <!> <!>`,1),Yct=B(`<!> <!> <!> <!> <span class="save-progress svelte-zjrq31" aria-live="polite"><!></span> <!> <!> <!>`,1),Xct=B(`<div role="none" class="error svelte-zjrq31"> </div>`),Zct=B(` <!>`,1),Qct=B(`<!> <!> <!> <!> <!> <!> <!> <!> <!>`,1),$ct={hash:`svelte-zjrq31`,code:`.save-progress.svelte-zjrq31 {color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);white-space:nowrap;min-width:0;overflow:hidden;text-overflow:ellipsis;}.error.svelte-zjrq31 {margin-top:8px;border-radius:var(--sui-control-medium-border-radius);padding:12px;background-color:var(--sui-secondary-background-color);font-size:var(--sui-font-size-default);line-height:1.5;}`};function elt(e,t){O(t,!0),K(e,$ct);let n=e=>{var t=H(),n=P(t),r=e=>{{let t=A(()=>z(fe)?.workflow?.pullRequest),n=A(()=>!PY.isLargeScreen),r=A(()=>PY.isSmallScreen?`menuitem`:`button`);G5(e,{get entry(){return z(ee)},get locale(){return z(te)},get collection(){return z(w)},get collectionFile(){return z(T)},get pullRequest(){return z(t)},get iconic(){return z(n)},get as(){return z(r)}})}};G(n,e=>{!i()&&z(w)&&z(ee)&&e(r)}),U(e,t)},r=LK(),i=J(t,`disabled`,3,!1),a=j(!1),o=j(0),s=j(!1),c=j(void 0),l=j(void 0),u=j(!1),d=j(void 0),f=j(!1),p=j(``),m=j(!1),h=j(!1),g=j(!1),_=j(!1),v=j(void 0),y=j(void 0),b=S6(()=>{let e=r.current;return{restore:!!e&&b6({draft:e,restore:!0}),clear:!!e&&b6({draft:e})}}),x=A(()=>r.current===void 0),S=A(()=>r.current?.isNew??!0),C=A(()=>!!r.current?.isIndexFile),w=A(()=>r.current?.collection),T=A(()=>r.current?.collectionFile),ee=A(()=>r.current?.originalEntry),E=A(()=>Rf(r.current)),te=A(()=>z(E).defaultLocale),ne=A(()=>z(w)?.name),re=A(()=>z(T)?.name),ie=A(()=>Ec.current&&z(w)?qf(z(w)):``),ae=A(()=>Ec.current&&z(w)?qf(z(w),{useSingular:!0}):``),oe=A(()=>z(T)?Kp(z(T)):z(w)&&z(ee)&&Ec.current?wW(z(w),z(ee)):``),se=A(()=>z(x)?``:z(S)?Y(`create_entry_title`,{values:{name:z(ae)}}):`${z(ie)} › ${z(oe)}`);L(()=>(p0.current=z(se),()=>{p0.current=``}));let ce=A(()=>z(m)||z(g)||z(_)),le=A(()=>i()||z(ce)),ue=A(()=>z(S)||r.modified||KK.current),de=A(()=>z(ne)&&z(ee)?QGe({entry:z(ee),collectionName:z(ne),fileName:z(re)}):[]),fe=A(()=>EZ.current&&z(ne)?UZ({collectionName:z(ne),fileName:z(re),originalEntry:z(ee)}):void 0),pe=A(()=>eQ(z(fe))),me=A(()=>GZ(z(fe))),he=A(()=>oQ(r.current)),ge=A(()=>Uct({collection:z(w),collectionFile:z(T),isIndexFile:z(C),hasPullRequest:!!z(fe),workflowEnabled:DZ(z(w)),publishedVersionExists:z(pe),discardsDraft:tQ(z(fe)),pendingDeletion:z(me),readonly:z(he),openAuthoring:Yf.current,creationDisabled:q7.current.creationDisabled})),_e=A(()=>z(ge).useWorkflow),ve=A(()=>z(ge).discardsDraft),ye=A(()=>z(ge).locked),be=A(()=>z(ge).canDuplicate),xe=A(()=>z(ge).removalMenuItems),Se=A(()=>z(_e)&&iRe(z(w),z(fe))),Ce=A(()=>z(Se)&&!YZ([...r.current?.pendingEntries.length?_H(r.current):[],...z(fe)?.workflow.companions??[]])),we=A(()=>Y(z(c)===`pending_publish`?`workflow.mark_as_ready`:`workflow.send_for_review`)),Te=A(()=>w7({pendingDeletion:z(me),publishedVersionExists:z(pe)}));L(()=>eat());let Ee=()=>{let e=z(w)&&gf(z(w))?mf.current:``;S0(jBe({collectionName:z(ne),dirPath:e}),{returnTo:A5})},De=e=>new Promise(t=>{M(c,e,!0),M(l,t,!0),M(s,!0)}),Oe=()=>z(_e),ke=()=>yu.closeOnSave??!0,Ae=async({skipCI:e=void 0,overwrite:t=!1,publish:n=!1}={})=>{let i=r.current;if(z(w)&&i){M(m,!0),M(h,n,!0);try{let s=await Wct({entryDraft:r,useWorkflow:Oe,skipCI:e,overwrite:t,publish:n,askForReview:De,closeOnSave:ke});s.type===`saved`?(s.statusError!==void 0&&(M(f,!0),M(p,s.statusError,!0)),s.path&&x0(s.path,{replaceState:!0,notifyChange:!1}),s.next===`close`?(Ee(),r.current=null):s.next===`reset`&&e8({entryDraft:r,collection:z(w),collectionFile:z(T),originalEntry:s.savedEntry,extraValues:i.extraValues,expanderStates:i.expanderStates})):s.type===`invalid`?(M(o,s.errorCount,!0),M(a,!0)):s.type===`conflict`?(M(d,{conflict:s.conflict,skipCI:e,publish:n},!0),M(u,!0)):s.type===`error`&&(M(f,!0),M(p,s.message,!0))}finally{M(m,!1),M(h,!1)}}};var je=Qct(),Me=P(je);{let e=A(()=>Y(`primary`));IV(Me,{variant:`primary`,get ariaLabel(){return z(e)},children:(e,t)=>{var a=Yct(),o=P(a);{let e=A(()=>Y(`cancel_editing`)),t=A(()=>yu.closeWithEscape&&!t0.current);x5(o,{get"aria-label"(){return z(e)},get useShortcut(){return z(t)},onclick:()=>{Ee()}})}var s=I(o,2),c=e=>{yS(e,{flex:!0})},l=e=>{var t=qct(),n=N(t),r=e=>{Nx(e,{children:(e,t)=>{var n=H(),r=P(n),i=e=>{var t=V();R(()=>W(t,z(se))),U(e,t)},a=e=>{var t=Kct(),n=P(t),r=F(n,!0),i=F(I(n,2),!0);R(()=>{W(r,z(ie)),W(i,z(oe))}),U(e,t)};G(r,e=>{z(S)?e(i):e(a,-1)}),U(e,n)},$$slots:{default:!0}})};G(n,e=>{z(x)||e(r)}),D(t),U(e,t)};G(s,e=>{PY.isSmallScreen?e(c):e(l,-1)});var u=I(s,2),d=e=>{n(e)};G(u,e=>{PY.isSmallScreen||e(d)});var f=I(u,2),p=e=>{Kst(e,{get entry(){return z(fe)},get disabled(){return z(le)}})};G(f,e=>{z(fe)&&!z(ye)&&e(p)});var g=I(f,2),C=N(g),w=e=>{var t=V();R(e=>W(t,e),[()=>Y(`save_progress.${ml.current.phase}`,{values:{done:ml.current.done,total:ml.current.total}})]),U(e,t)};G(C,e=>{z(m)&&ml.current&&e(w)}),D(g);var T=I(g,2),ee=e=>{},E=e=>{{let t=e=>{qS(e,{children:(e,t)=>{{let t=A(()=>Y(W8.current?`save_and_publish`:`save_without_publishing`));JS(e,{get label(){return z(t)},onclick:()=>{Ae({skipCI:!W8.current})}})}},$$slots:{default:!0}})},n=A(()=>Y(W8.current?z(m)?`saving`:`save`:z(m)?`publishing`:`publish`)),r=A(()=>z(le)||!z(ue));gS(e,{variant:`primary`,get label(){return z(n)},get disabled(){return z(r)},keyShortcuts:`Accel+S`,onclick:()=>{Ae()},popup:t,$$slots:{popup:!0}})}},te=e=>{{let t=e=>{qS(e,{children:(e,t)=>{{let t=A(()=>Y(z(Ce)?`save_and_publish_needs_review`:`save_and_publish`));JS(e,{get label(){return z(t)},get disabled(){return z(Ce)},onclick:()=>{Ae({publish:!0,skipCI:!1})}})}},$$slots:{default:!0}})},n=A(()=>Y(z(m)?z(h)?`publishing`:`saving`:`save`)),r=A(()=>z(le)||!z(ue));gS(e,{variant:`primary`,get label(){return z(n)},get disabled(){return z(r)},keyShortcuts:`Accel+S`,onclick:()=>{Ae()},popup:t,$$slots:{popup:!0}})}},ne=e=>{{let t=A(()=>Y(z(m)?`saving`:`save`)),n=A(()=>z(le)||!z(ue));Xx(e,{variant:`primary`,get label(){return z(t)},get disabled(){return z(n)},keyShortcuts:`Accel+S`,onclick:()=>{Ae()}})}};G(T,e=>{z(ye)?e(ee):U8.current&&!z(_e)?e(E,1):z(Se)?e(te,2):e(ne,-1)});var re=I(T,2),ae=e=>{Jst(e,{get entry(){return z(fe)},get disabled(){return z(le)},get modified(){return z(ue)}})};G(re,e=>{z(fe)&&!z(he)&&e(ae)});var ce=I(re,2);{let e=e=>{{let t=A(()=>Y(`editor_options`));qS(e,{get ariaLabel(){return z(t)},children:(e,t)=>{var a=Jct(),o=P(a),s=e=>{var t=Z7(),i=P(t);n(i);var a=I(i,2),o=e=>{var t=Z7(),n=P(t);No(n,17,()=>eot(r.current),({key:e,disabled:t})=>e,(e,t)=>{let n=()=>z(t).key,r=()=>z(t).disabled;{let t=A(()=>Y(`entry_sidebar.${n()}.title`));JS(e,{get label(){return z(t)},get disabled(){return r()},onclick:()=>{p7(n())}})}}),FS(I(n,2),{}),U(e,t)};G(a,e=>{z(x)||e(o)}),U(e,t)};G(o,e=>{PY.isSmallScreen&&e(s)});var c=I(o,2),l=e=>{var t=Z7(),n=P(t),i=e=>{{let t=A(()=>Y(`duplicate`)),n=A(()=>Y(`duplicate_entry`));JS(e,{variant:`ghost`,get disabled(){return z(le)},get label(){return z(t)},get"aria-label"(){return z(n)},onclick:async()=>{M(_,!0);let e=await Gct(r);M(_,!1),e&&x0(e,{replaceState:!0,notifyChange:!1,transitionType:`forwards`})}})}};G(n,e=>{z(be)&&e(i)});var a=I(n,2),o=e=>{JS(e,{variant:`ghost`,get disabled(){return z(le)},get label(){return z(Te).label},get"aria-label"(){return z(Te).title},onclick:()=>{z(pe)?z(y)?.confirmDiscard():z(y)?.confirmDelete()}})};G(a,e=>{z(xe).discard&&e(o)}),U(e,t)};G(c,e=>{!i()&&!z(S)&&e(l)});var u=I(c,2),d=e=>{{let t=A(()=>Y(`delete`));JS(e,{get label(){return z(t)},onclick:()=>{z(y)?.confirmDelete()}})}};G(u,e=>{z(xe).delete&&e(d)});var f=I(u,2),p=e=>{{let t=A(()=>Y(`edit_slug`)),n=A(()=>!N2e(r.current));JS(e,{get label(){return z(t)},get disabled(){return z(n)},onclick:()=>{p7(`slug`)}})}};G(f,e=>{PY.isSmallScreen||e(p)});var m=I(f,2);{let e=A(()=>!PY.isSmallScreen||!i()&&!z(S)),t=A(()=>({revert:z(ue)&&!z(ye),restore:b.availability.restore&&!z(ye),clear:b.availability.clear&&!z(ye)}));v6(m,{scope:`entry`,get separator(){return z(e)},get available(){return z(t)},get onSelect(){return b.select}})}var h=I(m,2),g=e=>{var t=Z7(),n=P(t);FS(n,{});var r=I(n,2);{let e=A(()=>Y(`deploy_preview.check_again`));JS(r,{get label(){return z(e)},onclick:()=>{tat()}})}U(e,t)};G(h,e=>{Wy.current&&e(g)});var v=I(h,2),C=e=>{got(e,{})};G(v,e=>{PY.isLargeScreen&&e(C)}),U(e,a)},$$slots:{default:!0}})}},t=A(()=>Y(`show_editor_options`));gs(hS(ce,{get disabled(){return z(le)},variant:`ghost`,iconic:!0,popupPosition:`bottom-right`,get"aria-label"(){return z(t)},get onclick(){return b.update},get onkeydown(){return b.update},popup:e,$$slots:{popup:!0}}),e=>M(v,e,!0),()=>z(v))}U(e,a)},$$slots:{default:!0}})}var Ne=I(Me,2);G2e(Ne,{get count(){return z(o)},onShowErrors:()=>{p7(`validation`)},get show(){return z(a)},set show(e){M(a,e,!0)}});var Pe=I(Ne,2);fC(Pe,{get id(){return r0.current.id},get show(){return r0.current.show},set show(e){r0.current.show=e},children:(e,t)=>{let n=A(()=>r0.current);bx(e,{get status(){return z(n).status},children:(e,t)=>{Ur();var r=V();R(e=>W(r,e),[()=>Y(`editor.${z(n).message}`,{values:{count:z(n).count,source:z(n).sourceLanguage?Of(z(n).sourceLanguage)??z(n).sourceLanguage:``}})]),U(e,r)},$$slots:{default:!0}})},$$slots:{default:!0}});var Fe=I(Pe,2);fC(Fe,{get id(){return i0.current.id},get show(){return i0.current.show},set show(e){i0.current.show=e},children:(e,t)=>{bx(e,{get status(){return i0.current.status},children:(e,t)=>{Ur();var n=V();R(()=>W(n,i0.current.message)),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}});var Ie=I(Fe,2);Pit(Ie,{get action(){return b.action},onClose:()=>{z(v)?.focus()},get open(){return b.dialogOpen},set open(e){b.dialogOpen=e}});var Le=I(Ie,2);{let e=A(()=>Y(`later`));wS(Le,{get title(){return z(we)},get okLabel(){return z(we)},get cancelLabel(){return z(e)},onOk:()=>{z(l)?.(!0)},onClose:()=>{z(l)?.(!1)},get open(){return z(s)},set open(e){M(s,e,!0)},children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(z(c)===`pending_publish`?`workflow.confirm_marking_as_ready`:`workflow.confirm_sending_for_review`)]),U(e,n)},$$slots:{default:!0}})}var Re=I(Le,2);gs(Pst(Re,{get collection(){return z(w)},get collectionFile(){return z(T)},get originalEntry(){return z(ee)},get unpublishedEntry(){return z(fe)},get associatedAssets(){return z(de)},get discardsDraft(){return z(ve)},get useWorkflow(){return z(_e)},get pendingDeletion(){return z(me)},onDone:()=>{Ee()},onClose:()=>{z(v)?.focus()},get deleting(){return z(g)},set deleting(e){M(g,e,!0)}}),e=>M(y,e,!0),()=>z(y));var ze=I(Re,2);{let e=A(()=>z(d)?.conflict);Fst(ze,{get conflict(){return z(e)},onOverwrite:async()=>{await Ae({skipCI:z(d)?.skipCI,overwrite:!0,publish:z(d)?.publish})},onClose:()=>{z(v)?.focus()},get open(){return z(u)},set open(e){M(u,e,!0)}})}var Be=I(ze,2);{let e=A(()=>Y(`saving_entry.error.title`));CS(Be,{get title(){return z(e)},onClose:()=>{z(v)?.focus()},get open(){return z(f)},set open(e){M(f,e,!0)},children:(e,t)=>{Ur();var n=Zct(),r=P(n),i=I(r),a=e=>{var t=Xct(),n=F(t,!0);R(()=>W(n,z(p))),U(e,t)};G(i,e=>{z(p)&&e(a)}),R(e=>W(r,`${e??``} `),[()=>Y(`saving_entry.error.description`)]),U(e,n)},$$slots:{default:!0}})}U(e,je),k()}var tlt=B(`<!> <!>`,1),nlt=B(`<div class="pane-wrapper svelte-jrunrx"><!></div>`),rlt=B(`<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>`,1),ilt=B(`<div role="none"> </div>`),alt=B(`<div role="none"><!></div> <div role="none"><!></div>`,1),olt=B(`<div role="none" class="pane-measure svelte-jrunrx"><!></div>`),slt=B(`<!> <!> <!>`,1),clt=B(`<div role="none" class="content-area svelte-jrunrx"><!></div> <!>`,1),llt=B(`<!> <!> <div role="none" class="body svelte-jrunrx"><!></div>`,1),ult=B(`<div role="group" class="wrapper content-editor svelte-jrunrx"><!></div> <!>`,1),dlt={hash:`svelte-jrunrx`,code:`.wrapper.svelte-jrunrx {position:fixed;inset:0;z-index:100;display:flex;flex-direction:column;background-color:var(--sui-secondary-background-color);}.pane-wrapper.svelte-jrunrx {display:contents;& > .pane {flex:auto;height:100%;overflow:hidden;display:flex;flex-direction:column;}}.body.svelte-jrunrx {flex:auto;display:flex;overflow:hidden;}.content-area.svelte-jrunrx {position:relative;flex:auto;border-block-start:var(--area-border); /* below the toolbar */background-color:var(--sui-primary-background-color);&:not(:only-child) {border-inline-end:var(--area-border); /* sidebar is present */border-start-end-radius:16px;}.sui.resizable-handle {border-inline:var(--area-border); /* between the panes */background-color:var(--sui-secondary-background-color); /* same as toolbar */}
/* Centred over the gutter, whose position is the first pane’s width */.swap-button {position:absolute;top:calc(50% - 12px);inset-inline-start:calc(
var(--gutter-position) + var(--sui-resizable-handle-size, 4px) / 2
);
/* Above the handle’s hit area, a positioned \`::before\` pseudo-element at \`z-index: 1\` */z-index:2;margin:0;border-radius:50%;opacity:0.5;translate:-50%;
/* Not \`all\`: the position would animate from the unmeasured width and lag behind a drag */transition-property:opacity, color, background-color;&:dir(rtl) {translate:50%;}&:hover,
&:focus-visible {opacity:1;}}}.pane-measure.svelte-jrunrx {display:flex;flex-direction:column;height:100%;}`};function flt(e,t){O(t,!0),K(e,dlt);let n=(e,t=Cr,n)=>{let r=()=>(n?.()).locale,i=()=>(n?.()).mode,a=A(()=>t()===`first`?a0:o0),o=A(()=>t()===`first`?o0:a0);var s=nlt(),c=N(s);{let e=A(()=>K5(i()===`edit`?`edit_x_locale`:`preview_x_locale`,r()));fH(c,{class:`pane`,get ariaLabel(){return z(e)},get"data-locale"(){return r()},get"data-mode"(){return i()},children:(e,n)=>{var r=tlt(),i=P(r);{let e=A(()=>`${t()}-pane-header`);sat(i,{get id(){return z(e)},get thisPane(){return z(a)},get thatPane(){return z(o)}})}var s=I(i,2),c=e=>{Nit(e,{id:`first-pane-body`,get thisPane(){return z(a)},get thatPaneContentArea(){return z(p)},get thisPaneContentArea(){return z(f)},set thisPaneContentArea(e){M(f,e,!0)}})},l=e=>{Nit(e,{id:`second-pane-body`,get thisPane(){return z(a)},get thatPaneContentArea(){return z(f)},get thisPaneContentArea(){return z(p)},set thisPaneContentArea(e){M(p,e,!0)}})};G(s,e=>{t()===`first`?e(c):e(l,-1)}),U(e,r)},$$slots:{default:!0}})}D(s),U(e,s)},r=J(t,`entryDraft`,7),i=J(t,`editorLocale`,3,void 0),a=J(t,`loading`,3,!1);IK(r());let o=!1,s=!1,c=Zv(),l=j(0),u=j(!0),d=j(void 0),f=j(void 0),p=j(void 0),m=A(()=>r().current===void 0),h=A(()=>r().current??{}),g=A(()=>Tr(z(h).isNew,!0)),_=A(()=>Tr(z(h).canPreview,!0)),v=A(()=>Tr(z(h).canShowSecondPane,!0)),y=A(()=>z(h).collection),b=A(()=>z(h).collectionName),x=A(()=>z(h).collectionFile),S=A(()=>z(h).fileName),C=A(()=>z(h).isIndexFile),w=A(()=>i8.current??{}),T=A(()=>z(w).showPreview),ee=A(()=>Tr(z(w).showSecondPane,!0)),E=A(()=>z(v)&&z(ee)),te=A(()=>Rf(r().current)),ne=A(()=>z(te).i18nEnabled),re=A(()=>z(te).allLocales),ie=A(()=>z(te).defaultLocale),ae=A(()=>Vit({collection:z(y),collectionFile:z(x)})),oe=A(()=>q7.current),se=A(()=>z(oe).readonly),ce=A(()=>z(oe).canCreate),le=A(()=>z(oe).quota),ue=A(()=>z(oe).creationDisabled),de=A(()=>aQ(r().current)),fe=A(()=>Hit({firstPane:a0.current,secondPane:o0.current})),pe=A(()=>Er(z(fe),3)),me=A(()=>z(pe)[0]),he=A(()=>z(pe)[1]),ge=A(()=>z(pe)[2]),_e=async()=>{if(o)return!1;let e=Uit({savedPanes:i8.current?.paneStates?.[z(ae)??``],editorLocale:i(),allLocales:z(re),defaultLocale:z(ie),canPreview:z(_),showPreview:z(T),showSecondPane:z(E)});return e?(o=!0,await Za(),[a0.current,o0.current]=e,(PY.isSmallScreen||PY.isMediumScreen)&&(o0.current=null),await Za(),o=!1,!0):!1},ve=async()=>{r().current&&!s&&(s=!0,await _e()||([a0.current,o0.current]=Wit({editorLocale:i(),currentLocale:a0.current?.locale,defaultLocale:z(ie),allLocales:z(re),i18nEnabled:z(ne),canPreview:z(_),showPreview:z(T),showSecondPane:z(E),singlePane:PY.isSmallScreen||PY.isMediumScreen})),s=!1)},ye=()=>{let e=a0.current,t=o0.current;z(y)&&!o&&e&&t&&z(ae)&&Kit(z(ae),[e,t])},be=()=>{JK(()=>{[a0.current,o0.current]=[o0.current,a0.current]})},xe=e=>{e.isTrusted&&r().current&&!r().current.interacted&&(r().current.interacted=!0)},Se=async e=>{await qK();let t=Git({firstPane:a0.current,secondPane:o0.current,locale:e});t&&([a0.current,o0.current]=t,await Iu(100))},Ce=async({locale:e,keyPath:t})=>{let n=c.next();await Se(e);let i=r().current;i&&await K$e({draft:i,locale:e,keyPath:t,isOutdated:()=>!n()})},we=async()=>{let{state:e}=window.history,{locale:t,keyPath:n}=e?.highlight??{};typeof t==`string`&&typeof n==`string`&&t&&n&&(await Ce({locale:t,keyPath:n}),window.history.replaceState({...e,highlight:null},``))},Te=e=>{e.source===window&&e.data?.type===`highlight-editor-field`&&e.data.payload&&Ce(e.data.payload)};So(()=>{$1.current||(r().current=null);let e=kJ();return window.addEventListener(`message`,Te),()=>{window.removeEventListener(`message`,Te),e()}}),L(()=>{yu.devModeEnabled&&console.info(`entryDraft`,Yr(r().current))}),f4e(()=>r(),()=>z(d)),L(()=>{let e=r().current;e&&(Object.values(e.currentValues).forEach(TK),Yr(e.currentLocales),Yr(e.currentSlugs),Object.values(e.files).forEach(({file:e})=>void 0),e.pendingEntries.forEach(e=>void 0),e.interacted),eo(()=>m2e(e))}),L(()=>{z(ae)&&(a0.current=null,o0.current=null)}),sl(()=>[z(ae),z(y),z(E),z(T),z(_),PY.isSmallScreen,PY.isMediumScreen],()=>{ve()}),L(()=>{a0.current,o0.current,ye()}),L(()=>{z(d)&&(async()=>{z(u)&&(M(u,!1),await ve(),await MJ(()=>z(d)),await we(),p2e())})()});var Ee=ult(),De=P(Ee);Oo(N(De),()=>r().current?.id,e=>{var t=slt(),i=P(t),o=e=>{var t=rlt(),n=P(t);ko(n,()=>({"--sui-infobar-border-width":`0 0 1px`,"--sui-infobar-message-justify-content":`center`})),Zx(n.lastChild,{dismissible:!1,children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>sQ(`entry`,{collection:z(y),collectionFile:z(x)})]),U(e,n)},$$slots:{default:!0}}),D(n),U(e,t)};G(i,e=>{z(de)&&!a()&&!(z(g)&&z(ue))&&e(o)});var s=I(i,2);{let e=A(()=>a()||z(g)&&z(ue));elt(s,{get disabled(){return z(e)}})}var c=I(s,2),u=e=>{dH(e,{children:(e,t)=>{var n=ilt(),r=F(n,!0);R(e=>W(r,e),[()=>Y(`loading_entries`,{values:{count:1}})]),U(e,n)},$$slots:{default:!0}})},d=e=>{},f=e=>{dH(e,{children:(e,t)=>{var n=alt(),r=P(n),i=N(r),a=e=>{var t=V();R(e=>W(t,e),[()=>Y(`entry_not_found`)]),U(e,t)},o=e=>{var t=V();R(e=>W(t,e),[()=>sQ(`collection`,{collection:z(y)})]),U(e,t)},s=e=>{var t=V();R(e=>W(t,e),[()=>Y(`creating_entries_disabled_by_admin`)]),U(e,t)},c=e=>{var t=V();R(e=>W(t,e),[()=>Y(`creating_entries_disabled_by_quota`,{values:{quota:z(le)}})]),U(e,t)};G(i,e=>{z(m)?e(a):z(se)?e(o,1):z(ce)?e(c,-1):e(s,2)}),D(r);var l=I(r,2);Xx(N(l),{variant:`primary`,onclick:()=>{let e=z(b)??Uf.current?.name;x0(e?`/collections/${e}`:`/collections`,{replaceState:!0,transitionType:`backwards`})},children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(`back_to_collection`)]),U(e,n)},$$slots:{default:!0}}),D(l),U(e,n)},$$slots:{default:!0}})},p=e=>{var t=llt(),r=P(t);gat(r,{});var i=I(r,2);lat(i,{});var a=I(i,2);Oo(N(a),()=>`${z(b)}|${z(S)}|${z(C)}`,e=>{var t=clt(),r=P(t),i=N(r),a=e=>{var t=tlt(),r=P(t);vme(r,{onResize:({sizes:e})=>{if(a0.current&&o0.current){let[t,n]=e;a0.current={...a0.current,width:t},o0.current={...o0.current,width:n}}},children:(e,t)=>{var r=slt(),i=P(r);eC(i,{get defaultSize(){return z(me)},get minSize(){return z(ge)},children:(e,t)=>{var r=olt(),i=N(r);n(i,()=>`first`,()=>a0.current),D(r),rne(r,`clientWidth`,e=>M(l,e)),U(e,r)},$$slots:{default:!0}});var a=I(i,2);mme(a,{}),eC(I(a,2),{get defaultSize(){return z(he)},get minSize(){return z(ge)},children:(e,t)=>{n(e,()=>`second`,()=>o0.current)},$$slots:{default:!0}}),U(e,r)},$$slots:{default:!0}});var i=I(r,2);{let e=A(()=>Y(`swap_panes`));Xx(i,{class:`swap-button`,iconic:!0,size:`small`,variant:`tertiary`,get"aria-label"(){return z(e)},get style(){return`--gutter-position: ${z(l)??``}px`},onclick:be,children:(e,t)=>{gx(e,{name:`swap_horiz`})},$$slots:{default:!0}})}U(e,t)},o=e=>{n(e,()=>`first`,()=>a0.current)},s=e=>{n(e,()=>`second`,()=>o0.current)},c=e=>{yS(e,{flex:!0})};G(i,e=>{a0.current&&o0.current?e(a):a0.current?e(o,1):o0.current?e(s,2):e(c,-1)}),D(r);var u=I(r,2),d=e=>{uot(e,{})},f=e=>{mot(e,{})};G(u,e=>{PY.isSmallScreen?e(d):e(f,-1)}),U(e,t)}),D(a),so(`pointerdown`,a,xe),so(`keydown`,a,xe),U(e,t)};G(c,e=>{a()?e(u):r().current===null?e(d,1):z(m)||z(g)&&z(ue)?e(f,2):e(p,-1)}),U(e,t)}),D(De),gs(De,e=>M(d,e),()=>z(d)),fC(I(De,2),{get show(){return e0.current},set show(e){e0.current=e},children:(e,t)=>{bx(e,{status:`success`,children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(`entry_duplicated`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),R(e=>q(De,`aria-label`,e),[()=>Y(`content_editor`)]),U(e,Ee),k()}co([`pointerdown`,`keydown`]);var plt=B(`<div role="none"> </div>`),mlt=B(`<div role="alert" class="error svelte-1n3qj92"></div>`),hlt=B(`<div role="none"><span hidden=""> </span> <!> <!></div>`),glt={hash:`svelte-1n3qj92`,code:`.cell.svelte-1n3qj92 {--sui-textbox-singleline-min-width: 10em;--sui-combobox-min-width: 10em;display:flex;flex-direction:column;gap:4px;border-radius:var(--sui-control-medium-border-radius);padding:2px;&.edited {background-color:var(--sui-secondary-background-color);}.sui:is(.text-input, .number-input, .combobox) {margin:0;}}.error.svelte-1n3qj92 {color:var(--sui-error-foreground-color);font-size:var(--sui-font-size-small);}`};function _lt(e,t){let n=mo();O(t,!0),K(e,glt);let r=J(t,`edited`,3,!1),i=J(t,`errors`,19,()=>[]),a=J(t,`readonly`,3,!1),o=A(()=>t.fieldConfig.name),s=A(()=>Tr(t.fieldConfig.widget,`string`)),c=A(()=>vG({config:t.fieldConfig,locale:t.locale})),l=A(()=>T8[z(s)]),u=A(()=>!!i().length),d=A(()=>h$e({fieldConfig:t.fieldConfig,inline:!0})),f=A(()=>t.entryEdits),p=A(()=>u3e({entry:t.entry,locale:t.locale,edits:z(f)})),m=A(()=>d3e(t.entry,t.locale));l3e({get values(){return z(p)},get slug(){return z(m)}});var h=hlt();let g;var _=N(h),v=F(_,!0),y=I(_,2),b=()=>t.value,x=e=>t.onChange(e);{let e=A(()=>fh({fieldConfig:t.fieldConfig,locale:t.locale}));Ro(y,()=>z(l),(r,i)=>{i(r,{get locale(){return t.locale},get keyPath(){return z(o)},get typedKeyPath(){return z(o)},get fieldId(){return n},get fieldLabel(){return z(c)},get fieldConfig(){return z(d)},get currentValue(){return b()},set currentValue(e){x(e)},get required(){return z(e)},get readonly(){return a()},get invalid(){return z(u)}})})}var S=I(y,2),C=e=>{var t=mlt();No(t,21,i,Ao,(e,t)=>{var n=plt(),r=F(n,!0);R(()=>W(r,z(t))),U(e,n)}),D(t),R(()=>q(t,`id`,`${n}-error`)),U(e,t)};G(S,e=>{z(u)&&e(C)}),D(h),R(e=>{g=$o(h,1,`cell svelte-1n3qj92`,null,g,{edited:r(),invalid:z(u)}),q(h,`data-field-type`,z(s)),q(_,`id`,`${n}-label`),W(v,e)},[()=>Y(`bulk_edit_cell`,{values:{field:z(c),entry:t.entryLabel}})]),U(e,h),k()}var vlt=(e,t)=>!!t.locales[e._i18n.defaultLocale]?.content&&!cf(e,t)&&!a3(t),ylt=(e,t,n)=>t.locales[e._i18n.defaultLocale]?.content[n],blt=({collection:e,entry:t,keyPath:n,edits:r})=>{let i=r[t.id];return i&&Object.hasOwn(i,n)?i[n]:ylt(e,t,n)},xlt=(e,t)=>{let n=e=>Cm(e)?``:e;return(0,Qc.default)(n(e),n(t))},Slt=({collection:e,entry:t,keyPath:n,value:r,edits:i})=>{let{[n]:a,...o}=i[t.id]??{},{[t.id]:s,...c}=i,l=ylt(e,t,n),u=xlt(r,E7(e.fields,n)?.widget===`boolean`?l??!1:l)?o:{...o,[n]:r};return Object.keys(u).length?{...c,[t.id]:u}:c},Clt=e=>Object.values(e).reduce((e,t)=>e+Object.keys(t).length,0),wlt=({collection:e,entry:t,entryEdits:n})=>{let{defaultLocale:r}=e._i18n,i=Object.fromEntries(Object.entries(t.locales).filter(([,{content:e}])=>!!e).map(([e,{content:t}])=>[e,{...t}]));return Object.entries(n).forEach(([t,n])=>{let a=E7(e.fields,t),o=!!a&&YG(a),s=i[r][t];Object.entries(i).forEach(([e,i])=>{e===r?i[t]=n:(PW(a?.i18n)||o&&QG({fieldConfig:a,targetValue:i[t],previousValue:s,sourceLocale:r,targetLocale:e}))&&(i[t]=JG({fieldConfig:a,value:n,sourceLocale:r,targetLocale:e}))})}),bGe({...r3({collection:e}),isNew:!1,currentValues:i}),{...t,locales:Object.fromEntries(Object.entries(t.locales).map(([e,t])=>[e,i[e]?{...t,content:i[e]}:{...t}]))}},Tlt=({collection:e,keyPath:t,fieldType:n,edits:r})=>{let i=new Map,a=rW(e.name).filter(t=>!cf(e,t)),o=new Set(a.flatMap(e=>Qp(e))),s=NZ(e.name).filter(t=>!cf(e,t)&&!Qp(t,{includePrevious:!0}).some(e=>o.has(e)));return[...a,...s,...FZ(e.name)].forEach(a=>{let o=R4(blt({collection:e,entry:a,keyPath:t,edits:r}),n);o!==void 0&&i.set(o,(i.get(o)??0)+1)}),i},Elt=({collection:e,entries:t,edits:n})=>{let{defaultLocale:r}=e._i18n,i=r3({collection:e}),a=new Map,o={};return t.forEach(t=>{let s=n[t.id];if(!s)return;let c={...t.locales[r]?.content,...s};Object.entries(s).forEach(([s,l])=>{let u=E7(e.fields,s),d=H4({draft:{...i,originalEntry:t},locale:r,keyPath:s,value:l,valueMap:c,validities:{[r]:{}}});if(d&&gGe({draft:i,fieldConfig:u,keyPath:s})){let t=u.widget??`string`,r=R4(l,t),i=Nl(a,s,()=>Tlt({collection:e,keyPath:s,fieldType:t,edits:n})),o={...d};delete o.valid,o.duplicateError=r!==void 0&&i.get(r)>1,d=ZWe(o)}d&&!d.valid&&(o[t.id]={...o[t.id],[s]:M4({validity:d,fieldConfig:u})})})}),o},Dlt=async({collection:e,entries:t,edits:n})=>{let r=new Map(rW(e.name).map(e=>[e.id,e])),i=t.filter(e=>!!n[e.id]&&r.has(e.id)).map(t=>c4({collection:e,entry:wlt({collection:e,entry:r.get(t.id),entryEdits:n[t.id]})})),a=r3({collection:e}),o=p4();return{changes:(await Promise.all(i.map(t=>i3({collection:e,entry:t,draft:a,cacheDB:o})))).flat(),savingEntries:i}},Olt=async({collection:e,entries:t,edits:n})=>{if(rQ({collection:e}))return 0;try{await m3()}catch(e){console.error(`Failed to check the repository for changes.`,e)}let{changes:r,savingEntries:i}=await Dlt({collection:e,entries:t,edits:n});return Oot({collection:e,changes:r,savingEntries:i})},klt=e=>{let t=J7.current.map(({name:t,entries:n})=>({name:t,entries:n.filter(t=>vlt(e,t))})).filter(({entries:e})=>e.length);return z7.current=t.flatMap(({entries:e})=>e),t},Alt=({collection:e,entry:t,keyPath:n,value:r})=>{L7.current=Slt({collection:e,entry:t,keyPath:n,value:r,edits:L7.current}),Object.keys(B7.current).length&&(B7.current=Elt({collection:e,entries:z7.current,edits:L7.current}))},jlt=B(`<div role="columnheader" class="cell svelte-bf9j9b"> </div>`),Mlt=B(`<div class="group-header svelte-bf9j9b" aria-hidden="true"> </div>`),Nlt=B(`<bdi></bdi>`),Plt=B(`<div role="cell" class="cell svelte-bf9j9b"><!></div>`),Flt=B(`<div role="row" class="row svelte-bf9j9b"><div role="rowheader" class="cell title svelte-bf9j9b"><!></div> <!> <div role="none" class="cell filler svelte-bf9j9b"></div></div>`),Ilt=B(`<div role="rowgroup" class="rowgroup svelte-bf9j9b"><!> <!></div>`),Llt=B(`<div role="none" class="wrapper svelte-bf9j9b"><div role="table" class="table svelte-bf9j9b"><div role="row" class="row header svelte-bf9j9b"><div role="columnheader" class="cell title svelte-bf9j9b"> </div> <!> <div role="none" class="cell filler svelte-bf9j9b"></div></div> <!></div></div>`),Rlt={hash:`svelte-bf9j9b`,code:`.wrapper.svelte-bf9j9b {height:100%;overflow:auto;overscroll-behavior:contain;}.table.svelte-bf9j9b {display:grid;
/* The entry titles, a column sized to its control for each field, and a filler taking up the
rest of the width so the row borders run across the list */grid-template-columns:minmax(160px, 280px) repeat(var(--column-count), max-content) 1fr;width:max-content;min-width:100%;.spinner {grid-column:1 / -1;}}.rowgroup.svelte-bf9j9b,
.row.svelte-bf9j9b {display:contents;}.group-header.svelte-bf9j9b {grid-column:1 / -1;border-bottom:1px solid var(--sui-secondary-border-color);padding:4px 8px;font-weight:var(--sui-font-weight-bold);background-color:var(--sui-secondary-background-color);}.cell.svelte-bf9j9b {display:flex;align-items:center;border-bottom:1px solid var(--sui-secondary-border-color);padding:4px 8px;min-width:0;&.filler {padding:0;}
/* The entry titles stay in view as the table is scrolled sideways, like a frozen column */&.title {position:sticky;inset-inline-start:0;z-index:1;border-inline-end:1px solid var(--sui-secondary-border-color);background-color:var(--sui-primary-background-color);}}.header.svelte-bf9j9b .cell:where(.svelte-bf9j9b) {position:sticky;top:0;z-index:2;background-color:var(--sui-primary-background-color);font-size:var(--sui-font-size-small);font-weight:var(--sui-font-weight-bold);&.title {z-index:3;}}`};function zlt(e,t){O(t,!0),K(e,Rlt),IK({current:void 0});let n=A(()=>Zst(t.collection)),r=A(()=>t.collection._i18n.defaultLocale),i=j([]),a=(e,n,r)=>{Alt({collection:t.collection,entry:e,keyPath:n,value:r})},o=e=>Ec.current?wW(t.collection,e):``,s=A(()=>new Map(z7.current.map((e,t)=>[e.id,t+2])));So(()=>{M(i,klt(t.collection))});var c=Llt(),l=N(c);let u;var d=N(l);q(d,`aria-rowindex`,1);var f=N(d),p=F(f,!0);No(I(f,2),17,()=>z(n),e=>e.name,(e,t)=>{var n=jlt(),i=F(n,!0);R(e=>W(i,e),[()=>vG({config:z(t),locale:z(r)})]),U(e,n)}),Ur(2),D(d),No(I(d,2),17,()=>z(i),({name:e,entries:t})=>e,(e,i)=>{let c=()=>z(i).name,l=()=>z(i).entries,u=A(()=>c()===`*`?void 0:qW(c()));var d=Ilt(),f=N(d),p=e=>{var t=Mlt(),n=F(t,!0);R(()=>W(n,z(u))),U(e,t)};G(f,e=>{z(u)&&e(p)}),tC(I(f,2),{get items(){return l()},itemKey:`id`,renderItem:(e,i=Cr)=>{let c=A(()=>o(i()));var l=Flt(),u=N(l);Nx(N(u),{lines:2,children:(e,n)=>{var r=H();Oo(P(r),()=>Ec.current,e=>{var n=Nlt();Lo(n,()=>wW(t.collection,i(),{useTemplate:!0,allowMarkdown:!0}),!0),D(n),U(e,n)}),U(e,r)},$$slots:{default:!0}}),D(u),No(I(u,2),17,()=>z(n),e=>e.name,(e,n)=>{let o=A(()=>z(n).name),s=A(()=>L7.current[i().id]);var l=Plt(),u=N(l);{let e=A(()=>blt({collection:t.collection,entry:i(),keyPath:z(o),edits:L7.current})),l=A(()=>!!z(s)&&Object.hasOwn(z(s),z(o))),d=A(()=>B7.current[i().id]?.[z(o)]);_lt(u,{get locale(){return z(r)},get fieldConfig(){return z(n)},get entryLabel(){return z(c)},get value(){return z(e)},get entry(){return i()},get entryEdits(){return z(s)},get edited(){return z(l)},get errors(){return z(d)},get readonly(){return R7.current},onChange:e=>{a(i(),z(o),e)}})}D(l),U(e,l)}),Ur(2),D(l),R(e=>q(l,`aria-rowindex`,e),[()=>z(s).get(i().id)]),U(e,l)},$$slots:{renderItem:!0}}),D(d),R(()=>q(d,`aria-label`,z(u))),U(e,d)}),D(l),D(c),R((e,t)=>{q(l,`aria-label`,e),q(l,`aria-rowcount`,z7.current.length+1),u=ts(l,``,u,{"--column-count":z(n).length}),W(p,t)},[()=>Y(`bulk_edit_table`),()=>Y(`bulk_edit_entry`)]),U(e,c),k()}var Blt=B(`<bdi></bdi>`),Vlt=B(`<!> <!>`,1),Hlt=B(`<div role="none" class="label svelte-b1f01"><!></div>`),Ult=B(`<bdi> </bdi>`),Wlt=B(`<!> <!> <!> <!>`,1),Glt={hash:`svelte-b1f01`,code:`.label.svelte-b1f01 {.icon.home {opacity:0.5;font-size:20px;vertical-align:-4px;}}`};function Klt(e,t){O(t,!0),K(e,Glt);let n=e=>{VS(e,{class:`title`,children:(e,n)=>{var r=Hlt();Nx(N(r),{lines:2,children:(e,n)=>{var r=Vlt(),i=P(r);Oo(i,()=>Ec.current,e=>{var n=Blt();Lo(n,()=>wW(t.collection,t.entry,{useTemplate:!0,allowMarkdown:!0}),!0),D(n),U(e,n)});var a=I(i,2),o=e=>{{let n=A(()=>of(t.collection)?.icon);gx(e,{get name(){return z(n)},class:`home`})}},s=A(()=>cf(t.collection,t.entry));G(a,e=>{z(s)&&e(o)}),U(e,r)},$$slots:{default:!0}}),D(r),U(e,r)},$$slots:{default:!0}})},r=J(t,`showCheckbox`,3,!1),i=J(t,`onSelect`,3,void 0),a=J(t,`columns`,19,()=>[]),o=A(()=>t.entry.workflow),s=A(()=>Ec.current?wW(t.collection,t.entry):``);var c=Wlt(),l=P(c),u=e=>{VS(e,{class:`checkbox`,children:(e,n)=>{{let n=A(()=>Y(`select_item`,{values:{name:z(s)}})),r=A(()=>vAe.current.has(t.entry.id));vS(e,{tabindex:`-1`,get ariaLabel(){return z(n)},get checked(){return z(r)},onChange:({detail:{checked:e}})=>{i()?.(e)}})}},$$slots:{default:!0}})};G(l,e=>{r()&&!(PY.isSmallScreen||PY.isMediumScreen)&&e(u)});var d=I(l,2),f=e=>{VS(e,{class:`image`,children:(e,n)=>{{let n=A(()=>t.viewType===`grid`?`tile`:`icon`);V5(e,{get collection(){return t.collection},get entry(){return t.entry},get variant(){return z(n)}})}},$$slots:{default:!0}})};G(d,e=>{t.collection._thumbnailFieldNames.length&&e(f)});var p=I(d,2),m=e=>{var r=H();No(P(r),17,a,e=>e.key,(e,r)=>{var i=H(),a=P(i),o=e=>{n(e)},s=e=>{let n=A(()=>Tqe({collection:t.collection,entry:t.entry,column:z(r)}));VS(e,{class:`column`,get"data-key"(){return z(r).key},children:(e,t)=>{var r=H(),i=P(r),a=e=>{var t=H(),r=P(t),i=e=>{{let t=A(()=>Y(`boolean.true`));gx(e,{name:`check`,role:`img`,get"aria-label"(){return z(t)}})}};G(r,e=>{z(n).value&&e(i)}),U(e,t)},o=e=>{var t=Hlt();Nx(N(t),{children:(e,t)=>{var r=Ult(),i=F(r,!0);R(()=>W(i,z(n).value)),U(e,r)},$$slots:{default:!0}}),D(t),U(e,t)};G(i,e=>{z(n).type===`boolean`?e(a):e(o,-1)}),U(e,r)},$$slots:{default:!0}})};G(a,e=>{z(r).key===`_summary`?e(o):e(s,-1)}),U(e,i)}),U(e,r)},h=e=>{n(e)};G(p,e=>{t.viewType===`table`?e(m):e(h,-1)}),VS(I(p,2),{class:`status`,children:(e,n)=>{var r=H(),i=P(r),a=e=>{{let n=A(()=>bZ(t.entry,t.collection));T7(e,{get status(){return z(n)}})}};G(i,e=>{z(o)&&e(a)}),U(e,r)},$$slots:{default:!0}}),U(e,c),k()}function qlt(e,t){O(t,!0);let n=J(t,`columns`,19,()=>[]),r=A(()=>{let e=Sct.current.get(t.entry.id);if(e!==void 0)return t.viewType===`table`?e+2:e+1}),i=A(()=>Ec.current?wW(t.collection,t.entry):``),a=e=>{ZU.current=Hb(ZU.current,t.entry,e)};US(e,{get"aria-rowindex"(){return z(r)},get"aria-label"(){return z(i)},onChange:e=>{a(e.detail.selected)},onclick:()=>{x0(c0(t.collection.name,t.entry.subPath),{transitionType:`forwards`})},children:(e,r)=>{{let r=A(()=>!Yf.current);Klt(e,{get collection(){return t.collection},get entry(){return t.entry},get viewType(){return t.viewType},get columns(){return n()},get showCheckbox(){return z(r)},onSelect:a})}},$$slots:{default:!0}}),k()}var Jlt=B(`<!> <!>`,1);function Ylt(e,t){O(t,!0);let n=J(t,`canMoveUp`,3,!1),r=J(t,`canMoveDown`,3,!1),i=J(t,`onMoveUp`,3,void 0),a=J(t,`onMoveDown`,3,void 0),o=async(e,t,n)=>{e.stopPropagation();let r=e.currentTarget.closest(`[role="row"]`);n?.(),await Za(),UYe({item:r,action:t})};var s=Jlt(),c=P(s);Klt(c,{get collection(){return t.collection},get entry(){return t.entry},get viewType(){return t.viewType}}),VS(I(c,2),{class:`reorder-actions`,children:(e,t)=>{var s=Jlt(),c=P(s);{let e=e=>{gx(e,{name:`arrow_upward`})},t=A(()=>!n()),r=A(()=>Y(`move_up`));Xx(c,{variant:`ghost`,iconic:!0,get disabled(){return z(t)},"data-action":`move-up`,get"aria-label"(){return z(r)},onclick:e=>o(e,`move-up`,i()),startIcon:e,$$slots:{startIcon:!0}})}var l=I(c,2);{let e=e=>{gx(e,{name:`arrow_downward`})},t=A(()=>!r()),n=A(()=>Y(`move_down`));Xx(l,{variant:`ghost`,iconic:!0,get disabled(){return z(t)},"data-action":`move-down`,get"aria-label"(){return z(n)},onclick:e=>o(e,`move-down`,a()),startIcon:e,$$slots:{startIcon:!0}})}U(e,s)},$$slots:{default:!0}}),U(e,s),k()}var Xlt=B(`<div role="row" tabindex="0" aria-selected="false" draggable="true"><!></div>`),Zlt=B(`<div role="none" class="wrapper svelte-1txp9gj"></div>`),Qlt={hash:`svelte-1txp9gj`,code:".wrapper.svelte-1txp9gj {\n /* The rows aren’t `<GridRow>` components, so they don’t get its scoped layout rules */.grid-row {display:table-row;height:var(--sui-primary-row-height);}\n\n /* The dragged row is left as a faint placeholder by the global `drag-placeholder` rule */.grid-row.drag-placeholder {cursor:grabbing;}.grid-row[draggable='true']:not(.drag-placeholder) {cursor:grab;}}"};function $lt(e,t){O(t,!0),K(e,Qlt);let n=j({}),r=j(void 0),i=j(void 0),a=(e=z(n))=>{P7.current=J7.current.flatMap(({name:t,entries:n})=>e[t]??n)},o=(e,t)=>z(n)[e]??t,s=A(()=>new Map(J7.current.flatMap(({name:e,entries:t})=>o(e,t)).map((e,t)=>[e.id,t]))),c=e=>z(s).get(e.id)+1,l=(e,t,r)=>{if(t===r)return;let i=z(n)[e]??[];M(n,{...z(n),[e]:Y3(i,t,r)}),F7.current=!0,a()},u=e=>{if(z(r)){let{name:t,entries:i}=z(r);e?(z(n)[t]??[]).some((e,t)=>e.id!==i[t]?.id)&&(F7.current=!0,a()):M(n,{...z(n),[t]:i})}M(r,void 0),M(i,void 0)};So(()=>{let e=Object.fromEntries(J7.current.map(({name:e,entries:n})=>[e,uW(n.filter(e=>!cf(t.collection,e)),t.collection)]));M(n,e),a(e)});var d=Zlt();No(d,21,()=>J7.current,({name:e,entries:t})=>e,(e,a)=>{let s=()=>z(a).name,d=()=>z(a).entries;var f=H();Do(P(f),Iu,null,e=>{{let a=A(()=>s()===`*`?void 0:qW(s()));zS(e,{get label(){return z(a)},children:(e,a)=>{let f=A(()=>o(s(),d()));var p=H();No(P(p),27,()=>z(f),e=>e.id,(e,a,o)=>{var d=Xlt();let p;var m=N(d);{let e=A(()=>z(o)>0),n=A(()=>z(o)<z(f).length-1);Ylt(m,{get collection(){return t.collection},get entry(){return z(a)},get viewType(){return t.viewType},get canMoveUp(){return z(e)},get canMoveDown(){return z(n)},onMoveUp:()=>{l(s(),z(o),z(o)-1)},onMoveDown:()=>{l(s(),z(o),z(o)+1)}})}D(d),R(e=>{p=$o(d,1,`sui grid-row`,null,p,{"drag-placeholder":z(i)?.id===z(a).id}),q(d,`aria-rowindex`,e)},[()=>c(z(a))]),oo(`dragstart`,d,e=>{M(r,{name:s(),entries:[...z(f)]}),M(i,z(a)),e.dataTransfer&&(e.dataTransfer.effectAllowed=`move`)}),oo(`dragover`,d,e=>{let t=s()===z(r)?.name;if(t){e.preventDefault();let t=z(n)[s()]??[],r=t.findIndex(({id:e})=>e===z(i)?.id),a=LYe({dragIndex:r,dropIndex:IYe({index:z(o),clientY:e.clientY,rect:e.currentTarget.getBoundingClientRect()})});a!==void 0&&M(n,{...z(n),[s()]:Y3(t,r,a)})}e.dataTransfer&&(e.dataTransfer.dropEffect=t?`move`:`none`)}),oo(`drop`,d,e=>{e.preventDefault(),u(s()===z(r)?.name)}),oo(`dragend`,d,()=>{u(!1)}),Wo(d,()=>nC,()=>({duration:200})),U(e,d)}),U(e,p)},$$slots:{default:!0}})}}),U(e,f)}),D(d),U(e,d),k()}var eut=B(`<!> <!> <!> <!>`,1);function tut(e,t){O(t,!0);let n=A(()=>EG.current.map(({key:e})=>e));ype(e,{children:(e,r)=>{US(e,{"aria-rowindex":1,children:(e,r)=>{var i=eut(),a=P(i),o=e=>{HS(e,{class:`checkbox`})};G(a,e=>{t.showCheckbox&&e(o)});var s=I(a,2),c=e=>{HS(e,{class:`image`})};G(s,e=>{t.collection._thumbnailFieldNames.length&&e(c)});var l=I(s,2);No(l,17,()=>t.columns,e=>e.key,(e,r)=>{let i=A(()=>Eqe({collection:t.collection,column:z(r),sortKeys:z(n)})),a=A(()=>b3.current);var o=H(),s=P(o),c=e=>{{let t=A(()=>z(r).key===`_summary`?`title`:`column`),n=A(()=>z(a).sort?.key===z(i)?z(a).sort.order:`none`);HS(e,{get class(){return z(t)},get sortOrder(){return z(n)},onSort:e=>{b3.current={...b3.current,sort:{key:z(i),order:e.detail.sortOrder}}},children:(e,t)=>{Ur();var n=V();R(()=>W(n,z(r).label)),U(e,n)},$$slots:{default:!0}})}},l=e=>{{let t=A(()=>z(r).key===`_summary`?`title`:`column`);HS(e,{get class(){return z(t)},children:(e,t)=>{Ur();var n=V();R(()=>W(n,z(r).label)),U(e,n)},$$slots:{default:!0}})}};G(s,e=>{z(i)?e(c):e(l,-1)}),U(e,o)}),HS(I(l,2),{class:`status`}),U(e,i)},$$slots:{default:!0}})},$$slots:{default:!0}}),k()}var nut=B(`<!> <!>`,1);function rut(e,t){O(t,!0);let n=e=>{qS(e,{children:(e,t)=>{var n=nut(),r=P(n);{let e=A(()=>Y(`entry`));JS(r,{get label(){return z(e)},onclick:()=>c()})}JS(I(r,2),{get label(){return z(o)},onclick:()=>c(!0)}),U(e,n)},$$slots:{default:!0}})},r=J(t,`label`,3,void 0),i=J(t,`keyShortcuts`,3,void 0),a=A(()=>Vp.current&&Uf.current?CAe(Uf.current):!1),o=A(()=>Ec.current&&Uf.current?of(Uf.current)?.label:``),s=A(()=>z(a)?gS:Xx),c=(e=!1)=>{let n=!e&&Uf.current&&_f(Uf.current)&&mf.current?`?path=${Yl(mf.current)}`:``;x0(`/collections/${t.collectionName}/new${n}`,{state:{index:e},transitionType:`forwards`})};var l=H(),u=P(l);{let e=e=>{gx(e,{name:`edit`})},t=A(()=>!r()),o=A(()=>Y(`create_new_entry`)),l=A(()=>z(a)?n:void 0);Ro(u,()=>z(s),(n,a)=>{a(n,{variant:`primary`,get iconic(){return z(t)},get disabled(){return q7.current.creationDisabled},get label(){return r()},get"aria-label"(){return z(o)},get keyShortcuts(){return i()},onclick:()=>c(),get popup(){return z(l)},startIcon:e,$$slots:{startIcon:!0}})})}U(e,l),k()}var iut=B(`<!> <!> <!>`,1),aut=B(`<span role="none"> </span>`),out=B(`<span role="none"> </span> <!>`,1);function sut(e,t){O(t,!0);let n=(e,t=Cr,n=Cr,r=Cr)=>{let s=A(()=>t()._i18n);{let c=A(()=>n()===`*`?G7.current.length?Y(`workflow.published_entries`):void 0:qW(n())),l=A(()=>n()!==`*`),u=A(()=>!nG(b3.current,n(),z(o)));zS(e,{get label(){return z(c)},get collapsible(){return z(l)},get expanded(){return z(u)},onChange:({detail:{expanded:e}})=>{b3.current=iG(b3.current,n(),!e,z(o))},children:(e,n)=>{{let n=(e,n=Cr)=>{qlt(e,{get collection(){return t()},get entry(){return n()},get viewType(){return z(i)},get columns(){return z(a)}})},o=A(()=>r().filter(e=>!!Zp(e,{defaultLocale:z(s).defaultLocale})?.content));tC(e,{get items(){return z(o)},itemKey:`id`,renderItem:n,$$slots:{renderItem:!0}})}},$$slots:{default:!0}})}},r=A(()=>Uf.current),i=A(()=>kqe({type:b3.current.type,types:Dqe(z(r)),isLargeScreen:PY.isLargeScreen,reordering:N7.current})),a=A(()=>z(i)===`table`&&z(r)?Cqe({collection:z(r),sortKeys:EG.current.map(({key:e})=>e)}):[]),o=A(()=>eG(M7.current,b3.current.group)),s=A(()=>J7.current.some(({entries:e})=>e.length)),c=A(()=>Aqe(b3.current)),l=()=>eo(()=>z(i))===`table`?void 0:Iu();{let t=A(()=>Y(`entry_list`));T5(e,{get"aria-label"(){return z(t)},children:(e,t)=>{var o=H(),u=P(o),d=e=>{var t=H(),o=P(t),u=e=>{zlt(e,{get collection(){return z(r)}})},d=e=>{{let t=A(()=>Y(`entries`)),o=A(()=>W7.current.length+G7.current.length+ +(z(i)===`table`));E5(e,{get viewType(){return z(i)},id:`entry-list`,get"aria-label"(){return z(t)},get scrollKey(){return z(c)},get"aria-rowcount"(){return z(o)},children:(e,t)=>{var o=H(),s=P(o),u=e=>{$lt(e,{get collection(){return z(r)},get viewType(){return z(i)}})},d=e=>{var t=iut(),o=P(t),s=e=>{{let t=A(()=>!Yf.current);tut(e,{get collection(){return z(r)},get columns(){return z(a)},get showCheckbox(){return z(t)}})}};G(o,e=>{z(i)===`table`&&e(s)});var u=I(o,2),d=e=>{{let t=A(()=>Y(`workflow.unpublished_entries`));zS(e,{get label(){return z(t)},children:(e,t)=>{var n=H();No(P(n),17,()=>G7.current,e=>e.id,(e,t)=>{qlt(e,{get collection(){return z(r)},get entry(){return z(t)},get viewType(){return z(i)},get columns(){return z(a)}})}),U(e,n)},$$slots:{default:!0}})}};G(u,e=>{G7.current.length&&e(d)}),Oo(I(u,2),()=>z(c),e=>{var t=H();No(P(t),17,()=>J7.current,({name:e,entries:t})=>e,(e,t)=>{let i=()=>z(t).name,a=()=>z(t).entries;var o=H();Do(P(o),l,null,e=>{n(e,()=>z(r),i,a)}),U(e,o)}),U(e,t)}),U(e,t)};G(s,e=>{N7.current?e(u):e(d,-1)}),U(e,o)},$$slots:{default:!0}})}},f=e=>{dH(e,{children:(e,t)=>{var n=aut(),r=F(n,!0);R(e=>W(r,e),[()=>Y(`no_entries_found`)]),U(e,n)},$$slots:{default:!0}})},p=e=>{dH(e,{children:(e,t)=>{var n=out(),i=P(n),a=F(i,!0),o=I(i,2);{let e=A(()=>Y(`create_new_entry`));rut(o,{get collectionName(){return z(r).name},get label(){return z(e)}})}R(e=>W(a,e),[()=>Y(`no_entries_created`)]),U(e,n)},$$slots:{default:!0}})};G(o,e=>{I7.current?e(u):z(s)||G7.current.length?e(d,1):W7.current.length?e(f,2):e(p,-1)}),U(e,t)},f=e=>{dH(e,{children:(e,t)=>{var n=aut(),r=F(n,!0);R(e=>W(r,e),[()=>Y(`collection_not_found`)]),U(e,n)},$$slots:{default:!0}})};G(u,e=>{z(r)?e(d):e(f,-1)}),U(e,o)},$$slots:{default:!0}})}k()}var cut=B(`<bdi></bdi>`),lut=B(`<div role="none" class="label svelte-1nfjp1"><!> <!></div>`),uut=B(`<!> <!>`,1),dut=B(`<span role="none"> </span>`),fut={hash:`svelte-1nfjp1`,code:`.label.svelte-1nfjp1 {display:flex;align-items:center;gap:16px;.icon {display:flex;align-items:center;justify-content:center;border-radius:var(--sui-control-medium-border-radius);width:var(--icon-size);height:var(--icon-size);background-color:var(--sui-secondary-background-color);}}`};function put(e,t){O(t,!0),K(e,fut);let n=A(()=>Uf.current?.files.filter(Md)??[]),r=A(()=>Object.fromEntries(OZ.current.filter(({workflow:e})=>e.collectionName===Uf.current?.name).map(e=>[e.workflow.fileName,bZ(e,Uf.current)])));{let t=A(()=>Y(`file_list`));T5(e,{get"aria-label"(){return z(t)},children:(e,t)=>{var i=H(),a=P(i),o=e=>{{let t=A(()=>Y(`files`));E5(e,{viewType:`list`,get"aria-label"(){return z(t)},get"aria-rowcount"(){return z(n).length},children:(e,t)=>{tC(e,{get items(){return z(n)},itemKey:`name`,renderItem:(e,t)=>{let n=()=>(t?.()).name,i=()=>(t?.()).label,a=()=>(t?.()).icon,o=A(()=>RAe(Uf.current,n()));US(e,{onclick:()=>{x0(c0(`${Uf.current?.name}`,n()),{transitionType:`forwards`})},children:(e,t)=>{var s=uut(),c=P(s);VS(c,{class:`title`,children:(e,t)=>{var r=lut(),s=N(r),c=e=>{gx(e,{get name(){return a()}})};G(s,e=>{a()&&e(c)}),Nx(I(s,2),{lines:2,children:(e,t)=>{var r=H(),a=P(r),s=e=>{var t=cut();Lo(t,()=>z(o),!0),D(t),U(e,t)},c=e=>{var t=V();R(()=>W(t,i()||n())),U(e,t)};G(a,e=>{z(o)===void 0?e(c,-1):e(s)}),U(e,r)},$$slots:{default:!0}}),D(r),U(e,r)},$$slots:{default:!0}}),VS(I(c,2),{class:`status`,children:(e,t)=>{var i=H(),a=P(i),o=e=>{T7(e,{get status(){return z(r)[n()]}})};G(a,e=>{z(r)[n()]&&e(o)}),U(e,i)},$$slots:{default:!0}}),U(e,s)},$$slots:{default:!0}})},$$slots:{renderItem:!0}})},$$slots:{default:!0}})}},s=e=>{dH(e,{children:(e,t)=>{var n=dut(),r=F(n,!0);R(e=>W(r,e),[()=>Y(`no_files_in_collection`)]),U(e,n)},$$slots:{default:!0}})};G(a,e=>{z(n)?.length?e(o):e(s,-1)}),U(e,i)},$$slots:{default:!0}})}k()}function mut(e,t){O(t,!0);let n=e=>{var n=H();No(P(n),17,()=>z(a),e=>e.path,(e,n)=>{mut(e,{get node(){return z(n)},get collectionName(){return t.collectionName}})}),U(e,n)},r=A(()=>t.node.path),i=A(()=>t.node.label),a=A(()=>t.node.children),o=A(()=>Uf.current?.name===t.collectionName),s=A(()=>z(o)&&mf.current===z(r)),c=A(()=>z(o)&&Sf(z(r),mf.current)),l=j(!1);L(()=>{(z(s)||z(c))&&eo(()=>{M(l,!0)})});{let o=e=>{gx(e,{name:`folder`})},c=A(()=>z(a).length?n:void 0);cH(e,{get label(){return z(i)},get selected(){return z(s)},get items(){return z(c)},onSelect:()=>{x0(Kl(`/collections/${t.collectionName}/filter/${z(r)}`),{transitionType:`forwards`})},get expanded(){return z(l)},set expanded(e){M(l,e,!0)},startIcon:o,$$slots:{startIcon:!0}})}k()}var hut=B(`<span class="count"> </span>`);function gut(e,t){O(t,!0);let n=e=>{var t=H();No(P(t),17,()=>z(d),e=>e.path,(e,t)=>{mut(e,{get node(){return z(t)},get collectionName(){return z(i)}})}),U(e,t)},r=J(t,`isSearchPage`,3,!1),i=A(()=>t.collection.name),a=A(()=>t.collection.label),o=A(()=>t.collection.icon),s=A(()=>Uf.current?.name===z(i)),c=A(()=>PY.isSmallScreen||r()?!1:z(s)&&!mf.current),l=A(()=>`files`in t.collection?[]:k2(t.collection)),u=A(()=>`files`in t.collection?t.collection.files.length:aW(z(i),z(l))),d=A(()=>V0e({collection:Kf(z(i)),entries:z(l)})),f=j(!1);L(()=>{z(s)&&eo(()=>{M(f,!0)})});{let t=e=>{{let t=A(()=>z(o)||`bookmark_manager`);gx(e,{get name(){return z(t)}})}},r=e=>{var t=hut(),n=F(t,!0);R((e,r)=>{q(t,`aria-label`,e),W(n,r)},[()=>z(u)?Y(`x_entries`,{values:{count:z(u)}}):void 0,()=>_5.current.format(z(u))]),U(e,t)},s=A(()=>z(a)||z(i)),l=A(()=>z(d).length?n:void 0);cH(e,{get label(){return z(s)},get selected(){return z(c)},get items(){return z(l)},onSelect:()=>{x0(`/collections/${z(i)}`,{transitionType:`forwards`})},get expanded(){return z(f)},set expanded(e){M(f,e,!0)},startIcon:t,endIcon:r,$$slots:{startIcon:!0,endIcon:!0}})}k()}var _ut=B(`<div class="wrapper svelte-ozneys"><!></div>`),vut={hash:`svelte-ozneys`,code:`.wrapper.svelte-ozneys {display:contents;}`};function yut(e,t){O(t,!0),K(e,vut);let n=A(()=>t.file.name),r=A(()=>t.file.icon),i=A(()=>t.file.label||z(n)),a=j(!1),o=j(void 0);var s=_ut();cH(N(s),{get label(){return z(i)},onSelect:()=>{d0.current=Y(`singleton_selected_announcement`,{values:{file:z(i)}})},onclick:()=>{x0(c0(`_singletons`,z(n)),{transitionType:`forwards`}),M(a,!1),z(o)?.querySelector(`[role="treeitem"]`)?.classList.remove(`focused`)},get selected(){return z(a)},set selected(e){M(a,e,!0)},startIcon:e=>{{let t=A(()=>z(r)||`edit_document`);gx(e,{get name(){return z(t)}})}},$$slots:{startIcon:!0}}),D(s),gs(s,e=>M(o,e),()=>z(o)),U(e,s),k()}var but=rl(()=>{let{published:e,time:t}=Uy.current,{current:n}=Hy,r=n?Vy.current[n]:void 0;return!r||r.checkedTime<=t?e:r.state===`ready`||r.state===`pending`||r.state!==`error`&&e}),xut=rl(()=>(!!yu.deployHookURL||typeof LX.current?.triggerDeployment==`function`)&&!but.current),Sut=async()=>{let{deployHookURL:e,deployHookAuthHeader:t}=yu;if(e&&!Ru(e))throw Error(`Deploy hook URL must use HTTPS or localhost`);let{ok:n,status:r}=e?await fetch(e,{method:`POST`,mode:t?`cors`:`no-cors`,headers:t?{Authorization:t}:{}}):await LX.current?.triggerDeployment?.()??{};if(!n&&(t||r!==0))throw Error(`Webhook returned ${r} error`);Gy(!0)},Cut=B(`<!> <!>`,1);function wut(e,t){O(t,!0);let n=j(`info`),r=j(!1),i=async()=>{M(n,`info`),M(r,!0);try{await Sut()}catch(e){M(n,`error`),M(r,!0),console.error(e)}};var a=H(),o=P(a),s=e=>{var t=Cut(),a=P(t);{let e=A(()=>PY.isSmallScreen?`small`:`medium`),t=A(()=>Y(`publish_changes`)),n=A(()=>!xut.current);Xx(a,{variant:`secondary`,get size(){return z(e)},get label(){return z(t)},get disabled(){return z(n)},onclick:()=>i()})}fC(I(a,2),{get show(){return z(r)},set show(e){M(r,e,!0)},children:(e,t)=>{bx(e,{get status(){return z(n)},children:(e,t)=>{Ur();var r=V();R(e=>W(r,e),[()=>Y(z(n)===`error`?`publishing_changes_failed`:`publishing_changes`)]),U(e,r)},$$slots:{default:!0}})},$$slots:{default:!0}}),U(e,t)};G(o,e=>{U8.current&&e(s)}),U(e,a),k()}var Tut=B(`<header><h2> </h2> <!></header> <!>`,1),Eut=B(`<span class="count"> </span>`),Dut=B(`<!> <!>`,1),Out=B(`<nav class="primary-sidebar"><!> <!></nav>`);function kut(e,t){O(t,!0);let n=J(t,`isSearchPage`,3,!1),r=A(()=>Dl.current?.collections?.filter(({hide:e})=>!e)??[]),i=A(()=>Dl.current?.singletons??[]),a=A(()=>z(r).some(e=>!(`divider`in e)&&gf(e)));var o=Out(),s=N(o),c=e=>{var t=Tut(),n=P(t),r=N(n),i=F(r,!0);wut(I(r,2),{}),D(n),I5(I(n,2),{onclick:e=>{e.preventDefault(),x0(`/search`)}}),R(e=>W(i,e),[()=>Y(`contents`)]),U(e,t)};G(s,e=>{PY.isSmallScreen&&e(c)});var l=I(s,2);{let e=A(()=>z(a)?void 0:`flat`),t=A(()=>Y(`collection_list`)),o=A(()=>n()||PY.isSmallScreen?void 0:`collection-container`);uH(l,{get class(){return z(e)},get ariaLabel(){return z(t)},get"aria-controls"(){return z(o)},expandOnSelect:!1,children:(e,t)=>{var a=Dut(),o=P(a),s=e=>{{let t=A(()=>Y(`collections`));GS(e,{get label(){return z(t)},children:(e,t)=>{var i=H();No(P(i),19,()=>z(r),(e,t)=>e.name??t,(e,t)=>{var r=H();Do(P(r),Iu,null,e=>{var r=H(),i=P(r),a=e=>{gut(e,{get collection(){return z(t)},get isSearchPage(){return n()}})},o=e=>{FS(e,{})};G(i,e=>{`divider`in z(t)?z(t).divider&&e(o,1):e(a)}),U(e,r)}),U(e,r)}),U(e,i)},$$slots:{default:!0}})}};G(o,e=>{z(r).length&&e(s)});var c=I(o,2),l=e=>{var t=H(),n=P(t),a=e=>{{let t=A(()=>Y(`files`));GS(e,{get label(){return z(t)},children:(e,t)=>{var n=H();No(P(n),19,()=>z(i),(e,t)=>e.name??t,(e,t)=>{var n=H();Do(P(n),Iu,null,e=>{var n=H(),r=P(n),i=e=>{yut(e,{get file(){return z(t)}})},a=e=>{FS(e,{})};G(r,e=>{`divider`in z(t)?z(t).divider&&e(a,1):e(i)}),U(e,n)}),U(e,n)}),U(e,n)},$$slots:{default:!0}})}},o=e=>{let t=A(()=>z(i).filter(e=>!(`divider`in e)).length);{let n=A(()=>Y(`collections`));GS(e,{get label(){return z(n)},children:(e,n)=>{{let n=e=>{gx(e,{name:`bookmark_manager`})},r=e=>{var n=Eut(),r=F(n,!0);R((e,t)=>{q(n,`aria-label`,e),W(r,t)},[()=>Y(`x_entries`,{values:{count:z(t)}}),()=>_5.current.format(z(t))]),U(e,n)},i=A(()=>Y(`files`)),a=A(()=>Uf.current?.name===`_singletons`);cH(e,{get label(){return z(i)},get selected(){return z(a)},onSelect:()=>{x0(`/collections/_singletons`,{transitionType:`forwards`})},startIcon:n,endIcon:r,$$slots:{startIcon:!0,endIcon:!0}})}},$$slots:{default:!0}})}};G(n,e=>{PY.isSmallScreen||z(r).length?e(a):e(o,-1)}),U(e,t)};G(c,e=>{z(i).length&&e(l)}),U(e,a)},$$slots:{default:!0}})}D(o),R(e=>q(o,`aria-label`,e),[()=>Y(`contents`)]),U(e,o),k()}var Aut=B(`<!> <!> <!> <!> <!> <!>`,1);function jut(e,t){O(t,!0);let n=J(t,`canSave`,3,!0),r=J(t,`saving`,15,!1),i=J(t,`validate`,3,void 0),a=J(t,`invalidMessage`,3,``),o=J(t,`discardMessage`,3,``),s=J(t,`onExit`,3,void 0),c=J(t,`leading`,3,void 0),l=j(!1),u=j(!1),d=j(!1),f=j(void 0),p=j(void 0),m=()=>{let e=z(f);(e.disabled?z(p):e).focus()},h=()=>{t.exitMode(),s()?.()},g=async()=>{if(i()&&!i()()){M(u,!0);return}r(!0);let{ok:e,cancelled:n}=await g2(t.commit);r(!1),e?h():(n||M(d,!0),await Za(),z(f).focus())};var _={focus:m},v=Aut(),y=P(v);xo(y,()=>c()??Cr);var b=I(y,2);{let e=A(()=>r()||!n());Xx(b,{variant:`primary`,get label(){return t.saveLabel},get"aria-label"(){return t.saveAriaLabel},get disabled(){return z(e)},onclick:()=>{g()},get element(){return z(f)},set element(e){M(f,e,!0)}})}var x=I(b,2);{let e=A(()=>Y(`cancel`));Xx(x,{variant:`secondary`,get label(){return z(e)},get"aria-label"(){return t.cancelAriaLabel},get disabled(){return r()},onclick:()=>{o()&&n()?M(l,!0):h()},get element(){return z(p)},set element(e){M(p,e,!0)}})}var S=I(x,2),C=e=>{{let n=A(()=>Y(`discard`));wS(e,{get title(){return t.cancelAriaLabel},get okLabel(){return z(n)},onOk:()=>{h()},get open(){return z(l)},set open(e){M(l,e,!0)},children:(e,t)=>{Ur();var n=V();R(()=>W(n,o())),U(e,n)},$$slots:{default:!0}})}};G(S,e=>{o()&&e(C)});var w=I(S,2),T=e=>{fC(e,{get show(){return z(u)},set show(e){M(u,e,!0)},children:(e,t)=>{bx(e,{status:`error`,children:(e,t)=>{Ur();var n=V();R(()=>W(n,a())),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}})};return G(w,e=>{a()&&e(T)}),fC(I(w,2),{get show(){return z(d)},set show(e){M(d,e,!0)},children:(e,n)=>{bx(e,{status:`error`,children:(e,n)=>{Ur();var r=V();R(()=>W(r,t.savingFailedMessage)),U(e,r)},$$slots:{default:!0}})},$$slots:{default:!0}}),U(e,v),k(_)}var Mut=B(`<div role="status" class="count svelte-a3wcu0"> </div> <!>`,1),Nut={hash:`svelte-a3wcu0`,code:`.count.svelte-a3wcu0 {font-size:var(--sui-font-size-small);opacity:0.8;white-space:nowrap;}`};function Put(e,t){O(t,!0),K(e,Nut);let n=J(t,`onExit`,3,void 0),r=j(void 0),i=A(()=>Clt(L7.current)),a=()=>{z(r).focus()},o=()=>({collection:Uf.current,entries:z7.current,edits:L7.current});var s={focus:a};{let t=e=>{var t=Mut(),n=P(t),r=F(n,!0);yS(I(n,2),{}),R(e=>W(r,e),[()=>Y(`bulk_edit_count`,{values:{count:z(i)}})]),U(e,t)},a=A(()=>Y(`save`)),s=A(()=>Y(`save_bulk_edits`)),c=A(()=>Y(`cancel_bulk_edits`)),l=A(()=>Y(`saving_bulk_edits_failed`)),u=A(()=>Y(`bulk_edit_invalid`)),d=A(()=>Y(`discard_bulk_edits_confirm`)),f=A(()=>!!z(i));gs(jut(e,{get saveLabel(){return z(a)},get saveAriaLabel(){return z(s)},get cancelAriaLabel(){return z(c)},get savingFailedMessage(){return z(l)},get invalidMessage(){return z(u)},get discardMessage(){return z(d)},get canSave(){return z(f)},validate:()=>{let e=Elt(o());return!Object.keys(e).length||(B7.current=e,!1)},commit:()=>Olt(o()),exitMode:()=>X7(!1),get onExit(){return n()},get saving(){return R7.current},set saving(e){R7.current=e},leading:t,$$slots:{leading:!0}}),e=>M(r,e,!0),()=>z(r))}return k(s)}function Fut(e,t){O(t,!0);let n=J(t,`onExit`,3,void 0),r=j(void 0);var i={focus:()=>{z(r).focus()}};{let t=A(()=>Y(`done`)),i=A(()=>Y(`done_reordering_entries`)),a=A(()=>Y(`cancel_reordering_entries`)),o=A(()=>Y(`saving_reorder_failed`));gs(jut(e,{get saveLabel(){return z(t)},get saveAriaLabel(){return z(i)},get cancelAriaLabel(){return z(a)},get savingFailedMessage(){return z(o)},get canSave(){return F7.current},commit:()=>Mot(Uf.current,P7.current),exitMode:()=>Y7(!1),get onExit(){return n()}}),e=>M(r,e,!0),()=>z(r))}return k(i)}var Iut=B(` <!>`,1),Lut=B(`<!> <!>`,1);function Rut(e,t){O(t,!0);let n=J(t,`open`,15,!1),r=j(!1),i=j(``),a=A(()=>{let e=[],t=[];return ZU.current.forEach(n=>{tQ(n)?e.push(n):t.push(n)}),{draftEntries:e,publishedEntries:t}}),o=A(()=>z(a).draftEntries),s=A(()=>z(a).publishedEntries),c=A(()=>{let e=Uf.current;return n()&&e&&z(s).length?h7({collection:e,entries:z(s)}):wot}),l=A(()=>{let e=ZGe({entries:z(s),collectionName:Uf.current?.name});return z(s).map((t,n)=>({entry:t,assets:e[n]}))}),u=A(()=>z(l).flatMap(({assets:e})=>e)),d=async()=>{let e=Uf.current,{ok:t,cancelled:n,result:a,error:c}=await g2(()=>jst({drafts:z(o),items:z(l),collection:e,useWorkflow:DZ(e)||z(s).some(e=>`workflow`in e)}));t?(a&&(l2.current={...c2,...a}),ZU.current=[]):n||(M(i,xl(c,`deleting_entry_failed`),!0),M(r,!0))};var f=Lut(),p=P(f);{let e=A(()=>Y(`delete_entries`,{values:{count:ZU.current.length}})),t=A(()=>Y(`delete`)),r=A(()=>!!z(c).blockers.length);wS(p,{get title(){return z(e)},get okLabel(){return z(t)},get okDisabled(){return z(r)},onOk:async()=>{await d()},get open(){return n()},set open(e){n(e)},children:(e,t)=>{let n=A(()=>ZU.current.length>1&&ZU.current.length===W7.current.length+G7.current.length);var r=Lut(),i=P(r),a=e=>{var t=Iut(),r=P(t),i=I(r),a=e=>{var t=V();R(e=>W(t,e),[()=>Y(z(s).length?`workflow.deleting_unpublished_note_some`:`workflow.deleting_unpublished_note_all`,{values:{count:z(o).length}})]),U(e,t)};G(i,e=>{z(o).length&&e(a)}),R(e=>W(r,`${e??``} `),[()=>Y(z(u).length?z(n)?`confirm_deleting_all_entries_with_assets`:`confirm_deleting_selected_entries_with_assets`:z(n)?`confirm_deleting_all_entries`:`confirm_deleting_selected_entries`,{values:{count:ZU.current.length}})]),U(e,t)};G(i,e=>{z(c).blockers.length||e(a)}),y5(I(i,2),{get plan(){return z(c)},get count(){return z(s).length}}),U(e,r)},$$slots:{default:!0}})}fC(I(p,2),{get show(){return z(r)},set show(e){M(r,e,!0)},children:(e,t)=>{bx(e,{status:`error`,children:(e,t)=>{Ur();var n=V();R(()=>W(n,z(i))),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),U(e,f),k()}var zut=B(`<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>`,1),But=B(`<bdi></bdi>`),Vut=B(`<div role="none" class="description svelte-83jnuc"><!></div>`),Hut=B(`<!> <!> <!> <!>`,1),Uut=B(`<!> <h2 role="none" class="svelte-83jnuc"><bdi> </bdi></h2> <!> <!>`,1),Wut=B(`<!> <!>`,1),Gut={hash:`svelte-83jnuc`,code:`h2.svelte-83jnuc {flex:none !important;}.description.svelte-83jnuc {flex:auto;font-size:var(--sui-font-size-small);opacity:0.8;}`};function Kut(e,t){O(t,!0),K(e,Gut);let n=j(!1),r=j(void 0),i=j(void 0),a=j(void 0),o=j(void 0),s=j(void 0),c=A(()=>Uf.current?.name??``),l=A(()=>Ec.current&&Uf.current?qf(Uf.current):z(c)),u=A(()=>Uf.current?.description),d=A(()=>q7.current),f=A(()=>z(d).isEntryCollection),p=A(()=>z(d).readonly),m=A(()=>z(d).canCreate),h=A(()=>z(d).canDelete),g=A(()=>z(d).canReorder),_=A(()=>z(d).canBulkEdit),v=A(()=>z(d).quota),y=A(()=>z(d).remaining),b=A(()=>z(d).nearingQuota),x=A(()=>z(d).creationDisabled),S=A(()=>!ZU.current.length||!z(h)),C=A(()=>!!(W7.current.length||G7.current.length));pa(()=>{z(S)&&document.activeElement===z(r)&&Za().then(()=>jJ())});var w=Wut(),T=P(w),ee=e=>{var t=Wut(),d=P(t),h=e=>{var t=zut(),n=P(t);ko(n,()=>({"--sui-infobar-border-width":`0 0 1px`,"--sui-infobar-message-justify-content":`center`})),Zx(n.lastChild,{dismissible:!1,children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>sQ(`collection`,{collection:Uf.current})]),U(e,n)},$$slots:{default:!0}}),D(n),U(e,t)},w=e=>{var t=zut(),n=P(t);ko(n,()=>({"--sui-infobar-border-width":`0 0 1px`,"--sui-infobar-message-justify-content":`center`})),Zx(n.lastChild,{dismissible:!1,children:(e,t)=>{var n=H(),r=P(n),i=e=>{var t=V();R(e=>W(t,e),[()=>Y(`creating_entries_disabled_by_admin`)]),U(e,t)},a=e=>{var t=V();R(e=>W(t,e),[()=>Y(`creating_entries_disabled_by_quota`,{values:{quota:z(v)}})]),U(e,t)},o=e=>{var t=V();R(e=>W(t,e),[()=>Y(`creating_entries_nearing_quota`,{values:{quota:z(v),remaining:z(y)}})]),U(e,t)};G(r,e=>{z(m)?z(x)?e(a,1):e(o,-1):e(i)}),U(e,n)},$$slots:{default:!0}}),D(n),U(e,t)};G(d,e=>{z(p)?e(h):z(f)&&(z(x)||z(b))&&e(w,1)});var T=I(d,2);{let e=A(()=>Y(`collection`));IV(T,{variant:`primary`,get ariaLabel(){return z(e)},children:(e,t)=>{var d=Uut(),p=P(d),m=e=>{{let t=A(()=>Y(`back_to_collection_list`));x5(e,{get"aria-label"(){return z(t)},onclick:()=>{S0(`/collections`)}})}};G(p,e=>{PY.isSmallScreen&&e(m)});var h=I(p,2),v=F(N(h),!0);D(h);var y=I(h,2),b=e=>{yS(e,{flex:!0})},w=e=>{var t=Vut();Nx(N(t),{children:(e,t)=>{var n=But();Lo(n,()=>Yu(z(u)||``),!0),D(n),U(e,n)},$$slots:{default:!0}}),D(t),U(e,t)};G(y,e=>{PY.isSmallScreen?e(b):e(w,-1)});var T=I(y,2),ee=e=>{gs(Fut(e,{onExit:async()=>{await Za(),z(i).focus()}}),e=>M(a,e,!0),()=>z(a))},E=e=>{gs(Put(e,{onExit:async()=>{await Za(),z(o).focus()}}),e=>M(s,e,!0),()=>z(s))},te=e=>{var t=Hut(),l=P(t),u=e=>{{let t=A(()=>Y(`delete`)),i=A(()=>Y(`delete_selected_entries`,{values:{count:ZU.current.length}}));Xx(e,{variant:`ghost`,get label(){return z(t)},get"aria-label"(){return z(i)},get disabled(){return z(S)},onclick:()=>{M(n,!0)},get element(){return z(r)},set element(e){M(r,e,!0)}})}};G(l,e=>{!PY.isSmallScreen&&!Yf.current&&e(u)});var d=I(l,2),f=e=>{{let t=A(()=>Y(`edit`)),n=A(()=>Y(`bulk_edit_entries`)),r=A(()=>!W7.current.length);Xx(e,{variant:`ghost`,get label(){return z(t)},get"aria-label"(){return z(n)},get disabled(){return z(r)},onclick:async()=>{X7(!0),await Za(),z(s).focus()},get element(){return z(o)},set element(e){M(o,e,!0)}})}};G(d,e=>{z(_)&&!PY.isSmallScreen&&e(f)});var p=I(d,2),m=e=>{{let t=A(()=>Y(`reorder`)),n=A(()=>Y(`reorder_entries`)),r=A(()=>!W7.current.length);Xx(e,{variant:`ghost`,get label(){return z(t)},get"aria-label"(){return z(n)},get disabled(){return z(r)},onclick:async()=>{Y7(!0),await Za(),z(a).focus()},get element(){return z(i)},set element(e){M(i,e,!0)}})}};G(p,e=>{z(g)&&e(m)}),Qx(I(p,2),{children:(e,t)=>{var n=H(),r=P(n),i=e=>{{let t=A(()=>PY.isSmallScreen?void 0:Y(`create`));rut(e,{get collectionName(){return z(c)},get label(){return z(t)},keyShortcuts:`Accel+E`})}};G(r,e=>{(!PY.isSmallScreen||z(C)&&!z(x))&&e(i)}),U(e,n)},$$slots:{default:!0}}),U(e,t)};G(T,e=>{z(f)&&N7.current?e(ee):z(f)&&I7.current?e(E,1):z(f)&&e(te,2)}),R(()=>W(v,z(l))),U(e,d)},$$slots:{default:!0}})}U(e,t)};G(T,e=>{Uf.current&&e(ee)}),Rut(I(T,2),{get open(){return z(n)},set open(e){M(n,e,!0)}}),U(e,w),k()}function qut(e,t){O(t,!0);let n=A(()=>Ey({collectionName:Uf.current?.name})),r=A(()=>Dp.current.filter(e=>EQ(e,z(n)))),i=A(()=>z(n)?.internalPath),a=A(()=>!Oy(z(n))||ky.current);var o=H(),s=P(o),c=e=>{{let t=A(()=>Y(`collection_assets`));fH(e,{id:`collection-assets`,class:`secondary-sidebar`,get ariaLabel(){return z(t)},children:(e,t)=>{z0(e,{get disabled(){return z(a)},multiple:!0,onDrop:({files:e})=>{Mp.current={folder:z(n),files:e}},children:(e,t)=>{gUe(e,{get assets(){return z(r)},onSelect:({asset:e})=>{x0(Kl(`/assets/${e.path}`),{transitionType:`forwards`})}})},$$slots:{default:!0}})},$$slots:{default:!0}})}};G(s,e=>{z(i)!==void 0&&PY.isLargeScreen&&b3.current.showMedia&&e(c)}),U(e,o),k()}var Jut=B(`<!> <!>`,1),Yut=B(`<!> <!> <!> <!> <!> <!> <!>`,1);function Xut(e,t){O(t,!0);let n=A(()=>Uf.current?._type===`entry`?Uf.current:void 0),r=A(()=>z(n)?.name),i=A(()=>!!K7.current),a=A(()=>K7.current>1);var o=H(),s=P(o),c=e=>{{let t=A(()=>Y(`entry_list`));IV(e,{variant:`secondary`,get ariaLabel(){return z(t)},children:(e,t)=>{var o=Yut(),s=P(o),c=e=>{{let t=A(()=>[...G7.current,...J7.current.flatMap(({entries:e})=>e)]);Ntt(e,{get allItems(){return z(t)},get selectedItems(){return ZU}})}};G(s,e=>{!(PY.isSmallScreen||PY.isMediumScreen)&&!Yf.current&&e(c)});var l=I(s,2);yS(l,{flex:!0});var u=I(l,2);{let e=A(()=>!z(a)||!EG.current.length);Ftt(u,{get disabled(){return z(e)},get currentView(){return b3},get sortKeys(){return EG.current},get collectionName(){return z(r)},"aria-controls":`entry-list`})}var d=I(u,2),f=e=>{{let t=A(()=>!z(a));Dtt(e,{get disabled(){return z(t)},get currentView(){return b3},get filters(){return lct.current},multiple:!0,"aria-controls":`entry-list`})}};G(d,e=>{lct.current?.length&&e(f)});var p=I(d,2),m=e=>{{let t=A(()=>!z(a)),n=A(()=>J7.current.map(({name:e})=>e));ktt(e,{get disabled(){return z(t)},get currentView(){return b3},get groups(){return M7.current},get groupNames(){return z(n)},"aria-controls":`entry-list`})}};G(p,e=>{M7.current?.length&&e(m)});var h=I(p,2);{let e=A(()=>!z(i)),t=A(()=>Dqe(z(n)));S3(h,{get disabled(){return z(e)},get currentView(){return b3},get types(){return z(t)},"aria-controls":`entry-list`})}var g=I(h,2),_=e=>{var t=Jut(),n=P(t);FS(n,{orientation:`vertical`});var a=I(n,2);{let e=e=>{gx(e,{name:`photo_library`})},t=A(()=>!z(i)||!Ey({collectionName:z(r)})),n=A(()=>!!b3.current.showMedia),o=A(()=>b3.current.showMedia?`collection-assets`:void 0),s=A(()=>!!b3.current.showMedia),c=A(()=>Y(b3.current.showMedia?`hide_assets`:`show_assets`));Xx(a,{variant:`ghost`,iconic:!0,get disabled(){return z(t)},get pressed(){return z(n)},get"aria-controls"(){return z(o)},get"aria-expanded"(){return z(s)},get"aria-label"(){return z(c)},onclick:()=>{b3.current={...b3.current,showMedia:!b3.current.showMedia}},startIcon:e,$$slots:{startIcon:!0}})}U(e,t)};G(g,e=>{PY.isSmallScreen||PY.isMediumScreen||e(_)}),U(e,o)},$$slots:{default:!0}})}};G(s,e=>{z(n)&&!N7.current&&!I7.current&&e(c)}),U(e,o),k()}var Zut=/^\/collections(?:\/(?<_collectionName>[^/]+)(?:\/(?<routeType>new|entries|filter))?(?:\/(?<subPath>.+?))?)?$/,Q7=(e,t)=>($1.current=!1,d0.current=Y(t),{...e,notFoundKey:t}),$7=(e,t,n)=>(t.current=void 0,d0.current=Y(n),e),Qut=e=>PY.isSmallScreen?(Uf.current=void 0,$1.current=!1,d0.current=Y(`viewing_collection_list`),{...e,isIndexPage:!0}):(x0(`/collections/${(Uf.current||fae()||gae())?.name}`,{replaceState:!0}),e),$ut=e=>{!e||e.hide?Uf.current=void 0:Uf.current?.name!==e.name&&(Uf.current=e,mf.current=``)},edt=({state:e,collection:t,collectionName:n,collectionLabel:r,routeType:i,subPath:a})=>i===`filter`&&!Vie({collection:t,entries:QZ(rW(n),NZ(n)),dirPath:a??``})?MZ.current?Q7(e,`page_not_found`):($1.current=!1,d0.current=Y(`loading`),{...e,awaitingDrafts:!0}):(mf.current=i===`filter`?a??``:``,$1.current=!1,d0.current=Y(`viewing_x_collection`,{values:{collection:r,count:W7.current.length}}),e),tdt=({state:e,entryDraft:t,collection:n,collectionName:r,collectionLabel:i,routeType:a,subPath:o,fileMap:s})=>{if(a!==`entries`||!o)return $7(e,t,`file_not_found`);let c=Object.hasOwn(s,o)?s[o]:void 0;return c?(e8({entryDraft:t,collection:n,collectionFile:c,originalEntry:zZ({collectionName:r,subPath:o})??Jp(r,o)??{slug:c.name,locales:Object.fromEntries(c._i18n.initialLocales.map(e=>[e,{}]))}}),fat(t),d0.current=Y(`edit_${n._type}_announcement`,{values:{collection:i,file:Kp(c)}}),e):$7(e,t,`file_not_found`)},ndt=({state:e,entryDraft:t,collection:n,collectionName:r,collectionLabel:i,routeType:a,subPath:o,params:s})=>{if(a===`new`&&!o){let r=_f(n)?s.path:void 0;r!==void 0&&delete s.path;let{_slug:a}=s;return delete s._slug,e8({entryDraft:t,collection:n,dynamicValues:s,initialPath:r,initialSlug:a,isIndexFile:!!window.history.state?.index}),d0.current=Y(`create_entry_announcement`,{values:{collection:i}}),e}if(a===`entries`&&o){let a=zZ({collectionName:r,subPath:o})??rW(r).find(e=>e.subPath===o);return a?(Ec.current&&(e8({entryDraft:t,collection:n,originalEntry:a}),fat(t),d0.current=Y(`edit_entry_announcement`,{values:{collection:i,entry:wW(Uf.current,a)}})),e):$7(e,t,`entry_not_found`)}return $7(e,t,`entry_not_found`)},rdt=({entryDraft:e})=>{let{path:t,params:n}=m0(),r=t.match(Zut),i={isIndexPage:!1,isSearchPage:!1,notFoundKey:``,awaitingDrafts:!1,editorLocale:n._locale};if(delete n._locale,Uf.current?.name===`_singletons`&&Gf().length&&(Uf.current=void 0),!r?.groups)return $1.current=!1,{...i,isSearchPage:Xtt(t)};let{_collectionName:a,routeType:o,subPath:s}=r.groups;if(!a)return Qut(i);let c=Kf(a);if($ut(c),!c||!Uf.current)return Q7(i,`collection_not_found`);let{name:l}=Uf.current,u=qf(Uf.current),d=`_fileMap`in Uf.current?Uf.current._fileMap:void 0;if(!o&&s)return Q7(i,`page_not_found`);let f={state:i,entryDraft:e,collection:c,collectionName:l,collectionLabel:u,routeType:o,subPath:s};return!o||o===`filter`?edt(f):($1.current=!0,o===`entries`&&s&&!MZ.current?(d0.current=Y(`loading_entries`,{values:{count:1}}),{...i,awaitingDrafts:!0}):d?tdt({...f,fileMap:d}):ndt({...f,params:n}))},idt=B(`<!> <!> <!>`,1);function adt(e,t){O(t,!0);let n=new FK,r=j(!1),i=j(!1),a=j(``),o=j(!1),s=j(void 0),c=A(()=>`files`in(Uf.current??{})?put:sut),l=()=>{(e=>{M(r,e.isIndexPage,!0),M(i,e.isSearchPage,!0),M(a,e.notFoundKey,!0),M(o,e.awaitingDrafts,!0),M(s,e.editorLocale,!0)})(rdt({entryDraft:n}))};So(()=>(l(),()=>{$1.current=!1})),sl(()=>$1.current,()=>{$1.current||f2e(n.current)}),L(()=>{z(o)&&MZ.current&&eo(()=>l())});var u=idt();oo(`hashchange`,$i,e=>{b0(e,l,Zut)});var d=P(u);{let e=e=>{var t=H(),n=P(t),a=e=>{kut(e,{get isSearchPage(){return z(i)}})};G(n,e=>{(!PY.isSmallScreen||z(r))&&e(a)}),U(e,t)},t=e=>{var t=H(),n=P(t),o=e=>{H5(e,{})},s=e=>{{let t=e=>{{let t=A(()=>Y(z(a)));w5(e,{get message(){return z(t)}})}},n=A(()=>Y(`content_library`));D5(e,{id:`collection-container`,get"aria-label"(){return z(n)},mainContent:t,$$slots:{mainContent:!0}})}},l=e=>{{let t=e=>{Kut(e,{})},n=e=>{var t=H(),n=P(t),r=e=>{Xut(e,{})};G(n,e=>{Uf.current?._type===`entry`&&K7.current&&e(r)}),U(e,t)},r=e=>{var t=H();Ro(P(t),()=>z(c),(e,t)=>{t(e,{})}),U(e,t)},i=e=>{qut(e,{})},a=A(()=>Y(`x_collection`,{values:{collection:Ec.current&&Uf.current?qf(Uf.current):``}})),o=A(()=>Uf.current?.description);D5(e,{id:`collection-container`,get"aria-label"(){return z(a)},get"aria-description"(){return z(o)},primaryToolbar:t,secondaryToolbar:n,mainContent:r,secondarySidebar:i,$$slots:{primaryToolbar:!0,secondaryToolbar:!0,mainContent:!0,secondarySidebar:!0}})}};G(n,e=>{z(i)?e(o):z(a)?e(s,1):PY.isSmallScreen&&z(r)||e(l,2)}),U(e,t)},n=A(()=>Y(`content_library`));B5(d,{uiSettingsKey:`contents-page`,get"aria-label"(){return z(n)},primarySidebar:e,main:t,$$slots:{primarySidebar:!0,main:!0}})}var f=I(d,2),p=e=>{flt(e,{get entryDraft(){return n},get editorLocale(){return z(s)},get loading(){return z(o)}})};G(f,e=>{$1.current&&e(p)}),iit(I(f,2),{}),U(e,u),k()}function odt(e,t){O(t,!0);{let t=A(()=>Y(`prefs.i18n.translators.default.select_service`));iC(e,{get ariaLabel(){return z(t)},get value(){return yu.defaultTranslationService},onChange:e=>{yu.defaultTranslationService=e.detail.value},children:(e,t)=>{var n=H();No(P(n),17,()=>Object.entries(f6),([e,{serviceLabel:t}])=>e,(e,t)=>{var n=A(()=>Er(z(t),2));let r=()=>z(n)[0],i=()=>z(n)[1].serviceLabel;{let t=A(()=>r()===yu.defaultTranslationService);KS(e,{get label(){return i()},get value(){return r()},get selected(){return z(t)}})}}),U(e,n)},$$slots:{default:!0}})}k()}var sdt=B(`<!> <!> <!>`,1);function cdt(e,t){O(t,!0);let n=A(()=>p6.current),r=A(()=>z(n).serviceId),i=A(()=>z(n).apiLabel),a=A(()=>z(n).developerURL),o=A(()=>z(n).apiKeyURL),s=A(()=>z(n).apiKeyPattern),c=j(``),l=A(()=>!!z(s)?.test(z(c).trim()));L(()=>{M(c,yu.apiKeys?.[z(r)]??``,!0)});let u=e=>{let{resolve:t}=n0.current;n0.current.show=!1,n0.current.resolve=void 0,t?.(e)};L(()=>{!$1.current&&n0.current.show&&u()});let d=()=>{let e=M0(z(r),z(c),z(s));e!==void 0&&u(e)};{let t=A(()=>Y(`translate_fields`,{values:{count:n0.current.multiple?2:1}})),n=A(()=>({spellcheck:!1,monospace:!0,ariaLabel:Y(`api_key`)})),r=A(()=>!z(l));PS(e,{get title(){return z(t)},get textboxAttrs(){return z(n)},oninput:e=>{e.inputType===`insertFromPaste`&&d()},get okDisabled(){return z(r)},onOk:()=>d(),onClose:()=>{u()},get open(){return n0.current.show},set open(e){n0.current.show=e},get value(){return z(c)},set value(e){M(c,e,!0)},children:(e,t)=>{var n=sdt(),r=P(n);odt(r,{});var s=I(r,2);yS(s,{}),Lo(I(s,2),()=>A0(`prefs.i18n.translators.description`,{service:z(i),developerURL:z(a),apiKeyURL:z(o)})),U(e,n)},$$slots:{default:!0}})}k()}var ldt=B(`<!> <!> <!> <!> <!>`,1);function udt(e,t){O(t,!0);var n=ldt(),r=P(n);fC(r,{get show(){return l2.current.saved},set show(e){l2.current.saved=e},children:(e,t)=>{bx(e,{status:`success`,children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(l2.current.published?`entry_saved_and_published`:`entry_saved`,{values:{count:l2.current.count}})]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}});var i=I(r,2);fC(i,{get show(){return l2.current.deletionCancelled},set show(e){l2.current.deletionCancelled=e},children:(e,t)=>{bx(e,{status:`success`,children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(`workflow.deletion_cancelled`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}});var a=I(i,2);fC(a,{get show(){return l2.current.discarded},set show(e){l2.current.discarded=e},children:(e,t)=>{bx(e,{status:`success`,children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(`workflow.changes_discarded`,{values:{count:l2.current.count}})]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}});var o=I(a,2);fC(o,{get show(){return l2.current.deleted},set show(e){l2.current.deleted=e},children:(e,t)=>{bx(e,{status:`success`,children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(l2.current.deletionPending?`workflow.deletion_pending`:`entries_deleted`,{values:{count:l2.current.count}})]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),fC(I(o,2),{get show(){return l2.current.alreadyPublished},set show(e){l2.current.alreadyPublished=e},children:(e,t)=>{bx(e,{status:`error`,children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(`open_authoring.entry_already_published`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),U(e,n),k()}function ddt(e,t){O(t,!0);let n=j(!!Up.current.length);fC(e,{get show(){return z(n)},set show(e){M(n,e,!0)},children:(e,t)=>{bx(e,{status:`error`,children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(`entry_parse_errors`,{values:{count:Up.current.length}})]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),k()}var fdt=/^\/pages\/(?<id>[^/]+)$/,e9=tl(``),pdt=rl(()=>e9.current?Vd.get(e9.current):void 0),t9=rl(()=>[...Vd.values()]),mdt=e=>e.match(fdt)?.groups?.id??``,hdt=({id:e})=>`/pages/${e}`,gdt=e=>{e.newTab?Tq(e.url):x0(hdt(e))},_dt=B(`<!> <h2 role="none"> </h2> <!>`,1),vdt=B(`<div role="none" class="content svelte-gu8e5g"></div>`),ydt=B(`<iframe class="svelte-gu8e5g"></iframe>`),bdt={hash:`svelte-gu8e5g`,code:`.content.svelte-gu8e5g {flex:auto;overflow:auto;}iframe.svelte-gu8e5g {flex:auto;border:0;width:100%;}`};function xdt(e,t){O(t,!0),K(e,bdt);let n=A(()=>pdt.current),r=A(()=>z(n)&&!z(n).newTab?z(n):void 0),i=A(()=>z(r)?.label??Y(`page_not_found`)),a=A(()=>z(r)?.component),o=e=>t=>OJe(t,(0,mr.createElement)(e));L(()=>{z(r)||(d0.current=Y(`page_not_found`))}),B5(e,{get"aria-label"(){return z(i)},main:e=>{D5(e,{get"aria-label"(){return z(i)},primaryToolbar:e=>{IV(e,{variant:`primary`,children:(e,t)=>{var n=_dt(),r=P(n),a=e=>{x5(e,{onclick:()=>S0(`/menu`)})};G(r,e=>{PY.isSmallScreen&&e(a)});var o=I(r,2),s=F(o,!0);yS(I(o,2),{flex:!0}),R(()=>W(s,z(i))),U(e,n)},$$slots:{default:!0}})},mainContent:e=>{var t=H(),n=P(t),i=e=>{{let t=A(()=>Y(`page_not_found`));w5(e,{get message(){return z(t)}})}},s=e=>{var t=vdt();qo(t,()=>o(z(a))),U(e,t)},c=e=>{var t=ydt();R(()=>{q(t,`src`,z(r).url),q(t,`title`,z(r).label)}),U(e,t)};G(n,e=>{z(r)?z(a)?e(s,1):e(c,-1):e(i)}),U(e,t)},$$slots:{primaryToolbar:!0,mainContent:!0}})},$$slots:{main:!0}}),k()}var Sdt=[`file-cache`,`tree-cache`,`asset-thumbnails`,`asset-hashes`],Cdt=RegExp(`^(?:${[...Object.keys(bX),`test-repo`].join(`|`)}):`),wdt=async()=>{try{await(await navigator.storage.getDirectory()).removeEntry(`sveltia-cms-test`,{recursive:!0})}catch{}},Tdt=async()=>{let e=LX.current,{databaseName:t}=e?.repository??{};t&&await Sdt.reduce((e,n)=>e.then(()=>new hu(t,n).clear()),Promise.resolve()),e?.name===`test-repo`&&await wdt()},Edt=async()=>{let e=NX(LX.current),t=new Set(e?[e]:[]);try{(await globalThis.indexedDB.databases?.())?.forEach(({name:e})=>{e&&Cdt.test(e)&&t.add(e)})}catch{}return[...t]},Ddt=async e=>new Promise(t=>{let n=()=>t(),r=globalThis.indexedDB.deleteDatabase(e);r.onsuccess=n,r.onerror=n,r.onblocked=n}),Odt=async()=>{try{let e=(await _u.keys()).filter(e=>e.startsWith(`sveltia-cms.`)||Pu.includes(e));await Promise.all(e.map(e=>_u.delete(e)))}catch{}},kdt=async()=>{let e=await Edt();await Promise.all([...e.map(e=>Ddt(e)),Odt(),wdt()])},Adt=rl(()=>PY.isLargeScreen&&PY.hasMouse&&!PY.isLocalHost&&!!LX.current?.isGit&&!!Fu.account?.token),n9=tl(!1),jdt=async e=>{let t=z5();if(t)return(await t.get(`onboarding`)??{})[e]},r9=async(e,t)=>{let n=z5();if(!n)return;let r=await n.get(`onboarding`)??{};await n.set(`onboarding`,{...r,[e]:t})},Mdt={get:jdt,set:r9},i9=(e,t=Mdt)=>{let n=tl(!1);return{show:n,showIfNeeded:async()=>{n.current=!await t.get(e)},hide:()=>{n.current=!1,t.set(e,!0)}}},a9=i9(`sveltia-cms.demo-welcome-seen`,{get:async e=>{try{return await _u.get(e)}catch{return}},set:async(e,t)=>{try{await _u.set(e,t)}catch{}}}),Ndt=async()=>{MX(LX.current?.name)&&await a9.showIfNeeded()},Pdt=B(`<p class="svelte-isqcpj"> </p> <p class="svelte-isqcpj"> </p>`,1),Fdt={hash:`svelte-isqcpj`,code:`p.svelte-isqcpj {margin:0;&:not(:first-child) {margin-top:1em;}}`};function Idt(e,t){O(t,!0),K(e,Fdt),So(()=>{Ndt()});{let t=A(()=>Y(`demo_welcome.title`)),n=A(()=>Y(`demo_welcome.button_label`));SS(e,{get title(){return z(t)},size:`small`,get okLabel(){return z(n)},showCancel:!1,onClose:()=>{a9.hide()},get open(){return a9.show.current},set open(e){a9.show.current=e},children:(e,t)=>{var n=Pdt(),r=P(n),i=F(r,!0),a=F(I(r,2),!0);R((e,t)=>{W(i,e),W(a,t)},[()=>Y(`demo_welcome.description`),()=>Y(`demo_welcome.reset_hint`)]),U(e,n)},$$slots:{default:!0}})}k()}var Ldt=()=>!!document.querySelector(`script[src*="/@vite/client"]`),Rdt=B(`<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>`,1);function zdt(e,t){O(t,!0);let n=A(()=>IX.current===`local`&&Ldt());var r=Rdt(),i=P(r);ko(i,()=>({"--sui-infobar-message-justify-content":`center`})),Zx(i.lastChild,{get show(){return z(n)},status:`warning`,children:(e,t)=>{var n=H();Lo(P(n),()=>Ju(Y(`live_reload_warning`),`https://sveltiacms.app/en/docs/workflows/local#troubleshooting`)),U(e,n)},$$slots:{default:!0}}),D(i),U(e,r),k()}var Bdt=B(` <!> <!>`,1),Vdt=B(`<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>`,1);function Hdt(e,t){O(t,!0);let n=i9(`mobileCta`);L(()=>{n.showIfNeeded()});var r=Vdt(),i=P(r);ko(i,()=>({"--sui-infobar-message-justify-content":`center`})),Zx(i.lastChild,{get show(){return n.show.current},dismissible:!1,children:(e,t)=>{Ur();var r=Bdt(),i=P(r),a=I(i);{let e=A(()=>Y(`mobile_promo_button`));Xx(a,{variant:`link`,get label(){return z(e)},onclick:()=>{n9.current=!0,n.hide()}})}var o=I(a,2);{let e=A(()=>Y(`later`));Xx(o,{variant:`link`,get label(){return z(e)},onclick:()=>{n.hide()}})}R(e=>W(i,`${e??``} `),[()=>Y(`mobile_promo_title`)]),U(e,r)},$$slots:{default:!0}}),D(i),U(e,r),k()}var Udt=B(` <!> <!>`,1),Wdt=B(`<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>`,1);function Gdt(e,t){O(t,!0);let n=j(``),r=j(!1),i=!1,a=async()=>{if(await jdt(`newLanguageCta`))return;let e=Ec.current,t=navigator.language,[i]=t.split(`-`);t!==e&&i!==e&&(M(n,ic.find(e=>e===t)??ic.find(e=>e.split(`-`)[0]===i)??``,!0),z(n)&&z(n)!==e&&M(r,!0))},o=()=>{M(r,!1),r9(`newLanguageCta`,!0)};L(()=>{let{locale:e}=yu;eo(()=>{!i&&e&&(i=!0,e!==`auto`&&a())})});var s=Wdt(),c=P(s);ko(c,()=>({"--sui-infobar-message-justify-content":`center`})),Zx(c.lastChild,{get show(){return z(r)},dismissible:!1,children:(e,t)=>{Ur();var r=Udt(),i=P(r),a=I(i);{let e=A(()=>Y(`change_language`,{locale:z(n)}));Xx(a,{variant:`link`,get label(){return z(e)},onclick:()=>{yu.locale=z(n),o()}})}var s=I(a,2);{let e=A(()=>Y(`later`,{locale:z(n)}));Xx(s,{variant:`link`,get label(){return z(e)},onclick:()=>{o()}})}R(e=>W(i,`${e??``} `),[()=>Y(`new_language_available`,{locale:z(n),values:{locale:Of(z(n),{displayLocale:z(n)})}})]),U(e,r)},$$slots:{default:!0}}),D(c),U(e,s),k()}var Kdt=({reason:e,detail:t=``})=>e===`operation_in_progress`?Y(`local_git_skip_reasons.operation_in_progress.${t}`):Y(`local_git_skip_reasons.${e}`,{values:{path:t,message:t}}),qdt=({ready:e,reason:t,detail:n,branch:r,author:i})=>{if(!e)return Y(`prefs.developer.local_git.not_ready`,{values:{reason:Kdt({reason:t,detail:n})}});let{name:a,email:o}=i;return Y(`prefs.developer.local_git.ready`,{values:{branch:r.replace(/^refs\/heads\//,``),name:a,email:o}})};function Jdt(e,t){O(t,!0);let n=j(!1),r=DY.current;L(()=>{let e=DY.current;e&&e!==r&&(r=e,M(n,!0))});var i=H();Oo(P(i),()=>DY.current,e=>{var t=H(),r=P(t),i=e=>{fC(e,{get show(){return z(n)},set show(e){M(n,e,!0)},children:(e,t)=>{bx(e,{status:`warning`,children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(`local_git_not_committed`,{values:{reason:Kdt(DY.current)}})]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}})};G(r,e=>{DY.current&&e(i)}),U(e,t)}),U(e,i),k()}function Ydt(e,t){O(t,!0),So(()=>{d0.current=Y(`page_not_found`)});{let t=e=>{D5(e,{mainContent:e=>{{let t=A(()=>Y(`page_not_found`));w5(e,{get message(){return z(t)}})}},$$slots:{mainContent:!0}})},n=A(()=>Y(`page_not_found`));B5(e,{get"aria-label"(){return z(n)},main:t,$$slots:{main:!0}})}k()}var Xdt=({selectedPageName:e,searchMode:t,hasAssets:n,assetsLink:r,workflowEnabled:i,workflowLabelKey:a,customPages:o,selectedCustomPageId:s,isSmallScreen:c})=>{let l=[{key:`collections`,label:Y(`contents`),icon:`article`,link:`/collections`,selected:e===`collections`||t===`contents`}];return n&&l.push({key:`assets`,label:Y(`assets`),icon:`photo`,link:r,selected:e===`assets`||t===`assets`}),i&&l.push({key:`workflow`,label:Y(a),icon:`rebase_edit`,link:`/workflow`,selected:e===`workflow`}),o.forEach(e=>{l.push({key:`pages/${e.id}`,label:e.label,icon:e.icon,link:hdt(e),selected:s===e.id})}),c&&l.push({key:`menu`,label:Y(`menu`),icon:`menu`,link:`/menu`,selected:e===`menu`}),l},Zdt=B(`<div role="none" class="wrapper svelte-t2r4ty"><!> <!></div>`),Qdt={hash:`svelte-t2r4ty`,code:`.wrapper.svelte-t2r4ty {display:contents;.sui.select-button-group {gap:4px;
@media (width < 768px) {justify-content:space-evenly;width:100%;
}}.sui.button {border-radius:var(--sui-button-medium-border-radius) !important;}}`};function $dt(e,t){O(t,!0),K(e,Qdt);let n=A(()=>PY.isSmallScreen?`/assets`:g1.current?f1(g1.current):Sy.current.length?Kl(`/assets/${wy.current?.internalPath??`-/all`}`):f1(d1.current[0]??u1)),r=A(()=>PY.isSmallScreen?[]:t9.current),i=A(()=>z(r).filter(({newTab:e})=>e)),a=A(()=>Xdt({selectedPageName:u0.current,searchMode:O5.current,hasAssets:!!(Sy.current.length||d1.current.length||l1.current.length),assetsLink:z(n),workflowEnabled:EZ.current,workflowLabelKey:TZ.current,customPages:z(r).filter(({newTab:e})=>!e),selectedCustomPageId:e9.current,isSmallScreen:PY.isSmallScreen}));var o=Zdt(),s=N(o);{let e=A(()=>Y(`switch_page`));pS(s,{get ariaLabel(){return z(e)},"aria-controls":`page-container`,children:(e,t)=>{var n=H();No(P(n),19,()=>z(a),({key:e,label:t,icon:n,link:r,selected:i})=>e,(e,t,n)=>{let r=()=>z(t).label,i=()=>z(t).icon,a=()=>z(t).link,o=()=>z(t).selected;{let t=e=>{gx(e,{get name(){return i()}})},s=A(()=>z(n)<9?`Alt+${z(n)+1}`:void 0);mS(e,{variant:`ghost`,iconic:!0,get selected(){return o()},get"aria-label"(){return r()},get keyShortcuts(){return z(s)},onclick:()=>{x0(a())},startIcon:t,$$slots:{startIcon:!0}})}}),U(e,n)},$$slots:{default:!0}})}No(I(s,2),17,()=>z(i),e=>e.id,(e,t)=>{Xx(e,{variant:`ghost`,iconic:!0,get"aria-label"(){return z(t).label},onclick:()=>{gdt(z(t))},startIcon:e=>{gx(e,{get name(){return z(t).icon}})},$$slots:{startIcon:!0}})}),D(o),U(e,o),k()}var eft=B(`<div role="none" class="buttons"><!></div>`);function tft(e,t){O(t,!0),Bde(e,{get inert(){return l0.current},children:(e,t)=>{{let t=A(()=>Y(`global`));IV(e,{variant:`primary`,get ariaLabel(){return z(t)},children:(e,t)=>{var n=eft();$dt(N(n),{}),D(n),U(e,n)},$$slots:{default:!0}})}},$$slots:{default:!0}}),k()}var o9=tl(null),nft=e=>{e.preventDefault(),o9.current=e},rft=()=>{o9.current=null},ift=()=>(window.addEventListener(`beforeinstallprompt`,nft),window.addEventListener(`appinstalled`,rft),()=>{window.removeEventListener(`beforeinstallprompt`,nft),window.removeEventListener(`appinstalled`,rft)}),aft=async()=>{let e=o9.current;e&&(o9.current=null,await e.prompt())};function oft(e,t){O(t,!0);var n=H(),r=P(n),i=e=>{{let t=A(()=>Y(`install_as_app`));JS(e,{get label(){return z(t)},onclick:async()=>{await aft()}})}};G(r,e=>{o9.current&&e(i)}),U(e,n),k()}var sft=B(`<kbd class="svelte-13q15u"> </kbd>`),cft=B(`<!> <!>`,1),lft=B(`<div role="none" class="wrapper svelte-13q15u"><!></div>`),uft={hash:`svelte-13q15u`,code:`.wrapper.svelte-13q15u {display:contents;.table-row {display:flex;align-items:center;gap:16px;padding:8px 0;border-top:1px solid var(--sui-secondary-border-color);&:last-child {border-bottom:1px solid var(--sui-secondary-border-color);}.feature {flex:auto;}.keys {display:flex;gap:8px;}}}kbd.svelte-13q15u {display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;border-color:var(--sui-primary-accent-color);border-radius:4px;padding:0 8px;height:32px;min-width:32px;background-color:var(--sui-tertiary-background-color);font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);}`};function dft(e,t){O(t,!0),K(e,uft);let n=J(t,`open`,15,!1),r=J(t,`onClose`,3,void 0),i=[{feature:`view_content_library`,keys:`Alt+1`},{feature:`view_asset_library`,keys:`Alt+2`},{feature:`search`,keys:`Accel+F`},{feature:`create_entry`,keys:`Accel+E`},{feature:`save_entry`,keys:`Accel+S`},{feature:`cancel_editing`,keys:`Escape`}];{let t=A(()=>Y(`keyboard_shortcuts`));SS(e,{get title(){return z(t)},size:`small`,showOk:!1,showCancel:!1,showClose:!0,style:`--sui-dialog-small-content-max-height:auto`,onClose:()=>{r()?.()},get open(){return n()},set open(e){n(e)},children:(e,t)=>{var n=lft(),r=N(n);{let e=A(()=>Y(`keyboard_shortcuts`));vhe(r,{get ariaLabel(){return z(e)},children:(e,t)=>{var n=H();No(P(n),17,()=>i,({feature:e,keys:t})=>t,(e,t)=>{let n=()=>z(t).feature,r=()=>z(t).keys;mhe(e,{children:(e,t)=>{var i=cft(),a=P(i);fhe(a,{class:`feature`,children:(e,t)=>{Ur();var r=V();R(e=>W(r,e),[()=>Y(`keyboard_shortcuts_.${n()}`)]),U(e,r)},$$slots:{default:!0}}),fhe(I(a,2),{class:`keys`,children:(e,t)=>{var n=H();No(P(n),16,()=>r().split(`+`),e=>e,(e,t)=>{var n=sft(),r=F(n,!0);R(e=>W(r,e),[()=>t.replace(`Accel`,PY.isMacOS?`⌘`:`Ctrl`)]),U(e,n)}),U(e,n)},$$slots:{default:!0}}),U(e,i)},$$slots:{default:!0}})}),U(e,n)},$$slots:{default:!0}})}D(n),U(e,n)},$$slots:{default:!0}})}k()}var fft=B(`<!> <!>`,1);function pft(e,t){O(t,!0);let n=j(!1);var r=fft(),i=P(r),a=e=>{{let t=A(()=>Y(`keyboard_shortcuts`));JS(e,{get label(){return z(t)},onclick:()=>{M(n,!0)}})}};G(i,e=>{PY.hasMouse&&e(a)}),dft(I(i,2),{onClose:()=>{t.menuButton?.focus()},get open(){return z(n)},set open(e){M(n,e,!0)}}),U(e,r),k()}function s9(e,t){let n=J(t,`defaultValue`,3,!0),r=yu;var i=()=>!!(r[t.key]??n()),a=e=>{r[t.key]=e};aC(e,{get checked(){return i()},set checked(e){a(e)},get label(){return t.label}})}var mft=B(`<section><h3> </h3> <p> </p> <div role="none"><!></div></section>`);function hft(e,t){O(t,!0);var n=mft(),r=N(n),i=F(r,!0),a=I(r,2),o=F(a,!0),s=I(a,2),c=N(s);{let e=A(()=>Y(`prefs.accessibility.underline_links.switch_label`));s9(c,{key:`underlineLinks`,get label(){return z(e)}})}D(s),D(n),R((e,t)=>{W(i,e),W(o,t)},[()=>Y(`prefs.accessibility.underline_links.title`),()=>Y(`prefs.accessibility.underline_links.description`)]),U(e,n),k()}function gft(e,t){O(t,!0);let n=J(t,`onChange`,3,void 0),r=A(()=>t.service.apiKeyPattern),i=j(``);So(()=>{M(i,yu.apiKeys?.[t.serviceId]??``,!0)}),sH(e,{flex:!0,autocomplete:`off`,spellcheck:`false`,get ariaLabel(){return t.ariaLabel},onchange:()=>{let e=z(i).trim(),a=!!e&&!!z(r)&&!z(r).test(e);j0(t.serviceId,a?``:e),n()?.({message:Y(a?`prefs.changes.api_key_invalid`:e?`prefs.changes.api_key_saved`:`prefs.changes.api_key_removed`),status:a?`error`:`success`})},get value(){return z(i)},set value(e){M(i,e,!0)}}),k()}var _ft=B(`<section><h4> </h4> <div role="none"><!></div></section>`),vft=B(`<section><h3> </h3> <p><!></p> <!></section>`);function c9(e,t){O(t,!0);let n=J(t,`docsURL`,3,void 0),r=J(t,`onChange`,3,void 0);var i=vft(),a=N(i),o=F(a,!0),s=I(a,2),c=N(s),l=e=>{var r=H();Lo(P(r),()=>Ju(t.description,n())),U(e,r)},u=e=>{var n=V();R(()=>W(n,t.description)),U(e,n)};G(c,e=>{n()?e(l):e(u,-1)}),D(s),No(I(s,2),17,()=>t.entries,([e,t])=>e,(e,n)=>{var i=A(()=>Er(z(n),2));let a=()=>z(i)[0],o=()=>z(i)[1],s=A(()=>o().serviceLabel);var c=_ft(),l=N(c),u=F(l,!0),d=I(l,2),f=N(d);{let e=A(()=>t.getFieldLabel(z(s)));gft(f,{get serviceId(){return a()},get service(){return o()},get ariaLabel(){return z(e)},get onChange(){return r()}})}D(d),D(c),R(()=>W(u,z(s))),U(e,c)}),D(i),R(()=>W(o,t.title)),U(e,i),k()}function yft(e,t){O(t,!0);let n=J(t,`onChange`,3,void 0);{let t=A(()=>Y(`prefs.ai.api_keys.title`)),r=A(()=>Y(`prefs.ai.api_keys.description`)),i=A(()=>Object.entries(rQe));c9(e,{get title(){return z(t)},get description(){return z(r)},get entries(){return z(i)},getFieldLabel:e=>Y(`prefs.ai.field_label`,{values:{service:e}}),get onChange(){return n()}})}k()}var bft=B(`<section><h3> </h3> <div role="none"><!></div></section>`);function xft(e,t){O(t,!0);var n=bft(),r=N(n),i=F(r,!0),a=I(r,2),o=N(a);{let e=A(()=>Y(`prefs.appearance.select_theme`));pS(o,{get ariaLabel(){return z(e)},onChange:e=>{yu.theme=e.detail.value},children:(e,t)=>{var n=H();No(P(n),16,()=>[`auto`,`dark`,`light`],e=>e,(e,t)=>{{let n=A(()=>Y(t===`auto`?`automatic`:`prefs.theme.${t}`)),r=A(()=>!yu.theme&&t===`auto`||yu.theme===t);mS(e,{variant:`tertiary`,get label(){return z(n)},get value(){return t},get selected(){return z(r)}})}}),U(e,n)},$$slots:{default:!0}})}D(a),D(n),R(e=>W(i,e),[()=>Y(`prefs.appearance.theme`)]),U(e,n),k()}var Sft=B(`<section><h3> </h3> <div role="none"><!></div> <div role="none"><!></div> <div role="none"><!></div></section>`);function Cft(e,t){O(t,!0);var n=Sft(),r=N(n),i=F(r,!0),a=I(r,2),o=N(a);{let e=A(()=>Y(`prefs.contents.editor.use_draft_backup.switch_label`));s9(o,{key:`useDraftBackup`,get label(){return z(e)}})}D(a);var s=I(a,2),c=N(s);{let e=A(()=>Y(`prefs.contents.editor.close_on_save.switch_label`));s9(c,{key:`closeOnSave`,get label(){return z(e)}})}D(s);var l=I(s,2),u=N(l);{let e=A(()=>Y(`prefs.contents.editor.close_with_escape.switch_label`));s9(u,{key:`closeWithEscape`,get label(){return z(e)}})}D(l),D(n),R(e=>W(i,e),[()=>Y(`prefs.contents.editor.title`)]),U(e,n),k()}var wft=B(`<section><h3> </h3> <p> </p> <div role="none"><!></div> <p> </p> <div role="none"><!></div></section> <!> <!>`,1);function Tft(e,t){O(t,!0);let n=j(!1),r=j(!1),i=async()=>{await Tdt(),window.location.reload()},a=async()=>{await kdt(),window.location.reload()};var o=wft(),s=P(o),c=N(s),l=F(c,!0),u=I(c,2),d=F(u,!0),f=I(u,2),p=N(f);{let e=A(()=>Y(`prefs.data.clear_data.file_cache.button_label`));Xx(p,{variant:`tertiary`,get label(){return z(e)},onclick:()=>{M(n,!0)}})}D(f);var m=I(f,2),h=F(m,!0),g=I(m,2),_=N(g);{let e=A(()=>Y(`prefs.data.clear_data.all_data.button_label`));Xx(_,{variant:`tertiary`,get label(){return z(e)},onclick:()=>{M(r,!0)}})}D(g),D(s);var v=I(s,2);{let e=A(()=>Y(`prefs.data.clear_data.file_cache.button_label`)),t=A(()=>Y(`prefs.data.clear_data.file_cache.button_label`));wS(v,{get title(){return z(e)},get okLabel(){return z(t)},onOk:i,get open(){return z(n)},set open(e){M(n,e,!0)},children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(`prefs.data.clear_data.file_cache.confirmation`)]),U(e,n)},$$slots:{default:!0}})}var y=I(v,2);{let e=A(()=>Y(`prefs.data.clear_data.all_data.button_label`)),t=A(()=>Y(`prefs.data.clear_data.all_data.button_label`));wS(y,{get title(){return z(e)},get okLabel(){return z(t)},onOk:a,get open(){return z(r)},set open(e){M(r,e,!0)},children:(e,t)=>{Ur();var n=V();R(e=>W(n,e),[()=>Y(`prefs.data.clear_data.all_data.confirmation`)]),U(e,n)},$$slots:{default:!0}})}R((e,t,n)=>{W(l,e),W(d,t),W(h,n)},[()=>Y(`prefs.data.clear_data.title`),()=>Y(`prefs.data.clear_data.file_cache.description`),()=>Y(`prefs.data.clear_data.all_data.description`)]),U(e,o),k()}var Eft=B(`<div role="none"><!></div>`),Dft=B(`<p> </p>`),Oft=B(`<section><h3> </h3> <p> </p> <div role="none"><!></div> <!></section>`),kft=B(`<section><h3> </h3> <p> </p> <!> <!></section>`),Aft=B(`<section><h3> </h3> <p> </p> <div role="none"><!></div></section> <!> <!>`,1);function jft(e,t){O(t,!0);let n=(e,t=Cr,n=Cr,i=Cr,a=Cr)=>{var o=Eft();NS(N(o),{dir:`ltr`,flex:!0,get ariaLabel(){return n()},showInlineLabel:!0,onchange:()=>{r()?.({message:yu[t()]?i():a()})},get value(){return yu[t()]},set value(e){yu[t()]=e}}),D(o),U(e,o)},r=J(t,`onChange`,3,void 0),i=async()=>await yLe();var a=Aft(),o=P(a),s=N(o),c=F(s,!0),l=I(s,2),u=F(l,!0),d=I(l,2),f=N(d);{let e=A(()=>Y(`prefs.developer.developer_mode.switch_label`));s9(f,{key:`devModeEnabled`,get label(){return z(e)},defaultValue:!1})}D(d),D(o);var p=I(o,2),m=e=>{var t=Oft(),n=N(t),r=F(n,!0),a=I(n,2),o=F(a,!0),s=I(a,2),c=N(s);{let e=A(()=>Y(`prefs.developer.local_git.switch_label`));s9(c,{key:`localGitCommits`,get label(){return z(e)},defaultValue:!1})}D(s);var l=I(s,2),u=e=>{var t=Eft();Do(N(t),i,e=>{var t=Dft(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`prefs.developer.local_git.checking`)]),U(e,t)},(e,t)=>{{let n=A(()=>z(t).ready?`success`:`warning`);bx(e,{get status(){return z(n)},children:(e,n)=>{Ur();var r=V();R(e=>W(r,e),[()=>qdt(z(t))]),U(e,r)},$$slots:{default:!0}})}}),D(t),U(e,t)};G(l,e=>{yu.localGitCommits&&e(u)}),D(t),R((e,t)=>{W(r,e),W(o,t)},[()=>Y(`prefs.developer.local_git.title`),()=>Y(`prefs.developer.local_git.description`)]),U(e,t)};G(p,e=>{IX.current===`local`&&e(m)});var h=I(p,2),g=e=>{var t=kft(),r=N(t),i=F(r,!0),a=I(r,2),o=F(a,!0),s=I(a,2);{let e=A(()=>Y(`prefs.developer.deploy_hook.url.field_label`)),t=A(()=>Y(`prefs.developer.deploy_hook.url.saved`)),r=A(()=>Y(`prefs.developer.deploy_hook.url.removed`));n(s,()=>`deployHookURL`,()=>z(e),()=>z(t),()=>z(r))}var c=I(s,2);{let e=A(()=>Y(`prefs.developer.deploy_hook.auth.field_label`)),t=A(()=>Y(`prefs.developer.deploy_hook.auth.saved`)),r=A(()=>Y(`prefs.developer.deploy_hook.auth.removed`));n(c,()=>`deployHookAuthHeader`,()=>z(e),()=>z(t),()=>z(r))}D(t),R((e,t)=>{W(i,e),W(o,t)},[()=>Y(`prefs.developer.deploy_hook.title`),()=>Y(`prefs.developer.deploy_hook.description`)]),U(e,t)};G(h,e=>{U8.current&&e(g)}),R((e,t)=>{W(c,e),W(u,t)},[()=>Y(`prefs.developer.developer_mode.title`),()=>Y(`prefs.developer.developer_mode.description`)]),U(e,a),k()}var Mft=B(`<section><h3> </h3> <div role="none"><!></div></section> <!>`,1);function Nft(e,t){O(t,!0);let n=J(t,`onChange`,3,void 0);var r=Mft(),i=P(r),a=N(i),o=F(a,!0),s=I(a,2);odt(N(s),{}),D(s),D(i);var c=I(i,2);{let e=A(()=>Y(`prefs.i18n.translators.api_keys.title`)),t=A(()=>Y(`prefs.i18n.translators.api_keys.description`)),r=A(()=>Object.entries(OQe));c9(c,{get title(){return z(e)},get description(){return z(t)},get docsURL(){return`https://sveltiacms.app/en/docs/integrations/translations`},get entries(){return z(r)},getFieldLabel:e=>Y(`prefs.i18n.translators.field_label`,{values:{service:e}}),get onChange(){return n()}})}R(e=>W(o,e),[()=>Y(`prefs.i18n.translators.default.title`)]),U(e,r),k()}var Pft=B(`<!> <!> <!>`,1),Fft=B(`<section><h3> </h3> <div role="none"><!></div></section> <!>`,1);function Ift(e,t){O(t,!0);let n=A(()=>ic.map(e=>{let t=Of(e,{displayLocale:Ec.current})??e,n=Of(e,{displayLocale:e})??e,r=t===n?t:`${t} — ${n}`;return{value:e,searchValue:`${r} (${e})`,label:r}}).sort((e,t)=>e.label.localeCompare(t.label))),r=A(()=>yu.locale??`auto`),i=j(``),a=A(()=>Of(z(i))??z(i));L(()=>{h5.current&&M(i,h5.current,!0)});var o=Fft(),s=P(o),c=N(s),l=F(c,!0),u=I(c,2);Oo(N(u),()=>Ec.current,e=>{{let t=A(()=>Y(`prefs.language.ui_language.select_language`));iC(e,{get ariaLabel(){return z(t)},get value(){return z(r)},onChange:e=>{yu.locale=e.detail.value,r9(`newLanguageCta`,!0)},children:(e,t)=>{var i=Pft(),a=P(i);{let e=A(()=>Y(`automatic`)),t=A(()=>z(r)===`auto`);KS(a,{get value(){return`auto`},get label(){return z(e)},get selected(){return z(t)}})}var o=I(a,2);FS(o,{}),No(I(o,2),17,()=>z(n),({value:e,searchValue:t,label:n})=>e,(e,t)=>{let n=()=>z(t).value,i=()=>z(t).searchValue,a=()=>z(t).label;{let t=A(()=>n()===z(r));KS(e,{get value(){return n()},get searchValue(){return i()},get label(){return a()},get selected(){return z(t)}})}}),U(e,i)},$$slots:{default:!0}})}}),D(u),D(s);var d=I(s,2);{let e=A(()=>!!h5.current);fC(d,{get show(){return z(e)},duration:0,children:(e,t)=>{bx(e,{status:`info`,children:(e,t)=>{var n=H(),r=P(n),i=e=>{var t=V();R(e=>W(t,e),[()=>Y(`switching_language`,{values:{locale:z(a)}})]),U(e,t)};G(r,e=>{z(a)&&e(i)}),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}})}R(e=>W(l,e),[()=>Y(`prefs.language.ui_language.title`)]),U(e,o),k()}var Lft=B(`<!> <!>`,1);function Rft(e,t){O(t,!0);let n=J(t,`onChange`,3,void 0),r=A(()=>{let{providers:e=[]}=r2();return Object.entries(n2).filter(([t,{authType:n}])=>e.includes(t)&&n!==`none`)}),i=A(()=>Object.entries(m$).filter(([,{isEnabled:e,authType:t}])=>(e?.()??!0)&&t!==`widget`));var a=Lft(),o=P(a);{let e=A(()=>Y(`prefs.media.cloud_storage.api_keys.title`)),t=A(()=>z(i).length?Y(`prefs.media.cloud_storage.api_keys.description`):Y(`prefs.media.cloud_storage.no_services`));c9(o,{get title(){return z(e)},get description(){return z(t)},get docsURL(){return`https://sveltiacms.app/en/docs/media`},get entries(){return z(i)},getFieldLabel:e=>Y(`prefs.media.cloud_storage.field_label`,{values:{service:e}}),get onChange(){return n()}})}var s=I(o,2);{let e=A(()=>Y(`prefs.media.stock_photos.api_keys.title`)),t=A(()=>z(r).length?Y(`prefs.media.stock_photos.api_keys.description`):Y(`prefs.media.stock_photos.no_services`));c9(s,{get title(){return z(e)},get description(){return z(t)},get docsURL(){return`https://sveltiacms.app/en/docs/integrations/stock-photos`},get entries(){return z(r)},getFieldLabel:e=>Y(`prefs.media.stock_photos.field_label`,{values:{service:e}}),get onChange(){return n()}})}U(e,a),k()}var l9=rl(()=>[{key:`appearance`,icon:`palette`,component:xft},{key:`language`,icon:`language`,component:Ift},{key:`contents`,icon:`library_books`,component:Cft},...(Dl.current?.i18n?.locales?.length??0)>1?[{key:`i18n`,icon:`translate`,component:Nft}]:[],{key:`media`,icon:`photo_library`,component:Rft},{key:`ai`,icon:`auto_awesome`,component:yft},{key:`accessibility`,icon:`accessibility_new`,component:hft},{key:`developer`,icon:`code_xml`,component:jft},{key:`data`,icon:`database`,component:Tft}]),zft=B(`<div class="container svelte-1attlke" role="none"><!></div> <!>`,1),Bft={hash:`svelte-1attlke`,code:`.container.svelte-1attlke {display:contents;section:not(:first-child) {margin:16px 0 0;}p {margin-top:0;}h3 {font-size:inherit;& ~ div {margin:8px 0 0;}& ~ p {margin:8px 0 0;color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);}}h4 {margin-bottom:4px;font-size:var(--sui-font-size-small);}}`};function Vft(e,t){K(e,Bft);let n=j(``),r=j(`success`),i=j(!1);var a=zft(),o=P(a);Ro(N(o),()=>t.Panel,(e,t)=>{t(e,{onChange:({message:e,status:t})=>{M(n,e,!0),M(r,t??`success`,!0),M(i,!0)}})}),D(o),fC(I(o,2),{get show(){return z(i)},set show(e){M(i,e,!0)},children:(e,t)=>{bx(e,{get status(){return z(r)},children:(e,t)=>{Ur();var r=V();R(()=>W(r,z(n))),U(e,r)},$$slots:{default:!0}})},$$slots:{default:!0}}),U(e,a)}var Hft=B(`<div role="none" class="wrapper svelte-pwxwga"><!> <!></div>`),Uft={hash:`svelte-pwxwga`,code:`.wrapper.svelte-pwxwga {display:flex;.sui.tab-list {flex:none;}.sui.tab-panel {flex:auto;border-width:0;}}`};function Wft(e,t){O(t,!0),K(e,Uft);let n=J(t,`open`,15,!1),r=J(t,`onClose`,3,void 0),i=j(`appearance`);{let t=A(()=>Y(`settings`));SS(e,{get title(){return z(t)},size:`large`,showOk:!1,showCancel:!1,showClose:!0,onClose:()=>{r()?.()},get open(){return n()},set open(e){n(e)},children:(e,t)=>{var n=Hft(),r=N(n);{let e=A(()=>Y(`categories`));Che(r,{orientation:`vertical`,get ariaLabel(){return z(e)},children:(e,t)=>{var n=H();No(P(n),17,()=>l9.current,({key:e,icon:t})=>e,(e,t)=>{let n=()=>z(t).key,r=()=>z(t).icon;{let t=e=>{gx(e,{get name(){return r()}})},a=A(()=>Y(`prefs.${n()}.title`)),o=A(()=>n()===z(i));khe(e,{get label(){return z(a)},get selected(){return z(o)},get"aria-controls"(){return`prefs-tab-${n()??``}`},onSelect:()=>{M(i,n(),!0)},startIcon:t,$$slots:{startIcon:!0}})}}),U(e,n)},$$slots:{default:!0}})}No(I(r,2),17,()=>l9.current,({key:e,component:t})=>e,(e,t)=>{let n=()=>z(t).key,r=()=>z(t).component;Dhe(e,{get id(){return`prefs-tab-${n()??``}`},children:(e,t)=>{Vft(e,{get Panel(){return r()}})},$$slots:{default:!0}})}),D(n),U(e,n)},$$slots:{default:!0}})}k()}var Gft=B(`<!> <!>`,1),Kft=B(`<!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!>`,1);function qft(e,t){O(t,!0);let n=j(!1),r=A(()=>IX.current===`local`),i=A(()=>IX.current===`test-repo`),a=A(()=>MX(IX.current));var o=Gft(),s=P(o);{let e=A(()=>Y(`account`));qS(s,{get ariaLabel(){return z(e)},children:(e,o)=>{var s=Kft(),c=P(s);{let e=A(()=>z(r)?Y(`working_with_local_repo`):z(a)?Y(`working_in_demo_mode`):z(i)?Y(`working_with_test_repo`):Y(`signed_in_as_x`,{values:{name:Fu.account?.login}})),t=A(()=>z(r)||z(i));JS(c,{get label(){return z(e)},get disabled(){return z(t)},onclick:()=>{Tq(Fu.account?.profileURL)}})}var l=I(c,2);FS(l,{});var u=I(l,2);{let e=A(()=>Y(`live_site`));JS(u,{get label(){return z(e)},onclick:()=>{C0()}})}var d=I(u,2),f=e=>{var t=Gft(),n=P(t);{let e=A(()=>Y(`git_repository`)),t=A(()=>!LX.current?.repository?.treeBaseURL);JS(n,{get label(){return z(e)},get disabled(){return z(t)},onclick:()=>{Tq(LX.current?.repository?.treeBaseURL)}})}var r=I(n,2);{let e=A(()=>Y(`cms_config`));JS(r,{get label(){return z(e)},onclick:()=>{x0(`/config`,{transitionType:`forwards`})}})}U(e,t)};G(d,e=>{yu.devModeEnabled&&e(f)});var p=I(d,2);FS(p,{});var m=I(p,2);{let e=A(()=>Y(`settings`));JS(m,{get label(){return z(e)},onclick:()=>{PY.isSmallScreen?x0(`/settings`,{transitionType:`forwards`}):M(n,!0)}})}var h=I(m,2),g=e=>{pft(e,{get menuButton(){return t.menuButton}})};G(h,e=>{yu.devModeEnabled||e(g)});var _=I(h,2),v=e=>{{let t=A(()=>Y(`sign_in_with_mobile`));JS(e,{get label(){return z(t)},onclick:()=>{n9.current=!0}})}};G(_,e=>{Adt.current&&e(v)});var y=I(_,2);oft(y,{});var b=I(y,2);FS(b,{});var x=I(b,2);{let e=A(()=>Y(`sign_out`));JS(x,{get label(){return z(e)},onclick:async()=>{window.requestAnimationFrame(()=>{f7e()})}})}U(e,s)},$$slots:{default:!0}})}Wft(I(s,2),{onClose:()=>{t.menuButton?.focus()},get open(){return z(n)},set open(e){M(n,e,!0)}}),U(e,o),k()}var Jft=B(`<img class="avatar svelte-q0ng4j" loading="lazy" alt=""/>`),Yft=B(`<div role="none" class="wrapper svelte-q0ng4j"><!></div>`),Xft={hash:`svelte-q0ng4j`,code:`.wrapper.svelte-q0ng4j {display:contents;button.avatar {border-width:0;background-color:transparent;}}.avatar.svelte-q0ng4j {width:32px;height:32px;border-radius:32px;object-fit:cover;}`};function Zft(e,t){O(t,!0),K(e,Xft);let n=j(void 0),r=A(()=>IX.current===`local`),i=A(()=>!!Fu.account?.avatarURL);var a=Yft(),o=N(a);{let e=e=>{var t=H(),n=P(t),a=e=>{gx(e,{name:`arrow_drop_down`,class:`small-arrow`})},o=e=>{var t=Jft();R(()=>q(t,`src`,Fu.account?.avatarURL)),U(e,t)},s=e=>{gx(e,{name:`account_circle`})};G(n,e=>{z(r)?e(a):z(i)?e(o,1):e(s,-1)}),U(e,t)},t=e=>{qft(e,{get menuButton(){return z(n)}})},a=A(()=>!z(r)),s=A(()=>z(r)?Y(`local_workflow.indicator`):void 0),c=A(()=>z(i)?`avatar`:``),l=A(()=>Y(`show_account_menu`));gs(hS(o,{variant:`ghost`,get iconic(){return z(a)},get label(){return z(s)},get class(){return z(c)},popupPosition:`bottom-right`,get"aria-label"(){return z(l)},endIcon:e,popup:t,$$slots:{endIcon:!0,popup:!0}}),e=>M(n,e,!0),()=>z(n))}D(a),U(e,a),k()}var Qft=B(`<!> <!>`,1);function $ft(e,t){O(t,!0);let n=A(()=>Gf({visible:!0,type:`entry`})),r=A(()=>z(n).map(e=>{let{name:t,label:n,label_singular:r,create:i=!0,limit:a=1/0}=e;return{name:t,label:r||n||t,disabled:!i||iQ({collection:e})||a<1/0&&u8(t)>=a}})),i=A(()=>ky.current||iQ()),a=A(()=>z(i)&&z(r).every(({disabled:e})=>e));{let t=e=>{gx(e,{name:`add`})},n=e=>{{let t=A(()=>Y(`create_entry_or_assets`));qS(e,{get ariaLabel(){return z(t)},children:(e,t)=>{var n=Qft(),a=P(n),o=e=>{var t=Qft(),n=P(t);No(n,17,()=>z(r),({name:e,label:t,disabled:n})=>e,(e,t)=>{let n=()=>z(t).name,r=()=>z(t).label,i=()=>z(t).disabled;JS(e,{get label(){return r()},get disabled(){return i()},onclick:()=>{x0(`/collections/${n()}/new`,{transitionType:`forwards`})}})}),FS(I(n,2),{}),U(e,t)};G(a,e=>{z(r).length&&e(o)});var s=I(a,2);{let e=A(()=>Y(`assets`));JS(s,{get label(){return z(e)},get disabled(){return z(i)},onclick:async()=>{x0(`/assets`,{transitionType:`forwards`}),await Iu(100),H1.current=!0}})}U(e,n)},$$slots:{default:!0}})}},o=A(()=>Y(`create_entry_or_assets`));hS(e,{variant:`ghost`,iconic:!0,get disabled(){return z(a)},popupPosition:`bottom-right`,get"aria-label"(){return z(o)},endIcon:t,popup:n,$$slots:{endIcon:!0,popup:!0}})}k()}var ept=B(`<span class="version svelte-wmw2gz"> </span>`),tpt={hash:`svelte-wmw2gz`,code:`.version.svelte-wmw2gz {border-radius:4px;padding:0 6px;color:var(--sui-secondary-foreground-color);background-color:var(--sui-selected-background-color);font-size:var(--sui-font-size-small);}`};function npt(e,t){O(t,!0),K(e,tpt);{let t=e=>{var t=H(),n=P(t),r=e=>{var t=ept(),n=F(t);R(e=>{q(t,`aria-label`,`(${e??``})`),W(n,`v0.266.0`)},[()=>Y(`version_x`,{values:{version:`0.266.0`}})]),U(e,t)};G(n,e=>{yu.devModeEnabled&&e(r)}),U(e,t)},n=A(()=>Y(`release_notes`));JS(e,{get label(){return z(n)},onclick:()=>{Tq(`https://github.com/sveltia/sveltia-cms/releases`)},endIcon:t,$$slots:{endIcon:!0}})}k()}var u9=(e,t=Cr,n=Cr)=>{{let r=A(()=>Y(t()));JS(e,{get label(){return z(r)},onclick:()=>{Tq(n())}})}},rpt=B(`<!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!>`,1),ipt=B(`<!> <!>`,1);function apt(e,t){O(t,!0);{let n=A(()=>Y(`help`));qS(e,{get ariaLabel(){return z(n)},children:(e,n)=>{var r=ipt(),i=P(r);pft(i,{get menuButton(){return t.menuButton}});var a=I(i,2),o=e=>{var t=rpt(),n=P(t);u9(n,()=>`documentation`,()=>`https://sveltiacms.app/en/docs`);var r=I(n,2);npt(r,{});var i=I(r,2);u9(i,()=>`announcements`,()=>`https://github.com/sveltia/sveltia-cms/discussions/categories/announcements`);var a=I(i,2);FS(a,{});var o=I(a,2);u9(o,()=>`report_issue`,()=>`https://github.com/sveltia/sveltia-cms/issues`);var s=I(o,2);u9(s,()=>`share_feedback`,()=>`https://github.com/sveltia/sveltia-cms/discussions/categories/ideas`);var c=I(s,2);u9(c,()=>`get_help`,()=>`https://github.com/sveltia/sveltia-cms/discussions/categories/q-a`);var l=I(c,2);u9(l,()=>`donate`,()=>`https://github.com/sponsors/kyoshino`);var u=I(l,2);FS(u,{});var d=I(u,2);u9(d,()=>`bluesky`,()=>`https://bsky.app/profile/sveltiacms.app`),u9(I(d,2),()=>`join_discord`,()=>`https://discord.com/invite/5hwCGqup5b`),U(e,t)};G(a,e=>{yu.devModeEnabled&&e(o)}),U(e,r)},$$slots:{default:!0}})}k()}var opt=B(`<div role="none" class="wrapper svelte-bzzge3"><!></div>`),spt={hash:`svelte-bzzge3`,code:`.wrapper.svelte-bzzge3 {display:contents;}`};function cpt(e,t){O(t,!0),K(e,spt);let n=j(void 0);var r=opt(),i=N(r);{let e=e=>{gx(e,{name:`help`})},t=e=>{apt(e,{get menuButton(){return z(n)}})},r=A(()=>Y(`show_help_menu`));gs(hS(i,{variant:`ghost`,iconic:!0,popupPosition:`bottom-right`,get"aria-label"(){return z(r)},endIcon:e,popup:t,$$slots:{endIcon:!0,popup:!0}}),e=>M(n,e,!0),()=>z(n))}D(r),U(e,r),k()}function lpt(e,t){O(t,!0);{let t=e=>{gx(e,{name:`notifications`})},n=A(()=>Y(`show_notifications`));Xx(e,{variant:`ghost`,iconic:!0,hidden:!0,get"aria-label"(){return z(n)},onclick:()=>{},startIcon:t,$$slots:{startIcon:!0}})}k()}var upt=B(`<img alt="" class="logo svelte-15c9hhi"/>`),dpt={hash:`svelte-15c9hhi`,code:`img.svelte-15c9hhi {width:24px;height:24px;object-fit:contain;}`};function fpt(e,t){O(t,!0),K(e,dpt);let n=A(()=>s5.current!==E7e&&(Dl.current?.logo?.show_in_header??!0));var r=H(),i=P(r),a=e=>{{let t=A(()=>Y(`visit_live_site`));Xx(e,{variant:`ghost`,iconic:!0,get"aria-label"(){return z(t)},onclick:()=>{C0()},children:(e,t)=>{var n=upt();R(()=>q(n,`src`,s5.current)),U(e,n)},$$slots:{default:!0}})}};G(i,e=>{z(n)&&e(a)}),U(e,r),k()}var ppt=B(`<div role="none" class="buttons"><!> <!></div> <!> <div role="none" class="buttons"><!> <!> <!> <!> <!></div>`,1),mpt=B(`<div role="none" class="toolbar-wrapper svelte-1kz79fh"><!></div>`),hpt={hash:`svelte-1kz79fh`,code:`.toolbar-wrapper.svelte-1kz79fh {display:contents;&[inert] {.sui.search-bar {
/* Disable the keyboard shortcut for the search bar */display:none !important;}}& > .sui.toolbar {
@media (width < 768px) {padding:0 4px;
}.buttons {flex:auto;display:flex;align-items:center;width:50%;&:last-child {justify-content:flex-end;}}.sui.search-bar {flex:none;width:640px;max-width:50%;
@media (width < 768px) {flex:auto;width:-moz-available;width:-webkit-fill-available;width:stretch;max-width:none;
}}}}`};function gpt(e,t){O(t,!0),K(e,hpt);var n=mpt(),r=N(n);{let e=A(()=>Y(`global`));IV(r,{variant:`primary`,get ariaLabel(){return z(e)},children:(e,t)=>{var n=ppt(),r=P(n),i=N(r);fpt(i,{}),$dt(I(i,2),{}),D(r);var a=I(r,2);I5(a,{});var o=I(a,2),s=N(o);wut(s,{});var c=I(s,2);$ft(c,{});var l=I(c,2);lpt(l,{});var u=I(l,2),d=e=>{cpt(e,{})};G(u,e=>{yu.devModeEnabled&&e(d)}),Zft(I(u,2),{}),D(o),U(e,n)},$$slots:{default:!0}})}D(n),R(()=>n.inert=l0.current),U(e,n),k()}var _pt=B(`<h2 role="none"> </h2> <!>`,1),vpt=B(`<section><h3 class="svelte-16cq5v7"> </h3> <!></section>`),ypt=B(`<div role="none" class="wrapper svelte-16cq5v7"><!> <section><h3 class="svelte-16cq5v7"> </h3> <!></section> <!></div>`),bpt={hash:`svelte-16cq5v7`,code:`.wrapper.svelte-16cq5v7 {overflow-y:auto;height:100%;--sui-menu-border-width: 0;--sui-menu-border-radius: 0;--sui-menu-padding: 8px 0;--sui-menu-divider-margin: 4px 0;}h3.svelte-16cq5v7 {padding:8px 16px;background-color:var(--sui-tertiary-background-color);color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-normal);}`};function xpt(e,t){O(t,!0),K(e,bpt);{let t=e=>{D5(e,{primaryToolbar:e=>{IV(e,{variant:`primary`,children:(e,t)=>{var n=_pt(),r=P(n),i=F(r,!0);yS(I(r,2),{flex:!0}),R(e=>W(i,e),[()=>Y(`menu`)]),U(e,n)},$$slots:{default:!0}})},mainContent:e=>{var t=ypt(),n=N(t),r=e=>{var t=vpt(),n=N(t),r=F(n,!0),i=I(n,2);{let e=A(()=>Y(`custom_pages`));qS(i,{get ariaLabel(){return z(e)},children:(e,t)=>{var n=H();No(P(n),17,()=>t9.current,e=>e.id,(e,t)=>{JS(e,{get label(){return z(t).label},onclick:()=>{gdt(z(t))},startIcon:e=>{gx(e,{get name(){return z(t).icon}})},$$slots:{startIcon:!0}})}),U(e,n)},$$slots:{default:!0}})}D(t),R(e=>W(r,e),[()=>Y(`custom_pages`)]),U(e,t)};G(n,e=>{t9.current.length&&e(r)});var i=I(n,2),a=N(i),o=F(a,!0);qft(I(a,2),{}),D(i);var s=I(i,2),c=e=>{var t=vpt(),n=N(t),r=F(n,!0);apt(I(n,2),{}),D(t),R(e=>W(r,e),[()=>Y(`help`)]),U(e,t)};G(s,e=>{yu.devModeEnabled&&e(c)}),D(t),R(e=>W(o,e),[()=>Y(`account`)]),U(e,t)},$$slots:{primaryToolbar:!0,mainContent:!0}})},n=A(()=>Y(`menu`));B5(e,{get"aria-label"(){return z(n)},main:t,$$slots:{main:!0}})}k()}var Spt=B(`<div> </div> <canvas class="svelte-1eeac91"></canvas>`,1),Cpt={hash:`svelte-1eeac91`,code:`canvas.svelte-1eeac91 {display:block;margin:32px auto 16px;width:200px !important;height:200px !important;}`};function wpt(e,t){O(t,!0),K(e,Cpt);let n=j(void 0);cl(()=>{if(!z(n)||!n9.current)return;let e=z(n),{origin:t,pathname:r}=window.location,i=Yr(yu),a=`${t}${r}#/signin/${K5e({token:Fu.account?.token,prefs:i})}`;return yu.devModeEnabled&&console.info(`Mobile sign-in URL:`,a),Zc(`qrcode`).then(({toCanvas:t})=>({toCanvas:t,target:e,url:a}))},({toCanvas:e,target:t,url:n})=>{e(t,n)},e=>{console.error(e)});{let t=A(()=>Y(`sign_in_with_mobile`));SS(e,{get title(){return z(t)},size:`small`,showOk:!1,showCancel:!1,showClose:!0,style:`--sui-dialog-small-content-max-height:auto`,get open(){return n9.current},set open(e){n9.current=e},children:(e,t)=>{var r=Spt(),i=P(r),a=F(i,!0);gs(I(i,2),e=>M(n,e),()=>z(n)),R(e=>W(a,e),[()=>Y(`sign_in_with_mobile_instruction`)]),U(e,r)},$$slots:{default:!0}})}k()}function Tpt(e,t){O(t,!0);let n=/^\/search\/(?<terms>.+)$/,r=()=>{let{path:e}=m0(),{terms:t}=e.match(n)?.groups??{};t&&t!==k5.current&&(k5.current=t),O5.current??=`contents`};So(()=>{r(),document.querySelector(`.sui.search-bar input`)?.focus()}),oo(`hashchange`,$i,()=>{r()});{let t=e=>{H5(e,{})},n=A(()=>Y(`search_results_for_x`,{values:{terms:k5.current}}));B5(e,{get"aria-label"(){return z(n)},main:t,$$slots:{main:!0}})}k()}var d9=B(`<!> <h2 role="none"> </h2>`,1),Ept=B(`<!> <!>`,1),Dpt=B(`<div role="none" class="wrapper svelte-116bna3"><!></div>`),Opt={hash:`svelte-116bna3`,code:`.wrapper.svelte-116bna3 {overflow-y:auto;height:100%;--sui-menu-border-width: 0;--sui-menu-border-radius: 0;--sui-menu-padding: 8px 0;& > .container {display:block;padding:16px;}}`};function kpt(e,t){O(t,!0),K(e,Opt);let n=/^\/settings(?:\/(?<panelKey>.+))?$/,r=j(void 0),i=j(!1),a=()=>{let{path:e}=m0(),t=e.match(n);if(!t?.groups)return;let{panelKey:a}=t.groups;M(r,a?l9.current.find(e=>e.key===a):void 0,!0),M(i,!!a&&!z(r),!0),z(i)&&(d0.current=Y(`page_not_found`))};So(()=>{a()}),oo(`hashchange`,$i,e=>{b0(e,a,n)});{let t=e=>{D5(e,{primaryToolbar:e=>{IV(e,{variant:`primary`,children:(e,t)=>{var n=Ept(),a=P(n),o=e=>{var t=d9(),n=P(t);x5(n,{onclick:()=>S0(`/settings`)});var i=F(I(n,2),!0);R(e=>W(i,e),[()=>Y(`prefs.${z(r).key}.title`)]),U(e,t)},s=e=>{var t=d9(),n=P(t);x5(n,{onclick:()=>S0(`/settings`)});var r=F(I(n,2),!0);R(e=>W(r,e),[()=>Y(`page_not_found`)]),U(e,t)},c=e=>{var t=d9(),n=P(t);x5(n,{onclick:()=>S0(`/menu`)});var r=F(I(n,2),!0);R(e=>W(r,e),[()=>Y(`settings`)]),U(e,t)};G(a,e=>{z(r)?e(o):z(i)?e(s,1):e(c,-1)}),yS(I(a,2),{flex:!0}),U(e,n)},$$slots:{default:!0}})},mainContent:e=>{var t=Dpt(),n=N(t),a=e=>{Vft(e,{get Panel(){return z(r).component}})},o=e=>{{let t=A(()=>Y(`page_not_found`));w5(e,{get message(){return z(t)},backPath:`/settings`})}},s=e=>{{let t=A(()=>Y(`settings`));qS(e,{get ariaLabel(){return z(t)},children:(e,t)=>{var n=H();No(P(n),17,()=>l9.current,({key:e,icon:t})=>e,(e,t)=>{let n=()=>z(t).key,r=()=>z(t).icon;{let t=e=>{gx(e,{get name(){return r()}})},i=A(()=>Y(`prefs.${n()}.title`));JS(e,{get label(){return z(i)},onclick:()=>x0(`/settings/${n()}`,{transitionType:`forwards`}),startIcon:t,$$slots:{startIcon:!0}})}}),U(e,n)},$$slots:{default:!0}})}};G(n,e=>{z(r)?e(a):z(i)?e(o,1):e(s,-1)}),D(t),U(e,t)},$$slots:{primaryToolbar:!0,mainContent:!0}})},n=A(()=>Y(`settings`));B5(e,{get"aria-label"(){return z(n)},main:t,$$slots:{main:!0}})}k()}function Apt(e,t){O(t,!0);let n={pending:{label:`deploy_preview.short.building`,tone:`warning`},error:{label:`deploy_preview.short.failed`,tone:`error`}},r=A(()=>n[t.state]);var i=H(),a=P(i),o=e=>{{let n=A(()=>Y(z(r).label));Rst(e,{get tone(){return z(r).tone},get label(){return z(n)},get class(){return`deploy-status-badge ${t.state??``}`}})}};G(a,e=>{z(r)&&e(o)}),U(e,i),k()}var jpt=B(`<p class="companions svelte-1nx78nt"> </p>`),Mpt=B(`<span role="none" class="author svelte-1nx78nt"><bdi> </bdi></span>`),Npt=B(`<span role="none" class="note svelte-1nx78nt"> </span>`),Ppt=B(`<div role="listitem"><button type="button" class="summary svelte-1nx78nt"><!> <span role="none" class="text svelte-1nx78nt"><span role="none" class="collection svelte-1nx78nt"><bdi> </bdi></span> <span role="none" class="title svelte-1nx78nt"><bdi> </bdi></span></span></button> <!> <footer role="none" class="svelte-1nx78nt"><div role="none" class="meta svelte-1nx78nt"><!> <span role="none" class="date svelte-1nx78nt"> </span> <!> <!></div> <div role="none" class="actions svelte-1nx78nt"><!> <!> <!></div></footer></div>`),Fpt={hash:`svelte-1nx78nt`,code:`.card.svelte-1nx78nt {display:flex;flex-direction:column;gap:4px;border:1px solid var(--sui-secondary-border-color);border-radius:var(--sui-control-medium-border-radius);padding:8px 12px;background-color:var(--sui-primary-background-color);cursor:grab;&.dragging {opacity:0.5;}&.static {cursor:default;}}.summary.svelte-1nx78nt {display:flex;align-items:center;gap:8px;border:0;padding:0;background:none;color:inherit;font-family:inherit;text-align:left;cursor:pointer;&:disabled {cursor:default;}
/* Let the label column shrink instead of pushing the thumbnail out of the card */.text:where(.svelte-1nx78nt) {display:flex;flex-direction:column;gap:2px;min-width:0;}}.collection.svelte-1nx78nt {color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);}.title.svelte-1nx78nt {font-size:var(--sui-font-size-default);line-height:1.4;overflow-wrap:anywhere;}.companions.svelte-1nx78nt {margin:0;color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);overflow-wrap:anywhere;}footer.svelte-1nx78nt {display:flex;align-items:center;justify-content:space-between;gap:8px;.meta:where(.svelte-1nx78nt) {display:flex;align-items:center;gap:6px;min-width:0;color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);}
/* Let a long user name truncate rather than push the date out of the card */.author:where(.svelte-1nx78nt) {overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.date:where(.svelte-1nx78nt),
.note:where(.svelte-1nx78nt) {flex:none;}.author:where(.svelte-1nx78nt) + .date:where(.svelte-1nx78nt)::before,
.date:where(.svelte-1nx78nt) + .note:where(.svelte-1nx78nt)::before {margin-inline-end:6px;content:'\\00B7'; /* middle dot */}.actions:where(.svelte-1nx78nt) {display:flex;flex:none;align-items:center;}}`};function f9(e,t){O(t,!0),K(e,Fpt);let n=J(t,`dragging`,3,!1),r=J(t,`busy`,3,!1),i=J(t,`deploying`,3,!1),a=J(t,`onDragStart`,3,void 0),o=J(t,`onDragEnd`,3,void 0),s=J(t,`onDelete`,3,void 0),c=J(t,`onPublish`,3,void 0),l=A(()=>t.entry.workflow),u=A(()=>z(l).collectionName),d=A(()=>z(l).fileName),f=A(()=>z(l).status),p=A(()=>z(l).pullRequest),m=A(()=>z(f)===`pending_deletion`),h=A(()=>Kf(z(u))),g=A(()=>z(h)&&z(d)?Wp(z(h),z(d)):void 0),_=A(()=>iQ({collection:z(h),collectionFile:z(g)})),v=A(()=>!z(m)&&!i()&&!z(_)&&vZ(z(h)).length>1),y=A(()=>(z(g)??z(h))?._i18n?.defaultLocale),b=A(()=>i()?Hy.current:z(p).headSHA),x=A(()=>(z(b)?Vy.current[z(b)]?.state:void 0)??`unknown`),S=A(()=>Ec.current?D4e(t.entry):t.entry.slug),C=A(()=>O4e(t.entry,Ec.current)),w=A(()=>Ec.current&&z(h)?qf(z(h),{useSingular:!0}):``),T=A(()=>!i()&&!z(_)&&XZ(t.entry,z(h))),ee=A(()=>eQ(t.entry)),E=A(()=>!i()&&!z(_)&&(z(ee)||z(h)?._type!==`entry`||z(h).delete!==!1)),te=A(()=>i()&&z(m)),ne=A(()=>z(m)||z(ee)?`undo`:`delete`);var re=Ppt();let ie;var ae=N(re),oe=N(ae),se=e=>{V5(e,{get collection(){return z(h)},get entry(){return t.entry},variant:`icon`})};G(oe,e=>{z(h)?._type===`entry`&&e(se)});var ce=I(oe,2),le=N(ce),ue=F(N(le),!0);D(le);var de=I(le,2),fe=F(N(de),!0);D(de),D(ce),D(ae);var pe=I(ae,2);No(pe,16,()=>z(C),e=>e,(e,t)=>{var n=jpt(),r=F(n,!0);R(()=>W(r,t)),U(e,n)});var me=I(pe,2),he=N(me),ge=N(he),_e=e=>{var t=Mpt(),n=F(N(t),!0);D(t),R(()=>W(n,z(p).author.name)),U(e,t)};G(ge,e=>{z(p).author?.name&&e(_e)});var ve=I(ge,2),ye=F(ve,!0),be=I(ve,2),xe=e=>{var t=Npt(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`workflow.deploying_deletion`)]),U(e,t)};G(be,e=>{z(te)&&e(xe)}),Apt(I(be,2),{get state(){return z(x)}}),D(he);var Se=I(he,2),Ce=N(Se),we=e=>{{let n=A(()=>i()?void 0:z(p));G5(e,{get entry(){return t.entry},get locale(){return z(y)},get collection(){return z(h)},get collectionFile(){return z(g)},get pullRequest(){return z(n)},size:`small`,iconic:!0})}};G(Ce,e=>{z(h)&&z(y)&&!z(te)&&e(we)});var Te=I(Ce,2),Ee=e=>{{let t=e=>{gx(e,{get name(){return z(ne)}})},n=A(()=>z(m)?Y(`workflow.cancel_deletion`):z(ee)?Y(`workflow.discard_changes`):Y(`delete_entries`,{values:{count:1}}));Xx(e,{variant:`ghost`,size:`small`,iconic:!0,get disabled(){return r()},get"aria-label"(){return z(n)},onclick:()=>{s()?.()},startIcon:t,$$slots:{startIcon:!0}})}};G(Te,e=>{z(E)&&e(Ee)});var De=I(Te,2),Oe=e=>{{let t=e=>{{let t=A(()=>z(m)?`delete`:`publish`);gx(e,{get name(){return z(t)}})}},n=A(()=>z(m)?Y(`delete_entries`,{values:{count:1}}):Y(`workflow.publish_entry`));Xx(e,{variant:`primary`,size:`small`,iconic:!0,get disabled(){return r()},get"aria-label"(){return z(n)},onclick:()=>{c()?.()},startIcon:t,$$slots:{startIcon:!0}})}};G(De,e=>{z(T)&&e(Oe)}),D(Se),D(me),D(re),R(e=>{ie=$o(re,1,`card svelte-1nx78nt`,null,ie,{dragging:n(),static:!z(v)}),q(re,`draggable`,!r()&&z(v)),q(ae,`aria-label`,z(S)),ae.disabled=z(te),W(ue,z(w)),W(fe,z(S)),W(ye,e)},[()=>z(p).updatedDate.toLocaleDateString(Ec.current,{month:`short`,day:`numeric`})]),oo(`dragstart`,re,e=>{e.dataTransfer&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,z(p).branch)),a()?.()}),oo(`dragend`,re,()=>{o()?.()}),so(`click`,ae,()=>{x0(c0(z(u),z(d)??t.entry.subPath),{transitionType:`forwards`})}),U(e,re),k()}co([`click`]);var Ipt=B(`<h2 role="none"> </h2> <!> <!>`,1),Lpt=B(`<span role="none"> </span>`),Rpt=B(`<header role="none" class="svelte-ljqw9n"><h3 role="none" class="svelte-ljqw9n"> </h3></header> <div role="list"></div>`,1),zpt=B(`<header role="none" class="svelte-ljqw9n"><h3 role="none" id="deletions-title" class="svelte-ljqw9n"> </h3></header> <div role="list" class="entries svelte-ljqw9n"></div>`,1),Bpt=B(`<div role="none" class="tray svelte-ljqw9n"><!></div>`),Vpt=B(`<header role="none" class="svelte-ljqw9n"><h3 role="none" id="deploying-title" class="svelte-ljqw9n"> </h3></header> <div role="list" class="entries svelte-ljqw9n"></div>`,1),Hpt=B(`<div role="none"><div role="none" class="columns svelte-ljqw9n"></div> <!> <!></div>`),Upt=B(`<!> <!> <!> <!>`,1),Wpt={hash:`svelte-ljqw9n`,code:`
/*
* Entries awaiting removal, and merged ones the site hasn’t caught up with, are listed in trays
* below the board rather than as extra columns: they have no stages to move through, and a
* column would take a share of the width for something rare
*/.board.svelte-ljqw9n {flex:auto;display:flex;flex-direction:column;overflow:hidden;}
/*
* With a single column, as with Preview Workflow, the cards would be stretched across the page,
* so they’re laid out in a grid instead, both in the column and in the trays below it
*/.board.single.svelte-ljqw9n .entries:where(.svelte-ljqw9n) {display:grid;grid-template-columns:repeat(auto-fill, minmax(320px, 1fr));align-content:start;}.tray.svelte-ljqw9n {flex:none;display:flex;flex-direction:column;max-height:33%;border-block-start:1px solid var(--sui-secondary-border-color);background-color:var(--sui-primary-background-color);.group {display:flex;flex-direction:column;overflow:hidden;}header:where(.svelte-ljqw9n) {display:flex;align-items:center;padding:0 16px;height:40px;background-color:var(--sui-tertiary-background-color);h3:where(.svelte-ljqw9n) {font-size:var(--sui-font-size-x-large);}}
/* Mirror the board’s track count, so a card here is the same size as one in a column */.entries:where(.svelte-ljqw9n) {display:grid;grid-template-columns:repeat(var(--column-count), 1fr);gap:8px;padding:8px;overflow-y:auto;
@media (width < 768px) {grid-template-columns:1fr;
}}}.columns.svelte-ljqw9n {flex:auto;display:flex;gap:4px;background-color:var(--sui-secondary-background-color); /* same as toolbar */
@media (width < 768px) {flex-direction:column;gap:0;
}.column {flex:auto;display:flex;flex-direction:column;width:calc(100% / var(--column-count));background-color:var(--sui-primary-background-color);
@media (width < 768px) {width:100%;height:calc(100% / var(--column-count));
}}header:where(.svelte-ljqw9n) {flex:none;display:flex;align-items:center;padding:0 16px;height:40px;background-color:var(--sui-tertiary-background-color);h3:where(.svelte-ljqw9n) {font-size:var(--sui-font-size-x-large);}}.entries:where(.svelte-ljqw9n) {flex:auto;display:flex;flex-direction:column;gap:8px;padding:8px;overflow-y:auto;&.drop-target {background-color:var(--sui-selected-background-color);}}}`};function Gpt(e,t){O(t,!0),K(e,Wpt);let n=j(void 0),r=j(void 0),i=j(void 0),a=j(!1),o=j(!1),s=j(`info`),c=j(``),l=j(!1),u=j([]),d=j(!1),f=({workflow:{pullRequest:{branch:e}}})=>z(u).includes(e)||jZ.current.includes(e),p=A(()=>eQ(z(i))),m=A(()=>z(i)?.workflow.status===`pending_deletion`),h=A(()=>w7({pendingDeletion:z(m),publishedVersionExists:z(p)})),g=A(()=>Mst({deletion:z(m)})),_=A(()=>E4e(wZ.current,OZ.current,SZ)),v=A(()=>z(_).columns),y=A(()=>z(_).pendingDeletions),b=A(()=>X5e.current);L(()=>eat());let x=!1,S=(e,t)=>{M(s,e,!0),M(c,t,!0),M(l,!0)},C=async(e,t,n,r=()=>Y(t.error))=>{S(`info`,Y(t.info));try{await e,S(`success`,Y(t.success))}catch(e){S(`error`,r(e)),console.error(e)}finally{n()}},w=async(e,t,n)=>{let{branch:r}=e.workflow.pullRequest;M(u,[...z(u),r]),await C(t,n,()=>{M(u,z(u).filter(e=>e!==r))},e=>v7(e,n.error))},T=async()=>{M(d,!0),await C(R8({fresh:!0}),y4e,()=>{M(d,!1)})},ee=e=>{S(`error`,Y(e))},E=e=>{M(i,e),M(a,!0)},te=e=>{M(i,e),M(o,!0)},ne=async e=>{let t=VZ(z(n)?.id);M(n,void 0),M(r,void 0),t&&SZ(t)!==e&&CZ(t,e)&&(Ust({entry:t,status:e})?await w(t,x7(t,e),v4e):ee(`workflow.status_change_blocked`))};L(()=>{if(x||!MZ.current)return;x=!0;let{key:e,values:t}=T4e(z(v),z(y));d0.current=Y(e,{values:t})});var re=Upt(),ie=P(re);{let e=e=>{{let t=e=>{IV(e,{variant:`primary`,children:(e,t)=>{var n=Ipt(),r=P(n),i=F(r,!0),a=I(r,2);yS(a,{flex:!0});var o=I(a,2);{let e=e=>{gx(e,{name:`refresh`})},t=A(()=>Y(`workflow.refresh`)),n=A(()=>!MZ.current||z(d));Xx(o,{variant:`ghost`,iconic:!0,get"aria-label"(){return z(t)},get disabled(){return z(n)},onclick:T,startIcon:e,$$slots:{startIcon:!0}})}R(e=>W(i,e),[()=>Y(TZ.current)]),U(e,n)},$$slots:{default:!0}})},i=e=>{var t=H(),i=P(t),a=e=>{dH(e,{children:(e,t)=>{var n=Lpt(),r=F(n,!0);R(e=>W(r,e),[()=>Y(`loading_entries`,{values:{count:2}})]),U(e,n)},$$slots:{default:!0}})},o=e=>{var t=Hpt();let i,a;var o=N(t);No(o,21,()=>z(v),({status:e,entries:t})=>e,(e,t)=>{let i=()=>z(t).status,a=()=>z(t).entries;fH(e,{class:`column`,get"aria-labelledby"(){return`${i()??``}-column-title`},children:(e,t)=>{var o=Rpt(),s=P(o),c=N(s),l=F(c,!0);D(s);var u=I(s,2);let d;No(u,21,a,e=>e.id,(e,t)=>{{let i=A(()=>f(z(t))),a=A(()=>z(n)?.id===z(t).id);f9(e,{get entry(){return z(t)},get busy(){return z(i)},get dragging(){return z(a)},onDragStart:()=>{M(n,z(t))},onDragEnd:()=>{M(n,void 0),M(r,void 0)},onDelete:()=>E(z(t)),onPublish:()=>te(z(t))})}},e=>{dH(e,{children:(e,t)=>{var n=Lpt(),r=F(n,!0);R(e=>W(r,e),[()=>Y(`workflow.no_entries`)]),U(e,n)},$$slots:{default:!0}})}),D(u),R((e,t)=>{q(c,`id`,`${i()??``}-column-title`),W(l,e),d=$o(u,1,`entries svelte-ljqw9n`,null,d,{"drop-target":z(r)===i()}),q(u,`aria-label`,t)},[()=>Y(_4e[i()]),()=>Y(_4e[i()])]),oo(`dragover`,u,e=>{z(n)&&CZ(z(n),i())&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`move`),M(r,i(),!0))}),oo(`dragleave`,u,()=>{z(r)===i()&&M(r,void 0)}),oo(`drop`,u,e=>{e.preventDefault(),ne(i())}),U(e,o)},$$slots:{default:!0}})}),D(o);var s=I(o,2),c=e=>{var t=Bpt();fH(N(t),{class:`group`,"aria-labelledby":`deletions-title`,children:(e,t)=>{var n=zpt(),r=P(n),i=F(N(r),!0);D(r);var a=I(r,2);No(a,21,()=>z(y),e=>e.id,(e,t)=>{{let n=A(()=>f(z(t)));f9(e,{get entry(){return z(t)},get busy(){return z(n)},onDelete:()=>E(z(t)),onPublish:()=>te(z(t))})}}),D(a),R((e,t)=>{W(i,e),q(a,`aria-label`,t)},[()=>Y(`status.pending_deletion`),()=>Y(`status.pending_deletion`)]),U(e,n)},$$slots:{default:!0}}),D(t),U(e,t)};G(s,e=>{z(y).length&&e(c)});var l=I(s,2),u=e=>{var t=Bpt();fH(N(t),{class:`group`,"aria-labelledby":`deploying-title`,children:(e,t)=>{var n=Vpt(),r=P(n),i=F(N(r),!0);D(r);var a=I(r,2);No(a,21,()=>z(b),({entry:e})=>e.workflow.pullRequest.branch,(e,t)=>{let n=()=>z(t).entry;f9(e,{get entry(){return n()},deploying:!0})}),D(a),R((e,t)=>{W(i,e),q(a,`aria-label`,t)},[()=>Y(`status.deploying`),()=>Y(`status.deploying`)]),U(e,n)},$$slots:{default:!0}}),D(t),U(e,t)};G(l,e=>{z(b).length&&e(u)}),D(t),R(()=>{i=$o(t,1,`board svelte-ljqw9n`,null,i,{single:z(v).length===1}),a=ts(t,``,a,{"--column-count":z(v).length})}),U(e,t)};G(i,e=>{MZ.current?e(o,-1):e(a)}),U(e,t)},a=A(()=>Y(TZ.current));D5(e,{get"aria-label"(){return z(a)},primaryToolbar:t,mainContent:i,$$slots:{primaryToolbar:!0,mainContent:!0}})}},t=A(()=>Y(TZ.current));B5(ie,{get"aria-label"(){return z(t)},main:e,$$slots:{main:!0}})}var ae=I(ie,2);wS(ae,{get title(){return z(h).title},get okLabel(){return z(h).label},onOk:async()=>{let e=VZ(z(i)?.id);e&&await w(e,S7(e),C4e(GZ(e)))},get open(){return z(a)},set open(e){M(a,e,!0)},children:(e,t)=>{Ur();var n=V();R(()=>W(n,z(h).message)),U(e,n)},$$slots:{default:!0}});var oe=I(ae,2);wS(oe,{get title(){return z(g).title},get okLabel(){return z(g).label},onOk:async()=>{let e=VZ(z(i)?.id);e&&(Wst({entry:e})?await w(e,wst(e,z(i)),w4e(GZ(e))):ee(`workflow.publish_blocked`))},get open(){return z(o)},set open(e){M(o,e,!0)},children:(e,t)=>{Ur();var n=V();R(()=>W(n,z(g).message)),U(e,n)},$$slots:{default:!0}});var se=I(oe,2),ce=e=>{fC(e,{get id(){return z(c)},get show(){return z(l)},set show(e){M(l,e,!0)},children:(e,t)=>{bx(e,{get status(){return z(s)},children:(e,t)=>{Ur();var n=V();R(()=>W(n,z(c))),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}})};G(se,e=>{z(c)&&e(ce)}),U(e,re),k()}var Kpt=B(`<!> <!>`,1),qpt=B(`<!> <!> <!> <!> <div role="none" class="page-root svelte-1a6c577"><!></div> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!>`,1),Jpt={hash:`svelte-1a6c577`,code:`.page-root.svelte-1a6c577 {position:relative;flex:auto;display:flex;flex-direction:column;overflow:hidden;view-transition-name:page-root;}`};function Ypt(e,t){O(t,!0),K(e,Jpt);let n=`not-found`,r=A(()=>({collections:adt,assets:Irt,search:PY.isSmallScreen?Tpt:O5.current?{contents:adt,assets:Irt}[O5.current]:Tpt,workflow:Gpt,config:tit,pages:xdt,menu:xpt,settings:kpt})),i=A(()=>u0.current===n?Ydt:z(r)[u0.current]),a=()=>{if(DBe())return;let{path:e}=m0(),t=ABe(e,Object.keys(z(r)));e9.current=mdt(e),`redirect`in t?window.location.replace(t.redirect):`notFound`in t?(u0.current=n,O5.current=null):(u0.current!==t.pageName&&(u0.current=t.pageName),t.searchMode!==void 0&&(O5.current=t.searchMode))};So(()=>{a()});var o=qpt();oo(`hashchange`,$i,()=>{a()});var s=P(o);zdt(s,{});var c=I(s,2);Gdt(c,{});var l=I(c,2),u=e=>{var t=Kpt(),n=P(t);Hdt(n,{}),wpt(I(n,2),{}),U(e,t)};G(l,e=>{Adt.current&&e(u)});var d=I(l,2),f=e=>{gpt(e,{})};G(d,e=>{PY.isSmallScreen||e(f)});var p=I(d,2);Ro(N(p),()=>z(i),(e,t)=>{t(e,{})}),D(p);var m=I(p,2),h=e=>{tft(e,{})};G(m,e=>{PY.isSmallScreen&&e(h)});var g=I(m,2);Qrt(g,{});var _=I(g,2);Zrt(_,{});var v=I(_,2);Vrt(v,{});var y=I(v,2);udt(y,{});var b=I(y,2);cdt(b,{});var x=I(b,2);ddt(x,{});var S=I(x,2);Jdt(S,{});var C=I(S,2);Idt(C,{}),zrt(I(C,2),{}),U(e,o),k()}function Xpt(e,t){O(t,!0);let n=A(()=>Qf.current),r=A(()=>!!z(n));{let t=A(()=>Y(`open_authoring.fork_repository`)),i=A(()=>Y(`open_authoring.fork`));wS(e,{get title(){return z(t)},get okLabel(){return z(i)},onOk:()=>{z(n)?.respond(!0)},onClose:()=>{z(n)?.respond(!1)},get open(){return z(r)},set open(e){M(r,e)},children:(e,t)=>{Ur();var r=V();R(e=>W(r,e),[()=>Y(`open_authoring.confirm_forking_repository`,{values:{repo:z(n).repo}})]),U(e,r)},$$slots:{default:!0}})}k()}var Zpt=B(` <!>`,1),Qpt=B(`<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>`,1);function $pt(e,t){O(t,!0);let n=i9(`openAuthoringNotice`),r=A(()=>Jf.current),i=A(()=>Zf(z(r))),a=A(()=>yae(LX.current?.repository,z(r)));L(()=>{z(r)&&n.showIfNeeded()});var o=H(),s=P(o),c=e=>{var t=Qpt(),r=P(t);ko(r,()=>({"--sui-infobar-message-justify-content":`center`})),Zx(r.lastChild,{get show(){return n.show.current},onDismiss:()=>{n.hide()},children:(e,t)=>{Ur();var r=Zpt(),o=P(r),s=I(o),c=e=>{{let t=A(()=>Y(`open_authoring.view_fork`));Xx(e,{variant:`link`,get label(){return z(t)},onclick:()=>{Tq(z(a)),n.hide()}})}};G(s,e=>{z(a)&&e(c)}),R(e=>W(o,`${e??``} `),[()=>Y(`open_authoring.contributing_via_fork`,{values:{repo:z(i)}})]),U(e,r)},$$slots:{default:!0}}),D(r),U(e,t)};G(s,e=>{z(r)&&e(c)}),U(e,o),k()}var emt=l(o(((e,t)=>{var n=Object.getPrototypeOf({});function r(){return function(e){return typeof e==`object`&&!!e&&!(e instanceof RegExp)&&!(e instanceof Date)}}function i(e){function t(e){return e!==`constructor`&&e!==`prototype`&&e!==`__proto__`}function i(e){let t=0,n=e.length,r=Array(n);for(;t<n;++t)r[t]=h(e[t]);return r}function a(e){let r={};if(u&&Object.getPrototypeOf(e)!==n)return u(e);let i=l(e),a,o,s;for(a=0,o=i.length;a<o;++a)t(s=i[a])&&(r[s]=h(e[s]));return r}function o(e,t){let n=e.length,r=t.length,i=0,a=Array(n+r);for(;i<n;++i)a[i]=h(e[i]);for(i=0;i<r;++i)a[i+n]=h(t[i]);return a}let s=Object.prototype.propertyIsEnumerable;function c(e){let t=Object.keys(e),n=Object.getOwnPropertySymbols(e);for(let r=0,i=n.length;r<i;++r)s.call(e,n[r])&&t.push(n[r]);return t}let l=e?.symbols?c:Object.keys,u=typeof e?.cloneProtoObject==`function`?e.cloneProtoObject:void 0,d=typeof e?.isMergeableObject==`function`?e.isMergeableObject:r(),f=e?.onlyDefinedProperties===!0;function p(e){return typeof e!=`object`||!e}let m=e&&typeof e.mergeArray==`function`?e.mergeArray({clone:h,deepmerge:_,getKeys:l,isMergeableObject:d}):o;function h(e){return d(e)?Array.isArray(e)?i(e):a(e):e}function g(e,r){let i={},a=l(e),o=l(r),s,c,p;for(s=0,c=a.length;s<c;++s)t(p=a[s])&&o.indexOf(p)===-1&&(i[p]=h(e[p]));for(s=0,c=o.length;s<c;++s)if(t(p=o[s])){if(p in e)a.indexOf(p)!==-1&&(u&&d(r[p])&&Object.getPrototypeOf(r[p])!==n?i[p]=u(r[p]):i[p]=_(e[p],r[p]));else{if(f&&r[p]===void 0)continue;i[p]=h(r[p])}}return i}function _(e,t){if(f&&t===void 0)return h(e);let n=Array.isArray(t),r=Array.isArray(e);return p(t)?t:d(e)?n&&r?m(e,t):n===r?g(e,t):h(t):h(t)}function v(){switch(arguments.length){case 0:return{};case 1:return h(arguments[0]);case 2:return _(arguments[0],arguments[1])}let e;for(let t=0,n=arguments.length;t<n;++t)e=_(e,arguments[t]);return e}return e?.all?v:_}t.exports=i,t.exports.default=i,t.exports.deepmerge=i,Object.defineProperty(t.exports,"isMergeableObject",{get:r})}))(),1),tmt=({collection:e,file:t})=>{let n=Lc(t.file);if(!n.includes(`{{locale}}`))return{_default:n};let r=Vf(e,t);return Object.fromEntries(r.allLocales.map(e=>[e,Af({_i18n:r,locale:e,path:n})]))},nmt=(e,t)=>{if(Md(t))return{collectionName:e.name,fileName:t.name,filePathMap:tmt({collection:e,file:t})}},rmt=(e,t)=>Bc(Object.values(e.filePathMap??{})[0],Object.values(t.filePathMap??{})[0]),imt=({collections:e})=>Gf({collections:e,type:`entry`}).map(e=>{let{name:t,folder:n,file:r}=e;if(typeof r==`string`)return{collectionName:t,filePathMap:{_default:Lc(r)}};let i=Lc(n),a=Vf(e),{allLocales:o,defaultLocale:s,omitDefaultLocaleFromFilePath:c,structureMap:{i18nMultiRootFolder:l}}=a,u=e=>Cf(i)?Af({_i18n:a,locale:e,path:i}):l?c&&e===s?i:`${e}/${i}`:i;return{collectionName:t,folderPath:i,folderPathMap:Object.fromEntries(o.map(e=>[e,u(e)]))}}).sort((e,t)=>Bc(e.folderPath??e.filePathMap._default,t.folderPath??t.filePathMap._default)),amt=({collections:e})=>Gf({collections:e,type:`file`}).flatMap(e=>(e.files??[]).map(t=>nmt(e,t))).filter(e=>!!e).sort(rmt),omt=({singletons:e})=>{let t=Array.isArray(e)?Nd(e):[];if(!t.length)return[];let n={name:`_singletons`,files:t};return t.map(e=>nmt(n,e)).filter(e=>!!e).sort(rmt)},smt=e=>[...imt(e),...amt(e),...omt(e)],cmt=`https://sveltiacms.app/en/docs/api/initialization#providing-a-full-configuration`,lmt=`https://sveltiacms.app/en/docs/config-basics#validation-and-autocomplete`,umt=(0,emt.default)({all:!0}),p9=new Map,dmt=e=>{let t=new URL(e);return t.searchParams.set(`_`,Date.now().toString()),fetch(t)},fmt=async({href:e,type:t=`application/yaml`},{manualInit:n=!1,showSchemaTip:r}={})=>{let i;if(!Rre.includes(t))throw Error(Y(`config.error.parse_failed`),{cause:Error(Y(`config.error.parse_failed_unsupported_type`))});let a=Ju(Y(n?`config.error.fetch_failed_with_manual_init`:`config.error.fetch_failed`),cmt);try{let t=new URL(e,window.location.href),n=p9.get(t.href);p9.delete(t.href),i=await(n??dmt(t))}catch(e){throw Error(a,{cause:e})}let{ok:o,status:s}=i;if(!o)throw Error(a,{cause:Error(Y(`config.error.fetch_failed_not_ok`,{values:{status:s}}))});let c=!1,l;try{if(t===`application/json`)l=await i.json(),X(l)&&l.$schema!==`https://unpkg.com/@sveltia/cms/schema/sveltia-cms.json`&&(c=!0);else{let e=await i.text();t===`application/toml`?(l=Kv(e),e.includes(`#:schema https://unpkg.com/@sveltia/cms/schema/sveltia-cms.json`)||(c=!0)):(l=qv(e,{merge:!0,maxAliasCount:-1}),e.includes(`# yaml-language-server: $schema=https://unpkg.com/@sveltia/cms/schema/sveltia-cms.json`)||(c=!0))}}catch(e){throw Error(Y(`config.error.parse_failed`),{cause:e})}if(!X(l))throw Error(Y(`config.error.parse_failed`),{cause:Error(Y(`config.error.parse_failed_invalid_object`))});return r&&c&&console.info(Y(`config.schema_tip`,{values:{link:lmt}})),l},pmt=e=>{if(e=e.replace(/^\/+/,`/`),e.endsWith(`/`))return`${e}config.yml`;let t=e.split(`/`);return t.pop()?.includes(`.`)?`${t.join(`/`)}/config.yml`:`${e}/config.yml`},mmt=e=>{let{origin:t}=window.location;return e.every(({href:e})=>Ru(e,t))},hmt=()=>{let e=[...document.querySelectorAll(`link[rel="cms-config-url"]`)].map(({href:e,type:t})=>({href:e,type:t||void 0}));return e.length||e.push(Tl?{href:`${Tl}/admin/config.yml`}:{href:pmt(window.location.pathname)}),e},gmt=()=>{let e=hmt();mmt(e)&&e.forEach(({href:e})=>{try{let t=new URL(e,window.location.href);if(!p9.has(t.href)){let e=dmt(t);e.catch(()=>{}),p9.set(t.href,e)}}catch{}})},_mt=async({manualInit:e=!1}={})=>{let t=hmt();if(!mmt(t))throw Error(Y(`config.error.insecure_urls`,{values:{count:t.length}}));let n=PY.isLocalHost&&!e&&t.length===1,r;try{r=await Promise.all(t.map(t=>fmt(t,{manualInit:e,showSchemaTip:n})))}finally{p9.clear()}return r.length===1?r[0]:umt(...r)},vmt=[{type:`warning`,prop:`use_graphql`,strKey:`unsupported_ignored_option`}],ymt=`https://sveltiacms.app/en/docs/backends#supported-backends`,bmt=`https://sveltiacms.app/en/docs/backends/BACKEND_NAME#authentication`,xmt={gitea:`gitea-forgejo`,forgejo:`gitea-forgejo`},Smt=`https://sveltiacms.app/en/docs/workflows/open`,Cmt=[`api_root`,`graphql_api_root`,`base_url`],wmt=/^\.|\.lock$|[\x00-\x20\x7f~^:?*[\\]|@\{/,Tmt=e=>e.split(`/`).every(e=>!wmt.test(e)),Emt=(e,t)=>{let{backend:n}=e,{errors:r,warnings:i}=t;if(!X(n)){r.add(Y(`config.error.missing_backend`));return}let{name:a}=n;if(!a){r.add(Y(`config.error.missing_backend_name`));return}if(!jLe.includes(a)){let e=ALe[a],t=e?e.deprecated?`deprecated`:`known`:`custom`,n=e?.label,i=Ju(Y(`config.error.unsupported_${t}_backend`,{values:{name:n}}),`https://sveltiacms.app/en/docs/migration/netlify-decap-cms#compatibility`),o=Ju(Y(`config.error.unsupported_backend_suggestion`),ymt);r.add(`${i} ${o}`);return}let{root_dir:o}=n;if(typeof o==`string`&&(o.split(`/`).includes(`..`)?r.add(Y(`config.error.invalid_root_dir`)):lx(e)&&!Tmt(lu(o))&&r.add(Y(`config.error.invalid_root_dir_branch`))),a in bX){let{repo:o,automatic_deployments:s,auth_methods:c,auth_type:l,app_id:u,open_authoring:d,auth_scope:f,api_root:p}=n;Array.isArray(c)&&!c.length&&r.add(Y(`config.error.no_auth_methods`)),a===`github`&&Array.isArray(f)&&!f.some(e=>e===`repo`||e===`public_repo`)&&r.add(Y(`config.error.auth_scope_no_repo`));let m=!c||c.includes(`token`),h=bmt.replace(`BACKEND_NAME`,xmt[a]??a);o===void 0?r.add(Y(`config.error.missing_repository`)):typeof o==`string`&&/^[^/:]+(?:\/[^/:]+)+$/.test(o)||r.add(Y(`config.error.invalid_repository`)),a===`forgejo`&&p===void 0&&r.add(Y(`config.error.missing_api_root`)),l===`implicit`&&r.add(Ju(Y(`config.error.oauth_implicit_flow`),h)),a===`github`&&l===`pkce`&&r.add(Ju(Y(`config.error.github_pkce_unsupported`),h)),a===`gitlab`&&l===`pkce`&&!u&&r.add(Y(`config.error.oauth_no_app_id`)),d&&(sx(ox({cmsConfig:e}))||r.add(Ju(Y(`config.error.open_authoring_no_workflow`),Smt)),a===`github`&&f===void 0&&i.add(`The \`open_authoring\` option is enabled without \`auth_scope\`, so contributors are asked for access to all their repositories, including private ones. Set \`auth_scope: public_repo\` if your repository is public, or \`auth_scope: repo\` to confirm the broader scope is needed. ${Smt}`)),vl(a)&&!u&&(m?i.add(Y(`config.warning.oauth_no_app_id`)):r.add(Y(`config.error.oauth_no_app_id`))),Cmt.forEach(r=>{let i=n[r];typeof i==`string`&&!Wu(i)&&g8({strKey:`invalid_url_option`,values:{option:r,url:i},context:{cmsConfig:e},collectors:t})}),s!==void 0&&S4(`automatic_deployments`),_8({UNSUPPORTED_OPTIONS:vmt,config:n,context:{cmsConfig:e},collectors:t})}},Dmt=[`code`,`markdown`,`richtext`,`text`],Omt=[`yaml`,`toml`,`json`],m9=(e,t,n=[])=>{if(!e||!t||t===`raw`||Ud.has(t))return!1;let r=t.endsWith(`-frontmatter`)||t===`frontmatter`;if(r&&n.length===1){let[{name:e,widget:t=`string`}]=n;if(e===`body`&&Dmt.includes(t))return!1}let i=e===`yml`?`yaml`:e,a=t===`yml`?`yaml`:t;if(lf.includes(i))return!r;if(r){let e=uf[i];return e!==void 0&&e!==a.replace(`-frontmatter`,``)}return Omt.includes(a)?Omt.includes(i)&&i!==a:!1},kmt=[`boolean`,`keyvalue`,`list`,`number`,`object`],Amt=e=>{let{widget:t=`string`}=e;return t===`number`?!(e.value_type??``).endsWith(`/string`):t===`compute`?VU(e):kmt.includes(t)||oh(e)},h9=({extension:e,format:t,bodyField:n,fields:r,context:i,collectors:a})=>{let{key:o=`body`,inline:s=!1}=n??{},c=Array.isArray(r)?r.find(({name:e})=>e===o):void 0;if(s||!c||typeof o!=`string`)return;let l=Mf({extension:jf({extension:e,format:t}),format:t});(l===`frontmatter`||l.endsWith(`-frontmatter`))&&Amt(c)&&g8({strKey:`front_matter_body_field_not_text`,values:{name:o,widget:c.widget},context:{...i,typedKeyPath:o},collectors:a})},g9=({cmsConfig:e,collection:t,file:n})=>{let r=Lf({cmsConfig:e,collection:t,file:n});if(r?.locales?.length)return r.canonical_slug?.key??If.key},jmt=/<[^>]+>$/,_9=e=>{let{field:t}=e,{fields:n}=e,{types:r,typeKey:i=`type`}=e;return t?[t]:n||(r?[...r.flatMap(({fields:e=[]})=>e),{name:i}]:[])},Mmt=(e,t)=>{let{widget:n=`string`}=e;return n===`keyvalue`||n===`code`&&bH(e,t)},Nmt=(e,t)=>{let n=[],r=!0,i=!1;return t.split(`.`).every(t=>{let a=t.replace(jmt,``);if(i)return!1;if(!a||a===`*`||eh(a))return!0;let o=r?e:n.flatMap(e=>_9(e)),s=r?[]:n.filter(e=>Mmt(e,a));return r=!1,n=o.filter(({name:e})=>e===a),!n.length&&s.length&&(n=s,i=!0),!!n.length})?n:[]},v9=(e,t)=>!!Nmt(e,t).length,Pmt=({collection:e,collectionFile:t,isIndexFile:n})=>{if(t)return t.fields;if(!e||`files`in e)return;let{fields:r,index_file:i}=e;return n&&typeof i==`object`&&i.fields?i.fields:r},Fmt=(e,{canonicalSlugKey:t,orderFieldKey:n})=>uG.includes(e)||e===`_manual`||e===t||e===n,y9=({option:e,template:t,keyPaths:n,specialTags:r=[],prefixedOnly:i=!1,type:a,strKey:o=`option_field_not_found`,fields:s,context:c,collectors:l})=>{let u=[];typeof t==`string`?ef(t).forEach(({content:e,name:t})=>{Die.test(e)||i&&!Yd.test(t)||r.includes(t)||u.push(t)}):(Array.isArray(n)?n:[n]).forEach(e=>{typeof e==`string`&&e&&u.push(e)}),u.forEach(t=>{v9(s,nf(t))||g8({type:a,strKey:o,values:{option:e,name:t},context:c,collectors:l})})},Imt=({thumbnail:e,fields:t,context:n,collectors:r})=>{if(y9({option:`thumbnail`,keyPaths:e,fields:t,context:n,collectors:r}),typeof e!=`string`||!e)return;let i=Nmt(t,nf(e)).map(({widget:e=`string`})=>e);i.length&&!i.some(e=>Ld.includes(e))&&g8({strKey:`thumbnail_field_not_media`,values:{name:e,widget:i[0]},context:n,collectors:r})},Lmt=({pathTemplate:e,dateFieldName:t,fields:n,context:r,collectors:i})=>{Eie.test(e)&&((t?n.some(({widget:e,name:n})=>e===`datetime`&&n===t):n.some(({widget:e})=>e===`datetime`))||g8({type:`warning`,strKey:t?`preview_path_date_field_not_found`:`preview_path_no_date_field`,values:{name:t},context:r,collectors:i}))},Rmt=({pathTemplate:e,dateFieldName:t,fields:n,context:r,collectors:i})=>{e&&(Lmt({pathTemplate:e,dateFieldName:t,fields:n,context:r,collectors:i}),y9({option:`preview_path`,template:e,prefixedOnly:!0,type:`warning`,strKey:`preview_path_field_not_found`,fields:n,context:r,collectors:i}))},zmt=[...Jd,...Object.keys(Xd),`slug`,`_slug`,`fields._slug`],Bmt=[`slug`,`locales`,`dirname`,`filename`,`extension`,`commit_date`,`commit_author`,`title`,`fields.title`],b9=({template:e,fields:t,context:n,collectors:r})=>{t?.length&&y9({option:`summary`,template:e,specialTags:Bmt,fields:t,context:n,collectors:r})},Vmt=({collection:e,context:t,collectors:n})=>{let{fields:r,path:i,summary:a,thumbnail:o}=e;if(!r?.length)return;let s={fields:r,context:t,collectors:n};y9({...s,option:`slug`,template:w2(e),specialTags:zmt}),y9({...s,option:`path`,template:i,specialTags:zmt}),b9({...s,template:a}),(typeof o==`string`||Array.isArray(o))&&(Array.isArray(o)?o:[o]).forEach(e=>{typeof e==`string`&&e.startsWith(`/`)?y9({...s,option:`thumbnail`,template:e,prefixedOnly:!0}):y9({...s,option:`thumbnail`,keyPaths:e})})},Hmt=({config:e,context:t,collectors:n})=>{let{default:r}=e;if(!X(r))return;let i=yH(e);if(!i){g8({strKey:`code_field_invalid_default_object`,context:t,collectors:n});return}let{code:a,lang:o}=i;Object.keys(r).filter(e=>![a,o].includes(e)).forEach(e=>{g8({strKey:`code_field_invalid_default_key`,values:{key:e,code:a,lang:o},context:t,collectors:n})})},Umt=({config:e,context:t,collectors:n})=>{let{value:r,value_type:i}=e,{tree:a,tags:o}=oq(r);a?o.some(({content:e})=>Object.hasOwn(Xd,gU(e).value))&&g8({strKey:`compute_field_uuid_in_expression`,values:{valueType:i},context:t,collectors:n}):g8({strKey:`compute_field_invalid_expression`,values:{valueType:i},context:t,collectors:n})},Wmt=(e,t)=>{if(t){let{tree:t,tags:n}=oq(e);return t?n:[]}return $d(e).tags.map(e=>({content:e,allItems:!1}))},Gmt=/<[^>]*>/g,Kmt=/(?<=^|\.)\d+(?=\.|$)/g,x9=e=>{let{value:t,transformations:n}=gU(e),r=[];return Yd.test(t)&&r.push({tagName:t,keyPath:nf(t).replace(Kmt,`*`)}),SH(n,e=>(r.push(...x9(e)),``)),r},qmt=({context:e,collectors:t},n)=>{let r=(e.typedKeyPath??``).replace(Gmt,``),i=r.split(`.`);n.forEach(({content:n,allItems:a})=>{let o=x9(n).find(({keyPath:e})=>e===r);if(o){g8({type:`warning`,strKey:`compute_field_self_reference`,values:{name:o.tagName},context:e,collectors:t});return}let{value:s}=gU(n);if(!Yd.test(s))return;let c=nf(s);if(a)return;let l=c.split(`.`);l.every((e,t)=>e!==`*`||l.slice(0,t+1).every((e,t)=>e===i[t]))||g8({type:`warning`,strKey:`compute_field_wildcard_without_item`,values:{name:s},context:e,collectors:t})})},Jmt=(e,t)=>{let{widget:n=`string`,value:r}=e??{};if(n===`compute`){let n=new Set((typeof r==`string`?Wmt(r,BU(e)):[]).flatMap(({content:e})=>x9(e).map(({keyPath:e})=>e)));return[{typedKeyPath:t,keyPath:t.replace(Gmt,``),references:n}]}let i=[];return yh(e??{},t,(e,t)=>{i.push(...Jmt(e,t))},!0),i},Ymt=new WeakMap,Xmt=e=>Nl(Ymt,e,()=>{let t=e.flatMap(e=>Jmt(e,`${e?.name}`)),n=new Map(t.map(e=>[e,t.filter(t=>t.keyPath!==e.keyPath&&e.references.has(t.keyPath))])),r=new Map,i=[],a=new Set,o=new Map,s=e=>{let t={index:r.size,lowLink:r.size};if(r.set(e,t),i.push(e),a.add(e),n.get(e).forEach(e=>{r.has(e)?a.has(e)&&(t.lowLink=Math.min(t.lowLink,r.get(e).index)):(s(e),t.lowLink=Math.min(t.lowLink,r.get(e).lowLink))}),t.lowLink!==t.index)return;let c=[],l;do l=i.pop(),a.delete(l),c.push(l);while(l!==e);if(c.length>1){let[e]=c.toSorted((e,t)=>e.typedKeyPath.localeCompare(t.typedKeyPath)),t=n.get(e).find(e=>c.includes(e));o.set(e.typedKeyPath,t.keyPath)}};return t.forEach(e=>{r.has(e)||s(e)}),o}),Zmt=({config:e,context:t,collectors:n})=>{let{value:r}=e,i=BU(e),a=Pmt(t);if(typeof r==`string`&&(i&&Umt({config:e,context:t,collectors:n}),t.componentName||qmt({config:e,context:t,collectors:n},Wmt(r,i))),a?.length){let e=Xmt(a).get(t.typedKeyPath??``);e!==void 0&&g8({type:`warning`,strKey:`compute_field_reference_cycle`,values:{name:`fields.${e}`},context:t,collectors:n}),y9({option:`value`,template:r,prefixedOnly:!0,fields:a,context:t,collectors:n})}},Qmt=[{prop:`dateFormat`,newProp:`date_format`},{prop:`timeFormat`,newProp:`time_format`},{prop:`pickerUtc`,newProp:`picker_utc`}],$mt=e=>{try{return Intl.DateTimeFormat(`en-US`,{timeZone:e}),!0}catch{return!1}},eht=e=>{let{config:t,context:n,collectors:r}=e,{picker_utc:i,input_timezone:a,output_utc:o}=t;i!==void 0&&(a!==void 0||o!==void 0)&&g8({type:`warning`,strKey:`conflicting_timezone_options`,context:n,collectors:r}),zH(a)&&!$mt(a)&&g8({strKey:`invalid_timezone`,values:{timeZone:a},context:n,collectors:r})},tht=e=>{let{config:t,context:n,collectors:r}=e,i=t,{localize_format:a}=i;if(!a)return;if(!BH(i).format){g8({type:`warning`,strKey:`localize_format_without_format`,context:n,collectors:r});return}if(typeof a==`string`){if(!UH(a)){g8({type:`warning`,strKey:`localize_format_unsupported_locale`,values:{locale:a},context:n,collectors:r});return}r.formatLocales.add(a);return}let{cmsConfig:o,collection:s,collectionFile:c}=n,l=s?Lf({cmsConfig:o,collection:s,file:c})?.locales??[]:o?.i18n?.locales??[];l.length?l.forEach(e=>{r.formatLocales.add(e)}):g8({type:`warning`,strKey:`localize_format_without_i18n`,context:n,collectors:r})},nht=e=>{_8({...e,UNSUPPORTED_OPTIONS:Qmt}),eht(e),tht(e)},rht=e=>e.includes(`{{`)?Qd(e,(e,t)=>`{{${hU(t).join(` | `)}}}`,{unescape:!1}):e,S9=[`media_folder`,`public_folder`],iht={compute:[`value`],datetime:[`default`],hidden:[`default`],list:[`summary`],object:[`summary`],relation:[`value_field`,`display_fields`,`search_fields`]},aht=[`pattern`,...UW],C9=(e,t)=>{X(e)&&t.forEach(t=>{let n=e[t];typeof n==`string`?e[t]=rht(n):Array.isArray(n)&&(e[t]=n.map(e=>typeof e==`string`?rht(e):e))})},oht=e=>{let{media_libraries:t,media_library:n}=e;X(t)&&Object.values(t).forEach(e=>{C9(e?.config,[`filename_template`])}),C9(n?.config,[`filename_template`])},w9=e=>{C9(e.i18n?.canonical_slug,[`value`])},T9=e=>{Array.isArray(e)&&e.forEach(e=>{if(!X(e))return;let{widget:t=`string`,filters:n,types:r}=e;C9(e,[...S9,...iht[t]??[]]),oht(e),Array.isArray(r)&&r.forEach(e=>C9(e,[`summary`])),t===`relation`&&Array.isArray(n)&&n.forEach(e=>C9(e,[`values`])),T9(_9(e))})},sht=e=>{X(e)&&(C9(e,[`file`,`summary`,`preview_path`,...S9]),w9(e),T9(e.fields))},cht=(e,t)=>{let n=Array.isArray(e)?e:e?.[t];Array.isArray(n)&&n.forEach(e=>C9(e,aht))},lht=e=>{if(!X(e))return;let{slug:t,nested:n,table_columns:r,index_file:i,files:a}=e;C9(e,[`folder`,`file`,`slug`,`path`,`summary`,`preview_path`,`table_columns`,`summary_fields`,`thumbnail`,...S9]),C9(t,[`template`]),C9(n,[`summary`]),w9(e),cht(e.view_filters,`filters`),cht(e.view_groups,`groups`),Array.isArray(r)&&r.forEach(e=>C9(e,[`field`])),T9(e.fields),X(i)&&(C9(i,[`summary`]),T9(i.fields)),Array.isArray(a)&&a.forEach(sht)},uht=e=>{let{backend:t,collections:n,singletons:r,asset_collections:i}=e;return C9(e,S9),oht(e),w9(e),X(t?.commit_messages)&&C9(t.commit_messages,Object.keys(t.commit_messages)),Array.isArray(n)&&n.forEach(lht),Array.isArray(r)&&r.forEach(sht),Array.isArray(i)&&i.forEach(e=>C9(e,S9)),e},dht=e=>{C9(e,[`summary`]),T9(e.fields)},fht=[...Jd,...Object.keys(Xd),`slug`,`dirname`,`filename`,`extension`],pht=[`{{media_folder}}`,`{{public_folder}}`],E9=({config:e,isGlobal:t=!1,context:n,collectors:r})=>{S9.forEach(i=>{let a=e[i];typeof a==`string`&&ef(a).forEach(({tag:e,name:a})=>{(t||!pht.includes(e)&&!fht.includes(a))&&g8({strKey:t?`global_folder_template_tag`:`unsupported_folder_template_tag`,values:{option:i,tag:e},context:n,collectors:r})})})},mht=({media_library:e,media_libraries:t})=>h$.includes(e?.name??``)||Object.keys(t??{}).some(e=>h$.includes(e)),hht=(e,t)=>{let{media_folder:n,public_folder:r,asset_collections:i}=e,{errors:a,warnings:o}=t;if(n===void 0&&!mht(e)&&a.add(Y(`config.error.missing_media_folder`)),r===``&&n!==void 0&&o.add(Y(`config.warning.empty_public_folder`)),typeof r==`string`&&(/^\.{1,2}\//.test(r)&&a.add(Y(`config.error.public_folder_relative_path`)),/^https?:/.test(r)&&a.add(Y(`config.error.public_folder_absolute_url`))),E9({config:e,isGlobal:!0,context:{cmsConfig:e},collectors:t}),Array.isArray(i)){let n={nameCounts:{},strKeyBase:`asset_collection_name`,collectors:t};i.forEach((r,i)=>{let{name:a}=r;v8({...n,name:a,index:i,context:{cmsConfig:e}}),E9({config:r,isGlobal:!0,context:{cmsConfig:e},collectors:t})})}},ght=[`raster_image`,...Mq,...Fq],_ht=({key:e,options:t,context:n,collectors:r})=>{let{quality:i}=t,a={values:{key:e},context:n,collectors:r};i!==void 0&&!(Number.isSafeInteger(i)&&i>=0&&i<=100)&&g8({...a,strKey:`invalid_transformation_quality`}),[`width`,`height`].forEach(n=>{let r=t[n];r!==void 0&&!(Number.isSafeInteger(r)&&r>0)&&g8({...a,strKey:`invalid_transformation_size`,values:{key:e,prop:n}})})},vht=({transformations:e,context:t,collectors:n})=>{X(e)&&Object.entries(e).forEach(([e,r])=>{ght.includes(e)?X(r)&&!Fq.includes(e)&&_ht({key:e,options:r,context:t,collectors:n}):g8({strKey:`invalid_transformation_key`,values:{key:e},context:t,collectors:n})})},yht=({config:e,context:t,collectors:n})=>{let{media_library:r,media_libraries:i}=e,a=[];X(i)&&(a.push(i.all),X(i.default)&&a.push(i.default.config)),X(r)&&(r.name??`default`)==="default"&&a.push(r.config),a.forEach(e=>{X(e)&&vht({transformations:e.transformations,context:t,collectors:n})}),e===t.cmsConfig&&[r,...X(i)?Object.values(i):[]].forEach(e=>{typeof e?.prefix==`string`&&tf(e.prefix)&&g8({type:`warning`,strKey:`site_library_prefix_template`,context:t,collectors:n})})},D9=({defaultValue:e,multiple:t=!1,context:n,collectors:r})=>{if(e==null)return;let i=Array.isArray(e);t&&!i&&g8({strKey:`invalid_default_multiple`,context:n,collectors:r}),!t&&i&&g8({strKey:`invalid_default_single`,context:n,collectors:r})},bht=({value:e,fields:t,strKeyBase:n,context:r,collectors:i})=>{let a=t.map(({name:e})=>e);Object.keys(e).filter(e=>!a.includes(e)).forEach(e=>{g8({strKey:`${n}_invalid_default_key`,values:{key:e},context:r,collectors:i})})},xht=({value:e,fields:t,types:n,typeKey:r=`type`,strKeyBase:i,context:a,collectors:o})=>{let s={value:e,strKeyBase:i,context:a,collectors:o};if(t){bht({...s,fields:t});return}let c=e[r];if(c===void 0){g8({strKey:`${i}_default_missing_type`,values:{typeKey:r},context:a,collectors:o});return}let l=n?.find(({name:e})=>e===c);l?bht({...s,fields:[...l.fields??[],{name:r}]}):g8({strKey:`${i}_invalid_default_type`,values:{typeKey:r,value:String(c)},context:a,collectors:o})},Sht=[{prop:`allow_multiple`,newProp:`multiple`,strKey:`allow_multiple`}],Cht=e=>{let{config:t,context:n,collectors:r}=e,{media_folder:i,default:a,multiple:o}=t;o!==void 0&&D9({defaultValue:a,multiple:o,context:n,collectors:r}),i!==void 0&&r.mediaFields.add({fieldConfig:t,context:n}),E9({config:t,context:n,collectors:r}),yht({config:t,context:n,collectors:r}),_8({...e,UNSUPPORTED_OPTIONS:Sht})},wht=e=>$d(e).tags.some(e=>{let{value:t,transformations:n}=gU(e),r=t===`locale`;return SH(n,e=>(wht(`{{${e}}}`)&&(r=!0),``)),r}),Tht=({config:e,context:t,collectors:n})=>{let{default:r}=e,{cmsConfig:i,collection:a,collectionFile:o}=t;typeof r==`string`&&a&&wht(r)&&(Lf({cmsConfig:i,collection:a,file:o})?.locales?.length||g8({strKey:`hidden_field_locale_without_i18n`,context:t,collectors:n}))},Eht=[[`min`,`max`],[`minlength`,`maxlength`]],Dht=({config:e,context:t,collectors:n})=>{let{default_localized:r}=e,{cmsConfig:i,collection:a,collectionFile:o}=t;if(!X(r)||!a)return;let s=Lf({cmsConfig:i,collection:a,file:o})?.locales??[];s.length?Object.keys(r).filter(e=>!s.includes(e)).forEach(e=>{g8({type:`warning`,strKey:`default_localized_unknown_locale`,values:{locale:e},context:t,collectors:n})}):g8({type:`warning`,strKey:`default_localized_without_i18n`,context:t,collectors:n})},Oht=({config:e,context:t,collectors:n})=>{let{widget:r=`string`,pattern:i,multiple:a,i18n:o}=e;zd.includes(r)&&a===!0&&o===`duplicate_if_empty`&&g8({type:`warning`,strKey:`duplicate_if_empty_multiple`,context:t,collectors:n}),Array.isArray(i)&&y8({option:`pattern`,pattern:i[0],context:t,collectors:n}),Eht.forEach(([r,i])=>{let{[r]:a,[i]:o}=e;typeof a==`number`&&typeof o==`number`&&a>o&&g8({strKey:`invalid_range_options`,values:{min:r,max:i},context:t,collectors:n})}),Dht({config:e,context:t,collectors:n})},kht=({config:e,context:t,collectors:n})=>{let{media_folder:r}=e;r!==void 0&&n.mediaFields.add({fieldConfig:e,context:t}),E9({config:e,context:t,collectors:n})},Aht={},jht=e=>{let{config:t,context:n}=e,{name:r,widget:i=`string`}=t,{typedKeyPath:a}=n,o={...e,context:{...n,typedKeyPath:a?`${a}.${r}`:r}},s=Pd.includes(i),c=Aht[i]??(s?void 0:kht);Oht(o),c?.(o),i===`date`&&g8({...o,strKey:`date_field_type`})},O9=(e,t,n)=>{let r={nameCounts:{},strKeyBase:`field_name`,context:t,collectors:n};e?.forEach((e,i)=>{let{name:a}=e;v8({...r,name:a,index:i})&&jht({config:e,context:t,collectors:n})})},Mht=[`string`,`relation`,`select`],Nht=(e,t,n)=>e===`object`||(g8({strKey:`invalid_list_variable_type`,context:t,values:{widget:e},collectors:n}),!1),Pht=[`keyvalue`,`object`],Fht=({config:e,context:t,collectors:n})=>{let{default:r}=e,{field:i}=e,{fields:a}=e,{types:o,typeKey:s=`type`}=e;Array.isArray(r)&&r.forEach(e=>{if(!a&&!o){let{widget:r=`string`}=i??{},a=!!i&&(Pht.includes(r)||!Pd.includes(r));X(e)&&!a&&g8({strKey:`list_field_invalid_default_object`,context:t,collectors:n})}else X(e)?xht({value:e,fields:a,types:o,typeKey:s,strKeyBase:`list_field`,context:t,collectors:n}):g8({strKey:`list_field_invalid_default_item`,values:{value:String(e)},context:t,collectors:n})})},Iht=({config:e,context:t,collectors:n})=>{let{fields:r}=e,{types:i}=e,{map_key_field:a}=e;if(typeof a!=`string`||!a)return;if(!r&&!i){g8({strKey:`list_field_map_key_no_subfields`,context:t,collectors:n});return}let o=(e,r)=>{let i=e.find(e=>e.name===a);if(!i){g8({strKey:r?`list_field_map_key_missing_in_type`:`list_field_map_key_not_found`,values:{name:a,type:r},context:t,collectors:n});return}let{widget:o=`string`,i18n:s}=i,{required:c=!0}=i;Mht.includes(o)||g8({strKey:`list_field_map_key_invalid_type`,values:{name:a,widget:o},context:t,collectors:n}),i.multiple===!0&&g8({strKey:`list_field_map_key_multiple`,values:{name:a},context:t,collectors:n});let{options:l}=i;o===`select`&&Array.isArray(l)&&l.some(e=>typeof(X(e)?e.value:e)!=`string`)&&g8({strKey:`list_field_map_key_option_not_string`,values:{name:a},context:t,collectors:n}),c!==!0&&g8({strKey:`list_field_map_key_not_required`,values:{name:a},context:t,collectors:n}),(s===!1||s===`none`)&&g8({strKey:`list_field_map_key_not_localized`,values:{name:a},context:t,collectors:n})};r?o(r):i.forEach(({name:e,fields:t=[]})=>o(t,e))},Lht=e=>{let{config:t,context:n,collectors:r}=e,{field:i}=t,{fields:a}=t,{types:o}=t,{thumbnail:s}=t,{typedKeyPath:c}=n,l={nameCounts:{},strKeyBase:`variable_type`,collectors:r};i&&a||i&&o||a&&o?g8({strKey:`invalid_list_field`,context:n,collectors:r}):a?.length===0||o?.length===0?g8({strKey:`list_field_no_subfields`,context:n,collectors:r}):(Fht(e),Iht(e),Imt({thumbnail:s,fields:_9(t),context:n,collectors:r}),i&&jht({config:i,context:{...n,typedKeyPath:`${c}.*`},collectors:r}),a&&O9(a,{...n,typedKeyPath:`${c}.*`},r),o?.forEach(({name:e,widget:t=`object`,fields:i},a)=>{let o={...n,typedKeyPath:`${c}.*<${e}>`};v8({...l,name:e,index:a,context:o})&&Nht(t,o,r)&&i&&O9(i,o,r)}))},Rht=[{prop:`valueType`,newProp:`value_type`}],zht=[`int`,`int/string`],Bht=[`float`,`float/string`],Vht=({config:e,context:t,collectors:n})=>{let{default:r,value_type:i=`int`}=e;if(![`string`,`number`].includes(typeof r))return;let a=zht.includes(i);if(!a&&!Bht.includes(i))return;let o=HU(r);(a?!Number.isInteger(o):!Number.isFinite(o))&&g8({strKey:a?`number_field_default_not_integer`:`number_field_default_not_number`,values:{value:String(r),valueType:i},context:t,collectors:n})},Hht=e=>{let{config:t,context:n,collectors:r}=e,{step:i}=t;Vht(e),typeof i==`number`&&i<=0&&i!==-1&&g8({strKey:`invalid_step`,values:{step:String(i)},context:n,collectors:r}),_8({...e,UNSUPPORTED_OPTIONS:Rht})},Uht=e=>{let{config:t,context:n,collectors:r}=e,{fields:i}=t,{types:a,typeKey:o}=t,{default:s,thumbnail:c}=t,{typedKeyPath:l}=n,u={nameCounts:{},strKeyBase:`variable_type`,collectors:r};i&&a?g8({strKey:`invalid_object_field`,context:n,collectors:r}):i?.length===0||a?.length===0?g8({strKey:`object_field_no_subfields`,context:n,collectors:r}):(X(s)&&xht({value:s,fields:i,types:a,typeKey:o,strKeyBase:`object_field`,context:n,collectors:r}),Imt({thumbnail:c,fields:_9(t),context:n,collectors:r}),i&&O9(i,n,r),a?.forEach(({name:e,fields:t},i)=>{let a={...n,typedKeyPath:`${l}<${e}>`};v8({...u,name:e,index:i,context:a})&&t&&O9(t,a,r)}))},Wht=[`extension`,`path`,`slug`,`slug_length`,`nested`,`meta`,`index_file`,`reorder`],Ght=e=>ef(e).some(({name:e})=>e===`slug`),Kht=(e,t)=>{let{cmsConfig:n,collection:r}=e,{file:i,format:a,preview_path:o,thumbnail:s}=r;typeof i==`string`&&((Uc(i).extension!==`json`||Cf(i))&&g8({strKey:`invalid_collection_data_file`,values:{file:i},context:e,collectors:t}),a!==void 0&&a!==`json`&&g8({strKey:`file_format_mismatch`,values:{extension:`json`,format:a},context:e,collectors:t}),Wht.forEach(n=>{n in r&&g8({strKey:`unsupported_collection_data_file_option`,values:{prop:n},context:e,collectors:t})}),[[`preview_path`,o],...(Array.isArray(s)?s:[s]).map(e=>[`thumbnail`,e])].forEach(([n,r])=>{typeof r==`string`&&Ght(r)&&g8({strKey:`collection_data_file_slug_tag`,values:{prop:n},context:e,collectors:t})}),(sx(ox({cmsConfig:n,collection:r}))||n.backend?.open_authoring)&&g8({strKey:`collection_data_file_workflow`,context:e,collectors:t}))},qht=[`slug`,`locale`],Jht=[{prop:`displayFields`,newProp:`display_fields`},{prop:`searchFields`,newProp:`search_fields`},{prop:`valueField`,newProp:`value_field`},{type:`warning`,prop:`options_length`,strKey:`unsupported_ignored_option`}],Yht=[{option:`value_field`,strKey:`relation_field_invalid_value_field`,list:!1},{option:`display_fields`,strKey:`relation_field_invalid_display_field`,list:!0},{option:`search_fields`,strKey:`relation_field_invalid_search_field`,list:!0}],Xht=({reference:e,strKey:t,fields:n,canonicalSlugKey:r,context:i,collectors:a})=>{let o=ef(e).map(({content:e})=>e);(o.length?o.filter(e=>!qht.includes(e)):[e]).forEach(e=>{let o=nf(e);o!==r&&!v9(n,o)&&g8({strKey:t,context:i,collectors:a,values:{field:e}})})},Zht=({fieldConfig:e,fields:t,canonicalSlugKey:n,orderFieldKey:r,context:i,collectors:a})=>{let{file:o,filters:s,sort_by:c}=e;Array.isArray(s)&&s.forEach(e=>{let r=X(e)?e.field:void 0;if(typeof r==`string`&&r&&r!==`slug`){let e=nf(r);e!==n&&!v9(t,e)&&g8({strKey:`relation_field_invalid_filter_field`,context:i,collectors:a,values:{field:r}})}});let l=X(c)?c.field:void 0;!o&&typeof l==`string`&&l&&!Fmt(l,{canonicalSlugKey:n,orderFieldKey:r})&&!v9(t,l)&&g8({strKey:`relation_field_invalid_sort_field`,context:i,collectors:a,values:{field:l}}),Yht.forEach(({option:r,strKey:o,list:s})=>{let c=e[r];Array.isArray(c)===s&&(s?c:[c]).forEach(e=>{typeof e==`string`&&e&&Xht({reference:e,strKey:o,fields:t,canonicalSlugKey:n,context:i,collectors:a})})})},Qht=({fieldConfig:e,context:t,collectors:n})=>{let{collection:r,value_field:i=`{{slug}}`}=e;Ght(i)&&g8({strKey:`relation_field_array_file_slug`,context:t,collectors:n,values:{collection:r}})},$ht=({collection:e,context:t,collectors:n})=>{let{cmsConfig:r,collection:i}=t;!i||!(`file`in i)||typeof i.file!=`string`||`divider`in e||`files`in e||!sx(ox({cmsConfig:r,collection:e}))||g8({strKey:`relation_field_array_file_workflow`,context:t,collectors:n,values:{collection:e.name}})},egt=e=>{let{config:t,context:n,collectors:r}=e,i=t,{collection:a,file:o,default:s,multiple:c}=i,{cmsConfig:l}=n;D9({defaultValue:s,multiple:c,context:n,collectors:r});let u=a===`_singletons`?{name:a,files:l?.singletons}:l?.collections?.find(e=>e.name===a),d,f;if(u){let e=`files`in u&&Array.isArray(u.files);o?(e&&(d=u.files.find(e=>`file`in e&&e.name===o)),d||g8({strKey:`relation_field_invalid_collection_file`,context:n,collectors:r,values:{file:o}})):e&&g8({strKey:`relation_field_missing_file_name`,context:n,collectors:r,values:{collection:a}}),f=g9({cmsConfig:l,collection:u,file:d}),`file`in u&&typeof u.file==`string`&&(i.value_field===void 0||typeof i.value_field==`string`)&&Qht({fieldConfig:i,context:n,collectors:r}),$ht({collection:u,context:n,collectors:r})}else g8({strKey:`relation_field_invalid_collection`,context:n,collectors:r,values:{collection:a}});o&&i.sort_by!==void 0&&g8({type:`warning`,strKey:`relation_field_sort_by_file_ignored`,context:n,collectors:r});let p=o?d?.fields:u?.fields;p?.length&&Zht({fieldConfig:i,fields:p,canonicalSlugKey:f,orderFieldKey:sW(u),context:n,collectors:r}),_8({...e,UNSUPPORTED_OPTIONS:Jht}),r.relationFields.add({fieldConfig:i,context:n})},tgt=[{prop:`editorComponents`,newProp:`editor_components`}],ngt=[...C$.filter(e=>!S$.includes(e)),`align`],rgt=e=>{if(w$.includes(e))return!0;let t=$m(e);return!!t&&!Nm(t)},igt=({config:e,context:t,collectors:n})=>{let{multiline:r=t.cmsConfig?.field_defaults?.richtext?.multiline??!0,buttons:i,editor_components:a}=e;r===!1&&[[`buttons`,i,e=>ngt.includes(e)],[`editor_components`,a,rgt]].forEach(([e,r,i])=>{Array.isArray(r)&&r.filter(i).forEach(r=>{g8({type:`warning`,strKey:`single_line_block_item`,values:{option:e,name:r},context:t,collectors:n})})})},agt=e=>{_8({...e,UNSUPPORTED_OPTIONS:tgt}),igt(e)};Object.assign(Aht,{code:Hmt,compute:Zmt,datetime:nht,file:Cht,hidden:Tht,image:Cht,list:Lht,markdown:agt,number:Hht,object:Uht,relation:egt,richtext:agt,select:({config:e,context:t,collectors:n})=>{let{options:r,default:i,multiple:a}=e;if(D9({defaultValue:i,multiple:a,context:t,collectors:n}),!Array.isArray(r))return;if(!r.length){g8({strKey:`select_field_no_options`,context:t,collectors:n});return}let o=r.map(e=>X(e)?e.value:e);new Set(o.filter((e,t)=>o.indexOf(e)!==t)).forEach(e=>{g8({strKey:`select_field_duplicate_option`,values:{value:String(e)},context:t,collectors:n})}),i===void 0||i===null&&!o.includes(null)||(Array.isArray(i)?i:[i]).forEach(e=>{let r=X(e)?e.value:e;o.includes(r)||g8({strKey:`select_field_invalid_default`,values:{value:String(r)},context:t,collectors:n})})}});var ogt=[`locales`,`default_locale`,`initial_locales`],sgt=e=>{e.save_all_locales!==void 0&&S4(`save_all_locales`),e.omit_default_locale_from_filename!==void 0&&S4(`omit_default_locale_from_filename`),e.structure===Ff.MULTIPLE_FOLDERS_I18N_ROOT&&S4(`multiple_folders_i18n_root`)},cgt=(e,t,n)=>{let{locales:r,default_locale:i,initial_locales:a}=e;Array.isArray(r)&&(r.length?(typeof i==`string`&&!r.includes(i)&&g8({strKey:`i18n_invalid_default_locale`,values:{locale:i},context:t,collectors:n}),Array.isArray(a)&&a.forEach(e=>{typeof e==`string`&&!r.includes(e)&&g8({strKey:`i18n_invalid_initial_locale`,values:{locale:e},context:t,collectors:n})})):g8({strKey:`i18n_no_locales`,context:t,collectors:n}))},k9=e=>e.some(e=>FW(e.i18n)||k9(_9(e))),A9=e=>Array.isArray(e)&&!!e.length,lgt=(e,t)=>{let{i18n:n,collections:r,singletons:i}=e;X(n)&&(sgt(n),cgt(n,{cmsConfig:e},t),(A9(r)||A9(i))&&([...r??[],...i??[]].some(e=>!(`divider`in e)&&!!e.i18n)||g8({strKey:`i18n_no_collections`,context:{cmsConfig:e},collectors:t})))},ugt=(e,t)=>{let{collection:n,collectionFile:r}=e;if(r){let{fields:n}=r;A9(n)&&!k9(n)&&g8({strKey:`collection_file_i18n_no_fields`,context:e,collectors:t});return}if(`files`in n){let{files:r}=n,i=Array.isArray(r)?r.filter(e=>!(`divider`in e)):[];i.length&&!i.some(e=>!!e.i18n)&&g8({strKey:`collection_i18n_no_files`,context:e,collectors:t});return}let{fields:i,index_file:a}=n;A9(i)&&!k9([...i,...X(a)?a.fields??[]:[]])&&g8({strKey:`collection_i18n_no_fields`,context:e,collectors:t})},dgt=(e,t)=>{let{cmsConfig:n,collection:r,collectionFile:i}=e,{i18n:a}=i??r;if(!a)return;X(a)&&sgt(a);let o=Lf({cmsConfig:n,collection:r,file:i});o?(X(a)&&ogt.some(e=>e in a)&&cgt(o,e,t),ugt(e,t)):i&&r.i18n&&!X(n?.i18n)||g8({type:`warning`,strKey:`i18n_not_configured`,context:e,collectors:t})},fgt=(e,t)=>{let{cmsConfig:n,collection:r,collectionFile:i}=e,{file:a,format:o=r.format,fields:s,i18n:c,summary:l}=i,{preview_path:u,preview_path_date_field:d}=i,{extension:f}=Uc(a);if(m9(f,o,s)&&g8({strKey:`file_format_mismatch`,context:e,values:{extension:f,format:o},collectors:t}),s?.length||g8({strKey:`collection_file_no_fields`,context:e,collectors:t}),Cf(a)&&!c&&g8({strKey:`collection_file_i18n_required`,context:e,collectors:t}),Cf(a)&&!Gie(a)){let o=Lf({cmsConfig:n,collection:r,file:i});o?.locales?.length&&rae(o)&&g8({type:`warning`,strKey:`locale_not_omitted_from_file_path`,values:{file:a},context:e,collectors:t})}dgt(e,t),E9({config:i,context:e,collectors:t}),O9(s,e,t),h9({extension:f,format:o,bodyField:i.body_field??r.body_field,fields:s,context:e,collectors:t}),Rmt({pathTemplate:u,dateFieldName:d,fields:s??[],context:e,collectors:t}),b9({template:l,fields:s,context:e,collectors:t})},pgt=(e,t)=>{let{cmsConfig:n,collection:r}=e,{files:i}=r,a={nameCounts:{},strKeyBase:`collection_file_name`,collectors:t};i.forEach((e,i)=>{if(`divider`in e)return;let{name:o}=e,s={cmsConfig:n,collection:r,collectionFile:e};v8({...a,name:o,index:i,context:s})&&fgt(s,t)})},mgt=({bulkEdit:e,fields:t=[],context:n,collectors:r})=>{X(e)&&Array.isArray(e.fields)&&e.fields.forEach(e=>{let i=E7(t,e);i?Yst(i)||g8({strKey:`unsupported_bulk_edit_field`,values:{name:String(e)},context:n,collectors:r}):g8({strKey:`invalid_bulk_edit_field`,values:{name:String(e)},context:n,collectors:r})})},hgt=({collection:e,context:t,collectors:n})=>{let{fields:r,filter:i}=e;if(!X(i))return;let{field:a,value:o,pattern:s}=i;typeof a==`string`&&a&&!uG.includes(a)&&a!==g9({cmsConfig:t.cmsConfig,collection:e})&&r?.length&&!v9(r,a)&&g8({strKey:`invalid_filter_field`,values:{name:a},context:t,collectors:n}),o===void 0&&s===void 0&&g8({strKey:`invalid_filter_no_condition`,context:t,collectors:n}),y8({option:`filter`,pattern:s,context:t,collectors:n})},ggt=({collection:e,context:t,collectors:n})=>{let{create:r=!0,fields:i,identifier_field:a}=e;if(!i?.length)return;if(a!==void 0){typeof a==`string`&&!v9(i,a)&&g8({strKey:`invalid_identifier_field`,values:{name:a},context:t,collectors:n});return}let o=E2(e);r&&w2(e)===void 0&&!o.editorRequired&&!o.autoIncrement&&!v9(i,`title`)&&g8({type:`warning`,strKey:`missing_identifier_field`,values:{name:`title`},context:t,collectors:n})},_gt=[Ff.SINGLE_FILE,Ff.SINGLE_FILE_DEFAULT_ROOT],vgt=({collection:e,context:t,collectors:n})=>{let{cmsConfig:r}=t,{slug:i,folder:a}=e,o=w2(e);if(T2(o)&&S4(`slug_editor_tag`),o&&$d(o).literals.some(e=>e.includes(`/`))&&g8({strKey:`invalid_slug_slash`,values:{slug:o},context:t,collectors:n}),!X(i))return;let{pattern:s,i18n:c,auto_increment:l}=i;if(l===!0&&o!==void 0&&g8({type:`warning`,strKey:`slug_template_ignored`,context:t,collectors:n}),Array.isArray(s)&&y8({option:`pattern`,pattern:s[0],context:t,collectors:n}),c===!0){let i=Lf({cmsConfig:r,collection:e}),o=i?.structure??Ff.SINGLE_FILE;(!i?.locales?.length||_gt.includes(o)&&!(typeof a==`string`&&Cf(a)))&&g8({type:`warning`,strKey:`slug_i18n_ineffective`,context:t,collectors:n})}},ygt=({config:e,options:t,fields:n,specialKeys:r,optionType:i,context:a,collectors:o})=>{let s=X(e),c={};t.forEach((e,t)=>{let{name:l,field:u,pattern:d}=X(e)?e:{};v8({name:l,index:t,nameCounts:c,strKeyBase:`${i}_name`,context:a,collectors:o,required:s}),i===`view_filter`&&X(e)&&d===void 0&&(GW(e)||g8({strKey:`invalid_view_filter_no_condition`,values:{count:String(t+1)},context:a,collectors:o})),typeof u==`string`&&u&&!r.includes(u)&&(v9(n,u)||g8({strKey:`invalid_${i}_field`,values:{name:u},context:a,collectors:o}))});let l=X(e)?e.default:void 0;typeof l==`string`&&l&&(t.some(e=>X(e)&&e.name===l)||g8({strKey:`invalid_${i}_default`,values:{name:l},context:a,collectors:o}))},bgt=(e,t)=>{let{fields:n,sortable_fields:r,table_columns:i,view_groups:a,view_filters:o}=e.collection;if(!n?.length)return;let s=g9({cmsConfig:e.cmsConfig,collection:e.collection}),c=[...uG,...s?[s]:[]];if(r){let{keys:i,defaultKey:a}=lG(r),o=sW(e.collection);new Set([...i,a]).forEach(r=>{r&&r!==`_summary`&&!Fmt(r,{canonicalSlugKey:s,orderFieldKey:o})&&!v9(n,r)&&g8({strKey:`invalid_sortable_field`,values:{name:r},context:e,collectors:t})}),Array.isArray(r)&&r.filter(cG).length>1&&g8({strKey:`multiple_sortable_field_defaults`,context:e,collectors:t})}let l=fG(e.collection);if(l){let r=Array.isArray(i)?`table_columns`:`summary_fields`;l.forEach(({key:i})=>{typeof i==`string`&&dG(i)?y9({option:r,template:i,specialTags:Bmt,fields:n,context:e,collectors:t}):typeof i==`string`&&i&&i!==`_summary`&&!c.includes(i)&&!v9(n,i)&&g8({strKey:`invalid_table_column_field`,values:{option:r,name:i},context:e,collectors:t})})}ygt({config:a,options:sG(a,`groups`).options,fields:n,specialKeys:c,optionType:`view_group`,context:e,collectors:t}),ygt({config:o,options:sG(o,`filters`).options,fields:n,specialKeys:c,optionType:`view_filter`,context:e,collectors:t})},xgt=e=>e[0]===`draft`&&e.every((t,n)=>n===0||$b.indexOf(t)>$b.indexOf(e[n-1])),Sgt=({value:e,context:t,collectors:n})=>{e&&typeof e==`object`&&Array.isArray(e.stages)&&(xgt(e.stages)||g8({strKey:`invalid_publish_mode_stages`,context:t,collectors:n}),(e.type===`preview`||e.type===`simple`)&&g8({type:`warning`,strKey:`publish_mode_stages_ignored`,values:{type:e.type},context:t,collectors:n}))},Cgt=[{prop:`sortableFields`,newProp:`sortable_fields`}],wgt=(e,t)=>{let{cmsConfig:n,collection:r}=e,{body_field:i,extension:a,fields:o,folder:s,format:c,index_file:l,preview_path:u,preview_path_date_field:d,reorder:f,bulk_edit:p,slug_length:m,view_groups:h}=r;if(m9(a,c)&&g8({strKey:`file_format_mismatch`,values:{extension:a,format:c},context:e,collectors:t}),m!==void 0&&S4(`slug_length`),_8({UNSUPPORTED_OPTIONS:Cgt,config:r,context:e,collectors:t}),o?.length||g8({strKey:`collection_no_fields`,context:e,collectors:t}),Kht(e,t),typeof s==`string`&&Cf(s)&&(Lf({cmsConfig:n,collection:r})?.locales?.length||g8({strKey:`collection_folder_i18n_required`,context:e,collectors:t}),Wie(s)||g8({strKey:`invalid_collection_folder_locale`,values:{folder:s},context:e,collectors:t})),O9(o,e,t),h9({extension:a,format:c,bodyField:i,fields:o,context:e,collectors:t}),ggt({collection:r,context:e,collectors:t}),vgt({collection:r,context:e,collectors:t}),Vmt({collection:r,context:e,collectors:t}),hgt({collection:r,context:e,collectors:t}),l){X(l)&&m9(l.extension,l.format)&&g8({strKey:`file_format_mismatch`,values:{extension:l.extension,format:l.format},context:{cmsConfig:n,collection:r,isIndexFile:!0},collectors:t});let e={cmsConfig:n,collection:r,isIndexFile:!0},s=l===!0?o:l.fields??o;if(O9(s,e,t),X(l)){let{extension:n,format:r,fields:o,summary:u}=l,d=n!==void 0||r!==void 0;(o||d)&&h9({...d?{extension:n,format:r}:{extension:a,format:c},bodyField:i,fields:s,context:e,collectors:t}),b9({template:u,fields:s,context:e,collectors:t})}}let g=cW({reorder:f});if(g){let{options:n}=sG(h,`groups`);n.some(({name:e})=>e===g)||g8({strKey:`invalid_reorder_group`,values:{name:g},context:e,collectors:t})}mgt({bulkEdit:p,fields:o,context:e,collectors:t}),Rmt({pathTemplate:u,dateFieldName:d,fields:[...o??[],...X(l)?l.fields??[]:[]],context:e,collectors:t}),bgt(e,t)},Tgt=({cmsConfig:e,collection:t},n)=>{let r=`divider`in t,i=`files`in t,a=`folder`in t,o=`file`in t,s=[r,i,a,o].filter(Boolean).length;s?s>1?g8({strKey:`invalid_collection_multiple_options`,context:{cmsConfig:e,collection:t},collectors:n}):(t.yaml_quote!==void 0&&S4(`yaml_quote`),dgt({cmsConfig:e,collection:t},n),E9({config:t,context:{cmsConfig:e,collection:t},collectors:n}),Sgt({value:t.publish_mode,context:{cmsConfig:e,collection:t},collectors:n}),i?pgt({cmsConfig:e,collection:t},n):(a||o)&&wgt({cmsConfig:e,collection:t},n)):g8({strKey:`invalid_collection_no_options`,context:{cmsConfig:e,collection:t},collectors:n})},Egt=(e,t)=>{let{collections:n,singletons:r}=e,{errors:i}=t;if(!Array.isArray(n)&&!Array.isArray(r)){i.add(Y(`config.error.no_collection`));return}n?.some(e=>!(`divider`in e)&&!e.hide)||r?.length||i.add(Y(`config.error.no_visible_collection`));let a={nameCounts:{},strKeyBase:`collection_name`,collectors:t};n?.forEach((n,r)=>{if(`divider`in n)return;let{name:i}=n,o={cmsConfig:e,collection:n};v8({...a,name:i,index:r,context:o})&&Tgt(o,t)}),Array.isArray(r)&&pgt({cmsConfig:e,collection:{name:`_singletons`,label:Y(`singletons`),label_singular:Y(`singleton`),files:r}},t)},Dgt=(e,t)=>{let{encoding:n=`unicode`,sanitize_replacement:r}=e.slug??{};typeof r==`string`&&r&&(n===`ascii`?OH:DH).test(r.replaceAll(` `,``))&&g8({strKey:`invalid_sanitize_replacement`,values:{replacement:r},context:{cmsConfig:e},collectors:t})},Ogt=[{type:`warning`,prop:`local_backend`,strKey:`unsupported_ignored_option`},{type:`warning`,prop:`locale`,strKey:`unsupported_ignored_option`},{type:`warning`,prop:`search`,strKey:`unsupported_ignored_option`}],kgt=[`site_url`],Agt=(e,t)=>{Emt(e,t),kgt.forEach(n=>{let r=e[n];Uu(r)&&!Wu(r)&&g8({strKey:`invalid_url_option`,values:{option:n,url:r},context:{cmsConfig:e},collectors:t})}),e.logo_url!==void 0&&S4(`logo_url`),Sgt({value:e.publish_mode,context:{cmsConfig:e},collectors:t}),hht(e,t),yht({config:e,context:{cmsConfig:e},collectors:t}),Dgt(e,t),lgt(e,t),Egt(e,t),_8({UNSUPPORTED_OPTIONS:Ogt,config:e,context:{cmsConfig:e},collectors:t}),Bd.forEach((n,r)=>{T3e({definition:n,componentName:r,cmsConfig:e,collectors:t}),km(n)||O9(n.fields,{cmsConfig:e,componentName:r},t)})},j9=e=>{let t=0,n=0;return e.split(`/`).forEach(e=>{e===`..`?(--t,n=Math.min(n,t)):e&&e!==`.`&&(t+=1)}),-n},jgt=(e,{collectionName:t,fileName:n})=>{if(n||t===`_singletons`)return 0;let r=e.collections?.find(e=>!(`divider`in e)&&`name`in e&&e.name===t);if(r&&`folder`in r&&!r.nested)return(r.path??``).split(`/`).length-1+(r.i18n||e.i18n?1:0)},Mgt=({config:e,entryFolders:t,assetFolders:n,collectors:r})=>{if(!uu())return;let i=new Set;t.forEach(({folderPath:e,folderPathMap:t,filePathMap:n})=>{[e,...Object.values(t??{}),...Object.values(n??{})].filter(e=>e!==void 0&&j9(e)>0).forEach(e=>i.add(e))}),n.forEach(t=>{let{internalPath:n,internalSubPath:r,entryRelative:a}=t;if(n===void 0)return;if(!a){j9(n)>0&&i.add(n);return}let o=jgt(e,t),s=[n,r].filter(Boolean).join(`/`);o!==void 0&&j9(s)>o&&i.add(s)}),i.forEach(e=>{r.errors.add(Y(`config.error.path_outside_root_dir`,{values:{path:e}}))})},Ngt={$schema:`http://json-schema.org/draft-07/schema#`,$id:`http://json-schema.org/draft-07/schema#`,title:`Core schema meta-schema`,definitions:{schemaArray:{type:`array`,minItems:1,items:{$ref:`#`}},nonNegativeInteger:{type:`integer`,minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:`#/definitions/nonNegativeInteger`},{default:0}]},simpleTypes:{enum:[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]},stringArray:{type:`array`,items:{type:`string`},uniqueItems:!0,default:[]}},type:[`object`,`boolean`],properties:{$id:{type:`string`,format:`uri-reference`},$schema:{type:`string`,format:`uri`},$ref:{type:`string`,format:`uri-reference`},$comment:{type:`string`},title:{type:`string`},description:{type:`string`},default:!0,readOnly:{type:`boolean`,default:!1},examples:{type:`array`,items:!0},multipleOf:{type:`number`,exclusiveMinimum:0},maximum:{type:`number`},exclusiveMaximum:{type:`number`},minimum:{type:`number`},exclusiveMinimum:{type:`number`},maxLength:{$ref:`#/definitions/nonNegativeInteger`},minLength:{$ref:`#/definitions/nonNegativeIntegerDefault0`},pattern:{type:`string`,format:`regex`},additionalItems:{$ref:`#`},items:{anyOf:[{$ref:`#`},{$ref:`#/definitions/schemaArray`}],default:!0},maxItems:{$ref:`#/definitions/nonNegativeInteger`},minItems:{$ref:`#/definitions/nonNegativeIntegerDefault0`},uniqueItems:{type:`boolean`,default:!1},contains:{$ref:`#`},maxProperties:{$ref:`#/definitions/nonNegativeInteger`},minProperties:{$ref:`#/definitions/nonNegativeIntegerDefault0`},required:{$ref:`#/definitions/stringArray`},additionalProperties:{$ref:`#`},definitions:{type:`object`,additionalProperties:{$ref:`#`},default:{}},properties:{type:`object`,additionalProperties:{$ref:`#`},default:{}},patternProperties:{type:`object`,additionalProperties:{$ref:`#`},propertyNames:{format:`regex`},default:{}},dependencies:{type:`object`,additionalProperties:{anyOf:[{$ref:`#`},{$ref:`#/definitions/stringArray`}]}},propertyNames:{$ref:`#`},const:!0,enum:{type:`array`,items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:`#/definitions/simpleTypes`},{type:`array`,items:{$ref:`#/definitions/simpleTypes`},minItems:1,uniqueItems:!0}]},format:{type:`string`},contentMediaType:{type:`string`},contentEncoding:{type:`string`},if:{$ref:`#`},then:{$ref:`#`},else:{$ref:`#`},allOf:{$ref:`#/definitions/schemaArray`},anyOf:{$ref:`#/definitions/schemaArray`},oneOf:{$ref:`#/definitions/schemaArray`},not:{$ref:`#`}},default:!0},M9=e=>e.replaceAll(`~1`,`/`).replaceAll(`~0`,`~`),Pgt=e=>e.replace(/^#/,``).split(`/`).filter(Boolean).map(M9),N9=(e,t)=>Pgt(t).reduce((e,t)=>e?.[t],e),Fgt=[`widget`,`name`],Igt=8,Lgt=(e,t)=>{let n=new Set,r=t;for(;X(r)&&typeof r.$ref==`string`;){if(n.has(r.$ref))return;n.add(r.$ref),r=N9(e,r.$ref)}return X(r)?r:void 0},P9=(e,t,n=0)=>{let r=Lgt(e,t);return!r||n>Igt?[]:Array.isArray(r.anyOf)?r.anyOf.flatMap(t=>P9(e,t,n+1)):X(r.properties)?[r]:[]},Rgt=(e,t)=>{let n=e.properties?.[t];if(X(n))return n.const===void 0?Array.isArray(n.enum)?n.enum:void 0:[n.const]},zgt=(e,t,n)=>{let r=P9(e,t);if(!r.length)return;let i=[],a=!1;if(r.every(e=>{let t=Rgt(e,n);return t?(i.push(...t),a||=!(e.required??[]).includes(n),!0):!1}))return{values:[...new Set(i)],optional:a}},Bgt=(e,t)=>{let n=P9(e,t);if(n.length)return n.map(e=>new Set(e.required??[])).reduce((e,t)=>e.intersection(t))},Vgt=(e,t)=>new Set(P9(e,t).flatMap(e=>Object.keys(e.properties))),F9=(e,t)=>({properties:{[e]:t.length===1?{const:t[0]}:{enum:t}}}),Hgt=(e,t)=>e.reduceRight((e,{condition:t,branch:n})=>({if:t,then:n,else:e}),t),Ugt=(e,t,n)=>Fgt.reduce((r,i)=>{if(r)return r;let a=t.map(t=>zgt(e,t,i)),o=a.filter(Boolean),s=o.flatMap(e=>e.values);return!o.length||a.length-o.length>1||s.length!==new Set(s).size?void 0:Hgt(n.map((e,t)=>({branch:e,tag:a[t]})).filter(e=>!!e.tag).sort((e,t)=>Number(e.tag?.optional)-Number(t.tag?.optional)).map(({branch:e,tag:t})=>({branch:e,condition:t?.optional?F9(i,t.values):{required:[i],...F9(i,t?.values)}})),n.filter((e,t)=>!a[t])[0]??{required:[i],...F9(i,s)})},void 0),Wgt=(e,t,n)=>{let r=t.map(t=>Bgt(e,t));if(r.some(e=>!e))return;let i=r,a=t.map(t=>Vgt(e,t)),o=i.map((e,t)=>{let n=a.reduce((e,n,r)=>t===r?e:e.union(n),new Set);return[...e.difference(n)]});if(o.filter(e=>!e.length).length>1)return;let s=n.map((e,t)=>({branch:e,markers:o[t]})).filter(e=>e.markers.length).map(({branch:e,markers:t})=>({branch:e,condition:t.length===1?{required:[t[0]]}:{anyOf:t.map(e=>({required:[e]}))}})),c=o.findIndex(e=>!e.length);return Hgt(s,c>-1?n[c]:{anyOf:s.map(({condition:e})=>e)})},I9=(e,{allowUnknownProperties:t=!1}={})=>{let n=r=>{if(Array.isArray(r))return r.map(n);if(!X(r))return r;let i={};if(Object.entries(r).forEach(([e,r])=>{e!==`anyOf`&&!(t&&e===`additionalProperties`&&r===!1)&&(i[e]=n(r))}),Array.isArray(r.anyOf)){let t=r.anyOf.map(n),a=r.anyOf.length>1?Ugt(e,r.anyOf,t)??Wgt(e,r.anyOf,t):void 0;a?Object.assign(i,a):i.anyOf=t}return i};return n(e)};function L9(e,t){let n=typeof e;if(n!==typeof t)return!1;let r=Array.isArray(e);if(r!==Array.isArray(t))return!1;if(r){let n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(!L9(e[r],t[r]))return!1;return!0}if(n===`object`){if(!e||!t)return e===t;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!L9(e[r],t[r]))return!1;return!0}return e===t}function R9(e){return encodeURI(Ggt(e)).replace(/#/g,`%23`)}function Ggt(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}var Kgt=/^[A-Za-z0-9._~!$&'()*+,;=:@/?-]$/,qgt=/^%[0-9A-Fa-f]{2}$/,Jgt=/^[A-Za-z0-9._~-]$/;function Ygt(e){let t=``;for(let n=0;n<e.length;){let r=e[n],i=e.slice(n,n+3);if(r===`%`&&qgt.test(i)){let e=String.fromCharCode(parseInt(i.slice(1),16));t+=Jgt.test(e)?e:i.toUpperCase(),n+=3;continue}let a=String.fromCodePoint(e.codePointAt(n));t+=Kgt.test(a)?a:encodeURIComponent(a),n+=a.length}return t}function z9(e,t){let n=new URL(e,t.href);return n.hash=n.hash?Ygt(n.hash.slice(1)):``,n}var Xgt={prefixItems:!0,items:!0,allOf:!0,anyOf:!0,oneOf:!0},Zgt={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependentSchemas:!0},Qgt={id:!0,$id:!0,$ref:!0,$schema:!0,$anchor:!0,$vocabulary:!0,$comment:!0,default:!0,enum:!0,const:!0,required:!0,dependentRequired:!0,type:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0},$gt=typeof self<`u`&&self.location&&self.location.origin!==`null`?new URL(self.location.origin+self.location.pathname+location.search):new URL(`https://github.com/cfworker`);function B9(e,t=Object.create(null),n=$gt,r=``){if(e&&typeof e==`object`&&!Array.isArray(e)){let i=e.$id||e.id;if(i){let a=z9(i,n);a.hash.length>1?t[a.href]=e:(a.hash=``,r===``?n=a:B9(e,t,n))}}else if(e!==!0&&e!==!1)return t;let i=n.href+(r?`#`+r:``);if(t[i]!==void 0&&t[i]!==e)throw Error(`Duplicate schema URI "${i}".`);if(t[i]=e,e===!0||e===!1)return t;if(e.__absolute_uri__===void 0&&Object.defineProperty(e,"__absolute_uri__",{enumerable:!1,value:i}),e.$ref&&e.__absolute_ref__===void 0){let t=z9(e.$ref,n);Object.defineProperty(e,"__absolute_ref__",{enumerable:!1,value:t.href})}if(e.$recursiveRef&&e.__absolute_recursive_ref__===void 0){let t=z9(e.$recursiveRef,n);Object.defineProperty(e,"__absolute_recursive_ref__",{enumerable:!1,value:t.href})}if(e.$anchor){let r=z9(`#`+e.$anchor,n);t[r.href]=e}for(let i in e){if(Qgt[i])continue;let a=`${r}/${R9(i)}`,o=e[i];if(Array.isArray(o)){if(Xgt[i]){let e=o.length;for(let r=0;r<e;r++)B9(o[r],t,n,`${a}/${r}`)}}else if(Zgt[i])for(let e in o)B9(o[e],t,n,`${a}/${R9(e)}`);else B9(o,t,n,a)}return t}var e_t=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,t_t=[0,31,28,31,30,31,30,31,31,30,31,30,31],n_t=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|([+-])(\d\d):(\d\d))?$/i,r_t=/^(?=.{1,253}$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*$/i,i_t=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,a_t=/^(?:(?:[^\x00-\x20\x7f"<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?:\.(?:[a-z0-9_]|%[0-9a-f]{2})+)*(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?:\.(?:[a-z0-9_]|%[0-9a-f]{2})+)*(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,o_t=/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,s_t=/^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,c_t=/^(?:\/(?:[^~/]|~0|~1)*)*$/,l_t=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,u_t=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,d_t=/^("(?:[\x20-\x21\x23-\x5b\x5d-\x7e]|\\[\x20-\x7e])*"|[a-z0-9.!#$%&'*+/=?^_`{|}~-]+)@(.+)$/i,f_t=e=>{let t=e.match(d_t);if(!t)return!1;let n=t[1],r=t[2];if(!n||!r||n.length>64||r.length>253||n[0]!==`"`&&(n[0]===`.`||n.endsWith(`.`)||n.includes(`..`)))return!1;if(r.startsWith(`[`)&&r.endsWith(`]`)){let e=r.slice(1,-1);return/^ipv6:/i.test(e)?m_t.test(e.slice(5)):p_t.test(e)}return r_t.test(r)},p_t=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,m_t=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,h_t=e=>/^P(?:\d+W|(?:(?:\d+Y(?:\d+M(?:\d+D)?)?|\d+M(?:\d+D)?|\d+D)(?:T(?:\d+H(?:\d+M(?:\d+S)?)?|\d+M(?:\d+S)?|\d+S))?|T(?:\d+H(?:\d+M(?:\d+S)?)?|\d+M(?:\d+S)?|\d+S)))$/.test(e);function V9(e){return e.test.bind(e)}var g_t={date:v_t,time:y_t.bind(void 0,!0),"date-time":x_t,duration:h_t,uri:w_t,"uri-reference":V9(i_t),"uri-template":V9(a_t),url:V9(o_t),email:f_t,hostname:V9(r_t),ipv4:V9(p_t),ipv6:V9(m_t),regex:E_t,uuid:V9(s_t),"json-pointer":V9(c_t),"json-pointer-uri-fragment":V9(l_t),"relative-json-pointer":V9(u_t)};function __t(e){return e%4==0&&(e%100!=0||e%400==0)}function v_t(e){let t=e.match(e_t);if(!t)return!1;let n=t[1],r=t[2],i=t[3];if(!n||!r||!i)return!1;let a=+n,o=+r,s=+i,c=o==2&&__t(a)?29:t_t[o];return o>=1&&o<=12&&s>=1&&c!==void 0&&s<=c}function y_t(e,t){let n=t.match(n_t);if(!n)return!1;let r=n[1],i=n[2],a=n[3];if(!r||!i||!a)return!1;let o=+r,s=+i,c=+a,l=n[5],u=n[6],d=+(n[7]??0),f=+(n[8]??0);if(o>23||s>59||c>60||d>23||f>59||e&&l===void 0)return!1;if(c<60)return!0;let p=u===`+`?1:u===`-`?-1:0;return(o*60+s-p*(d*60+f)+1440)%1440==1439}var b_t=/t|\s/i;function x_t(e){let[t,n,r]=e.split(b_t);return t!==void 0&&n!==void 0&&r===void 0&&v_t(t)&&y_t(!0,n)}var S_t=/\/|:/,C_t=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function w_t(e){return S_t.test(e)&&C_t.test(e)}var T_t=/[^\\]\\Z/;function E_t(e){if(T_t.test(e))return!1;try{return new RegExp(e,`u`),!0}catch{return!1}}function D_t(e){let t=0,n=e.length,r=0,i;for(;r<n;)t++,i=e.charCodeAt(r++),i>=55296&&i<=56319&&r<n&&(i=e.charCodeAt(r),(i&64512)==56320&&r++);return t}function H9(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function O_t(e){let t=Math.abs(e).toString().split(`e`),n=t[0],r=t[1]??`0`,i=n.indexOf(`.`),a=i===-1?0:n.length-i-1;return[BigInt(n.replace(`.`,``)),Number(r)-a]}function k_t(e,t){if(!Number.isFinite(e)||!Number.isFinite(t)||t<=0)return!1;let[n,r]=O_t(e),[i,a]=O_t(t),o=r-a;return o>=0?n*10n**BigInt(o)%i==0n:n%(i*10n**BigInt(-o))==0n}function U9(e,t,n=`2019-09`,r=B9(t),i=!0,a=null,o=`#`,s=`#`,c=Object.create(null)){if(t===!0)return{valid:!0,errors:[]};if(t===!1)return{valid:!1,errors:[{instanceLocation:o,keyword:`false`,keywordLocation:o,error:`False boolean schema.`}]};let l=typeof e,u;switch(l){case`boolean`:case`number`:case`string`:u=l;break;case`object`:u=e===null?`null`:Array.isArray(e)?`array`:`object`;break;default:throw Error(`Instances of "${l}" type are not supported.`)}let{$ref:d,$recursiveRef:f,$recursiveAnchor:p,type:m,const:h,enum:g,required:_,not:v,anyOf:y,allOf:b,oneOf:x,if:S,then:C,else:w,format:T,properties:ee,patternProperties:E,additionalProperties:te,unevaluatedProperties:ne,minProperties:re,maxProperties:ie,propertyNames:ae,dependentRequired:oe,dependentSchemas:se,dependencies:ce,prefixItems:le,items:ue,additionalItems:de,unevaluatedItems:fe,contains:pe,minContains:me,maxContains:he,minItems:ge,maxItems:_e,uniqueItems:ve,minimum:ye,maximum:be,exclusiveMinimum:xe,exclusiveMaximum:Se,multipleOf:Ce,minLength:we,maxLength:Te,pattern:Ee,__absolute_ref__:De,__absolute_recursive_ref__:Oe}=t,ke=[];if(p===!0&&a===null&&(a=t),f===`#`){let l=a===null?r[Oe]:a,u=`${s}/$recursiveRef`,d=U9(e,a===null?t:a,n,r,i,l,o,u,c);d.valid||ke.push({instanceLocation:o,keyword:`$recursiveRef`,keywordLocation:u,error:`A subschema had errors.`},...d.errors)}if(d!==void 0){let t=r[De||d];if(t===void 0){let e=`Unresolved $ref "${d}".`;throw De&&De!==d&&(e+=` Absolute URI "${De}".`),e+=`\nKnown schemas:\n- ${Object.keys(r).join(`
- `)}`,Error(e)}let l=`${s}/$ref`,u=U9(e,t,n,r,i,a,o,l,c);if(u.valid||ke.push({instanceLocation:o,keyword:`$ref`,keywordLocation:l,error:`A subschema had errors.`},...u.errors),n===`4`||n===`7`)return{valid:ke.length===0,errors:ke}}if(Array.isArray(m)){let t=m.length,n=!1;for(let r=0;r<t;r++)if(u===m[r]||m[r]===`integer`&&u===`number`&&e%1==0&&e===e){n=!0;break}n||ke.push({instanceLocation:o,keyword:`type`,keywordLocation:`${s}/type`,error:`Instance type "${u}" is invalid. Expected "${m.join(`", "`)}".`})}else m===`integer`?(u!==`number`||e%1||e!==e)&&ke.push({instanceLocation:o,keyword:`type`,keywordLocation:`${s}/type`,error:`Instance type "${u}" is invalid. Expected "${m}".`}):m!==void 0&&u!==m&&ke.push({instanceLocation:o,keyword:`type`,keywordLocation:`${s}/type`,error:`Instance type "${u}" is invalid. Expected "${m}".`});if(h!==void 0&&(u===`object`||u===`array`?L9(e,h)||ke.push({instanceLocation:o,keyword:`const`,keywordLocation:`${s}/const`,error:`Instance does not match ${JSON.stringify(h)}.`}):e!==h&&ke.push({instanceLocation:o,keyword:`const`,keywordLocation:`${s}/const`,error:`Instance does not match ${JSON.stringify(h)}.`})),g!==void 0&&(u===`object`||u===`array`?g.some(t=>L9(e,t))||ke.push({instanceLocation:o,keyword:`enum`,keywordLocation:`${s}/enum`,error:`Instance does not match any of ${JSON.stringify(g)}.`}):g.some(t=>e===t)||ke.push({instanceLocation:o,keyword:`enum`,keywordLocation:`${s}/enum`,error:`Instance does not match any of ${JSON.stringify(g)}.`})),v!==void 0){let t=`${s}/not`;U9(e,v,n,r,i,a,o,t).valid&&ke.push({instanceLocation:o,keyword:`not`,keywordLocation:t,error:`Instance matched "not" schema.`})}let Ae=[];if(y!==void 0){let t=`${s}/anyOf`,l=ke.length,u=!1;for(let[s,l]of y.entries()){let d=Object.create(c),f=U9(e,l,n,r,i,p===!0?a:null,o,`${t}/${s}`,d);ke.push(...f.errors),u||=f.valid,f.valid&&Ae.push(d)}u?ke.length=l:ke.splice(l,0,{instanceLocation:o,keyword:`anyOf`,keywordLocation:t,error:`Instance does not match any subschemas.`})}if(b!==void 0){let t=`${s}/allOf`,l=ke.length,u=!0;for(let[s,l]of b.entries()){let d=Object.create(c),f=U9(e,l,n,r,i,p===!0?a:null,o,`${t}/${s}`,d);ke.push(...f.errors),u&&=f.valid,f.valid&&Ae.push(d)}u?ke.length=l:ke.splice(l,0,{instanceLocation:o,keyword:`allOf`,keywordLocation:t,error:`Instance does not match every subschema.`})}if(x!==void 0){let t=`${s}/oneOf`,l=ke.length,u=x.filter((s,l)=>{let u=Object.create(c),d=U9(e,s,n,r,i,p===!0?a:null,o,`${t}/${l}`,u);return ke.push(...d.errors),d.valid&&Ae.push(u),d.valid}).length;u===1?ke.length=l:ke.splice(l,0,{instanceLocation:o,keyword:`oneOf`,keywordLocation:t,error:`Instance does not match exactly one subschema (${u} matches).`})}if((u===`object`||u===`array`)&&Object.assign(c,...Ae),S!==void 0){let t=`${s}/if`,l=Object.create(null);if(U9(e,S,n,r,i,a,o,t,l).valid){if(Object.assign(c,l),C!==void 0){let l=U9(e,C,n,r,i,a,o,`${s}/then`,c);l.valid||ke.push({instanceLocation:o,keyword:`if`,keywordLocation:t,error:`Instance does not match "then" schema.`},...l.errors)}}else if(w!==void 0){let l=U9(e,w,n,r,i,a,o,`${s}/else`,c);l.valid||ke.push({instanceLocation:o,keyword:`if`,keywordLocation:t,error:`Instance does not match "else" schema.`},...l.errors)}}if(u===`object`){if(_!==void 0)for(let t of _)H9(e,t)||ke.push({instanceLocation:o,keyword:`required`,keywordLocation:`${s}/required`,error:`Instance does not have required property "${t}".`});let t=Object.keys(e);if(re!==void 0&&t.length<re&&ke.push({instanceLocation:o,keyword:`minProperties`,keywordLocation:`${s}/minProperties`,error:`Instance does not have at least ${re} properties.`}),ie!==void 0&&t.length>ie&&ke.push({instanceLocation:o,keyword:`maxProperties`,keywordLocation:`${s}/maxProperties`,error:`Instance does not have at least ${ie} properties.`}),ae!==void 0){let t=`${s}/propertyNames`;for(let s in e){let e=`${o}/${R9(s)}`,c=U9(s,ae,n,r,i,a,e,t);c.valid||ke.push({instanceLocation:o,keyword:`propertyNames`,keywordLocation:t,error:`Property name "${s}" does not match schema.`},...c.errors)}}if(oe!==void 0){let t=`${s}/dependantRequired`;for(let n in oe)if(H9(e,n)){let r=oe[n];for(let i of r)H9(e,i)||ke.push({instanceLocation:o,keyword:`dependentRequired`,keywordLocation:t,error:`Instance has "${n}" but does not have "${i}".`})}}if(se!==void 0)for(let[t,l]of Object.entries(se)){let u=`${s}/dependentSchemas`;if(H9(e,t)){let s=U9(e,l,n,r,i,a,o,`${u}/${R9(t)}`,c);s.valid||ke.push({instanceLocation:o,keyword:`dependentSchemas`,keywordLocation:u,error:`Instance has "${t}" but does not match dependant schema.`},...s.errors)}}if(ce!==void 0){let t=`${s}/dependencies`;for(let s in ce)if(H9(e,s)){let c=ce[s];if(Array.isArray(c))for(let n of c)H9(e,n)||ke.push({instanceLocation:o,keyword:`dependencies`,keywordLocation:t,error:`Instance has "${s}" but does not have "${n}".`});else{let l=U9(e,c,n,r,i,a,o,`${t}/${R9(s)}`);l.valid||ke.push({instanceLocation:o,keyword:`dependencies`,keywordLocation:t,error:`Instance has "${s}" but does not match dependant schema.`},...l.errors)}}}let l=Object.create(null),u=!1;if(ee!==void 0){let t=`${s}/properties`;for(let[s,d]of Object.entries(ee)){if(!H9(e,s))continue;let f=`${o}/${R9(s)}`,p=U9(e[s],d,n,r,i,a,f,`${t}/${R9(s)}`);if(l[s]=!0,p.valid)c[s]=!0;else if(u=i,ke.push({instanceLocation:o,keyword:`properties`,keywordLocation:t,error:`Property "${s}" does not match schema.`},...p.errors),u)break}}if(!u&&E!==void 0){let t=`${s}/patternProperties`;for(let[s,d]of Object.entries(E)){let f=new RegExp(s,`u`);for(let p in e){if(!f.test(p))continue;let m=`${o}/${R9(p)}`,h=U9(e[p],d,n,r,i,a,m,`${t}/${R9(s)}`);l[p]=!0,h.valid?c[p]=!0:(u=i,ke.push({instanceLocation:o,keyword:`patternProperties`,keywordLocation:t,error:`Property "${p}" matches pattern "${s}" but does not match associated schema.`},...h.errors))}}}if(!u&&te!==void 0){let t=`${s}/additionalProperties`;for(let s in e){if(l[s])continue;let d=`${o}/${R9(s)}`,f=U9(e[s],te,n,r,i,a,d,t);f.valid?c[s]=!0:(u=i,ke.push({instanceLocation:o,keyword:`additionalProperties`,keywordLocation:t,error:`Property "${s}" does not match additional properties schema.`},...f.errors))}}else if(!u&&ne!==void 0){let t=`${s}/unevaluatedProperties`;for(let s in e)if(!c[s]){let l=`${o}/${R9(s)}`,u=U9(e[s],ne,n,r,i,a,l,t);u.valid?c[s]=!0:ke.push({instanceLocation:o,keyword:`unevaluatedProperties`,keywordLocation:t,error:`Property "${s}" does not match unevaluated properties schema.`},...u.errors)}}}else if(u===`array`){_e!==void 0&&e.length>_e&&ke.push({instanceLocation:o,keyword:`maxItems`,keywordLocation:`${s}/maxItems`,error:`Array has too many items (${e.length} > ${_e}).`}),ge!==void 0&&e.length<ge&&ke.push({instanceLocation:o,keyword:`minItems`,keywordLocation:`${s}/minItems`,error:`Array has too few items (${e.length} < ${ge}).`});let t=e.length,l=0,u=!1;if(le!==void 0){let d=`${s}/prefixItems`,f=Math.min(le.length,t);for(;l<f;l++){let t=U9(e[l],le[l],n,r,i,a,`${o}/${l}`,`${d}/${l}`);if(c[l]=!0,!t.valid&&(u=i,ke.push({instanceLocation:o,keyword:`prefixItems`,keywordLocation:d,error:`Items did not match schema.`},...t.errors),u))break}}if(ue!==void 0){let d=`${s}/items`;if(Array.isArray(ue)){let s=Math.min(ue.length,t);for(;l<s;l++){let t=U9(e[l],ue[l],n,r,i,a,`${o}/${l}`,`${d}/${l}`);if(c[l]=!0,!t.valid&&(u=i,ke.push({instanceLocation:o,keyword:`items`,keywordLocation:d,error:`Items did not match schema.`},...t.errors),u))break}}else for(;l<t;l++){let t=U9(e[l],ue,n,r,i,a,`${o}/${l}`,d);if(c[l]=!0,!t.valid&&(u=i,ke.push({instanceLocation:o,keyword:`items`,keywordLocation:d,error:`Items did not match schema.`},...t.errors),u))break}if(!u&&de!==void 0){let d=`${s}/additionalItems`;for(;l<t;l++){let t=U9(e[l],de,n,r,i,a,`${o}/${l}`,d);c[l]=!0,t.valid||(u=i,ke.push({instanceLocation:o,keyword:`additionalItems`,keywordLocation:d,error:`Items did not match additional items schema.`},...t.errors))}}}if(pe!==void 0){if(t===0&&me===void 0)ke.push({instanceLocation:o,keyword:`contains`,keywordLocation:`${s}/contains`,error:`Array is empty. It must contain at least one item matching the schema.`});else if(me!==void 0&&t<me)ke.push({instanceLocation:o,keyword:`minContains`,keywordLocation:`${s}/minContains`,error:`Array has less items (${t}) than minContains (${me}).`});else{let l=`${s}/contains`,u=ke.length,d=0;for(let s=0;s<t;s++){let t=U9(e[s],pe,n,r,i,a,`${o}/${s}`,l);t.valid?(c[s]=!0,d++):ke.push(...t.errors)}d>=(me||0)&&(ke.length=u),me===void 0&&d===0?ke.splice(u,0,{instanceLocation:o,keyword:`contains`,keywordLocation:l,error:`Array does not contain item matching schema.`}):me!==void 0&&d<me?ke.push({instanceLocation:o,keyword:`minContains`,keywordLocation:`${s}/minContains`,error:`Array must contain at least ${me} items matching schema. Only ${d} items were found.`}):he!==void 0&&d>he&&ke.push({instanceLocation:o,keyword:`maxContains`,keywordLocation:`${s}/maxContains`,error:`Array may contain at most ${he} items matching schema. ${d} items were found.`})}}if(!u&&fe!==void 0){let u=`${s}/unevaluatedItems`;for(;l<t;l++){if(c[l])continue;let t=U9(e[l],fe,n,r,i,a,`${o}/${l}`,u);c[l]=!0,t.valid||ke.push({instanceLocation:o,keyword:`unevaluatedItems`,keywordLocation:u,error:`Items did not match unevaluated items schema.`},...t.errors)}}if(ve)for(let n=0;n<t;n++){let r=e[n],i=typeof r==`object`&&!!r;for(let a=0;a<t;a++){if(n===a)continue;let t=e[a];(r===t||i&&typeof t==`object`&&t&&L9(r,t))&&(ke.push({instanceLocation:o,keyword:`uniqueItems`,keywordLocation:`${s}/uniqueItems`,error:`Duplicate items at indexes ${n} and ${a}.`}),n=2**53-1,a=2**53-1)}}}else if(u===`number`)n===`4`?(ye!==void 0&&(xe===!0&&e<=ye||e<ye)&&ke.push({instanceLocation:o,keyword:`minimum`,keywordLocation:`${s}/minimum`,error:`${e} is less than ${xe?`or equal to `:``} ${ye}.`}),be!==void 0&&(Se===!0&&e>=be||e>be)&&ke.push({instanceLocation:o,keyword:`maximum`,keywordLocation:`${s}/maximum`,error:`${e} is greater than ${Se?`or equal to `:``} ${be}.`})):(ye!==void 0&&e<ye&&ke.push({instanceLocation:o,keyword:`minimum`,keywordLocation:`${s}/minimum`,error:`${e} is less than ${ye}.`}),be!==void 0&&e>be&&ke.push({instanceLocation:o,keyword:`maximum`,keywordLocation:`${s}/maximum`,error:`${e} is greater than ${be}.`}),xe!==void 0&&e<=xe&&ke.push({instanceLocation:o,keyword:`exclusiveMinimum`,keywordLocation:`${s}/exclusiveMinimum`,error:`${e} is less than ${xe}.`}),Se!==void 0&&e>=Se&&ke.push({instanceLocation:o,keyword:`exclusiveMaximum`,keywordLocation:`${s}/exclusiveMaximum`,error:`${e} is greater than or equal to ${Se}.`})),Ce!==void 0&&(k_t(e,Ce)||ke.push({instanceLocation:o,keyword:`multipleOf`,keywordLocation:`${s}/multipleOf`,error:`${e} is not a multiple of ${Ce}.`}));else if(u===`string`){let t=we===void 0&&Te===void 0?0:D_t(e);we!==void 0&&t<we&&ke.push({instanceLocation:o,keyword:`minLength`,keywordLocation:`${s}/minLength`,error:`String is too short (${t} < ${we}).`}),Te!==void 0&&t>Te&&ke.push({instanceLocation:o,keyword:`maxLength`,keywordLocation:`${s}/maxLength`,error:`String is too long (${t} > ${Te}).`}),Ee!==void 0&&!new RegExp(Ee,`u`).test(e)&&ke.push({instanceLocation:o,keyword:`pattern`,keywordLocation:`${s}/pattern`,error:`String does not match pattern.`}),T!==void 0&&g_t[T]&&!g_t[T](e)&&ke.push({instanceLocation:o,keyword:`format`,keywordLocation:`${s}/format`,error:`String does not match format "${T}".`})}return{valid:ke.length===0,errors:ke}}var A_t=class{schema;draft;shortCircuit;lookup;constructor(e,t=`2019-09`,n=!0){this.schema=e,this.draft=t,this.shortCircuit=n,this.lookup=B9(e)}validate(e){return U9(e,this.schema,this.draft,this.lookup,this.shortCircuit)}addSchema(e,t){t&&(e={...e,$id:t}),B9(e,this.lookup)}},j_t=`7`,M_t=[`$ref`,`properties`,`items`,`if`,`allOf`,`oneOf`,`additionalProperties`],W9=`false`,N_t={type:`type`,enum:`allowedValues`,const:`allowedValue`,minItems:`limit`,maxItems:`limit`,minLength:`limit`,maxLength:`limit`},P_t=(e,t)=>Pgt(t).reduce((t,n)=>n===`$ref`&&X(t)&&typeof t.$ref==`string`?N9(e,t.$ref):t?.[n],e),F_t=({keyword:e,keywordLocation:t,instanceLocation:n},r,i)=>{let a=n.replace(/^#/,``);if(e===`required`){let o=P_t(r,t),s=N9(i,n);return!Array.isArray(o)||!X(s)?[]:o.filter(e=>!(e in s)).map(t=>({instancePath:a,keyword:e,params:{missingProperty:t}}))}let o=N_t[e];return[{instancePath:a,keyword:e,params:o?{[o]:P_t(r,t)}:{}}]},I_t=e=>{let t=e.filter(({keyword:e})=>e!==W9).map(({instanceLocation:e})=>e);return e.filter(({keyword:e,instanceLocation:n})=>e===W9&&!t.some(e=>e===n||e.startsWith(`${n}/`))).map(({instanceLocation:e})=>{let t=e.replace(/^#/,``),n=t.lastIndexOf(`/`);return{instancePath:t.slice(0,n),keyword:`additionalProperties`,params:{additionalProperty:M9(t.slice(n+1))}}})},G9=e=>{let t=new A_t(structuredClone(e),j_t,!1);return n=>{let{valid:r,errors:i}=t.validate(n);if(r)return[];let a=new Set;return I_t(i).concat(i.filter(({keyword:e})=>e!==W9&&!M_t.includes(e)).filter(({keyword:e,instanceLocation:t,keywordLocation:n})=>{if(e!==`required`)return!0;let r=`${t}|${n}`;return!a.has(r)&&(a.add(r),!0)}).flatMap(t=>F_t(t,e,n)))}},L_t=()=>{let e=[],t;return Hd.forEach(({schema:n},r)=>{X(n)&&(t??=G9(Ngt),t(n).length?console.warn(`Ignoring the invalid schema registered for the \`${r}\` field type`):e.push({if:{required:[`widget`],properties:{widget:{const:r}}},then:I9(n,{allowUnknownProperties:!0})}))}),e},R_t=e=>{let t=e.definitions?.CustomField,n=X(t)?L_t():[];return n.length?{...e,definitions:{...e.definitions,CustomField:{allOf:[t,...n]}}}:e},z_t=[`string`,`number`,`integer`,`boolean`,`array`,`object`,`null`],K9=e=>kf(Ec.current,{type:`disjunction`}).format(e),B_t=e=>`\`${typeof e==`string`&&e?e:JSON.stringify(e)}\``,V_t=e=>Y(`config.error.schema_value_type.${e}`),q9=e=>e.reduce((e,t)=>eh(t)?`${e}[${t}]`:e?`${e}.${t}`:t,``),H_t=(e,t,n)=>{let r=t?.widget===`list`?`${e}.*`:e;return r?`${r}.${n}`:n},U_t=(e,t)=>{let n=t.split(`/`).slice(1).map(M9),r={},i=[],a=e,o=``,s=0,c=!0;for(;s<n.length&&c;){let t=n[s],i=n[s+1],l=i!==void 0&&eh(i)?a?.[t]?.[i]:void 0;X(l)&&a===e&&(t===`collections`||t===`singletons`)?(r[t===`collections`?`collection`:`collectionFile`]=l,a=l,s+=2):X(l)&&t===`files`&&r.collection?(r.collectionFile=l,a=l,s+=2):X(l)&&t===`fields`?(o=H_t(o,a,l.name),a=l,s+=2):X(l)&&t===`types`?(o=`${o}${a?.widget===`list`?`.*`:``}<${l.name}>`,a=l,s+=2):t===`field`&&X(a?.field)?(o=H_t(o,a,a.field.name),a=a.field,s+=1):c=!1}return i.push(...n.slice(s)),o&&(r.typedKeyPath=o),{context:r,option:i}},W_t=({keyword:e,params:t},n)=>e===`enum`?{strKey:`schema_invalid_enum`,values:{option:n,values:K9(t.allowedValues.map(B_t))}}:e===`const`?t.allowedValue===``?{strKey:`schema_invalid_empty_value`,values:{option:n}}:{strKey:`schema_invalid_const`,values:{option:n,value:String(t.allowedValue)}}:e===`minItems`||e===`maxItems`?{strKey:`schema_invalid_item_count`,values:{option:n,count:String(t.limit)}}:{strKey:`schema_invalid_value`,values:{option:n}},G_t=({config:e,errors:t,collectors:n})=>{t.filter(({keyword:e})=>e===`additionalProperties`).forEach(({instancePath:t,params:r})=>{let{context:i,option:a}=U_t(e,t);g8({type:`warning`,strKey:`schema_unknown_option`,values:{option:q9([...a,r.additionalProperty])},context:i,collectors:n})});let r=t.filter(({keyword:e})=>e!==`if`&&e!==`additionalProperties`),i=[...new Set(r.map(({instancePath:e})=>e))];i.filter(e=>!i.some(t=>t.startsWith(`${e}/`))).forEach(t=>{let i=r.filter(({instancePath:e})=>e===t),{context:a,option:o}=U_t(e,t),s=i.some(({keyword:e})=>e===`anyOf`),c=i.filter(({keyword:e})=>e===`required`).map(({params:e})=>q9([...o,e.missingProperty])),l=i.filter(({keyword:e})=>e!==`required`&&e!==`anyOf`),u=[...new Set(l.filter(({keyword:e,params:t})=>e===`type`&&z_t.includes(t.type)).map(({params:e})=>e.type))];c.length>1&&s?g8({strKey:`schema_missing_one_of`,values:{options:K9([...new Set(c)].map(B_t))},context:a,collectors:n}):[...new Set(c)].forEach(e=>{g8({strKey:`schema_missing_option`,values:{option:e},context:a,collectors:n})}),u.length&&g8({strKey:`schema_invalid_type`,values:{option:q9(o),type:K9(u.map(V_t))},context:a,collectors:n}),l.filter(({keyword:e,params:t})=>!(e===`type`&&z_t.includes(t.type))).forEach(e=>{g8({...W_t(e,q9(o)),context:a,collectors:n})}),!c.length&&!l.length&&g8({strKey:`schema_invalid_value`,values:{option:q9(o)},context:a,collectors:n})})},J9={$schema:`http://json-schema.org/draft-07/schema#`,$ref:`#/definitions/CmsConfig`,definitions:{CmsConfig:{type:`object`,properties:{load_config_file:{type:`boolean`},backend:{$ref:`#/definitions/Backend`},publish_mode:{anyOf:[{type:`string`,const:``},{$ref:`#/definitions/PublishModeType`},{$ref:`#/definitions/PublishModeOptions`}]},media_folder:{type:`string`},public_folder:{type:`string`},media_library:{$ref:`#/definitions/GlobalLegacyMediaLibrary`},media_libraries:{$ref:`#/definitions/MediaLibraries`},app_title:{type:`string`},site_url:{type:`string`},display_url:{type:`string`},logo_url:{type:`string`},logo:{$ref:`#/definitions/LogoOptions`},logout_redirect_url:{type:`string`},issue_reports:{$ref:`#/definitions/IssueReports`},show_preview_links:{type:`boolean`},slug:{$ref:`#/definitions/SlugOptions`},collections:{type:`array`,items:{anyOf:[{$ref:`#/definitions/Collection`},{$ref:`#/definitions/CollectionDivider`}]}},singletons:{type:`array`,items:{anyOf:[{$ref:`#/definitions/CollectionFile`},{$ref:`#/definitions/CollectionDivider`}]}},asset_collections:{type:`array`,items:{$ref:`#/definitions/AssetCollection`}},i18n:{$ref:`#/definitions/I18nOptions`},editor:{$ref:`#/definitions/EditorOptions`},output:{$ref:`#/definitions/OutputOptions`},field_defaults:{$ref:`#/definitions/FieldDefaults`},readonly:{type:`boolean`},$schema:{type:`string`,format:`uri`}},required:[`backend`],additionalProperties:!1,anyOf:[{required:[`collections`]},{required:[`singletons`]}]},Backend:{anyOf:[{$ref:`#/definitions/GitBackend`},{$ref:`#/definitions/TestBackend`}]},GitBackend:{anyOf:[{$ref:`#/definitions/GitHubBackend`},{$ref:`#/definitions/GitLabBackend`},{$ref:`#/definitions/GiteaBackend`},{$ref:`#/definitions/ForgejoBackend`}]},GitHubBackend:{type:`object`,additionalProperties:!1,properties:{name:{type:`string`,const:`github`},repo:{type:`string`},api_root:{type:`string`},graphql_api_root:{type:`string`},base_url:{type:`string`},auth_type:{type:`string`,const:``},auth_endpoint:{type:`string`},app_id:{type:`string`},cms_label_prefix:{type:`string`},squash_merges:{type:`boolean`},preview_context:{type:`string`},open_authoring:{type:`boolean`},auth_scope:{anyOf:[{type:`string`,const:`repo`},{type:`string`,const:`public_repo`},{type:`array`,items:{type:`string`,enum:[`repo`,`public_repo`,`workflow`]}}]},branch:{type:`string`},root_dir:{type:`string`},site_domain:{type:`string`},commit_messages:{$ref:`#/definitions/CommitMessages`},automatic_deployments:{type:`boolean`},skip_ci:{type:`boolean`},prompt_commit_messages:{anyOf:[{type:`boolean`},{type:`string`,const:`prefix`},{type:`string`,const:`suffix`}]},signoff_commits:{type:`boolean`},auth_methods:{type:`array`,items:{$ref:`#/definitions/AuthMethodName`}},include_credentials:{type:`boolean`}},required:[`name`,`repo`]},CommitMessages:{type:`object`,properties:{create:{type:`string`},update:{type:`string`},delete:{type:`string`},uploadMedia:{type:`string`},deleteMedia:{type:`string`},openAuthoring:{type:`string`}},additionalProperties:!1},AuthMethodName:{type:`string`,enum:[`oauth`,`token`]},GitLabBackend:{type:`object`,additionalProperties:!1,properties:{name:{type:`string`,const:`gitlab`},repo:{type:`string`},api_root:{type:`string`},graphql_api_root:{type:`string`},base_url:{type:`string`},auth_type:{type:`string`,enum:[``,`pkce`]},auth_endpoint:{type:`string`},app_id:{type:`string`},cms_label_prefix:{type:`string`},squash_merges:{type:`boolean`},preview_context:{type:`string`},open_authoring:{type:`boolean`},branch:{type:`string`},root_dir:{type:`string`},site_domain:{type:`string`},commit_messages:{$ref:`#/definitions/CommitMessages`},automatic_deployments:{type:`boolean`},skip_ci:{type:`boolean`},prompt_commit_messages:{anyOf:[{type:`boolean`},{type:`string`,const:`prefix`},{type:`string`,const:`suffix`}]},signoff_commits:{type:`boolean`},auth_methods:{type:`array`,items:{$ref:`#/definitions/AuthMethodName`}},include_credentials:{type:`boolean`}},required:[`name`,`repo`]},GiteaBackend:{type:`object`,additionalProperties:!1,properties:{name:{type:`string`,const:`gitea`},repo:{type:`string`},api_root:{type:`string`},base_url:{type:`string`},auth_endpoint:{type:`string`},app_id:{type:`string`},cms_label_prefix:{type:`string`},squash_merges:{type:`boolean`},preview_context:{type:`string`},open_authoring:{type:`boolean`},branch:{type:`string`},root_dir:{type:`string`},site_domain:{type:`string`},commit_messages:{$ref:`#/definitions/CommitMessages`},automatic_deployments:{type:`boolean`},skip_ci:{type:`boolean`},prompt_commit_messages:{anyOf:[{type:`boolean`},{type:`string`,const:`prefix`},{type:`string`,const:`suffix`}]},signoff_commits:{type:`boolean`},auth_methods:{type:`array`,items:{$ref:`#/definitions/AuthMethodName`}},include_credentials:{type:`boolean`}},required:[`name`,`repo`]},ForgejoBackend:{type:`object`,additionalProperties:!1,properties:{name:{type:`string`,const:`forgejo`},api_root:{type:`string`},base_url:{type:`string`},repo:{type:`string`},auth_endpoint:{type:`string`},app_id:{type:`string`},cms_label_prefix:{type:`string`},squash_merges:{type:`boolean`},preview_context:{type:`string`},open_authoring:{type:`boolean`},branch:{type:`string`},root_dir:{type:`string`},site_domain:{type:`string`},commit_messages:{$ref:`#/definitions/CommitMessages`},automatic_deployments:{type:`boolean`},skip_ci:{type:`boolean`},prompt_commit_messages:{anyOf:[{type:`boolean`},{type:`string`,const:`prefix`},{type:`string`,const:`suffix`}]},signoff_commits:{type:`boolean`},auth_methods:{type:`array`,items:{$ref:`#/definitions/AuthMethodName`}},include_credentials:{type:`boolean`}},required:[`api_root`,`name`,`repo`]},TestBackend:{type:`object`,properties:{name:{type:`string`,const:`test-repo`},root_dir:{type:`string`}},required:[`name`],additionalProperties:!1},PublishModeType:{type:`string`,enum:[`simple`,`preview`,`editorial_workflow`]},PublishModeOptions:{type:`object`,properties:{type:{$ref:`#/definitions/PublishModeType`},stages:{type:`array`,items:{$ref:`#/definitions/PublishModeStage`}},direct_publish:{type:`boolean`},allow_incomplete_drafts:{type:`boolean`}},additionalProperties:!1},PublishModeStage:{type:`string`,enum:[`draft`,`pending_review`,`pending_publish`]},GlobalLegacyMediaLibrary:{anyOf:[{type:`object`,additionalProperties:!1,properties:{name:{type:`string`,const:`default`},config:{$ref:`#/definitions/DefaultMediaLibraryConfig`}}},{$ref:`#/definitions/NamedLegacyMediaLibrary`}]},DefaultMediaLibraryConfig:{type:`object`,additionalProperties:!1,properties:{multiple:{type:`boolean`},max_file_size:{type:`number`},slugify_filename:{type:`boolean`},filename_template:{type:`string`},transformations:{$ref:`#/definitions/ImageTransformations`}}},ImageTransformations:{type:`object`,additionalProperties:!1,properties:{svg:{$ref:`#/definitions/VectorImageTransformationOptions`},raster_image:{$ref:`#/definitions/RasterImageTransformationOptions`},avif:{$ref:`#/definitions/RasterImageTransformationOptions`},gif:{$ref:`#/definitions/RasterImageTransformationOptions`},heic:{$ref:`#/definitions/RasterImageTransformationOptions`},jpeg:{$ref:`#/definitions/RasterImageTransformationOptions`},png:{$ref:`#/definitions/RasterImageTransformationOptions`},webp:{$ref:`#/definitions/RasterImageTransformationOptions`}}},VectorImageTransformationOptions:{type:`object`,properties:{optimize:{type:`boolean`}},additionalProperties:!1},RasterImageTransformationOptions:{type:`object`,properties:{format:{type:`string`,const:`webp`},quality:{type:`number`},width:{type:`number`},height:{type:`number`}},additionalProperties:!1},NamedLegacyMediaLibrary:{anyOf:[{type:`object`,additionalProperties:!1,properties:{name:{type:`string`,const:`cloudinary`},output_filename_only:{type:`boolean`},use_transformations:{type:`boolean`},config:{type:`object`}},required:[`name`]},{type:`object`,additionalProperties:!1,properties:{name:{type:`string`,const:`uploadcare`},config:{type:`object`},settings:{$ref:`#/definitions/UploadcareMediaLibrarySettings`}},required:[`name`]},{type:`object`,additionalProperties:!1,properties:{name:{$ref:`#/definitions/S3MediaLibraryName`},label:{type:`string`},access_key_id:{type:`string`},bucket:{type:`string`},region:{type:`string`},account_id:{type:`string`},jurisdiction:{type:`string`,enum:[`default`,`eu`,`fedramp`]},project_id:{type:`string`},endpoint:{type:`string`},prefix:{type:`string`},force_path_style:{type:`boolean`},public_url:{type:`string`}},required:[`bucket`,`name`]},{type:`object`,additionalProperties:!1,properties:{name:{type:`string`,const:`azure_blob_storage`},label:{type:`string`},account_name:{type:`string`},container:{type:`string`},endpoint:{type:`string`},prefix:{type:`string`},public_url:{type:`string`}},required:[`container`,`name`]},{type:`object`,additionalProperties:!1,properties:{name:{type:`string`,const:`stock_assets`},providers:{type:`array`,items:{$ref:`#/definitions/StockAssetProviderName`}}},required:[`name`]}]},UploadcareMediaLibrarySettings:{type:`object`,properties:{autoFilename:{type:`boolean`},defaultOperations:{type:`string`}},additionalProperties:!1},S3MediaLibraryName:{type:`string`,enum:[`aws_s3`,`backblaze_b2`,`bunny_storage`,`cloudflare_r2`,`digitalocean_spaces`,`neon_object_storage`,`scaleway_object_storage`,`supabase_storage`]},StockAssetProviderName:{type:`string`,enum:[`pexels`,`picsum`,`pixabay`,`unsplash`]},MediaLibraries:{type:`object`,properties:{all:{$ref:`#/definitions/SharedMediaLibraryOptions`},default:{anyOf:[{type:`boolean`,const:!1},{$ref:`#/definitions/DefaultMediaLibrary`}]},cloudinary:{anyOf:[{type:`boolean`,const:!1},{$ref:`#/definitions/CloudinaryMediaLibrary`}]},uploadcare:{anyOf:[{type:`boolean`,const:!1},{$ref:`#/definitions/UploadcareMediaLibrary`}]},aws_s3:{anyOf:[{type:`boolean`,const:!1},{$ref:`#/definitions/S3MediaLibrary`}]},azure_blob_storage:{anyOf:[{type:`boolean`,const:!1},{$ref:`#/definitions/AzureMediaLibrary`}]},cloudflare_r2:{anyOf:[{type:`boolean`,const:!1},{$ref:`#/definitions/S3MediaLibrary`}]},digitalocean_spaces:{anyOf:[{type:`boolean`,const:!1},{$ref:`#/definitions/S3MediaLibrary`}]},backblaze_b2:{anyOf:[{type:`boolean`,const:!1},{$ref:`#/definitions/S3MediaLibrary`}]},bunny_storage:{anyOf:[{type:`boolean`,const:!1},{$ref:`#/definitions/S3MediaLibrary`}]},neon_object_storage:{anyOf:[{type:`boolean`,const:!1},{$ref:`#/definitions/S3MediaLibrary`}]},scaleway_object_storage:{anyOf:[{type:`boolean`,const:!1},{$ref:`#/definitions/S3MediaLibrary`}]},supabase_storage:{anyOf:[{type:`boolean`,const:!1},{$ref:`#/definitions/S3MediaLibrary`}]},stock_assets:{anyOf:[{type:`boolean`,const:!1},{$ref:`#/definitions/StockMediaLibrary`}]}},additionalProperties:!1},SharedMediaLibraryOptions:{type:`object`,properties:{max_file_size:{type:`number`},slugify_filename:{type:`boolean`},filename_template:{type:`string`},transformations:{$ref:`#/definitions/ImageTransformations`}},additionalProperties:!1},DefaultMediaLibrary:{type:`object`,properties:{config:{$ref:`#/definitions/DefaultMediaLibraryConfig`}},additionalProperties:!1},CloudinaryMediaLibrary:{type:`object`,properties:{output_filename_only:{type:`boolean`},use_transformations:{type:`boolean`},config:{type:`object`}},additionalProperties:!1},UploadcareMediaLibrary:{type:`object`,properties:{config:{type:`object`},settings:{$ref:`#/definitions/UploadcareMediaLibrarySettings`}},additionalProperties:!1},S3MediaLibrary:{type:`object`,properties:{label:{type:`string`},access_key_id:{type:`string`},bucket:{type:`string`},region:{type:`string`},account_id:{type:`string`},jurisdiction:{type:`string`,enum:[`default`,`eu`,`fedramp`]},project_id:{type:`string`},endpoint:{type:`string`},prefix:{type:`string`},force_path_style:{type:`boolean`},public_url:{type:`string`}},required:[`bucket`],additionalProperties:!1},AzureMediaLibrary:{type:`object`,properties:{label:{type:`string`},account_name:{type:`string`},container:{type:`string`},endpoint:{type:`string`},prefix:{type:`string`},public_url:{type:`string`}},required:[`container`],additionalProperties:!1},StockMediaLibrary:{type:`object`,properties:{providers:{type:`array`,items:{$ref:`#/definitions/StockAssetProviderName`}}},additionalProperties:!1},LogoOptions:{type:`object`,properties:{src:{type:`string`},show_in_header:{type:`boolean`}},additionalProperties:!1},IssueReports:{type:`object`,properties:{url:{type:`string`}},additionalProperties:!1},SlugOptions:{type:`object`,properties:{encoding:{type:`string`,enum:[`unicode`,`ascii`]},clean_accents:{type:`boolean`},sanitize_replacement:{type:`string`},maxlength:{type:`number`},trim:{type:`boolean`},lowercase:{type:`boolean`},timezone:{type:`string`,enum:[`local`,`utc`]}},additionalProperties:!1},Collection:{anyOf:[{$ref:`#/definitions/EntryCollection`},{$ref:`#/definitions/FileCollection`}]},EntryCollection:{type:`object`,additionalProperties:!1,properties:{folder:{type:`string`},file:{type:`string`},fields:{type:`array`,items:{$ref:`#/definitions/Field`}},path:{type:`string`},filter:{$ref:`#/definitions/CollectionFilter`},create:{type:`boolean`},delete:{type:`boolean`},duplicate:{type:`boolean`},reorder:{anyOf:[{type:`boolean`},{$ref:`#/definitions/ReorderOptions`}]},table_columns:{type:`array`,items:{anyOf:[{type:`string`},{$ref:`#/definitions/TableColumn`}]}},summary_fields:{type:`array`,items:{type:`string`}},bulk_edit:{anyOf:[{type:`boolean`},{$ref:`#/definitions/BulkEditOptions`}]},extension:{type:`string`},identifier_field:{type:`string`},slug:{anyOf:[{type:`string`},{$ref:`#/definitions/CollectionSlugOptions`}]},slug_length:{type:`number`},summary:{type:`string`},sortable_fields:{anyOf:[{$ref:`#/definitions/SortableFields`},{type:`array`,items:{anyOf:[{type:`string`},{$ref:`#/definitions/SortableField`}]}}]},view_filters:{anyOf:[{$ref:`#/definitions/ViewFilters`},{type:`array`,items:{$ref:`#/definitions/ViewFilter`}}]},view_groups:{anyOf:[{$ref:`#/definitions/ViewGroups`},{type:`array`,items:{$ref:`#/definitions/ViewGroup`}}]},nested:{$ref:`#/definitions/NestedEntryOptions`},meta:{$ref:`#/definitions/CollectionMetaData`},index_file:{anyOf:[{type:`boolean`},{$ref:`#/definitions/CollectionIndexFile`}]},thumbnail:{anyOf:[{type:`string`},{type:`boolean`},{type:`array`,items:{type:`string`}}]},limit:{type:`number`},aliases_field:{type:[`string`,`boolean`]},permalink_field:{type:[`string`,`boolean`]},label_singular:{type:`string`},description:{type:`string`},media_folder:{type:`string`},public_folder:{type:`string`},hide:{type:`boolean`},publish_mode:{anyOf:[{$ref:`#/definitions/PublishModeType`},{$ref:`#/definitions/PublishModeOptions`}]},publish:{type:`boolean`},format:{type:`string`},frontmatter_delimiter:{anyOf:[{type:`string`},{type:`array`,items:{type:`string`}}]},body_field:{$ref:`#/definitions/BodyFieldOptions`},i18n:{anyOf:[{type:`boolean`},{$ref:`#/definitions/I18nOptions`}]},preview_path:{type:`string`},preview_path_date_field:{type:`string`},editor:{$ref:`#/definitions/EditorOptions`},yaml_quote:{type:`boolean`},name:{type:`string`},label:{type:`string`},icon:{type:`string`},readonly:{type:`boolean`}},required:[`fields`,`name`]},Field:{anyOf:[{$ref:`#/definitions/StandardField`},{$ref:`#/definitions/CustomField`}]},StandardField:{anyOf:[{$ref:`#/definitions/VisibleField`},{$ref:`#/definitions/HiddenField`}]},VisibleField:{anyOf:[{$ref:`#/definitions/BooleanField`},{$ref:`#/definitions/CodeField`},{$ref:`#/definitions/ColorField`},{$ref:`#/definitions/ComputeField`},{$ref:`#/definitions/DateTimeField`},{$ref:`#/definitions/FileField`},{$ref:`#/definitions/ImageField`},{$ref:`#/definitions/KeyValueField`},{$ref:`#/definitions/ListField`},{$ref:`#/definitions/MapField`},{$ref:`#/definitions/MarkdownField`},{$ref:`#/definitions/NumberField`},{$ref:`#/definitions/ObjectField`},{$ref:`#/definitions/RelationField`},{$ref:`#/definitions/RichTextField`},{$ref:`#/definitions/SelectField`},{$ref:`#/definitions/StringField`},{$ref:`#/definitions/TextField`},{$ref:`#/definitions/UuidField`}]},BooleanField:{type:`object`,additionalProperties:!1,properties:{before_input:{type:`string`},after_input:{type:`string`},widget:{type:`string`,const:`boolean`},default:{type:`boolean`},default_localized:{type:`object`,additionalProperties:{type:`boolean`}},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{$ref:`#/definitions/FieldI18nStrategy`},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},FieldI18nStrategy:{anyOf:[{type:`boolean`},{type:`string`,const:`duplicate`},{type:`string`,const:`sync`},{type:`string`,const:`translate`},{type:`string`,const:`none`}]},CodeField:{type:`object`,additionalProperties:!1,properties:{widget:{type:`string`,const:`code`},default:{anyOf:[{type:`string`},{type:`object`,additionalProperties:{type:`string`}}]},default_localized:{type:`object`,additionalProperties:{anyOf:[{type:`string`},{type:`object`,additionalProperties:{type:`string`}}]}},default_language:{type:`string`},allow_language_selection:{type:`boolean`},output_code_only:{type:`boolean`},keys:{type:`object`,properties:{code:{type:`string`},lang:{type:`string`}},required:[`code`,`lang`],additionalProperties:!1},pattern:{type:`array`,minItems:2,items:[{anyOf:[{type:`string`},{type:`string`,format:`regex`}]},{type:`string`}],maxItems:2},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{$ref:`#/definitions/FieldI18nStrategy`},{type:`string`,const:`duplicate_if_empty`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},ColorField:{type:`object`,additionalProperties:!1,properties:{unique:{type:`boolean`},widget:{type:`string`,const:`color`},default:{type:`string`},default_localized:{type:`object`,additionalProperties:{type:`string`}},allowInput:{type:`boolean`},enableAlpha:{type:`boolean`},pattern:{type:`array`,minItems:2,items:[{anyOf:[{type:`string`},{type:`string`,format:`regex`}]},{type:`string`}],maxItems:2},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{$ref:`#/definitions/FieldI18nStrategy`},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},ComputeField:{type:`object`,additionalProperties:!1,properties:{widget:{type:`string`,const:`compute`},value:{type:`string`},value_type:{type:`string`,enum:[`string`,`float`,`int`,`int/string`,`float/string`]},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{$ref:`#/definitions/FieldI18nStrategy`},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`value`,`widget`]},DateTimeField:{type:`object`,additionalProperties:!1,properties:{unique:{type:`boolean`},widget:{type:`string`,const:`datetime`},default:{type:`string`},default_localized:{type:`object`,additionalProperties:{type:`string`}},type:{$ref:`#/definitions/DateTimeInputType`},min:{type:`string`},max:{type:`string`},step:{anyOf:[{type:`number`},{type:`string`,const:`any`}]},format:{type:`string`},date_format:{type:[`string`,`boolean`]},time_format:{type:[`string`,`boolean`]},localize_format:{type:[`string`,`boolean`]},picker_utc:{type:`boolean`},input_timezone:{type:`string`},output_utc:{type:`boolean`},auto_now:{anyOf:[{type:`boolean`},{type:`array`,items:{$ref:`#/definitions/DateTimeAutoNowStage`}}]},pattern:{type:`array`,minItems:2,items:[{anyOf:[{type:`string`},{type:`string`,format:`regex`}]},{type:`string`}],maxItems:2},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{$ref:`#/definitions/FieldI18nStrategy`},{type:`string`,const:`duplicate_if_empty`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},DateTimeInputType:{type:`string`,enum:[`datetime-local`,`date`,`time`]},DateTimeAutoNowStage:{type:`string`,enum:[`create`,`update`]},FileField:{type:`object`,additionalProperties:!1,properties:{unique:{type:`boolean`},widget:{type:`string`,const:`file`},select_folder:{type:`boolean`},default:{anyOf:[{type:`string`},{type:`array`,items:{type:`string`}}]},default_localized:{type:`object`,additionalProperties:{anyOf:[{type:`string`},{type:`array`,items:{type:`string`}}]}},multiple:{type:`boolean`},min:{type:`number`},max:{type:`number`},accept:{type:`string`},choose_url:{type:`boolean`},media_folder:{type:`string`},public_folder:{type:`string`},media_library:{$ref:`#/definitions/FieldLegacyMediaLibrary`},media_libraries:{$ref:`#/definitions/FieldMediaLibraries`},pattern:{type:`array`,minItems:2,items:[{anyOf:[{type:`string`},{type:`string`,format:`regex`}]},{type:`string`}],maxItems:2},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{$ref:`#/definitions/FieldI18nStrategy`},{type:`string`,const:`duplicate_if_empty`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},FieldLegacyMediaLibrary:{anyOf:[{type:`object`,additionalProperties:!1,properties:{name:{type:`string`,const:`default`},config:{$ref:`#/definitions/DefaultMediaLibraryConfig`}},required:[`name`]},{$ref:`#/definitions/FieldNamedLegacyMediaLibrary`},{$ref:`#/definitions/UnnamedLegacyMediaLibrary`}]},FieldNamedLegacyMediaLibrary:{anyOf:[{type:`object`,additionalProperties:!1,properties:{name:{type:`string`,const:`cloudinary`},output_filename_only:{type:`boolean`},use_transformations:{type:`boolean`},config:{type:`object`}},required:[`name`]},{type:`object`,additionalProperties:!1,properties:{name:{type:`string`,const:`uploadcare`},config:{type:`object`},settings:{$ref:`#/definitions/UploadcareMediaLibrarySettings`}},required:[`name`]},{type:`object`,additionalProperties:!1,properties:{name:{$ref:`#/definitions/S3MediaLibraryName`},label:{type:`string`},access_key_id:{type:`string`},bucket:{type:`string`},region:{type:`string`},account_id:{type:`string`},jurisdiction:{type:`string`,enum:[`default`,`eu`,`fedramp`]},project_id:{type:`string`},endpoint:{type:`string`},prefix:{type:`string`},force_path_style:{type:`boolean`},public_url:{type:`string`}},required:[`name`]},{type:`object`,additionalProperties:!1,properties:{name:{type:`string`,const:`azure_blob_storage`},label:{type:`string`},account_name:{type:`string`},container:{type:`string`},endpoint:{type:`string`},prefix:{type:`string`},public_url:{type:`string`}},required:[`name`]},{type:`object`,additionalProperties:!1,properties:{name:{type:`string`,const:`stock_assets`},providers:{type:`array`,items:{$ref:`#/definitions/StockAssetProviderName`}}},required:[`name`]}]},UnnamedLegacyMediaLibrary:{anyOf:[{type:`object`,additionalProperties:!1,properties:{name:{not:{}},config:{$ref:`#/definitions/DefaultMediaLibraryConfig`}}},{type:`object`,additionalProperties:!1,properties:{name:{not:{}},output_filename_only:{type:`boolean`},use_transformations:{type:`boolean`},config:{type:`object`}}},{type:`object`,additionalProperties:!1,properties:{name:{not:{}},config:{type:`object`},settings:{$ref:`#/definitions/UploadcareMediaLibrarySettings`}}},{type:`object`,additionalProperties:!1,properties:{name:{not:{}},label:{type:`string`},access_key_id:{type:`string`},bucket:{type:`string`},region:{type:`string`},account_id:{type:`string`},jurisdiction:{type:`string`,enum:[`default`,`eu`,`fedramp`]},project_id:{type:`string`},endpoint:{type:`string`},prefix:{type:`string`},force_path_style:{type:`boolean`},public_url:{type:`string`}},required:[`bucket`]},{type:`object`,additionalProperties:!1,properties:{name:{not:{}},label:{type:`string`},account_name:{type:`string`},container:{type:`string`},endpoint:{type:`string`},prefix:{type:`string`},public_url:{type:`string`}},required:[`container`]},{type:`object`,additionalProperties:!1,properties:{name:{not:{}},providers:{type:`array`,items:{$ref:`#/definitions/StockAssetProviderName`}}}}]},FieldMediaLibraries:{type:`object`,additionalProperties:!1,properties:{azure_blob_storage:{anyOf:[{type:`object`,properties:{label:{type:`string`},account_name:{type:`string`},container:{type:`string`},endpoint:{type:`string`},prefix:{type:`string`},public_url:{type:`string`}},additionalProperties:!1},{type:`boolean`,const:!1}]},aws_s3:{anyOf:[{type:`object`,properties:{label:{type:`string`},access_key_id:{type:`string`},bucket:{type:`string`},region:{type:`string`},account_id:{type:`string`},jurisdiction:{type:`string`,enum:[`default`,`eu`,`fedramp`]},project_id:{type:`string`},endpoint:{type:`string`},prefix:{type:`string`},force_path_style:{type:`boolean`},public_url:{type:`string`}},additionalProperties:!1},{type:`boolean`,const:!1}]},backblaze_b2:{anyOf:[{type:`object`,properties:{label:{type:`string`},access_key_id:{type:`string`},bucket:{type:`string`},region:{type:`string`},account_id:{type:`string`},jurisdiction:{type:`string`,enum:[`default`,`eu`,`fedramp`]},project_id:{type:`string`},endpoint:{type:`string`},prefix:{type:`string`},force_path_style:{type:`boolean`},public_url:{type:`string`}},additionalProperties:!1},{type:`boolean`,const:!1}]},bunny_storage:{anyOf:[{type:`object`,properties:{label:{type:`string`},access_key_id:{type:`string`},bucket:{type:`string`},region:{type:`string`},account_id:{type:`string`},jurisdiction:{type:`string`,enum:[`default`,`eu`,`fedramp`]},project_id:{type:`string`},endpoint:{type:`string`},prefix:{type:`string`},force_path_style:{type:`boolean`},public_url:{type:`string`}},additionalProperties:!1},{type:`boolean`,const:!1}]},cloudflare_r2:{anyOf:[{type:`object`,properties:{label:{type:`string`},access_key_id:{type:`string`},bucket:{type:`string`},region:{type:`string`},account_id:{type:`string`},jurisdiction:{type:`string`,enum:[`default`,`eu`,`fedramp`]},project_id:{type:`string`},endpoint:{type:`string`},prefix:{type:`string`},force_path_style:{type:`boolean`},public_url:{type:`string`}},additionalProperties:!1},{type:`boolean`,const:!1}]},digitalocean_spaces:{anyOf:[{type:`object`,properties:{label:{type:`string`},access_key_id:{type:`string`},bucket:{type:`string`},region:{type:`string`},account_id:{type:`string`},jurisdiction:{type:`string`,enum:[`default`,`eu`,`fedramp`]},project_id:{type:`string`},endpoint:{type:`string`},prefix:{type:`string`},force_path_style:{type:`boolean`},public_url:{type:`string`}},additionalProperties:!1},{type:`boolean`,const:!1}]},neon_object_storage:{anyOf:[{type:`object`,properties:{label:{type:`string`},access_key_id:{type:`string`},bucket:{type:`string`},region:{type:`string`},account_id:{type:`string`},jurisdiction:{type:`string`,enum:[`default`,`eu`,`fedramp`]},project_id:{type:`string`},endpoint:{type:`string`},prefix:{type:`string`},force_path_style:{type:`boolean`},public_url:{type:`string`}},additionalProperties:!1},{type:`boolean`,const:!1}]},scaleway_object_storage:{anyOf:[{type:`object`,properties:{label:{type:`string`},access_key_id:{type:`string`},bucket:{type:`string`},region:{type:`string`},account_id:{type:`string`},jurisdiction:{type:`string`,enum:[`default`,`eu`,`fedramp`]},project_id:{type:`string`},endpoint:{type:`string`},prefix:{type:`string`},force_path_style:{type:`boolean`},public_url:{type:`string`}},additionalProperties:!1},{type:`boolean`,const:!1}]},supabase_storage:{anyOf:[{type:`object`,properties:{label:{type:`string`},access_key_id:{type:`string`},bucket:{type:`string`},region:{type:`string`},account_id:{type:`string`},jurisdiction:{type:`string`,enum:[`default`,`eu`,`fedramp`]},project_id:{type:`string`},endpoint:{type:`string`},prefix:{type:`string`},force_path_style:{type:`boolean`},public_url:{type:`string`}},additionalProperties:!1},{type:`boolean`,const:!1}]},all:{$ref:`#/definitions/SharedMediaLibraryOptions`},default:{anyOf:[{type:`boolean`,const:!1},{$ref:`#/definitions/DefaultMediaLibrary`}]},cloudinary:{anyOf:[{type:`boolean`,const:!1},{$ref:`#/definitions/CloudinaryMediaLibrary`}]},uploadcare:{anyOf:[{type:`boolean`,const:!1},{$ref:`#/definitions/UploadcareMediaLibrary`}]},stock_assets:{anyOf:[{type:`boolean`,const:!1},{$ref:`#/definitions/StockMediaLibrary`}]}}},ImageField:{type:`object`,additionalProperties:!1,properties:{unique:{type:`boolean`},widget:{type:`string`,const:`image`},default:{anyOf:[{type:`string`},{type:`array`,items:{type:`string`}}]},default_localized:{type:`object`,additionalProperties:{anyOf:[{type:`string`},{type:`array`,items:{type:`string`}}]}},multiple:{type:`boolean`},min:{type:`number`},max:{type:`number`},accept:{type:`string`},choose_url:{type:`boolean`},media_folder:{type:`string`},public_folder:{type:`string`},media_library:{$ref:`#/definitions/FieldLegacyMediaLibrary`},media_libraries:{$ref:`#/definitions/FieldMediaLibraries`},pattern:{type:`array`,minItems:2,items:[{anyOf:[{type:`string`},{type:`string`,format:`regex`}]},{type:`string`}],maxItems:2},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{$ref:`#/definitions/FieldI18nStrategy`},{type:`string`,const:`duplicate_if_empty`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},KeyValueField:{type:`object`,additionalProperties:!1,properties:{min:{type:`number`},max:{type:`number`},widget:{type:`string`,const:`keyvalue`},default:{type:`object`,additionalProperties:{type:`string`}},default_localized:{type:`object`,additionalProperties:{type:`object`,additionalProperties:{type:`string`}}},key_label:{type:`string`},value_label:{type:`string`},label_singular:{type:`string`},label_singular_localized:{type:`object`,additionalProperties:{type:`string`}},root:{type:`boolean`},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{$ref:`#/definitions/FieldI18nStrategy`},{type:`string`,const:`duplicate_keys`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},ListField:{anyOf:[{$ref:`#/definitions/SimpleListField`},{$ref:`#/definitions/ListFieldWithSubField`},{$ref:`#/definitions/ListFieldWithSubFields`},{$ref:`#/definitions/ListFieldWithTypes`}]},SimpleListField:{type:`object`,additionalProperties:!1,properties:{pattern:{type:`array`,minItems:2,items:[{anyOf:[{type:`string`},{type:`string`,format:`regex`}]},{type:`string`}],maxItems:2},root:{type:`boolean`},min:{type:`number`},max:{type:`number`},widget:{type:`string`,const:`list`},default:{type:`array`,items:{}},default_localized:{type:`object`,additionalProperties:{type:`array`,items:{}}},label_singular:{type:`string`},label_singular_localized:{type:`object`,additionalProperties:{type:`string`}},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{$ref:`#/definitions/FieldI18nStrategy`},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},ListFieldWithSubField:{type:`object`,additionalProperties:!1,properties:{field:{$ref:`#/definitions/Field`},allow_add:{type:`boolean`},allow_remove:{type:`boolean`},allow_duplicate:{type:`boolean`},allow_reorder:{type:`boolean`},add_to_top:{type:`boolean`},summary:{type:`string`},thumbnail:{type:`string`},collapsed:{anyOf:[{type:`boolean`},{type:`string`,const:`auto`}]},minimize_collapsed:{anyOf:[{type:`boolean`},{type:`string`,const:`auto`}]},root:{type:`boolean`},min:{type:`number`},max:{type:`number`},widget:{type:`string`,const:`list`},default:{type:`array`,items:{}},default_localized:{type:`object`,additionalProperties:{type:`array`,items:{}}},label_singular:{type:`string`},label_singular_localized:{type:`object`,additionalProperties:{type:`string`}},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{$ref:`#/definitions/FieldI18nStrategy`},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`field`,`name`,`widget`]},ListFieldWithSubFields:{type:`object`,additionalProperties:!1,properties:{map_key_field:{type:`string`},fields:{type:`array`,items:{$ref:`#/definitions/Field`}},allow_add:{type:`boolean`},allow_remove:{type:`boolean`},allow_duplicate:{type:`boolean`},allow_reorder:{type:`boolean`},add_to_top:{type:`boolean`},summary:{type:`string`},thumbnail:{type:`string`},collapsed:{anyOf:[{type:`boolean`},{type:`string`,const:`auto`}]},minimize_collapsed:{anyOf:[{type:`boolean`},{type:`string`,const:`auto`}]},root:{type:`boolean`},min:{type:`number`},max:{type:`number`},widget:{type:`string`,const:`list`},default:{type:`array`,items:{}},default_localized:{type:`object`,additionalProperties:{type:`array`,items:{}}},label_singular:{type:`string`},label_singular_localized:{type:`object`,additionalProperties:{type:`string`}},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{$ref:`#/definitions/FieldI18nStrategy`},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`fields`,`name`,`widget`]},ListFieldWithTypes:{type:`object`,additionalProperties:!1,properties:{map_key_field:{type:`string`},types:{type:`array`,items:{$ref:`#/definitions/VariableFieldType`}},typeKey:{type:`string`},allow_add:{type:`boolean`},allow_remove:{type:`boolean`},allow_duplicate:{type:`boolean`},allow_reorder:{type:`boolean`},add_to_top:{type:`boolean`},summary:{type:`string`},thumbnail:{type:`string`},collapsed:{anyOf:[{type:`boolean`},{type:`string`,const:`auto`}]},minimize_collapsed:{anyOf:[{type:`boolean`},{type:`string`,const:`auto`}]},root:{type:`boolean`},min:{type:`number`},max:{type:`number`},widget:{type:`string`,const:`list`},default:{type:`array`,items:{}},default_localized:{type:`object`,additionalProperties:{type:`array`,items:{}}},label_singular:{type:`string`},label_singular_localized:{type:`object`,additionalProperties:{type:`string`}},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{$ref:`#/definitions/FieldI18nStrategy`},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`types`,`widget`]},VariableFieldType:{type:`object`,properties:{name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},widget:{type:`string`,const:`object`},description:{type:`string`},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},summary:{type:`string`},fields:{type:`array`,items:{$ref:`#/definitions/Field`}}},required:[`name`],additionalProperties:!1},MapField:{type:`object`,additionalProperties:!1,properties:{widget:{type:`string`,const:`map`},default:{type:`string`},default_localized:{type:`object`,additionalProperties:{type:`string`}},decimals:{type:`number`},type:{type:`string`,enum:[`Point`,`LineString`,`Polygon`]},center:{type:`array`,items:{type:`number`},minItems:2,maxItems:2},zoom:{type:`number`},pattern:{type:`array`,minItems:2,items:[{anyOf:[{type:`string`},{type:`string`,format:`regex`}]},{type:`string`}],maxItems:2},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{$ref:`#/definitions/FieldI18nStrategy`},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},MarkdownField:{type:`object`,additionalProperties:!1,properties:{unique:{type:`boolean`},widget:{type:`string`,const:`markdown`},default:{type:`string`},default_localized:{type:`object`,additionalProperties:{type:`string`}},minimal:{type:`boolean`},multiline:{type:`boolean`},buttons:{type:`array`,items:{$ref:`#/definitions/RichTextEditorButtonName`}},editor_components:{type:`array`,items:{type:`string`}},allow_nested_components:{anyOf:[{type:`boolean`},{type:`string`,const:`exclude_self`}]},modes:{type:`array`,items:{$ref:`#/definitions/RichTextEditorMode`}},sanitize_preview:{type:`boolean`},linked_images:{type:`boolean`},use_emoji_autocomplete:{type:`boolean`},use_markdown_shortcuts:{type:`boolean`},pattern:{type:`array`,minItems:2,items:[{anyOf:[{type:`string`},{type:`string`,format:`regex`}]},{type:`string`}],maxItems:2},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{$ref:`#/definitions/FieldI18nStrategy`},{type:`string`,const:`duplicate_if_empty`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},RichTextEditorButtonName:{type:`string`,enum:[`bold`,`italic`,`strikethrough`,`code`,`link`,`heading-one`,`heading-two`,`heading-three`,`heading-four`,`heading-five`,`heading-six`,`quote`,`bulleted-list`,`numbered-list`,`align`]},RichTextEditorMode:{type:`string`,enum:[`rich_text`,`raw`]},NumberField:{type:`object`,additionalProperties:!1,properties:{unique:{type:`boolean`},before_input:{type:`string`},after_input:{type:`string`},widget:{type:`string`,const:`number`},default:{type:[`string`,`number`]},default_localized:{type:`object`,additionalProperties:{type:[`string`,`number`]}},value_type:{type:`string`,enum:[`float`,`int`,`int/string`,`float/string`]},min:{type:`number`},max:{type:`number`},step:{type:`number`},auto_increment:{type:`boolean`},pattern:{type:`array`,minItems:2,items:[{anyOf:[{type:`string`},{type:`string`,format:`regex`}]},{type:`string`}],maxItems:2},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{$ref:`#/definitions/FieldI18nStrategy`},{type:`string`,const:`duplicate_if_empty`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},ObjectField:{anyOf:[{$ref:`#/definitions/ObjectFieldWithSubFields`},{$ref:`#/definitions/ObjectFieldWithTypes`}]},ObjectFieldWithSubFields:{type:`object`,additionalProperties:!1,properties:{fields:{type:`array`,items:{$ref:`#/definitions/Field`}},widget:{type:`string`,const:`object`},default:{type:`object`},default_localized:{type:`object`,additionalProperties:{type:`object`}},collapsed:{anyOf:[{type:`boolean`},{type:`string`,const:`auto`}]},summary:{type:`string`},thumbnail:{type:`string`},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{$ref:`#/definitions/FieldI18nStrategy`},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`fields`,`name`,`widget`]},ObjectFieldWithTypes:{type:`object`,additionalProperties:!1,properties:{types:{type:`array`,items:{$ref:`#/definitions/VariableFieldType`}},typeKey:{type:`string`},widget:{type:`string`,const:`object`},default:{type:`object`},default_localized:{type:`object`,additionalProperties:{type:`object`}},collapsed:{anyOf:[{type:`boolean`},{type:`string`,const:`auto`}]},summary:{type:`string`},thumbnail:{type:`string`},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{$ref:`#/definitions/FieldI18nStrategy`},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`types`,`widget`]},RelationField:{type:`object`,additionalProperties:!1,properties:{unique:{type:`boolean`},multiple:{type:`boolean`},min:{type:`number`},max:{type:`number`},dropdown_threshold:{type:`number`},widget:{type:`string`,const:`relation`},default:{anyOf:[{},{type:`array`,items:{}}]},default_localized:{type:`object`},collection:{type:`string`},file:{type:`string`},value_field:{type:`string`},display_fields:{type:`array`,items:{type:`string`}},search_fields:{type:`array`,items:{type:`string`}},filters:{type:`array`,items:{$ref:`#/definitions/RelationFieldFilterOptions`}},sort_by:{$ref:`#/definitions/RelationFieldSortOptions`},pattern:{type:`array`,minItems:2,items:[{anyOf:[{type:`string`},{type:`string`,format:`regex`}]},{type:`string`}],maxItems:2},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{$ref:`#/definitions/FieldI18nStrategy`},{type:`string`,const:`duplicate_if_empty`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`collection`,`name`,`widget`]},RelationFieldFilterOptions:{type:`object`,properties:{field:{$ref:`#/definitions/FieldKeyPath`},values:{type:`array`,items:{}},exclude:{type:`boolean`}},required:[`field`,`values`],additionalProperties:!1},FieldKeyPath:{type:`string`},RelationFieldSortOptions:{type:`object`,properties:{field:{$ref:`#/definitions/FieldKeyPath`},direction:{type:`string`,enum:[`ascending`,`descending`]}},required:[`field`],additionalProperties:!1},RichTextField:{type:`object`,additionalProperties:!1,properties:{unique:{type:`boolean`},widget:{type:`string`,const:`richtext`},format:{$ref:`#/definitions/RichTextValueFormat`},default:{type:`string`},default_localized:{type:`object`,additionalProperties:{type:`string`}},minimal:{type:`boolean`},multiline:{type:`boolean`},buttons:{type:`array`,items:{$ref:`#/definitions/RichTextEditorButtonName`}},editor_components:{type:`array`,items:{type:`string`}},allow_nested_components:{anyOf:[{type:`boolean`},{type:`string`,const:`exclude_self`}]},modes:{type:`array`,items:{$ref:`#/definitions/RichTextEditorMode`}},sanitize_preview:{type:`boolean`},linked_images:{type:`boolean`},use_emoji_autocomplete:{type:`boolean`},use_markdown_shortcuts:{type:`boolean`},pattern:{type:`array`,minItems:2,items:[{anyOf:[{type:`string`},{type:`string`,format:`regex`}]},{type:`string`}],maxItems:2},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{$ref:`#/definitions/FieldI18nStrategy`},{type:`string`,const:`duplicate_if_empty`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},RichTextValueFormat:{type:`string`,enum:[`markdown`,`html`]},SelectField:{type:`object`,additionalProperties:!1,properties:{unique:{type:`boolean`},multiple:{type:`boolean`},min:{type:`number`},max:{type:`number`},dropdown_threshold:{type:`number`},widget:{type:`string`,const:`select`},default:{anyOf:[{$ref:`#/definitions/SelectFieldValue`},{$ref:`#/definitions/SelectFieldOption`},{type:`array`,items:{anyOf:[{$ref:`#/definitions/SelectFieldValue`},{$ref:`#/definitions/SelectFieldOption`}]}}]},default_localized:{type:`object`,additionalProperties:{anyOf:[{$ref:`#/definitions/SelectFieldValue`},{$ref:`#/definitions/SelectFieldOption`},{type:`array`,items:{anyOf:[{$ref:`#/definitions/SelectFieldValue`},{$ref:`#/definitions/SelectFieldOption`}]}}]}},options:{anyOf:[{type:`array`,items:{$ref:`#/definitions/SelectFieldValue`}},{type:`array`,items:{$ref:`#/definitions/SelectFieldOption`}}]},pattern:{type:`array`,minItems:2,items:[{anyOf:[{type:`string`},{type:`string`,format:`regex`}]},{type:`string`}],maxItems:2},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{$ref:`#/definitions/FieldI18nStrategy`},{type:`string`,const:`duplicate_if_empty`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`options`,`widget`]},SelectFieldValue:{type:[`string`,`number`,`boolean`,`null`]},SelectFieldOption:{type:`object`,properties:{label:{type:`string`},value:{$ref:`#/definitions/SelectFieldValue`}},required:[`label`,`value`],additionalProperties:!1},StringField:{type:`object`,additionalProperties:!1,properties:{unique:{type:`boolean`},minlength:{type:`number`},maxlength:{type:`number`},before_input:{type:`string`},after_input:{type:`string`},widget:{type:`string`,const:`string`},default:{type:`string`},default_localized:{type:`object`,additionalProperties:{type:`string`}},type:{type:`string`,enum:[`url`,`text`,`email`]},prefix:{type:`string`},suffix:{type:`string`},use_emoji_autocomplete:{type:`boolean`},pattern:{type:`array`,minItems:2,items:[{anyOf:[{type:`string`},{type:`string`,format:`regex`}]},{type:`string`}],maxItems:2},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{$ref:`#/definitions/FieldI18nStrategy`},{type:`string`,const:`duplicate_if_empty`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`]},TextField:{type:`object`,additionalProperties:!1,properties:{unique:{type:`boolean`},minlength:{type:`number`},maxlength:{type:`number`},widget:{type:`string`,const:`text`},default:{type:`string`},default_localized:{type:`object`,additionalProperties:{type:`string`}},use_emoji_autocomplete:{type:`boolean`},pattern:{type:`array`,minItems:2,items:[{anyOf:[{type:`string`},{type:`string`,format:`regex`}]},{type:`string`}],maxItems:2},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{$ref:`#/definitions/FieldI18nStrategy`},{type:`string`,const:`duplicate_if_empty`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},UuidField:{type:`object`,additionalProperties:!1,properties:{widget:{type:`string`,const:`uuid`},default:{type:`string`},default_localized:{type:`object`,additionalProperties:{type:`string`}},prefix:{type:`string`},use_b32_encoding:{type:`boolean`},read_only:{type:`boolean`},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{$ref:`#/definitions/FieldI18nStrategy`},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},HiddenField:{type:`object`,additionalProperties:!1,properties:{widget:{type:`string`,const:`hidden`},default:{},default_localized:{type:`object`},i18n:{$ref:`#/definitions/FieldI18nStrategy`},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},CustomField:{type:`object`,properties:{widget:{type:`string`,minLength:1,not:{enum:[`boolean`,`code`,`color`,`compute`,`datetime`,`file`,`hidden`,`image`,`keyvalue`,`list`,`map`,`markdown`,`number`,`object`,`relation`,`richtext`,`select`,`string`,`text`,`uuid`]}},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{$ref:`#/definitions/FieldI18nStrategy`},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},CollectionFilter:{type:`object`,properties:{field:{$ref:`#/definitions/FieldKeyPath`},value:{anyOf:[{},{type:`array`,items:{}}]},pattern:{anyOf:[{type:`string`},{type:`string`,format:`regex`}]}},required:[`field`],additionalProperties:!1},ReorderOptions:{type:`object`,properties:{key:{type:`string`},group:{type:`string`}},additionalProperties:!1},TableColumn:{type:`object`,properties:{field:{$ref:`#/definitions/FieldKeyPath`},label:{type:`string`}},required:[`field`],additionalProperties:!1},BulkEditOptions:{type:`object`,properties:{fields:{type:`array`,items:{type:`string`}}},additionalProperties:!1},CollectionSlugOptions:{type:`object`,properties:{template:{type:`string`},editable:{anyOf:[{type:`boolean`},{type:`array`,items:{$ref:`#/definitions/SlugEditableStage`}}]},i18n:{anyOf:[{type:`boolean`},{type:`string`,const:`duplicate`}]},auto_increment:{type:`boolean`},hint:{type:`string`},pattern:{type:`array`,minItems:2,items:[{anyOf:[{type:`string`},{type:`string`,format:`regex`}]},{type:`string`}],maxItems:2}},additionalProperties:!1},SlugEditableStage:{type:`string`,enum:[`create`,`update`]},SortableFields:{type:`object`,properties:{fields:{type:`array`,items:{$ref:`#/definitions/FieldKeyPath`}},default:{$ref:`#/definitions/SortableFieldsDefaultOptions`}},required:[`fields`],additionalProperties:!1},SortableFieldsDefaultOptions:{type:`object`,properties:{field:{$ref:`#/definitions/FieldKeyPath`},direction:{type:`string`,enum:[`ascending`,`descending`,`Ascending`,`Descending`,`None`]}},required:[`field`],additionalProperties:!1},SortableField:{type:`object`,properties:{field:{$ref:`#/definitions/FieldKeyPath`},label:{type:`string`},default_sort:{anyOf:[{type:`boolean`},{type:`string`,const:`desc`},{type:`string`,const:`asc`}]}},required:[`field`],additionalProperties:!1},ViewFilters:{type:`object`,properties:{filters:{type:`array`,items:{$ref:`#/definitions/ViewFilter`}},default:{type:`string`}},required:[`filters`],additionalProperties:!1},ViewFilter:{type:`object`,additionalProperties:!1,properties:{eq:{$ref:`#/definitions/ViewComparisonValue`},ne:{$ref:`#/definitions/ViewComparisonValue`},lt:{$ref:`#/definitions/ViewComparisonValue`},lte:{$ref:`#/definitions/ViewComparisonValue`},gt:{$ref:`#/definitions/ViewComparisonValue`},gte:{$ref:`#/definitions/ViewComparisonValue`},in:{type:`array`,items:{$ref:`#/definitions/ViewComparisonValue`}},not_in:{type:`array`,items:{$ref:`#/definitions/ViewComparisonValue`}},empty:{type:`boolean`},name:{type:`string`},label:{type:`string`},field:{$ref:`#/definitions/FieldKeyPath`},pattern:{anyOf:[{type:`string`},{type:`boolean`},{type:`string`,format:`regex`}]}},required:[`field`,`label`]},ViewComparisonValue:{type:[`string`,`number`,`boolean`]},ViewGroups:{type:`object`,properties:{groups:{type:`array`,items:{$ref:`#/definitions/ViewGroup`}},default:{type:`string`}},required:[`groups`],additionalProperties:!1},ViewGroup:{type:`object`,additionalProperties:!1,properties:{eq:{$ref:`#/definitions/ViewComparisonValue`},ne:{$ref:`#/definitions/ViewComparisonValue`},lt:{$ref:`#/definitions/ViewComparisonValue`},lte:{$ref:`#/definitions/ViewComparisonValue`},gt:{$ref:`#/definitions/ViewComparisonValue`},gte:{$ref:`#/definitions/ViewComparisonValue`},in:{type:`array`,items:{$ref:`#/definitions/ViewComparisonValue`}},not_in:{type:`array`,items:{$ref:`#/definitions/ViewComparisonValue`}},empty:{type:`boolean`},name:{type:`string`},label:{type:`string`},field:{$ref:`#/definitions/FieldKeyPath`},pattern:{anyOf:[{type:`string`},{type:`boolean`},{type:`string`,format:`regex`}]},collapsed:{type:`boolean`}},required:[`field`,`label`]},NestedEntryOptions:{type:`object`,properties:{depth:{type:`number`},summary:{type:`string`},subfolders:{type:`boolean`}},additionalProperties:!1},CollectionMetaData:{type:`object`,properties:{path:{$ref:`#/definitions/CollectionMetaDataPath`}},additionalProperties:!1},CollectionMetaDataPath:{type:`object`,properties:{widget:{type:`string`},label:{type:`string`},index_file:{type:`string`}},additionalProperties:!1},CollectionIndexFile:{type:`object`,properties:{name:{type:`string`},extension:{type:`string`},format:{type:`string`},label:{type:`string`},icon:{type:`string`},summary:{type:`string`},fields:{type:`array`,items:{$ref:`#/definitions/Field`}},editor:{$ref:`#/definitions/EditorOptions`}},additionalProperties:!1},EditorOptions:{type:`object`,properties:{preview:{type:`boolean`},second_pane:{type:`boolean`}},additionalProperties:!1},BodyFieldOptions:{type:`object`,properties:{key:{type:`string`},inline:{type:`boolean`}},additionalProperties:!1},I18nOptions:{type:`object`,properties:{structure:{$ref:`#/definitions/I18nFileStructure`},locales:{type:`array`,items:{type:`string`}},default_locale:{type:`string`},initial_locales:{anyOf:[{type:`array`,items:{type:`string`}},{type:`string`,const:`default`},{type:`string`,const:`all`}]},save_all_locales:{type:`boolean`},canonical_slug:{type:`object`,properties:{key:{type:`string`},value:{type:`string`}},additionalProperties:!1},omit_default_locale_from_filename:{type:`boolean`},omit_default_locale_from_file_path:{type:`boolean`},omit_default_locale_from_preview_path:{type:`boolean`}},additionalProperties:!1},I18nFileStructure:{type:`string`,enum:[`single_file`,`single_file_default_root`,`multiple_files`,`multiple_folders`,`multiple_folders_i18n_root`,`multiple_root_folders`]},FileCollection:{type:`object`,additionalProperties:!1,properties:{files:{type:`array`,items:{$ref:`#/definitions/CollectionFile`}},label_singular:{type:`string`},description:{type:`string`},media_folder:{type:`string`},public_folder:{type:`string`},hide:{type:`boolean`},publish_mode:{anyOf:[{$ref:`#/definitions/PublishModeType`},{$ref:`#/definitions/PublishModeOptions`}]},publish:{type:`boolean`},format:{type:`string`},frontmatter_delimiter:{anyOf:[{type:`string`},{type:`array`,items:{type:`string`}}]},body_field:{$ref:`#/definitions/BodyFieldOptions`},i18n:{anyOf:[{type:`boolean`},{$ref:`#/definitions/I18nOptions`}]},preview_path:{type:`string`},preview_path_date_field:{type:`string`},editor:{$ref:`#/definitions/EditorOptions`},yaml_quote:{type:`boolean`},name:{type:`string`},label:{type:`string`},icon:{type:`string`},readonly:{type:`boolean`}},required:[`files`,`name`]},CollectionFile:{type:`object`,properties:{name:{type:`string`},label:{type:`string`},icon:{type:`string`},summary:{type:`string`},file:{type:`string`},fields:{type:`array`,items:{$ref:`#/definitions/Field`}},media_folder:{type:`string`},public_folder:{type:`string`},format:{type:`string`},frontmatter_delimiter:{anyOf:[{type:`string`},{type:`array`,items:{type:`string`}}]},body_field:{$ref:`#/definitions/BodyFieldOptions`},i18n:{anyOf:[{type:`boolean`},{$ref:`#/definitions/I18nOptions`}]},preview_path:{type:`string`},preview_path_date_field:{type:`string`},editor:{$ref:`#/definitions/EditorOptions`},readonly:{type:`boolean`}},required:[`name`,`file`,`fields`],additionalProperties:!1},CollectionDivider:{type:`object`,properties:{name:{type:`string`},divider:{type:`boolean`}},required:[`divider`],additionalProperties:!1},AssetCollection:{type:`object`,additionalProperties:!1,properties:{media_folder:{type:`string`},public_folder:{type:`string`},name:{type:`string`},label:{type:`string`},icon:{type:`string`},readonly:{type:`boolean`}},required:[`media_folder`,`name`]},OutputOptions:{type:`object`,properties:{omit_empty_optional_fields:{type:`boolean`},encode_file_path:{type:`boolean`},json:{$ref:`#/definitions/JsonFormatOptions`},yaml:{$ref:`#/definitions/YamlFormatOptions`}},additionalProperties:!1},JsonFormatOptions:{type:`object`,properties:{indent_style:{type:`string`,enum:[`space`,`tab`]},indent_size:{type:`number`}},additionalProperties:!1},YamlFormatOptions:{type:`object`,properties:{indent_size:{type:`number`},indent_sequences:{type:`boolean`},quote:{type:`string`,enum:[`none`,`double`,`single`]},block_quote:{anyOf:[{type:`boolean`},{type:`string`,const:`literal`},{type:`string`,const:`folded`}]}},additionalProperties:!1},FieldDefaults:{type:`object`,properties:{richtext:{$ref:`#/definitions/RichTextFieldDefaults`}},additionalProperties:!1},RichTextFieldDefaults:{type:`object`,additionalProperties:!1,properties:{format:{$ref:`#/definitions/RichTextValueFormat`},default:{type:`string`},default_localized:{type:`object`,additionalProperties:{type:`string`}},minimal:{type:`boolean`},multiline:{type:`boolean`},buttons:{type:`array`,items:{$ref:`#/definitions/RichTextEditorButtonName`}},editor_components:{type:`array`,items:{type:`string`}},allow_nested_components:{anyOf:[{type:`boolean`},{type:`string`,const:`exclude_self`}]},modes:{type:`array`,items:{$ref:`#/definitions/RichTextEditorMode`}},sanitize_preview:{type:`boolean`},linked_images:{type:`boolean`},use_emoji_autocomplete:{type:`boolean`},use_markdown_shortcuts:{type:`boolean`}}}}},K_t=void 0,q_t=()=>{if(J9)return K_t??={strict:I9(J9),lenient:I9(J9,{allowUnknownProperties:!0})},K_t},Y9=e=>e instanceof RegExp?e.source:Array.isArray(e)?e.map(Y9):X(e)?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,Y9(t)])):e,J_t=({config:e,schemas:t,collectors:n})=>{if(t)try{let r=Y9(e),i=G9(R_t(t.strict))(r);if(!i.length)return;let a=i.filter(({keyword:e})=>e===`additionalProperties`),o=a.length?G9(R_t(t.lenient))(r):i;G_t({config:e,errors:[...a,...o],collectors:n})}catch(e){console.warn(`Skipping configuration schema validation`,e)}},{DEV:Y_t}={DEV:!1},X_t=(0,emt.default)(),Z_t=e=>{let t=smt(e),n=hRe(e,[...Ml.mediaFields]);Bp.current=t,Sy.current=n,yu.devModeEnabled&&(console.info(`allEntryFolders`,t),console.info(`allAssetFolders`,n))},Q_t=async e=>{Dl.current=void 0,Al.current=[],Object.assign(Ml,{errors:new Set,warnings:new Set,mediaFields:new Set,relationFields:new Set,formatLocales:new Set});try{if(!window.isSecureContext)throw Error(Y(`config.error.no_secure_context`));let t;if(e){if(!X(e))throw Error(Y(`config.error.parse_failed`));t=e,t.load_config_file!==!1&&(t=X_t(await _mt({manualInit:!0}),t))}else t=await _mt();Object.assign(Ol,t);let n=uht(structuredClone(t));if(J_t({config:n,schemas:q_t(),collectors:Ml}),Agt(n,Ml),Ml.errors.size)throw Ml.errors.forEach(e=>{console.error(e)}),Error(`Errors found in configuration`);if(Ml.warnings.size&&Ml.warnings.forEach(e=>{console.warn(e)}),n._siteURL=n.site_url?.trim()||(Y_t?Tl:window.location.origin),n._baseURL=zc(n._siteURL)?new URL(n._siteURL).origin:``,n.collections?.forEach(e=>{`folder`in e&&(e.folder=e.folder.replace(/^\.(?:\/|$)/,``).replace(/^\/$/,``))}),await Promise.all([gke(Ml.formatLocales),n.slug?.clean_accents?ike():void 0]),Dl.current=n,Z_t(n),Mgt({config:n,entryFolders:Bp.current,assetFolders:Sy.current,collectors:Ml}),Ml.errors.size)throw Dl.current=void 0,Error(`Errors found in configuration`);kl.current=await Pc(JSON.stringify(n,(e,t)=>typeof t==`bigint`?t.toString():t)),console.debug(`CMS configuration:`,n),yu.devModeEnabled&&console.info(`collectors`,Ml)}catch(e){Al.current=Ml.errors.size?[...Ml.errors]:[e.name===`Error`?e.message:Y(`config.error.unexpected`)],console.error(e,e.cause)}},$_t=B(`<link rel="apple-touch-icon"/>`),evt=B(`<link rel="manifest"/>`),tvt=B(`<link rel="icon"/> <!> <!>`,1),nvt=B(`<link type="application/yaml" rel="cms-config-url"/>`),rvt=B(`<meta name="referrer" content="same-origin"/> <meta name="robots" content="noindex"/> <!> <!>`,1),ivt=B(`<!> <!> <!> <div role="none" class="infobars svelte-7y4msj"><!> <!> <!></div> <div role="none" class="main svelte-7y4msj"><!></div>`,1),avt=B(`<div role="none" class="outer svelte-7y4msj"><!></div> <div role="status" class="svelte-7y4msj"> </div>`,1),ovt={hash:`svelte-7y4msj`,code:`
@view-transition {navigation:auto;
}
@keyframes svelte-7y4msj-slide-out-to-left {
from {
transform: translateX(0);
filter: brightness(1);
}
to {
transform: translateX(-20%);
filter: brightness(0.5);
}
}
@keyframes svelte-7y4msj-slide-out-to-right {
from {
transform: translateX(0);
opacity: 1;
}
to {
transform: translateX(100%);
opacity: 0;
}
}
@keyframes svelte-7y4msj-slide-in-from-right {
from {
transform: translateX(100%);
opacity: 0;
}
to {
transform: translateX(0);
opacity: 1;
}
}
@keyframes svelte-7y4msj-slide-in-from-left {
from {
transform: translateX(-20%);
filter: brightness(0.5);
}
to {
transform: translateX(0);
filter: brightness(1);
}
}
/* RTL-specific keyframes that mirror the depth effect */
@keyframes svelte-7y4msj-slide-out-to-left-rtl {
from {
transform: translateX(0);
opacity: 1;
}
to {
transform: translateX(-100%);
opacity: 0;
}
}
@keyframes svelte-7y4msj-slide-out-to-right-rtl {
from {
transform: translateX(0);
filter: brightness(1);
}
to {
transform: translateX(20%);
filter: brightness(0.5);
}
}
@keyframes svelte-7y4msj-slide-in-from-right-rtl {
from {
transform: translateX(20%);
filter: brightness(0.5);
}
to {
transform: translateX(0);
filter: brightness(1);
}
}
@keyframes svelte-7y4msj-slide-in-from-left-rtl {
from {
transform: translateX(-100%);
opacity: 0;
}
to {
transform: translateX(0);
opacity: 1;
}
}
@keyframes svelte-7y4msj-fade-out {
from {
opacity: 1;
}
to {
opacity: 0;
}
}
@keyframes svelte-7y4msj-fade-in {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
/* The dragged item of a sortable list is left as a faint placeholder marking the gap it would
drop into. The pointer already carries the browser’s own drag image of it, so showing it
twice at full strength would just be confusing. */.drag-placeholder {opacity:0.25;}html:active-view-transition-type(forwards) {
@media (width < 768px) {&::view-transition-old(page-root) {z-index:999;
animation: 100ms ease-in both svelte-7y4msj-slide-out-to-left;
@media (prefers-reduced-motion) {
animation: none;
}}&::view-transition-new(page-root) {
@media (width < 768px) {z-index:1000;
animation: 100ms ease-in both svelte-7y4msj-slide-in-from-right;
}
@media (prefers-reduced-motion) {
animation: none;
}}&:dir(rtl) {&::view-transition-old(page-root) {
animation: 100ms ease-in both svelte-7y4msj-slide-out-to-right-rtl;
@media (prefers-reduced-motion) {
animation: none;
}}&::view-transition-new(page-root) {
animation: 100ms ease-in both svelte-7y4msj-slide-in-from-left-rtl;
@media (prefers-reduced-motion) {
animation: none;
}}}
}}html:active-view-transition-type(backwards) {
@media (width < 768px) {&::view-transition-old(page-root) {z-index:1000;
animation: 100ms ease-in both svelte-7y4msj-slide-out-to-right;
@media (prefers-reduced-motion) {
animation: none;
}}&::view-transition-new(page-root) {z-index:999;
animation: 100ms ease-in both svelte-7y4msj-slide-in-from-left;
@media (prefers-reduced-motion) {
animation: none;
}}&:dir(rtl) {&::view-transition-old(page-root) {
animation: 100ms ease-in both svelte-7y4msj-slide-out-to-left-rtl;
@media (prefers-reduced-motion) {
animation: none;
}}&::view-transition-new(page-root) {
animation: 100ms ease-in both svelte-7y4msj-slide-in-from-right-rtl;
@media (prefers-reduced-motion) {
animation: none;
}}}
}}html:active-view-transition-type(unknown) {&::view-transition-old(page-main) {
animation: 100ms ease-in both svelte-7y4msj-fade-out;
@media (prefers-reduced-motion) {
animation: none;
}}&::view-transition-new(page-main) {
animation: 100ms ease-in both svelte-7y4msj-fade-in;
@media (prefers-reduced-motion) {
animation: none;
}}}body:not(:has(#nc-root)) {overflow:hidden;}#nc-root > .sui.app-shell {position:absolute;}.sui.app-shell {
/* A placeholder is often the only visible label of a search box, so it has to meet the 4.5:1
text contrast. Sveltia UI only renders it at full strength in the high-contrast themes; the
default themes leave it at 50% opacity, which is 2.6:1 on white. */--sui-textbox-placeholder-foreground-color: var(--sui-tertiary-foreground-color);--sui-textbox-placeholder-opacity: 1;
/* Border drawn where a primary area (page content, editor panes, asset preview) meets a
secondary one (sidebars, toolbars, the gutter between panes). The default themes tell them
apart by background alone, so the width is zero; the high-contrast themes, which set
\`--sui-modal-border-width\` to outline dialogs for the same reason, get a visible line. */--area-border: var(--sui-modal-border-width) solid var(--sui-primary-border-color);}.outer.svelte-7y4msj {display:flex;flex-direction:column;position:absolute;inset:0;overflow:hidden;}.infobars.svelte-7y4msj {display:contents;}.main.svelte-7y4msj {position:relative;flex:auto;display:flex;flex-direction:column;overflow:hidden;background-color:var(--sui-secondary-background-color);}[role='status'].svelte-7y4msj {position:absolute;z-index:-1;opacity:0;pointer-events:none;-webkit-user-select:none;user-select:none;}`};function svt(e,t){O(t,!0),K(e,ovt),f9e(),pa(()=>{rFe()}),So(()=>{l5.current.length?console.error(`Unsupported browser. Missing features:`,l5.current):Q_t(t.config)}),So(()=>ift()),So(()=>{let e=document.querySelector(`#nc-root`);e&&window.getComputedStyle(e).position===`static`&&window.requestAnimationFrame(()=>{let{top:t,height:n}=e.getBoundingClientRect();n?e.style.position=`relative`:(e.style.position=`fixed`,e.style.inset=`${t}px 0 0 0`)})});let n=j(!1),r=A(()=>[p0.current||f0.current,o5.current].filter(Boolean).join(` – `));L(()=>{Rp.current&&Fu.account?y0(`forwards`,()=>{M(n,!0)}):y0(`backwards`,()=>{M(n,!1)})}),Ko(`7y4msj`,e=>{var t=rvt(),n=I(P(t),4),i=e=>{var t=tvt(),n=P(t),i=I(n,2),a=e=>{var t=$_t();R(()=>q(t,`href`,c5.current.large)),U(e,t)};G(i,e=>{c5.current&&e(a)});var o=I(i,2),s=e=>{var t=evt();R(()=>q(t,`href`,k7e.current)),U(e,t)};G(o,e=>{k7e.current&&e(s)}),R(()=>{q(n,`href`,s5.current),q(n,`type`,D7e.current)}),ote(()=>{ea.title=z(r)??``}),U(e,t)};G(n,e=>{jl.current&&e(i)});var a=I(n,2),o=e=>{var t=nvt();R(()=>q(t,`href`,`${Tl??``}/admin/config.yml`)),U(e,t)};G(a,e=>{Tl&&e(o)}),U(e,t)}),oo(`mousedown`,ea.body,e=>{let t=e.target?.closest(`a`);if(t){let{origin:e,pathname:n}=t;(e!==window.location.origin||n!==window.location.pathname)&&(t.rel=`noopener noreferrer`,t.target=`_blank`)}}),LOe(e,{children:(e,t)=>{var r=avt(),i=P(r);c6(N(i),{scope:`page`,children:(e,t)=>{var r=ivt(),i=P(r);p9e(i,{});var a=I(i,2);Xpt(a,{});var o=I(a,2);W7e(o,{});var s=I(o,2),c=N(s);$7e(c,{});var l=I(c,2),u=e=>{q7e(e,{})};G(l,e=>{LX.current&&e(u)});var d=I(l,2),f=e=>{$pt(e,{})};G(d,e=>{Fu.account&&Rp.current&&e(f)}),D(s);var p=I(s,2);c6(N(p),{scope:`page`,children:(e,t)=>{var r=H(),i=P(r),a=e=>{Ypt(e,{})},o=e=>{B7e(e,{})};G(i,e=>{Fu.account&&Rp.current&&z(n)?e(a):e(o,-1)}),U(e,r)},$$slots:{default:!0}}),D(p),R(()=>s.inert=l0.current),U(e,r)},$$slots:{default:!0}}),D(i);var a=F(I(i,2),!0);R(()=>W(a,d0.current)),U(e,r)},$$slots:{default:!0}}),k()}var cvt=!1,X9=async({config:e}={})=>{k8(e===void 0||X(e),`init`,`config`,`an object`),cvt||(cvt=!0,document.readyState===`loading`&&!document.querySelector(`#nc-root`)&&await new Promise(e=>{window.addEventListener(`DOMContentLoaded`,()=>e(void 0),{once:!0})}),e?.load_config_file!==!1&&gmt(),go(svt,{target:document.querySelector(`#nc-root`)??document.body,props:{config:e}}))},lvt=(e,t,{fromFile:n,toFile:r}={})=>{if(k8(Uu(e),`registerCustomFormat`,`name`,`a non-empty string`),k8(Uu(t),`registerCustomFormat`,`extension`,`a non-empty string`),k8(n===void 0||typeof n==`function`,`registerCustomFormat`,`fromFile`,`a function`),k8(r===void 0||typeof r==`function`,`registerCustomFormat`,`toFile`,`a function`),typeof n!=`function`&&typeof r!=`function`)throw Error("At least one of `fromFile` or `toFile` must be provided to `CMS.registerCustomFormat()`");Nie.includes(e)||(n||console.warn(`The custom “${e}” format has no \`fromFile\` method, so its entries can’t be loaded`),r||console.warn(`The custom “${e}” format has no \`toFile\` method, so its entries can’t be saved`)),Ud.set(e,{extension:t,parser:n,formatter:r})},uvt=e=>{k8(X(e),`registerCustomPage`,`definition`,`an object`);let{id:t,label:n,icon:r,component:i,url:a,newTab:o}=e;A8(typeof t==`string`&&/^[\w-]+$/.test(t),`id`,`a non-empty string of alphanumeric characters, hyphens and underscores`),A8(Uu(n),`label`,`a non-empty string`),A8(r===void 0||Uu(r),`icon`,`a non-empty string`),O8(i===void 0!=(a===void 0),"Either `definition.component` or `definition.url` must be given"),A8(i===void 0||K3(i),`component`,`a React component`),A8(o===void 0||typeof o==`boolean`&&i===void 0,`newTab`,"a boolean given along with `url`");let s;if(a!==void 0){let e=Uu(a)?s5e(a):null;A8(!!e&&[`http:`,`https:`].includes(e.protocol),`url`,"a valid `http` or `https` URL or file path"),s=e.href}Vd.set(t,{id:t,label:n,icon:r??`extension`,component:i,url:s,newTab:o??!1}),i&&j3()},Z9=(e,t)=>{A8(e===void 0||typeof e==`function`,t,`a function`)},dvt=e=>{let{fromInline:t,toInline:n,trigger:r,toPreview:i,onInsert:a,onEdit:o}=e,{fromBlock:s,toBlock:c}=e;A8(typeof(n??c)==`function`,`toInline`,`a function`),Z9(t??s,`fromInline`),Z9(i,`toPreview`),Z9(a,`onInsert`),Z9(o,`onEdit`),A8(r===void 0||Uu(r),`trigger`,`a non-empty string`)},fvt=e=>{A8(typeof e.toBlock==`function`,`toBlock`,`a function`),Z9(e.toPreview,`toPreview`),A8(Array.isArray(e.fields),`fields`,`an array`);let{htmlSelector:t,fromBlockHTML:n,toBlockHTML:r}=e,i=[t,n,r];i.some(e=>e!==void 0)&&(O8(!i.includes(void 0),"The `definition.htmlSelector`, `definition.fromBlockHTML` and `definition.toBlockHTML` must be given together"),A8(Uu(t)&&Ooe(t),`htmlSelector`,`a valid CSS selector`),O8(!!Pm(t),"Each selector in the `definition.htmlSelector` must name the element type it matches"),A8(typeof n==`function`,`fromBlockHTML`,`a function`),A8(typeof r==`function`,`toBlockHTML`,`a function`))},pvt=e=>{k8(X(e),`registerEditorComponent`,`definition`,`an object`),A8(Uu(e.id),`id`,`a non-empty string`),A8(e.label===void 0||Uu(e.label),`label`,`a non-empty string`),A8(e.pattern instanceof RegExp,`pattern`,`a RegExp`),km(e)?dvt(e):(fvt(e),dht(e)),Bd.set(e.id,e),(e.toPreview?.length??0)>=3&&y4()},mvt=e=>{if(!X(e))throw TypeError(`The event listener must be an object`);let{name:t,handler:n}=e;if(typeof t!=`string`||typeof n!=`function`)throw TypeError("The event listener must have a string `name` property and a function `handler` property");if(!$Ge.includes(t))throw RangeError(`Unsupported event listener name "${t}". Supported names are: ${$Ge.join(`, `)}`);Tie.add(e),y4()},Q9=(e,t,n,r)=>{let i=X(e),a=i?e:{name:e,controlComponent:t,previewComponent:n,schema:r},[o,s]=i?[`controlComponent`,`previewComponent`]:[`control`,`preview`],{name:c,controlComponent:l,previewComponent:u,summaryComponent:d,schema:f}=a;k8(Uu(c),`registerFieldType`,`name`,`a non-empty string`),o5e({name:c,reserved:Pd,subject:`field type`,builtin:`built-in field type`,custom:`custom field type`}),k8(K3(l)||typeof l==`string`,`registerFieldType`,o,`a React component or a string`),k8(u===void 0||K3(u),`registerFieldType`,s,`a React component`),k8(d===void 0||K3(d),`registerFieldType`,`summaryComponent`,`a React component`),k8(f===void 0||X(f),`registerFieldType`,`schema`,`an object`),Hd.set(c,{control:l,preview:u,summary:d,schema:f}),y4(),j3()},hvt=(e,{raw:t=!1,collection:n,file:r}={})=>{k8(Uu(e),`registerPreviewStyle`,`style`,`a non-empty string`),k8(typeof t==`boolean`,`registerPreviewStyle`,`raw`,`a boolean`),k8(n===void 0||Uu(n),`registerPreviewStyle`,`collection`,`a non-empty string`),k8(r===void 0||Uu(r),`registerPreviewStyle`,`file`,`a non-empty string`),O8(r===void 0||n!==void 0,"The `file` option for `CMS.registerPreviewStyle()` requires the `collection` option");let i=t?null:s5e(e);k8(t||!!i,`registerPreviewStyle`,`style`,"a valid URL or file path when `raw` is false");let a=t?URL.createObjectURL(new Blob([e],{type:`text/css`})):i.href;[...Wd].some(e=>e.url===a&&e.collection===n&&e.file===r)||Wd.add({url:a,collection:n,file:r})},gvt=(e,t)=>{k8(Uu(e),`registerPreviewTemplate`,`name`,`a non-empty string`),k8(K3(t),`registerPreviewTemplate`,`component`,`a React component`),wie.set(e,t),y4(),j3()},_vt=(e,t)=>{k8(typeof e==`string`&&mU.test(e),`registerStringTransformation`,`name`,`a string consisting of letters, digits and underscores, not starting with a digit`),o5e({name:e,reserved:pU,subject:`string transformation`,builtin:`built-in transformation`,custom:`custom transformation`}),k8(typeof t==`function`,`registerStringTransformation`,`transform`,`a function`),Gd.set(e,t)},vvt=(e,t,{fieldConfig:n}={})=>{k8(e instanceof Element,`renderRichText`,`target`,`an element`),k8(typeof t==`string`,`renderRichText`,`value`,`a string`),k8(n===void 0||X(n),`renderRichText`,`fieldConfig`,`an object`);let r=go(w8,{target:e,props:{locale:``,keyPath:``,typedKeyPath:``,fieldConfig:{name:`body`,sanitize_preview:!0,...n,widget:`richtext`},currentValue:t}});return()=>{yo(r)}},yvt=mr.default,bvt=new Proxy({React:yvt,getFieldType:j8,getWidget:j8,init:X9,registerCustomFormat:lvt,registerCustomPage:uvt,registerEditorComponent:pvt,registerEventListener:mvt,registerFieldType:Q9,registerPreviewStyle:hvt,registerPreviewTemplate:gvt,registerStringTransformation:_vt,registerWidget:Q9,renderRichText:vvt},{get:(e,t)=>{if(t in e)return e[t];if(que.includes(t))return console.warn(`CMS.%s() is not supported in Sveltia CMS, and we don’t have any plans to implement it. See %s for compatibility information.`,t,`https://sveltiacms.app/en/docs/migration/netlify-decap-cms#compatibility`),()=>void 0}}),xvt=function(e,t,n,r){var i;t[0]=0;for(var a=1;a<t.length;a++){var o=t[a++],s=t[a]?(t[0]|=o?1:2,n[t[a++]]):t[++a];o===3?r[0]=s:o===4?r[1]=Object.assign(r[1]||{},s):o===5?(r[1]=r[1]||{})[t[++a]]=s:o===6?r[1][t[++a]]+=s+``:o?(i=e.apply(s,xvt(e,s,n,[``,null])),r.push(i),s[0]?t[0]|=2:(t[a-2]=0,t[a]=i)):r.push(s)}return r},Svt=new Map;function Cvt(e){var t=Svt.get(this);return t||(t=new Map,Svt.set(this,t)),(t=xvt(this,t.get(e)||(t.set(e,t=function(e){for(var t,n,r=1,i=``,a=``,o=[0],s=function(e){r===1&&(e||(i=i.replace(/^\s*\n\s*|\s*\n\s*$/g,``)))?o.push(0,e,i):r===3&&(e||i)?(o.push(3,e,i),r=2):r===2&&i===`...`&&e?o.push(4,e,0):r===2&&i&&!e?o.push(5,0,!0,i):r>=5&&((i||!e&&r===5)&&(o.push(r,0,i,n),r=6),e&&(o.push(r,e,0,n),r=6)),i=``},c=0;c<e.length;c++){c&&(r===1&&s(),s(c));for(var l=0;l<e[c].length;l++)t=e[c][l],r===1?t===`<`?(s(),o=[o],r=3):i+=t:r===4?i===`--`&&t===`>`?(r=1,i=``):i=t+i[0]:a?t===a?a=``:i+=t:t===`"`||t===`'`?a=t:t===`>`?(s(),r=1):r&&(t===`=`?(r=5,n=i,i=``):t===`/`&&(r<5||e[c][l+1]===`>`)?(s(),r===3&&(o=o[0]),r=o,(o=o[0]).push(2,0,r),r=0):t===` `||t===` `||t===`
`||t===`\r`?(s(),r=2):i+=t),r===3&&i===`!--`&&(r=4,o=o[0])}return s(),o}(e)),t),arguments,[])).length>1?t:t[0]}var wvt=e=>{let t={},n=``,r=0,i=``,a=()=>{let e=n.indexOf(`:`),r=n.slice(0,e).trim(),i=n.slice(e+1).replace(/!\s*important\s*$/i,``).trim();e>0&&r&&i&&(t[r.startsWith(`--`)?r:r.toLowerCase().replace(/-([a-z])/g,(e,t)=>t.toUpperCase())]=i),n=``};return[...e].forEach(e=>{if(i)i=e===i?``:i;else if(e===`"`||e===`'`)i=e;else if(e===`(`)r+=1;else if(e===`)`)--r;else if(e===`;`&&r<=0){a();return}n+=e}),a(),t},Tvt=Cvt.bind((e,t,...n)=>(0,mr.createElement)(e,typeof t?.style==`string`?{...t,style:wvt(t.style)}:t,...n)),Evt=bvt;window.CMS=bvt,window.initCMS=X9,window.createClass=m.default,window.createElement=mr.createElement,window.h=mr.createElement,window.rf=mr.Fragment,window.html=Tvt,globalThis.__SVELTIA_CMS_REACT__=mr.default,globalThis[`__SVELTIA_CMS_MODULES_0.266.0_82a9571e9238`]=Kue,window.marked=ur,window.DOMPurify=ut,document.querySelector(`link[rel="stylesheet"][href$="/sveltia-cms.css"]`)&&console.warn("Sveltia CMS does not require a stylesheet. Remove the invalid `<link>` tag referencing `sveltia-cms.css` to avoid unnecessary network requests.");var $9=document.querySelector(`script[src$="/sveltia-cms.js"]`);$9?.type===`module`&&console.warn('The Sveltia CMS script is not an ES module. Remove the "type="module" attribute from the `<script>` tag to avoid unexpected behavior when using the JavaScript API.'),document.querySelector(`script[src="https://identity.netlify.com/v1/netlify-identity-widget.js"]`)&&console.warn(`Netlify Identity Widget is not supported in Sveltia CMS.`),!window.CMS_MANUAL_INIT&&(document.currentScript||$9)&&X9();export{yvt as React,Evt as default,j8 as getFieldType,j8 as getWidget,X9 as init,lvt as registerCustomFormat,uvt as registerCustomPage,pvt as registerEditorComponent,mvt as registerEventListener,Q9 as registerFieldType,Q9 as registerWidget,hvt as registerPreviewStyle,gvt as registerPreviewTemplate,_vt as registerStringTransformation,vvt as renderRichText};
//# sourceMappingURL=sveltia-cms.mjs.map