@panphora/clayjs 1.24.0 → 1.24.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all.js +1 -1
- package/dist/clay-dom.js +1 -1
- package/dist/clay-events.js +1 -1
- package/dist/clay-internals.js +1 -1
- package/dist/clay-options.js +1 -1
- package/dist/clay-router.js +1 -1
- package/dist/clay-ui.js +1 -1
- package/dist/clay-utils.js +1 -1
- package/dist/clay.js +1 -1
- package/dist/clay.standalone.js +15016 -13603
- package/dist/m/c-277QP5ET.js +1 -0
- package/dist/m/{c-BULK5J4M.js → c-3UW5EJ77.js} +1 -1
- package/dist/m/{c-GM7OA6EJ.js → c-42ZNV7LI.js} +1 -1
- package/dist/m/{c-RXTPKCMC.js → c-6IJEVE6B.js} +1 -1
- package/dist/m/{c-2R4OBWIP.js → c-6LEYVQJK.js} +1 -1
- package/dist/m/{c-LO4C4J77.js → c-6Q6RGFBF.js} +1 -1
- package/dist/m/{c-PD5AKHY3.js → c-7CM4GMTS.js} +1 -1
- package/dist/m/c-APGHGDZM.js +1 -0
- package/dist/m/{c-Q6VNQDJE.js → c-B7GOFGQR.js} +1 -1
- package/dist/m/{c-RJKKRWHW.js → c-BGN7RCTJ.js} +1 -1
- package/dist/m/{c-A7N5TNSL.js → c-C5AKJVRH.js} +1 -1
- package/dist/m/{c-SNVDWMM3.js → c-CJ7QYEWI.js} +1 -1
- package/dist/m/{c-PVJMJL3P.js → c-CZHTXGJS.js} +1 -1
- package/dist/m/{c-KJHVB2KG.js → c-DDS23EY6.js} +1 -1
- package/dist/m/{c-VSEUFJAO.js → c-DFKBGSN2.js} +1 -1
- package/dist/m/{c-DLBX4JCJ.js → c-EDE45NM7.js} +1 -1
- package/dist/m/c-EILLN2H2.js +1 -0
- package/dist/m/{c-EY5KDUZF.js → c-FEC6LGFF.js} +1 -1
- package/dist/m/{c-PMRRMT72.js → c-HDVH3MVC.js} +1 -1
- package/dist/m/c-HKSLOVU4.js +1 -0
- package/dist/m/{c-GNIVHLEJ.js → c-HL6BLJNA.js} +1 -1
- package/dist/m/c-HTLYXCUH.js +1 -0
- package/dist/m/{c-RTSRGGTP.js → c-JQF2EUCG.js} +1 -1
- package/dist/m/{c-O5ARALMJ.js → c-JWDCQL6J.js} +1 -1
- package/dist/m/{c-WOELSNWS.js → c-LATNQ6Q5.js} +1 -1
- package/dist/m/{c-UM7VZDTW.js → c-LSVN3OLG.js} +1 -1
- package/dist/m/{c-HSNGLIFB.js → c-MFOSMAVM.js} +2 -2
- package/dist/m/{c-FZRZPIFS.js → c-MQYEDF3Q.js} +1 -1
- package/dist/m/{c-2OIKXOY6.js → c-ND3Q2G2I.js} +1 -1
- package/dist/m/{c-PZRWZZRO.js → c-OCYG4NBQ.js} +1 -1
- package/dist/m/{c-54ZZZYUN.js → c-P2HKMJAW.js} +1 -1
- package/dist/m/{c-VI3BJHCM.js → c-PCNJETUA.js} +1 -1
- package/dist/m/{c-7YETSAVY.js → c-PDBNCJCT.js} +1 -1
- package/dist/m/{c-A5ZBFICF.js → c-PYG2NGWU.js} +1 -1
- package/dist/m/{c-RBPZNU2D.js → c-QQFHEODI.js} +1 -1
- package/dist/m/{c-YINHPF4V.js → c-SGH3UTF3.js} +1 -1
- package/dist/m/{c-FV46ZKGX.js → c-SKMIR5HQ.js} +1 -1
- package/dist/m/{c-TWOXQQKV.js → c-STRI73GQ.js} +1 -1
- package/dist/m/{c-75N3KG35.js → c-T3P3AXEW.js} +1 -1
- package/dist/m/c-U4NTUVDZ.js +1 -0
- package/dist/m/{c-P5NKFRL4.js → c-UOOIF2AL.js} +1 -1
- package/dist/m/c-VHSMPITY.js +1 -0
- package/dist/m/{c-6UPEKW6O.js → c-X75G43SZ.js} +1 -1
- package/dist/m/{c-YGGO2G2L.js → c-XW5TIYYB.js} +1 -1
- package/dist/m/{c-DZPO22O3.js → c-YDW4VCHP.js} +1 -1
- package/dist/m/{c-YB3CDTDZ.js → c-YLHTD3KX.js} +1 -1
- package/dist/m/c-Z4G2UK6T.js +4 -0
- package/dist/m/{c-VNAYHV2J.js → c-ZGCO4J3H.js} +1 -1
- package/dist/m/core/{admin-attrs-5UGMYCKW.js → admin-attrs-ONRWVXPK.js} +1 -1
- package/dist/m/core/{autosave-4P66VXX7.js → autosave-TBKAAAFB.js} +1 -1
- package/dist/m/core/{conflict-notice-BAR23OWH.js → conflict-notice-FOEE6I7E.js} +1 -1
- package/dist/m/core/draft-mode-4MCL3LYI.js +1 -0
- package/dist/m/core/{host-permission-3HE4CFD6.js → host-permission-X4BENZEU.js} +1 -1
- package/dist/m/core/{is-edit-mode-GK7IFFMT.js → is-edit-mode-FFHCQ5DR.js} +1 -1
- package/dist/m/core/{persist-AIJGTKKI.js → persist-6ILUR34S.js} +1 -1
- package/dist/m/core/{recovery-LPB6X72P.js → recovery-APWADU4K.js} +1 -1
- package/dist/m/core/{save-FV4ZCKBI.js → save-6HT2LABE.js} +1 -1
- package/dist/m/core/{save-core-K7XFAWQ4.js → save-core-EVMNZQ4V.js} +1 -1
- package/dist/m/core/{site-edits-TEQORBJU.js → site-edits-G4BOZMV4.js} +1 -1
- package/dist/m/core/{unsaved-warning-FF63QGKI.js → unsaved-warning-ITZDIZ2I.js} +1 -1
- package/dist/m/internals/{index-AX4CG7B2.js → index-HS3CQDFW.js} +1 -1
- package/dist/m/loader-GLLVDUZA.js +1 -0
- package/dist/m/manifest-50FF1C45.js +1 -0
- package/dist/m/manifest-edit-BE1A621D.js +1 -0
- package/dist/m/manifest.json +710 -674
- package/dist/m/plugins/{ai-edit-CUKQQWJX.js → ai-edit-LABECCSN.js} +1 -1
- package/dist/m/plugins/{cms-JANMGPHM.js → cms-T2HLI7JG.js} +16 -16
- package/dist/m/plugins/{demo-JIR7DXJA.js → demo-T7B4RIKL.js} +1 -1
- package/dist/m/plugins/{derive-QVI3LI3A.js → derive-6LPJOCAV.js} +1 -1
- package/dist/m/plugins/{indicator-DAKZGAWI.js → indicator-J4ABFARX.js} +1 -1
- package/dist/m/plugins/{live-UAJGWRNP.js → live-PGBIEMGB.js} +1 -1
- package/dist/m/plugins/{menu-BFJ644YX.js → menu-YZL3X2AJ.js} +1 -1
- package/dist/m/plugins/page-WOCNX2IN.js +2 -0
- package/dist/m/plugins/{page-view-OYN7Z5TS.js → page-view-SJODOOGE.js} +1 -1
- package/dist/m/plugins/{people-VBDR5Y22.js → people-C4TCWFOQ.js} +1 -1
- package/dist/m/plugins/{richclay-CBLZRFB4.js → richclay-Y2NV44NA.js} +3 -3
- package/dist/m/plugins/sortable-XCHQG65Z.js +1 -0
- package/dist/m/plugins/{source-ZXDD7F6X.js → source-YK7MO23W.js} +1 -1
- package/dist/m/plugins/{undo-5JI5G7CQ.js → undo-VLRBQNPN.js} +1 -1
- package/dist/m/plugins/{upgrade-6B6QS3NR.js → upgrade-NNTJBSK2.js} +1 -1
- package/dist/m/plugins/{upload-DNJNW6H3.js → upload-ZKKJV76X.js} +1 -1
- package/dist/m/plugins/visitor-drafts-RTZNONHT.js +20 -0
- package/dist/m/plugins/{visitor-drafts-owner-VIAZC3CF.js → visitor-drafts-owner-LHUHFU3L.js} +1 -1
- package/dist/m/plugins/{visitor-menu-ZHKWIKKY.js → visitor-menu-FY4KM2SW.js} +1 -1
- package/dist/m/plugins/wire-M2NR354P.js +1 -0
- package/dist/m/{reader-core-F6RY3V64.js → reader-core-T2S3JC4E.js} +2 -2
- package/dist/m/sync/{live-sync-M2PP2IWY.js → live-sync-Z64YREWQ.js} +1 -1
- package/dist/m/vendor/{sap-core.vendor-OA5SKL7Q.js → sap-core.vendor-QAEPMETX.js} +1 -1
- package/dist/offline-manifest.json +455 -425
- package/entries/clay-data.js +1 -1
- package/entries/sap.js +1 -1
- package/package.json +2 -2
- package/src/core/draft-mode.js +6 -0
- package/src/core/save-core.js +7 -8
- package/src/core/unsaved-warning.js +2 -2
- package/src/lib/idb-error-code.js +20 -0
- package/src/loader.js +2 -0
- package/src/plugins/page.js +19 -5
- package/src/plugins/sortable.js +7 -0
- package/src/plugins/visitor-drafts/commit.js +303 -0
- package/src/plugins/visitor-drafts/idb.js +221 -0
- package/src/plugins/visitor-drafts/prompt.js +23 -3
- package/src/plugins/visitor-drafts/session.js +345 -0
- package/src/plugins/visitor-drafts/store.js +210 -26
- package/src/plugins/visitor-drafts.js +148 -28
- package/src/vendor/hyper-html-api-data.vendor.js +1 -1
- package/src/vendor/hyper-html-api-upgrade.vendor.js +2 -2
- package/src/vendor/hypercms.vendor.js +16 -16
- package/src/vendor/richclay.vendor.js +1 -1
- package/src/vendor/sap-core.vendor.js +1 -1
- package/dist/m/c-234RSEIW.js +0 -1
- package/dist/m/c-2YIJ6ZA6.js +0 -1
- package/dist/m/c-H2H7TI6O.js +0 -1
- package/dist/m/c-JMDKPBMC.js +0 -4
- package/dist/m/c-N7JPUPGC.js +0 -1
- package/dist/m/c-NEXFVJIT.js +0 -1
- package/dist/m/c-T527QHOB.js +0 -1
- package/dist/m/core/draft-mode-WSQAT67S.js +0 -1
- package/dist/m/loader-5IA5OJ3J.js +0 -1
- package/dist/m/manifest-98258645.js +0 -1
- package/dist/m/manifest-edit-ABF56000.js +0 -1
- package/dist/m/plugins/page-ZBIYHGK4.js +0 -2
- package/dist/m/plugins/sortable-HDOQ6GAC.js +0 -1
- package/dist/m/plugins/visitor-drafts-A5FDQ2G7.js +0 -20
- package/dist/m/plugins/wire-XOT7XKJL.js +0 -1
- /package/dist/m/plugins/{richclay-CBLZRFB4.js.LEGAL.txt → richclay-Y2NV44NA.js.LEGAL.txt} +0 -0
|
@@ -21,7 +21,7 @@ var richclay=(()=>{var kn=Object.defineProperty;var ds=Object.getOwnPropertyDesc
|
|
|
21
21
|
`)),i.appendChild(D(o))}let s=new re(i,4);for(;o=s.nextNode();)o.data=o.data.replace(/ /g," ");return i.normalize(),$(_("PRE",this._config.tagAttributes.pre,[i]))},e),this.focus()):this.changeFormat({tag:"CODE",attributes:this._config.tagAttributes.code},null,e),this}removeCode(){let e=this.getSelection(),t=e.commonAncestorContainer;return w(t,this._root,"PRE")?(this.modifyBlocks(n=>{let i=this._root,r=n.querySelectorAll("PRE"),o=r.length;for(;o--;){let s=r[o],a=new re(s,4),l;for(;l=a.nextNode();){let h=l.data;h=h.replace(/ (?= )/g,"\xA0");let d=document.createDocumentFragment(),u;for(;(u=h.indexOf(`
|
|
22
22
|
`))>-1;)d.appendChild(document.createTextNode(h.slice(0,u))),d.appendChild(_("BR")),h=h.slice(u+1);l.parentNode.insertBefore(d,l),l.data=h}ge(s,i),Y(s,D(s))}return n},e),this.focus()):this.changeFormat(null,{tag:"CODE"},e),this}toggleCode(){return this.hasFormat("PRE")||this.hasFormat("CODE")?this.removeCode():this.code(),this}_removeFormatting(e,t){for(let n=e.firstChild,i;n;n=i){if(i=n.nextSibling,L(n)){if(n instanceof Text||n.nodeName==="BR"||n.nodeName==="IMG"){t.appendChild(n);continue}}else if(xe(n)){t.appendChild(this.createDefaultBlock([this._removeFormatting(n,document.createDocumentFragment())]));continue}this._removeFormatting(n,t)}return t}removeAllFormatting(e){if(e||(e=this.getSelection()),e.collapsed)return this.focus();let t=this._root,n=e.commonAncestorContainer;for(;n&&n!==t&&!xe(n);)n=n.parentNode;if(n||(nr(e,t),n=t),n instanceof Text)return this.focus();this.saveUndoState(e),He(e,n,n,t);let i=e.startContainer,r=e.startOffset,o=e.endContainer,s=e.endOffset,a=document.createDocumentFragment(),l=document.createDocumentFragment(),h=le(o,s,n,t),d=le(i,r,n,t),u;for(;d!==h;)u=d.nextSibling,a.appendChild(d),d=u;if(this._removeFormatting(a,l),l.normalize(),d=l.firstChild,u=l.lastChild,d){n.insertBefore(l,h);let p=Array.from(n.childNodes);r=p.indexOf(d),s=u?p.indexOf(u)+1:0}else h&&(r=Array.from(n.childNodes).indexOf(h),s=r);return e.setStart(n,r),e.setEnd(n,s),Xe(n,e),X(e),this.setSelection(e),this._updatePath(e,!0),this.focus()}},vr=Js;function Sr(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function ea(e){if(Array.isArray(e))return e}function ta(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var i,r,o,s,a=[],l=!0,h=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(l=(i=o.call(n)).done)&&(a.push(i.value),a.length!==t);l=!0);}catch(d){h=!0,r=d}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(h)throw r}}return a}}function na(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
23
23
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ia(e,t){return ea(e)||ta(e,t)||ra(e,t)||na()}function ra(e,t){if(e){if(typeof e=="string")return Sr(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)?Sr(e,t):void 0}}var Br=Object.entries,Ar=Object.setPrototypeOf,oa=Object.isFrozen,sa=Object.getPrototypeOf,aa=Object.getOwnPropertyDescriptor,j=Object.freeze,Z=Object.seal,tt=Object.create,Hr=typeof Reflect<"u"&&Reflect,jn=Hr.apply,Zn=Hr.construct;j||(j=function(t){return t});Z||(Z=function(t){return t});jn||(jn=function(t,n){for(var i=arguments.length,r=new Array(i>2?i-2:0),o=2;o<i;o++)r[o-2]=arguments[o];return t.apply(n,r)});Zn||(Zn=function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return new t(...i)});var yt=F(Array.prototype.forEach),la=F(Array.prototype.lastIndexOf),Cr=F(Array.prototype.pop),et=F(Array.prototype.push),ca=F(Array.prototype.splice),Oe=Array.isArray,_t=F(String.prototype.toLowerCase),Wn=F(String.prototype.toString),Lr=F(String.prototype.match),bt=F(String.prototype.replace),wr=F(String.prototype.indexOf),ha=F(String.prototype.trim),ua=F(Number.prototype.toString),da=F(Boolean.prototype.toString),Nr=typeof BigInt>"u"?null:F(BigInt.prototype.toString),xr=typeof Symbol>"u"?null:F(Symbol.prototype.toString),K=F(Object.prototype.hasOwnProperty),Tt=F(Object.prototype.toString),G=F(RegExp.prototype.test),We=fa(TypeError);function F(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return jn(e,t,i)}}function fa(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return Zn(e,n)}}function A(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:_t;if(Ar&&Ar(e,null),!Oe(t))return e;let i=t.length;for(;i--;){let r=t[i];if(typeof r=="string"){let o=n(r);o!==r&&(oa(t)||(t[i]=o),r=o)}e[r]=!0}return e}function pa(e){for(let t=0;t<e.length;t++)K(e,t)||(e[t]=null);return e}function ne(e){let t=tt(null);for(let i of Br(e)){var n=ia(i,2);let r=n[0],o=n[1];K(e,r)&&(Oe(o)?t[r]=pa(o):o&&typeof o=="object"&&o.constructor===Object?t[r]=ne(o):t[r]=o)}return t}function ma(e){switch(typeof e){case"string":return e;case"number":return ua(e);case"boolean":return da(e);case"bigint":return Nr?Nr(e):"0";case"symbol":return xr?xr(e):"Symbol()";case"undefined":return Tt(e);case"function":case"object":{if(e===null)return Tt(e);let t=e,n=be(t,"toString");if(typeof n=="function"){let i=n(t);return typeof i=="string"?i:Tt(i)}return Tt(e)}default:return Tt(e)}}function be(e,t){for(;e!==null;){let i=aa(e,t);if(i){if(i.get)return F(i.get);if(typeof i.value=="function")return F(i.value)}e=sa(e)}function n(){return null}return n}function ga(e){try{return G(e,""),!0}catch{return!1}}var kr=j(["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"]),$n=j(["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"]),Kn=j(["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"]),ya=j(["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"]),Vn=j(["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"]),ba=j(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Rr=j(["#text"]),Or=j(["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"]),Gn=j(["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","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","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-rendering","textlength","type","u1","u2","unicode","values","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"]),Dr=j(["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"]),Kt=j(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Ta=Z(/{{[\w\W]*|^[\w\W]*}}/g),_a=Z(/<%[\w\W]*|^[\w\W]*%>/g),Ea=Z(/\${[\w\W]*/g),va=Z(/^data-[\-\w.\u00B7-\uFFFF]+$/),Sa=Z(/^aria-[\-\w]+$/),Ir=Z(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Aa=Z(/^(?:\w+script|data):/i),Ca=Z(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),La=Z(/^html$/i),wa=Z(/^[a-z][.\w]*(-[.\w]+)+$/i),Mr=Z(/<[/\w!]/g),Na=Z(/<[/\w]/g),xa=Z(/<\/no(script|embed|frames)/i),ka=Z(/\/>/i),ye={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Ra=function(){return typeof window>"u"?null:window},Oa=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null,r="data-tt-policy-suffix";n&&n.hasAttribute(r)&&(i=n.getAttribute(r));let o="dompurify"+(i?"#"+i:"");try{return t.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},Pr=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Re=function(t,n,i,r){return K(t,n)&&Oe(t[n])?A(r.base?ne(r.base):{},t[n],r.transform):i};function Fr(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ra(),t=g=>Fr(g);if(t.version="3.4.11",t.removed=[],!e||!e.document||e.document.nodeType!==ye.document||!e.Element)return t.isSupported=!1,t;let n=e.document,i=n,r=i.currentScript;e.DocumentFragment;let o=e.HTMLTemplateElement,s=e.Node,a=e.Element,l=e.NodeFilter,h=e.NamedNodeMap;h===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let d=e.DOMParser,u=e.trustedTypes,p=a.prototype,b=be(p,"cloneNode"),y=be(p,"remove"),E=be(p,"nextSibling"),S=be(p,"childNodes"),N=be(p,"parentNode"),P=be(p,"shadowRoot"),J=be(p,"attributes"),U=s&&s.prototype?be(s.prototype,"nodeType"):null,he=s&&s.prototype?be(s.prototype,"nodeName"):null;if(typeof o=="function"){let g=n.createElement("template");g.content&&g.content.ownerDocument&&(n=g.content.ownerDocument)}let ie,Ie="",un,Ai=!1,lt=0,Ci=function(){if(lt>0)throw We('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.')},Ke=function(c){Ci(),lt++;try{return ie.createHTML(c)}finally{lt--}},Ho=function(c){Ci(),lt++;try{return ie.createScriptURL(c)}finally{lt--}},Fo=function(){return Ai||(un=Oa(u,r),Ai=!0),un},kt=n,dn=kt.implementation,Li=kt.createNodeIterator,Uo=kt.createDocumentFragment,zo=kt.getElementsByTagName,qo=i.importNode,M=Pr();t.isSupported=typeof Br=="function"&&typeof N=="function"&&dn&&dn.createHTMLDocument!==void 0;let Wo=Ta,$o=_a,Ko=Ea,Vo=va,Go=Sa,jo=Aa,wi=Ca,Zo=wa,Ni=Ir,x=null,xi=A({},[...kr,...$n,...Kn,...Vn,...Rr]),k=null,ki=A({},[...Or,...Gn,...Dr,...Kt]),R=Object.seal(tt(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}})),ct=null,Ri=null,Ce=Object.seal(tt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Oi=!0,fn=!0,Di=!1,Ii=!0,Le=!1,ht=!0,Me=!1,pn=!1,mn=null,gn=null,yn=!1,Ve=!1,Rt=!1,Ot=!1,Mi=!0,Pi=!1,Bi="user-content-",bn=!0,Tn=!1,Ge={},fe=null,_n=A({},["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"]),Hi=null,Fi=A({},["audio","video","img","source","image","track"]),En=null,Ui=A({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Dt="http://www.w3.org/1998/Math/MathML",It="http://www.w3.org/2000/svg",pe="http://www.w3.org/1999/xhtml",je=pe,vn=!1,Sn=null,Yo=A({},[Dt,It,pe],Wn),zi=j(["mi","mo","mn","ms","mtext"]),An=A({},zi),qi=j(["annotation-xml"]),Cn=A({},qi),Xo=A({},["title","style","font","a","script"]),ut=null,Qo=["application/xhtml+xml","text/html"],Jo="text/html",O=null,Ze=null,es=n.createElement("form"),Wi=function(c){return c instanceof RegExp||c instanceof Function},Ln=function(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Ze&&Ze===c)return;(!c||typeof c!="object")&&(c={}),c=ne(c),ut=Qo.indexOf(c.PARSER_MEDIA_TYPE)===-1?Jo:c.PARSER_MEDIA_TYPE,O=ut==="application/xhtml+xml"?Wn:_t,x=Re(c,"ALLOWED_TAGS",xi,{transform:O}),k=Re(c,"ALLOWED_ATTR",ki,{transform:O}),Sn=Re(c,"ALLOWED_NAMESPACES",Yo,{transform:Wn}),En=Re(c,"ADD_URI_SAFE_ATTR",Ui,{transform:O,base:Ui}),Hi=Re(c,"ADD_DATA_URI_TAGS",Fi,{transform:O,base:Fi}),fe=Re(c,"FORBID_CONTENTS",_n,{transform:O}),ct=Re(c,"FORBID_TAGS",ne({}),{transform:O}),Ri=Re(c,"FORBID_ATTR",ne({}),{transform:O}),Ge=K(c,"USE_PROFILES")?c.USE_PROFILES&&typeof c.USE_PROFILES=="object"?ne(c.USE_PROFILES):c.USE_PROFILES:!1,Oi=c.ALLOW_ARIA_ATTR!==!1,fn=c.ALLOW_DATA_ATTR!==!1,Di=c.ALLOW_UNKNOWN_PROTOCOLS||!1,Ii=c.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Le=c.SAFE_FOR_TEMPLATES||!1,ht=c.SAFE_FOR_XML!==!1,Me=c.WHOLE_DOCUMENT||!1,Ve=c.RETURN_DOM||!1,Rt=c.RETURN_DOM_FRAGMENT||!1,Ot=c.RETURN_TRUSTED_TYPE||!1,yn=c.FORCE_BODY||!1,Mi=c.SANITIZE_DOM!==!1,Pi=c.SANITIZE_NAMED_PROPS||!1,bn=c.KEEP_CONTENT!==!1,Tn=c.IN_PLACE||!1,Ni=ga(c.ALLOWED_URI_REGEXP)?c.ALLOWED_URI_REGEXP:Ir,je=typeof c.NAMESPACE=="string"?c.NAMESPACE:pe,An=K(c,"MATHML_TEXT_INTEGRATION_POINTS")&&c.MATHML_TEXT_INTEGRATION_POINTS&&typeof c.MATHML_TEXT_INTEGRATION_POINTS=="object"?ne(c.MATHML_TEXT_INTEGRATION_POINTS):A({},zi),Cn=K(c,"HTML_INTEGRATION_POINTS")&&c.HTML_INTEGRATION_POINTS&&typeof c.HTML_INTEGRATION_POINTS=="object"?ne(c.HTML_INTEGRATION_POINTS):A({},qi);let f=K(c,"CUSTOM_ELEMENT_HANDLING")&&c.CUSTOM_ELEMENT_HANDLING&&typeof c.CUSTOM_ELEMENT_HANDLING=="object"?ne(c.CUSTOM_ELEMENT_HANDLING):tt(null);if(R=tt(null),K(f,"tagNameCheck")&&Wi(f.tagNameCheck)&&(R.tagNameCheck=f.tagNameCheck),K(f,"attributeNameCheck")&&Wi(f.attributeNameCheck)&&(R.attributeNameCheck=f.attributeNameCheck),K(f,"allowCustomizedBuiltInElements")&&typeof f.allowCustomizedBuiltInElements=="boolean"&&(R.allowCustomizedBuiltInElements=f.allowCustomizedBuiltInElements),Z(R),Le&&(fn=!1),Rt&&(Ve=!0),Ge&&(x=A({},Rr),k=tt(null),Ge.html===!0&&(A(x,kr),A(k,Or)),Ge.svg===!0&&(A(x,$n),A(k,Gn),A(k,Kt)),Ge.svgFilters===!0&&(A(x,Kn),A(k,Gn),A(k,Kt)),Ge.mathMl===!0&&(A(x,Vn),A(k,Dr),A(k,Kt))),Ce.tagCheck=null,Ce.attributeCheck=null,K(c,"ADD_TAGS")&&(typeof c.ADD_TAGS=="function"?Ce.tagCheck=c.ADD_TAGS:Oe(c.ADD_TAGS)&&(x===xi&&(x=ne(x)),A(x,c.ADD_TAGS,O))),K(c,"ADD_ATTR")&&(typeof c.ADD_ATTR=="function"?Ce.attributeCheck=c.ADD_ATTR:Oe(c.ADD_ATTR)&&(k===ki&&(k=ne(k)),A(k,c.ADD_ATTR,O))),K(c,"ADD_URI_SAFE_ATTR")&&Oe(c.ADD_URI_SAFE_ATTR)&&A(En,c.ADD_URI_SAFE_ATTR,O),K(c,"FORBID_CONTENTS")&&Oe(c.FORBID_CONTENTS)&&(fe===_n&&(fe=ne(fe)),A(fe,c.FORBID_CONTENTS,O)),K(c,"ADD_FORBID_CONTENTS")&&Oe(c.ADD_FORBID_CONTENTS)&&(fe===_n&&(fe=ne(fe)),A(fe,c.ADD_FORBID_CONTENTS,O)),bn&&(x["#text"]=!0),Me&&A(x,["html","head","body"]),x.table&&(A(x,["tbody"]),delete ct.tbody),c.TRUSTED_TYPES_POLICY){if(typeof c.TRUSTED_TYPES_POLICY.createHTML!="function")throw We('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof c.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw We('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let m=ie;ie=c.TRUSTED_TYPES_POLICY;try{Ie=Ke("")}catch(T){throw ie=m,T}}else c.TRUSTED_TYPES_POLICY===null?(ie=void 0,Ie=""):(ie===void 0&&(ie=Fo()),ie&&typeof Ie=="string"&&(Ie=Ke("")));j&&j(c),Ze=c},$i=A({},[...$n,...Kn,...ya]),Ki=A({},[...Vn,...ba]),ts=function(c,f,m){return f.namespaceURI===pe?c==="svg":f.namespaceURI===Dt?c==="svg"&&(m==="annotation-xml"||An[m]):!!$i[c]},ns=function(c,f,m){return f.namespaceURI===pe?c==="math":f.namespaceURI===It?c==="math"&&Cn[m]:!!Ki[c]},is=function(c,f,m){return f.namespaceURI===It&&!Cn[m]||f.namespaceURI===Dt&&!An[m]?!1:!Ki[c]&&(Xo[c]||!$i[c])},rs=function(c){let f=N(c);(!f||!f.tagName)&&(f={namespaceURI:je,tagName:"template"});let m=_t(c.tagName),T=_t(f.tagName);return Sn[c.namespaceURI]?c.namespaceURI===It?ts(m,f,T):c.namespaceURI===Dt?ns(m,f,T):c.namespaceURI===pe?is(m,f,T):!!(ut==="application/xhtml+xml"&&Sn[c.namespaceURI]):!1},we=function(c){et(t.removed,{element:c});try{N(c).removeChild(c)}catch{if(y(c),!N(c))throw We("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Vi=function(c){let f=S(c);if(f){let T=[];yt(f,v=>{et(T,v)}),yt(T,v=>{try{y(v)}catch{}})}let m=J(c);if(m)for(let T=m.length-1;T>=0;--T){let v=m[T],C=v&&v.name;if(typeof C=="string")try{c.removeAttribute(C)}catch{}}},Pe=function(c,f){try{et(t.removed,{attribute:f.getAttributeNode(c),from:f})}catch{et(t.removed,{attribute:null,from:f})}if(f.removeAttribute(c),c==="is")if(Ve||Rt)try{we(f)}catch{}else try{f.setAttribute(c,"")}catch{}},os=function(c){let f=J(c);if(f)for(let m=f.length-1;m>=0;--m){let T=f[m],v=T&&T.name;if(!(typeof v!="string"||k[O(v)]))try{c.removeAttribute(v)}catch{}}},ss=function(c){let f=[c];for(;f.length>0;){let m=f.pop();(U?U(m):m.nodeType)===ye.element&&os(m);let v=S(m);if(v)for(let C=v.length-1;C>=0;--C)f.push(v[C])}},Gi=function(c){let f=null,m=null;if(yn)c="<remove></remove>"+c;else{let C=Lr(c,/^[\r\n\t ]+/);m=C&&C[0]}ut==="application/xhtml+xml"&&je===pe&&(c='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+c+"</body></html>");let T=ie?Ke(c):c;if(je===pe)try{f=new d().parseFromString(T,ut)}catch{}if(!f||!f.documentElement){f=dn.createDocument(je,"template",null);try{f.documentElement.innerHTML=vn?Ie:T}catch{}}let v=f.body||f.documentElement;return c&&m&&v.insertBefore(n.createTextNode(m),v.childNodes[0]||null),je===pe?zo.call(f,Me?"html":"body")[0]:Me?f.documentElement:v},ji=function(c){return Li.call(c.ownerDocument||c,c,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},Mt=function(c){return c=bt(c,Wo," "),c=bt(c,$o," "),c=bt(c,Ko," "),c},wn=function(c){var f;c.normalize();let m=Li.call(c.ownerDocument||c,c,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null),T=m.nextNode();for(;T;)T.data=Mt(T.data),T=m.nextNode();let v=(f=c.querySelectorAll)===null||f===void 0?void 0:f.call(c,"template");v&&yt(v,C=>{Ye(C.content)&&wn(C.content)})},Pt=function(c){let f=he?he(c):null;return typeof f!="string"||O(f)!=="form"?!1:typeof c.nodeName!="string"||typeof c.textContent!="string"||typeof c.removeChild!="function"||c.attributes!==J(c)||typeof c.removeAttribute!="function"||typeof c.setAttribute!="function"||typeof c.namespaceURI!="string"||typeof c.insertBefore!="function"||typeof c.hasChildNodes!="function"||c.nodeType!==U(c)||c.childNodes!==S(c)},Ye=function(c){if(!U||typeof c!="object"||c===null)return!1;try{return U(c)===ye.documentFragment}catch{return!1}},dt=function(c){if(!U||typeof c!="object"||c===null)return!1;try{return typeof U(c)=="number"}catch{return!1}};function Te(g,c,f){g.length!==0&&yt(g,m=>{m.call(t,c,f,Ze)})}let as=function(c,f){return!!(ht&&c.hasChildNodes()&&!dt(c.firstElementChild)&&G(Mr,c.textContent)&&G(Mr,c.innerHTML)||ht&&c.namespaceURI===pe&&f==="style"&&dt(c.firstElementChild)||c.nodeType===ye.processingInstruction||ht&&c.nodeType===ye.comment&&G(Na,c.data))},ls=function(c,f){if(!ct[f]&&Xi(f)&&(R.tagNameCheck instanceof RegExp&&G(R.tagNameCheck,f)||R.tagNameCheck instanceof Function&&R.tagNameCheck(f)))return!1;if(bn&&!fe[f]){let m=N(c),T=S(c);if(T&&m){let v=T.length;for(let C=v-1;C>=0;--C){let q=Tn?T[C]:b(T[C],!0);m.insertBefore(q,E(c))}}}return we(c),!0},Zi=function(c){if(Te(M.beforeSanitizeElements,c,null),Pt(c))return we(c),!0;let f=O(he?he(c):c.nodeName);if(Te(M.uponSanitizeElement,c,{tagName:f,allowedTags:x}),as(c,f))return we(c),!0;if(ct[f]||!(Ce.tagCheck instanceof Function&&Ce.tagCheck(f))&&!x[f])return ls(c,f);if((U?U(c):c.nodeType)===ye.element&&!rs(c)||(f==="noscript"||f==="noembed"||f==="noframes")&&G(xa,c.innerHTML))return we(c),!0;if(Le&&c.nodeType===ye.text){let T=Mt(c.textContent);c.textContent!==T&&(et(t.removed,{element:c.cloneNode()}),c.textContent=T)}return Te(M.afterSanitizeElements,c,null),!1},Yi=function(c,f,m){if(Ri[f]||Mi&&(f==="id"||f==="name")&&(m in n||m in es))return!1;let T=k[f]||Ce.attributeCheck instanceof Function&&Ce.attributeCheck(f,c);if(!(fn&&G(Vo,f))){if(!(Oi&&G(Go,f))){if(T){if(!En[f]){if(!G(Ni,bt(m,wi,""))){if(!((f==="src"||f==="xlink:href"||f==="href")&&c!=="script"&&wr(m,"data:")===0&&Hi[c])){if(!(Di&&!G(jo,bt(m,wi,"")))){if(m)return!1}}}}}else if(!(Xi(c)&&(R.tagNameCheck instanceof RegExp&&G(R.tagNameCheck,c)||R.tagNameCheck instanceof Function&&R.tagNameCheck(c))&&(R.attributeNameCheck instanceof RegExp&&G(R.attributeNameCheck,f)||R.attributeNameCheck instanceof Function&&R.attributeNameCheck(f,c))||f==="is"&&R.allowCustomizedBuiltInElements&&(R.tagNameCheck instanceof RegExp&&G(R.tagNameCheck,m)||R.tagNameCheck instanceof Function&&R.tagNameCheck(m))))return!1}}return!0},cs=A({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Xi=function(c){return!cs[_t(c)]&&G(Zo,c)},hs=function(c,f,m,T){if(ie&&typeof u=="object"&&typeof u.getAttributeType=="function"&&!m)switch(u.getAttributeType(c,f)){case"TrustedHTML":return Ke(T);case"TrustedScriptURL":return Ho(T)}return T},us=function(c,f,m,T){try{m?c.setAttributeNS(m,f,T):c.setAttribute(f,T),Pt(c)?we(c):Cr(t.removed)}catch{Pe(f,c)}},Qi=function(c){Te(M.beforeSanitizeAttributes,c,null);let f=c.attributes;if(!f||Pt(c))return;let m={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:k,forceKeepAttr:void 0},T=f.length,v=O(c.nodeName);for(;T--;){let C=f[T],q=C.name,B=C.namespaceURI,ae=C.value,ue=O(q),xn=ae,ee=q==="value"?xn:ha(xn);if(m.attrName=ue,m.attrValue=ee,m.keepAttr=!0,m.forceKeepAttr=void 0,Te(M.uponSanitizeAttribute,c,m),ee=m.attrValue,Pi&&(ue==="id"||ue==="name")&&wr(ee,Bi)!==0&&(Pe(q,c),ee=Bi+ee),ht&&G(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,ee)){Pe(q,c);continue}if(ue==="attributename"&&Lr(ee,"href")){Pe(q,c);continue}if(!m.forceKeepAttr){if(!m.keepAttr){Pe(q,c);continue}if(!Ii&&G(ka,ee)){Pe(q,c);continue}if(Le&&(ee=Mt(ee)),!Yi(v,ue,ee)){Pe(q,c);continue}ee=hs(v,ue,B,ee),ee!==xn&&us(c,q,B,ee)}}Te(M.afterSanitizeAttributes,c,null)},Bt=function(c){let f=null,m=ji(c);for(Te(M.beforeSanitizeShadowDOM,c,null);f=m.nextNode();)if(Te(M.uponSanitizeShadowNode,f,null),Zi(f),Qi(f),Ye(f.content)&&Bt(f.content),(U?U(f):f.nodeType)===ye.element){let v=P(f);Ye(v)&&(Nn(v),Bt(v))}Te(M.afterSanitizeShadowDOM,c,null)},Nn=function(c){let f=[{node:c,shadow:null}];for(;f.length>0;){let m=f.pop();if(m.shadow){Bt(m.shadow);continue}let T=m.node,C=(U?U(T):T.nodeType)===ye.element,q=S(T);if(q)for(let B=q.length-1;B>=0;--B)f.push({node:q[B],shadow:null});if(C){let B=he?he(T):null;if(typeof B=="string"&&O(B)==="template"){let ae=T.content;Ye(ae)&&f.push({node:ae,shadow:null})}}if(C){let B=P(T);Ye(B)&&f.push({node:null,shadow:B},{node:B,shadow:null})}}};return t.sanitize=function(g){let c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},f=null,m=null,T=null,v=null;if(vn=!g,vn&&(g="<!-->"),typeof g!="string"&&!dt(g)&&(g=ma(g),typeof g!="string"))throw We("dirty is not a string, aborting");if(!t.isSupported)return g;pn?(x=mn,k=gn):Ln(c),(M.uponSanitizeElement.length>0||M.uponSanitizeAttribute.length>0)&&(x=ne(x)),M.uponSanitizeAttribute.length>0&&(k=ne(k)),t.removed=[];let C=Tn&&typeof g!="string"&&dt(g);if(C){let ae=he?he(g):g.nodeName;if(typeof ae=="string"){let ue=O(ae);if(!x[ue]||ct[ue])throw We("root node is forbidden and cannot be sanitized in-place")}if(Pt(g))throw We("root node is clobbered and cannot be sanitized in-place");try{Nn(g)}catch(ue){throw Vi(g),ue}}else if(dt(g))f=Gi("<!---->"),m=f.ownerDocument.importNode(g,!0),m.nodeType===ye.element&&m.nodeName==="BODY"||m.nodeName==="HTML"?f=m:f.appendChild(m),Nn(m);else{if(!Ve&&!Le&&!Me&&g.indexOf("<")===-1)return ie&&Ot?Ke(g):g;if(f=Gi(g),!f)return Ve?null:Ot?Ie:""}f&&yn&&we(f.firstChild);let q=ji(C?g:f);try{for(;T=q.nextNode();)Zi(T),Qi(T),Ye(T.content)&&Bt(T.content)}catch(ae){throw C&&Vi(g),ae}if(C)return yt(t.removed,ae=>{ae.element&&ss(ae.element)}),Le&&wn(g),g;if(Ve){if(Le&&wn(f),Rt)for(v=Uo.call(f.ownerDocument);f.firstChild;)v.appendChild(f.firstChild);else v=f;return(k.shadowroot||k.shadowrootmode)&&(v=qo.call(i,v,!0)),v}let B=Me?f.outerHTML:f.innerHTML;return Me&&x["!doctype"]&&f.ownerDocument&&f.ownerDocument.doctype&&f.ownerDocument.doctype.name&&G(La,f.ownerDocument.doctype.name)&&(B="<!DOCTYPE "+f.ownerDocument.doctype.name+`>
|
|
24
|
-
`+B),Le&&(B=Mt(B)),ie&&Ot?Ke(B):B},t.setConfig=function(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ln(g),pn=!0,mn=x,gn=k},t.clearConfig=function(){Ze=null,pn=!1,mn=null,gn=null,ie=un,Ie=""},t.isValidAttribute=function(g,c,f){Ze||Ln({});let m=O(g),T=O(c);return Yi(m,T,f)},t.addHook=function(g,c){typeof c=="function"&&K(M,g)&&et(M[g],c)},t.removeHook=function(g,c){if(K(M,g)){if(c!==void 0){let f=la(M[g],c);return f===-1?void 0:ca(M[g],f,1)[0]}return Cr(M[g])}},t.removeHooks=function(g){K(M,g)&&(M[g]=[])},t.removeAllHooks=function(){M=Pr()},t}var Ur=Fr();var z=(e,t="0 0 18 18")=>`<svg viewBox="${t}" width="18" height="18" aria-hidden="true" focusable="false">${e}</svg>`,I={bold:z('<path fill="currentColor" d="M178.48,115.7A44,44,0,0,0,148,40H80a8,8,0,0,0-8,8V200a8,8,0,0,0,8,8h80a48,48,0,0,0,18.48-92.3ZM88,56h60a28,28,0,0,1,0,56H88Zm72,136H88V128h72a32,32,0,0,1,0,64Z"/>',"0 0 256 256"),italic:z('<path fill="currentColor" d="M200,56a8,8,0,0,1-8,8H157.77L115.1,192H144a8,8,0,0,1,0,16H64a8,8,0,0,1,0-16H98.23L140.9,64H112a8,8,0,0,1,0-16h80A8,8,0,0,1,200,56Z"/>',"0 0 256 256"),underline:z('<path fill="currentColor" d="M200,224a8,8,0,0,1-8,8H64a8,8,0,0,1,0-16H192A8,8,0,0,1,200,224Zm-72-24a64.07,64.07,0,0,0,64-64V56a8,8,0,0,0-16,0v80a48,48,0,0,1-96,0V56a8,8,0,0,0-16,0v80A64.07,64.07,0,0,0,128,200Z"/>',"0 0 256 256"),strike:z('<path fill="currentColor" d="M224,128a8,8,0,0,1-8,8H175.93c9.19,7.11,16.07,17.2,16.07,32,0,13.34-7,25.7-19.75,34.79C160.33,211.31,144.61,216,128,216s-32.33-4.69-44.25-13.21C71,193.7,64,181.34,64,168a8,8,0,0,1,16,0c0,17.35,22,32,48,32s48-14.65,48-32c0-14.85-10.54-23.58-38.77-32H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128ZM76.33,104a8,8,0,0,0,7.61-10.49A17.3,17.3,0,0,1,83.11,88c0-18.24,19.3-32,44.89-32,18.84,0,34.16,7.42,41,19.85a8,8,0,0,0,14-7.7C173.33,50.52,152.77,40,128,40,93.29,40,67.11,60.63,67.11,88a33.73,33.73,0,0,0,1.62,10.49A8,8,0,0,0,76.33,104Z"/>',"0 0 256 256"),link:z('<path fill="currentColor" d="M240,88.23a54.43,54.43,0,0,1-16,37L189.25,160a54.27,54.27,0,0,1-38.63,16h-.05A54.63,54.63,0,0,1,96,119.84a8,8,0,0,1,16,.45A38.62,38.62,0,0,0,150.58,160h0a38.39,38.39,0,0,0,27.31-11.31l34.75-34.75a38.63,38.63,0,0,0-54.63-54.63l-11,11A8,8,0,0,1,135.7,59l11-11A54.65,54.65,0,0,1,224,48,54.86,54.86,0,0,1,240,88.23ZM109,185.66l-11,11A38.41,38.41,0,0,1,70.6,208h0a38.63,38.63,0,0,1-27.29-65.94L78,107.31A38.63,38.63,0,0,1,144,135.71a8,8,0,0,0,16,.45A54.86,54.86,0,0,0,144,96a54.65,54.65,0,0,0-77.27,0L32,130.75A54.62,54.62,0,0,0,70.56,224h0a54.28,54.28,0,0,0,38.64-16l11-11A8,8,0,0,0,109,185.66Z"/>',"0 0 256 256"),unlink:z('<path fill="currentColor" d="M198.63,57.37a32,32,0,0,0-45.19-.06L141.79,69.52a8,8,0,0,1-11.58-11l11.72-12.29a1.59,1.59,0,0,1,.13-.13,48,48,0,0,1,67.88,67.88,1.59,1.59,0,0,1-.13.13l-12.29,11.72a8,8,0,0,1-11-11.58l12.21-11.65A32,32,0,0,0,198.63,57.37ZM114.21,186.48l-11.65,12.21a32,32,0,0,1-45.25-45.25l12.21-11.65a8,8,0,0,0-11-11.58L46.19,141.93a1.59,1.59,0,0,0-.13.13,48,48,0,0,0,67.88,67.88,1.59,1.59,0,0,0,.13-.13l11.72-12.29a8,8,0,1,0-11.58-11ZM216,152H192a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16ZM40,104H64a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm120,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V192A8,8,0,0,0,160,184ZM96,72a8,8,0,0,0,8-8V40a8,8,0,0,0-16,0V64A8,8,0,0,0,96,72Z"/>',"0 0 256 256"),ul:z('<path fill="currentColor" d="M80,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H88A8,8,0,0,1,80,64Zm136,56H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm0,64H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16ZM44,52A12,12,0,1,0,56,64,12,12,0,0,0,44,52Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,116Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,180Z"/>',"0 0 256 256"),ol:z('<path fill="currentColor" d="M224,128a8,8,0,0,1-8,8H104a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128ZM104,72H216a8,8,0,0,0,0-16H104a8,8,0,0,0,0,16ZM216,184H104a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16ZM43.58,55.16,48,52.94V104a8,8,0,0,0,16,0V40a8,8,0,0,0-11.58-7.16l-16,8a8,8,0,0,0,7.16,14.32ZM79.77,156.72a23.73,23.73,0,0,0-9.6-15.95,24.86,24.86,0,0,0-34.11,4.7,23.63,23.63,0,0,0-3.57,6.46,8,8,0,1,0,15,5.47,7.84,7.84,0,0,1,1.18-2.13,8.76,8.76,0,0,1,12-1.59A7.91,7.91,0,0,1,63.93,159a7.64,7.64,0,0,1-1.57,5.78,1,1,0,0,0-.08.11L33.59,203.21A8,8,0,0,0,40,216H72a8,8,0,0,0,0-16H56l19.08-25.53A23.47,23.47,0,0,0,79.77,156.72Z"/>',"0 0 256 256"),quote:z('<path fill="currentColor" d="M100,56H40A16,16,0,0,0,24,72v64a16,16,0,0,0,16,16h60v8a32,32,0,0,1-32,32,8,8,0,0,0,0,16,48.05,48.05,0,0,0,48-48V72A16,16,0,0,0,100,56Zm0,80H40V72h60ZM216,56H156a16,16,0,0,0-16,16v64a16,16,0,0,0,16,16h60v8a32,32,0,0,1-32,32,8,8,0,0,0,0,16,48.05,48.05,0,0,0,48-48V72A16,16,0,0,0,216,56Zm0,80H156V72h60Z"/>',"0 0 256 256"),undo:z('<path fill="currentColor" d="M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"/>',"0 0 256 256"),redo:z('<path fill="currentColor" d="M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z"/>',"0 0 256 256"),clear:z('<path fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="square" stroke-linejoin="miter" d="M3 3l18 18M5 5v3M9 5h10v3M12 5v3M12 12v7M8 19h8"/>',"0 0 24 24"),code:z('<path fill="currentColor" d="M69.12,94.15,28.5,128l40.62,33.85a8,8,0,1,1-10.24,12.29l-48-40a8,8,0,0,1,0-12.29l48-40a8,8,0,0,1,10.24,12.3Zm176,27.7-48-40a8,8,0,1,0-10.24,12.3L227.5,128l-40.62,33.85a8,8,0,1,0,10.24,12.29l48-40a8,8,0,0,0,0-12.29ZM162.73,32.48a8,8,0,0,0-10.25,4.79l-64,176a8,8,0,0,0,4.79,10.26A8.14,8.14,0,0,0,96,224a8,8,0,0,0,7.52-5.27l64-176A8,8,0,0,0,162.73,32.48Z"/>',"0 0 256 256"),indent:z('<path fill="currentColor" d="M224,128a8,8,0,0,1-8,8H112a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128ZM112,72H216a8,8,0,0,0,0-16H112a8,8,0,0,0,0,16ZM216,184H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16ZM34.34,141.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0,0-11.32l-40-40A8,8,0,0,0,34.34,61.66L68.69,96,34.34,130.34A8,8,0,0,0,34.34,141.66Z"/>',"0 0 256 256"),outdent:z('<path fill="currentColor" d="M224,128a8,8,0,0,1-8,8H112a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128ZM112,72H216a8,8,0,0,0,0-16H112a8,8,0,0,0,0,16ZM216,184H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16ZM72,144a8,8,0,0,0,5.66-13.66L43.31,96,77.66,61.66A8,8,0,0,0,66.34,50.34l-40,40a8,8,0,0,0,0,11.32l40,40A8,8,0,0,0,72,144Z"/>',"0 0 256 256"),blocks:z('<path fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="square" stroke-linejoin="miter" d="M19 4h-9a4.5 4.5 0 0 0 0 9h3M13 4v16M17 4v16"/>',"0 0 24 24"),h1:z('<path fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" d="M3.5 5.5v12M12 5.5v12M3.5 11.5H12M17 12l3-2v10"/>',"0 0 24 24"),h2:z('<path fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" d="M3.5 5.5v12M12 5.5v12M3.5 11.5H12M16 12.5c0-3.5 6-3.5 6 0 0 2-2.5 3.5-6 7.5h6"/>',"0 0 24 24"),h3:z('<path fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" d="M3.5 5.5v12M12 5.5v12M3.5 11.5H12M16 11c1.5-1.5 6-1.5 6 1.5 0 1.5-1.5 2.5-3 2.5h-1M19 15c1.5 0 3 1 3 2.5 0 3-4.5 3-6 1.5"/>',"0 0 24 24")},Se=e=>e.blocksStayOut(),Da=e=>!!e.element.closest("a"),Et={minimal:["bold","italic","link","unorderedList"],inline:["bold","italic","underline","strikethrough","code","link","undo","redo","clearFormatting"],standard:["blockMenu","bold","italic","underline","strikethrough","code","link","unorderedList","orderedList","quote","outdent","indent","undo","redo","clearFormatting"]};function zr(){return new Map(Ia.map(e=>[e.id,e]))}function nt(e=globalThis){let t=e?.navigator;return t?/Mac|iPhone|iPad|iPod/.test(t.platform||t.userAgent||""):!1}function qr(e,t=globalThis){return e?e.replace("Mod",nt(t)?"Cmd":"Ctrl"):""}var Ia=[De("bold","Bold",I.bold,"Mod+B","inline",e=>e.toggleFormat("B","bold","removeBold")),De("italic","Italic",I.italic,"Mod+I","inline",e=>e.toggleFormat("I","italic","removeItalic")),De("underline","Underline",I.underline,"Mod+U","inline",e=>e.toggleFormat("U","underline","removeUnderline")),De("strikethrough","Strikethrough",I.strike,"Mod+Shift+7","inline",e=>e.toggleFormat("S","strikethrough","removeStrikethrough")),De("code","Code",I.code,null,"inline",e=>e.toggleCode(),e=>e.selectionHasFormat("CODE")||e.selectionHasFormat("PRE")),{id:"link",label:"Link",ariaLabel:"Insert or edit link",icon:I.link,group:"links",shortcut:"Mod+K",mutates:!1,isDisabled:Da,run:e=>e.openLinkDialog(),isActive:e=>!!e.currentLinkElement()},{id:"unlink",label:"Remove link",ariaLabel:"Remove link",icon:I.unlink,group:"links",run:e=>e.squire.removeLink()},De("unorderedList","Bulleted list",I.ul,"Mod+Shift+8","lists",e=>e.toggleList("UL"),e=>e.pathHas("UL"),Se),De("orderedList","Numbered list",I.ol,"Mod+Shift+9","lists",e=>e.toggleList("OL"),e=>e.pathHas("OL"),Se),De("quote","Quote",I.quote,null,"blocks",e=>e.pathHas("BLOCKQUOTE")?e.squire.decreaseQuoteLevel():e.squire.increaseQuoteLevel(),e=>e.pathHas("BLOCKQUOTE"),Se),{id:"outdent",label:"Outdent",ariaLabel:"Decrease indent",icon:I.outdent,group:"blocks",shortcut:"Mod+[",isDisabled:Se,run:e=>e.outdent()},{id:"indent",label:"Indent",ariaLabel:"Increase indent",icon:I.indent,group:"blocks",shortcut:"Mod+]",isDisabled:Se,run:e=>e.indent()},{id:"undo",label:"Undo",ariaLabel:"Undo",icon:I.undo,group:"history",shortcut:"Mod+Z",mutates:!1,run:e=>e.squire.undo()},{id:"redo",label:"Redo",ariaLabel:"Redo",icon:I.redo,group:"history",shortcut:"Mod+Shift+Z",mutates:!1,run:e=>e.squire.redo()},{id:"clearFormatting",label:"Clear formatting",ariaLabel:"Clear formatting",icon:I.clear,group:"cleanup",run:e=>e.squire.removeAllFormatting()},{id:"blockMenu",type:"menu",label:"Block style",ariaLabel:"Choose block style",icon:I.blocks,group:"blocks",isDisabled:Se,options:[Vt("Paragraph","P",I.blocks),Vt("Heading 1","H1",I.h1),Vt("Heading 2","H2",I.h2),Vt("Heading 3","H3",I.h3),{label:"Quote",icon:I.quote,value:"BLOCKQUOTE",isDisabled:Se,run:e=>e.squire.increaseQuoteLevel(),isActive:e=>e.pathHas("BLOCKQUOTE")},{label:"Code block",icon:I.code,value:"PRE",isDisabled:Se,run:e=>e.setBlockType("PRE"),isActive:e=>e.pathHas("PRE")}]}];function De(e,t,n,i,r,o,s=l=>l.selectionHasFormat(Ma(e)),a){return{id:e,label:t,ariaLabel:t,icon:n,group:r,shortcut:i,isDisabled:a,run:o,isActive:s}}function Ma(e){return{bold:"B",italic:"I",underline:"U",strikethrough:"S"}[e]}function Vt(e,t,n){return{label:e,icon:n,value:t,isDisabled:Se,run:i=>i.setBlockType(t),isActive:i=>i.pathHas(t)}}var Xn=/^(?:#text|A(?:BBR|CRONYM)?|B(?:R|D[IO])?|C(?:ITE|ODE)|D(?:ATA|EL|FN)|EM|FONT|HR|I(?:FRAME|MG|NPUT|NS)?|KBD|Q|R(?:P|T|UBY)|S(?:AMP|MALL|PAN|TR(?:IKE|ONG)|U[BP])?|TIME|U|VAR|WBR)$/,jt=/[^ \t\r\n]/;var Pa=new Set(["BR","HR","IFRAME","IMG","INPUT","WBR"]),Qn=e=>e?.nodeType===1&&e.matches('[editor-ui],[clay~="editor-ui"]'),St=new Set(["svg","math"]);function Zt(e){let t=e.nodeType;return t===3||t===8?!0:t!==1?!1:St.has(e.nodeName)?!0:Xn.test(e.nodeName)?Array.from(e.childNodes).every(Zt):!1}function At(e){return Array.from(e.childNodes).some(t=>!Zt(t))}var Yn=e=>e?.nodeType===1&&!St.has(e.nodeName)&&!Xn.test(e.nodeName);function Ct(e,t){let n=Array.from(e.childNodes),i=0;return n.forEach((r,o)=>{if(!(r.nodeType!==1||St.has(r.nodeName))&&(i+=Ct(r,t),!!Yn(r))){for(Yn(n[o-1])&&e.insertBefore(t(),r);r.firstChild;)e.insertBefore(r.firstChild,r);r.remove(),i+=1}}),i}var Jn=new Set(["TABLE","THEAD","TBODY","TFOOT","TR","COLGROUP"]);function Yt(e){return!!e.closest?.("p")||Jn.has(e.nodeName)}var Ba=new Set(["P","H1","H2","H3","H4","H5","H6","PRE","LABEL","LEGEND","LI","TD","TH","DT","DD","FIGCAPTION","SUMMARY","CAPTION"]);function Vr(e){return Ba.has(e.nodeName)||Xt(e)}var Gr=new Set(["AREA","BASE","BR","COL","EMBED","HR","IMG","INPUT","LINK","META","PARAM","SOURCE","TRACK","WBR"]),Ha=new Set(["SCRIPT","STYLE","TEXTAREA","TITLE","IFRAME","NOSCRIPT","XMP"]),jr="http://www.w3.org/1999/xhtml";function Zr(e){return Jn.has(e.nodeName)||Gr.has(e.nodeName)||Ha.has(e.nodeName)||e.nodeName==="TEMPLATE"||!!e.namespaceURI&&e.namespaceURI!==jr}function Yr(e){return Jn.has(e.nodeName)?"a table element cannot be an editable region. Move the editable attribute to a <td>, a <th>, or an element inside one.":e.namespaceURI&&e.namespaceURI!==jr?"an SVG or MathML element cannot be an editable region: an edit puts an HTML block inside it, and the next page load moves that text out of the graphic entirely. Put a <foreignObject> in the SVG and mark an HTML element inside it instead.":Gr.has(e.nodeName)?"this element cannot contain anything, so there is nothing to edit. Move the editable attribute to an element that holds text.":e.nodeName==="TEMPLATE"?"a <template> keeps its content out of the document, so edits to it are never saved.":"this element treats its content as plain text, so any edit would be saved as visible markup rather than formatting."}function Xt(e){return e.nodeType===1&&!St.has(e.nodeName)&&Xn.test(e.nodeName)}function Qt(e){return Array.from(e.querySelectorAll("*")).some(Yn)}function Xr(e,t={}){let{blockTag:n="DIV",wrapBareRoot:i=!1,onBareRootWrapped:r,blocksAllowed:o=!Yt(e)}=t;return eo(e),o&&za(e,n,i,r),e}var Fa=e=>Zt(e)&&e.nodeType!==8&&!Qn(e),Ua=e=>e.nodeType!==8&&!Qn(e)&&!(e.nodeType===3&&!jt.test(e.nodeValue));function Qr(e,{wrapBareRoot:t=!1,blocksAllowed:n=!Yt(e)}={}){return n?At(e)?Array.from(e.childNodes).some(Fa)||Jr(e):t:!1}function Jr(e){return Array.from(e.children).some(t=>At(t)?!ei(t)&&Array.from(t.childNodes).some(i=>i.nodeType===3&&!jt.test(i.nodeValue))||Jr(t):!1)}function eo(e){At(e)&&(ei(e)||Array.from(e.childNodes).forEach(t=>{t.nodeType===3&&!jt.test(t.nodeValue)&&t.remove()}),Array.from(e.children).forEach(eo))}function za(e,t,n,i){if(!At(e)){if(!n)return;let s=e.ownerDocument.createElement(t);if(!Array.from(e.childNodes).some(Ua)){s.appendChild(e.ownerDocument.createElement("BR")),e.appendChild(s);return}for(;e.firstChild;)s.appendChild(e.firstChild);e.appendChild(s),i?.(e,s);return}let r=[],o=()=>{let s=r;if(r=[],!s.some(l=>l.nodeType!==8))return;let a=e.ownerDocument.createElement(t);e.insertBefore(a,s[0]),s.forEach(l=>a.appendChild(l))};Array.from(e.childNodes).forEach(s=>{Qn(s)?o():Zt(s)?r.push(s):o()}),o()}function ei(e){return e.nodeName==="PRE"}function to(e,t){return{start:Wr(e,t.startContainer,t.startOffset),end:Wr(e,t.endContainer,t.endOffset),collapsed:t.collapsed}}function no(e,t,n){Kr(t,"setStart",e,n.start),n.collapsed?t.collapse(!0):Kr(t,"setEnd",e,n.end)}function Wr(e,t,n){if(!e.contains(t))return{scope:e,after:[],before:[]};if(t.nodeType===3){if(!qa(t))return{container:t,offset:n};let i=t.parentNode;return $r(i,Array.from(i.childNodes).indexOf(t))}return{container:t,offset:n,childCount:t.childNodes.length,...$r(t,n)}}function $r(e,t){let n=Array.from(e.childNodes),i=Math.max(0,t);return{scope:e,after:n.slice(i),before:n.slice(0,i).reverse()}}function Kr(e,t,n,i){let{container:r,childCount:o}=i;if(r&&n.contains(r)&&(o===void 0||o===r.childNodes.length)){e[t](r,Math.min(i.offset,Gt(r)));return}let s=i.after?.find(h=>n.contains(h));if(s){e[t](vt(s,!0),0);return}let a=i.before?.find(h=>n.contains(h));if(a){let h=vt(a,!1);e[t](h,Gt(h));return}let l=i.scope&&n.contains(i.scope)?i.scope:n;e[t](l,0)}function qa(e){return e.nodeType===3&&!jt.test(e.nodeValue)&&!!e.parentNode&&e.parentNode.nodeType===1&&At(e.parentNode)&&!ei(e.parentNode)}var it=e=>e.nodeType===1||e.nodeType===3;function vt(e,t=!0){let n=e;for(;n.nodeType===1&&!St.has(n.nodeName);){let i=Array.from(n.childNodes).filter(it),r=t?i[0]:i[i.length-1];if(!r||Pa.has(r.nodeName))break;n=r}return n}function Gt(e){return e.nodeType===3?e.nodeValue.length:e.childNodes.length}var de="[data-richclay], [richclay], [editable], [clay-editable]",Wa="[data-richclay], [richclay], [clay-editable]",$a=["editable","clay-editable"],ii=':is([editable~="single-line"], [clay-editable~="single-line"])';function oi(e){return!e||typeof e.matches!="function"?!1:e.tagName.includes("-")?e.matches(Wa):!0}var Ka="[data-richclay-toolbar], [data-richclay-menu], [data-richclay-dialog], [data-richclay-link-popover], [data-richclay-live], [data-richclay-float]",Va=["richclay-editor","richclay-inline","richclay-active","richclay-empty","richclay-focused"],ri=new WeakSet,io=new WeakSet,ro=["clay:ready","hyperclay:ready"];function oo(e){return[e.clay?.ready,e.hyperclay?.ready].find(t=>t&&typeof t.then=="function")||null}function so(e){return typeof e.clay?.isEditMode=="boolean"?e.clay.isEditMode:typeof e.hyperclay?.isEditMode=="boolean"?e.hyperclay.isEditMode:null}function Ga(e){let t=e.hyperclayModules,n=e.__hyperclayNoAutoExport===!1&&t&&typeof t=="object"&&typeof t.nodeType!="number";return so(e)!==null||!!oo(e)||!!n}function ja(e){return e.clay?.addDocumentTransform||e.hyperclay?.beforeSave||null}function Za(e){return e.clay?.onSnapshot||e.hyperclay?.onSnapshot||null}var Ya={boxSizing:"border-box",minWidth:"100%",overflow:"auto",width:"0"};function Jt(e={},t=window){return e.hyperclay===!1?!1:e.hyperclay===!0?!0:!!(Ga(t)||rl(t))}function si(e=window){let t=co(e);if(t!==null)return t;if(typeof e.__hyperclayEditMode=="boolean")return e.__hyperclayEditMode;let n=so(e);return n!==null?n:ol(e)}function ao(e={},t=window){return e.readOnly?!1:Jt(e,t)?si(t):!0}function lo(e){let t=$a.find(r=>e.hasAttribute(r));if(!t)return null;let n=new Set((e.getAttribute(t)||"").trim().split(/\s+/).filter(Boolean)),i={inline:!0,singleLine:n.has("single-line"),toolbarOnSelect:n.has("toolbar-on-select")};return n.has("no-toolbar")&&(i.toolbar=!1),n.has("link-label")&&(i.singleLine=!0,i.linkLabel=!0,i.toolbar=["link","undo","redo"]),i}function ai(e=window){if(ri.has(e))return;let t=Za(e)||ja(e);if(typeof t!="function"){Xa(e);return}t(n=>li(n)),ri.add(e)}function Xa(e){if(io.has(e))return;let t=e.document,n=oo(e);if(!t&&!n)return;io.add(e);let i=()=>{ai(e),ri.has(e)&&r()},r=()=>{t&&ro.forEach(o=>t.removeEventListener(o,i))};t&&ro.forEach(o=>t.addEventListener(o,i)),n&&n.then(i,()=>{})}function li(e){e.querySelectorAll?.(Ka).forEach(t=>t.remove()),e.querySelectorAll?.(de).forEach(t=>{if(t.getAttribute("data-richclay-active")!=="true")return;if(en(t,"save"),tl(t)){let i=t.ownerDocument,r=!!t.matches?.(ii);Ct(t,()=>r?i.createTextNode(" "):i.createElement("br")),t.querySelectorAll(t.localName).forEach(o=>{for(;o.firstChild;)o.parentNode.insertBefore(o.firstChild,o);o.remove()})}t.matches?.(ii)&&il(t),t.querySelectorAll("#squire-selection-start, #squire-selection-end").forEach(i=>{i.remove()}),t.querySelectorAll(".squire-image-resize-container").forEach(i=>i.remove()),nl(t),(t.matches?.("pre")?[t,...t.querySelectorAll("pre")]:Array.from(t.querySelectorAll("pre"))).filter(i=>i.hasAttribute("data-richclay-pre")).forEach(i=>{Object.entries(Ya).forEach(([r,o])=>{i.style[r]||(i.style[r]=o)}),i.removeAttribute("data-richclay-pre")})}),e.querySelectorAll?.("#squire-selection-start, #squire-selection-end").forEach(t=>t.remove())}var Qa="p, td, th, li, dl, dt, dd, table, blockquote, div, section, article, aside, main, header, footer, figure, figcaption",ti="data-richclay-measure";function Ja(e){let t=e.ownerDocument,n=e.closest(Qa)||e;e.setAttribute(ti,"");let i=t.createElement("div");try{i.innerHTML=n.outerHTML}finally{e.removeAttribute(ti)}let r=i.querySelector(`[${ti}]`);return!r||r.textContent!==e.textContent}var el=e=>!!e.querySelector(e.localName),tl=e=>!!e.matches?.(ii)||(Qt(e)||el(e))&&Ja(e);function en(e,t){let n=e.getAttribute("data-richclay-runtime-contenteditable");e.hasAttribute("contenteditable")&&(n==="true"?e.removeAttribute("contenteditable"):n?t==="destroy"?e.setAttribute("contenteditable",n):(e.setAttribute("inert-contenteditable",n),e.removeAttribute("contenteditable")):t==="save"&&(e.setAttribute("inert-contenteditable",e.getAttribute("contenteditable")),e.removeAttribute("contenteditable"))),Va.forEach(i=>e.classList.remove(i)),e.getAttribute("class")===""&&e.removeAttribute("class"),ni(e,"role","data-richclay-runtime-role"),ni(e,"aria-multiline","data-richclay-runtime-aria-multiline"),ni(e,"no-undo","data-richclay-runtime-no-undo"),e.getAttribute("data-richclay-runtime-display")==="true"&&(e.style.removeProperty("display"),e.getAttribute("style")===""&&e.removeAttribute("style")),sl(e),e.removeAttribute("data-richclay-active"),e.removeAttribute("data-richclay-placeholder"),e.removeAttribute("data-richclay-pre"),e.removeAttribute("data-richclay-runtime-role"),e.removeAttribute("data-richclay-runtime-aria-multiline"),e.removeAttribute("data-richclay-runtime-no-undo"),e.removeAttribute("data-richclay-runtime-describedby"),e.removeAttribute("data-richclay-runtime-contenteditable"),e.removeAttribute("data-richclay-runtime-display"),e.getAttribute("data-richclay-runtime-marker")==="true"&&e.removeAttribute("data-richclay"),e.removeAttribute("data-richclay-runtime-marker")}function nl(e){let n=[e];for(;n.length;)n.pop().childNodes.forEach(r=>{r.nodeType===3?r.nodeValue.includes("\u200B")&&(r.nodeValue=r.nodeValue.split("\u200B").join("")):r.nodeType===1&&n.push(r)});e.querySelectorAll("b, i, u, s, em, strong, code, sub, sup, span").forEach(i=>{i.children.length===0&&(i.textContent||"")===""&&i.attributes.length===0&&i.remove()})}function il(e){let t=Array.from(e.childNodes).filter(i=>i.nodeType!==3||(i.nodeValue||"").trim()!=="");if(t.length!==1)return;let n=t[0];if(!(n.nodeType!==1||n.nodeName!=="P"||n.attributes.length>0)){for(;n.firstChild;)e.insertBefore(n.firstChild,n);n.remove()}}function ci(e){if(!e.hasAttribute("inert-contenteditable"))return null;let t=e.getAttribute("inert-contenteditable");return["false","plaintext-only"].includes(t)||(t="true"),e.setAttribute("contenteditable",t),e.removeAttribute("inert-contenteditable"),t==="true"&&e.setAttribute("data-richclay-runtime-contenteditable","true"),t}function ce(e){return e.setAttribute("snapshot-remove",""),e.setAttribute("no-watch",""),e}function co(e){try{let t=new URLSearchParams(e.location?.search||"");if(t.get("editmode")==="true")return!0;if(t.get("editmode")==="false")return!1}catch{return null}return null}function rl(e){return co(e)!==null||typeof e.__hyperclayEditMode=="boolean"}function ol(e){let n=(e.document?.cookie||"").match(/(?:^|;\s*)isAdminOfCurrentResource=([^;]*)/);return!!(n&&n[1]!=="")}function ni(e,t,n){e.hasAttribute(n)&&e.removeAttribute(t)}function sl(e){let t=e.getAttribute("data-richclay-runtime-describedby");if(!t)return;let n=(e.getAttribute("aria-describedby")||"").split(/\s+/).filter(Boolean).filter(i=>i!==t);n.length?e.setAttribute("aria-describedby",n.join(" ")):e.removeAttribute("aria-describedby")}var al=0;function ho(e=document){let t=e.createElement("div");return t.id=`richclay-live-${++al}`,t.className="richclay-sr-only",t.setAttribute("aria-live","polite"),t.setAttribute("aria-atomic","true"),t.setAttribute("data-richclay-live",""),ce(t),e.body.appendChild(t),t}function rt(e,t){!e||!t||(e.textContent="",e.ownerDocument.defaultView.setTimeout(()=>{e.textContent=t},20))}function Lt(e){e.preventDefault()}function hi(e){try{return e?.cloneRange?.()||null}catch{return null}}function ot(e){try{return hi(e?.getSelection?.())}catch{return null}}function tn(e,t){if(!e||!t)return!1;try{return e.setSelection(t),!0}catch{return!1}}function nn(e,t,n,i){e.hasAttribute(t)||e.setAttribute(i,"true"),e.setAttribute(t,n)}function uo(e,t){let n=new Set((e.getAttribute("aria-describedby")||"").split(/\s+/).filter(Boolean));n.add(t.id),e.setAttribute("aria-describedby",Array.from(n).join(" ")),e.setAttribute("data-richclay-runtime-describedby",t.id)}var ll=0,st=class{constructor(t,n,i={}){this.editor=t,this.controls=n,this.options=i,this.id=++ll,this.items=[],this.menus=new Map,this.activeIndex=0,this.root=this.createRoot(),this.onRootKeydown=r=>this.handleRootKeydown(r),this.onRootClick=r=>this.handleRootClick(r),this.onRootPointerDown=r=>this.handleRootPointerDown(r),this.onDocumentPointerDown=r=>this.handleDocumentPointerDown(r),this.render(),this.root.addEventListener("keydown",this.onRootKeydown),this.root.addEventListener("click",this.onRootClick),this.root.addEventListener("mousedown",this.onRootPointerDown),this.root.ownerDocument.addEventListener("mousedown",this.onDocumentPointerDown)}destroy(){this.closeMenus(),this.root.removeEventListener("keydown",this.onRootKeydown),this.root.removeEventListener("click",this.onRootClick),this.root.removeEventListener("mousedown",this.onRootPointerDown),this.root.ownerDocument.removeEventListener("mousedown",this.onDocumentPointerDown),this.root.remove()}update(){this.items.forEach(t=>{let{def:n,button:i}=t;if(typeof n.isActive=="function"){let r=!!n.isActive(this.editor);i.setAttribute("aria-pressed",r?"true":"false"),i.classList.toggle("is-active",r)}typeof n.isDisabled=="function"&&(i.disabled=!!n.isDisabled(this.editor))}),this.ensureSingleTabStop()}focusFirst(){this.activeIndex=0,this.ensureSingleTabStop(),this.items[0]?.button.focus()}createRoot(){let t=this.editor.element.ownerDocument,n=t.createElement("div");n.className="richclay-toolbar",n.setAttribute("role","toolbar"),n.setAttribute("aria-label",this.options.ariaLabel||"Rich text formatting"),n.setAttribute("data-richclay-toolbar",""),ce(n);let i=cl(this.options.toolbarContainer,t);return i?i.appendChild(n):this.editor.element.insertAdjacentElement("beforebegin",n),n}render(){this.root.textContent="",this.items=[],this.menus.clear();let t=null;this.visibleControls().forEach((n,i)=>{if(n.type==="separator"){this.root.appendChild(po(this.root.ownerDocument)),t=null;return}t&&n.group&&n.group!==t&&this.root.appendChild(po(this.root.ownerDocument)),t=n.group||t,n.type==="menu"?this.renderMenu(n,i):this.renderButton(n,i)}),this.ensureSingleTabStop(),this.update()}visibleControls(){let t=this.controls.filter(i=>i.type==="separator"||!i.isDisabled?.(this.editor)),n=[];for(t.forEach(i=>{let r=n[n.length-1];i.type==="separator"&&(!r||r.type==="separator")||n.push(i)});n[n.length-1]?.type==="separator";)n.pop();return n}renderButton(t,n){let i=fo(this.root.ownerDocument,t);i.dataset.richclayControl=t.id,i.dataset.richclayIndex=String(n),typeof t.isActive=="function"&&i.setAttribute("aria-pressed","false"),this.root.appendChild(i),this.items.push({def:t,button:i,type:"button"})}renderMenu(t,n){let i=this.root.ownerDocument,r=fo(i,t),o=`richclay-menu-${this.id}-${t.id}`;r.dataset.richclayControl=t.id,r.dataset.richclayIndex=String(n),r.setAttribute("aria-haspopup","menu"),r.setAttribute("aria-expanded","false"),r.setAttribute("aria-controls",o);let s=i.createElement("div");s.id=o,s.className="richclay-menu",s.hidden=!0,s.setAttribute("role","menu"),s.setAttribute("data-richclay-menu",""),ce(s),t.options.forEach((l,h)=>{let d=i.createElement("button");d.type="button",d.className="richclay-menu-item",d.setAttribute("role","menuitemradio"),d.setAttribute("tabindex","-1"),d.dataset.richclayMenuItem=t.id,d.dataset.richclayOptionIndex=String(h),d.innerHTML=l.icon||"",d.appendChild(i.createTextNode(l.label)),d.addEventListener("mousedown",Lt),d.addEventListener("click",u=>{u.preventDefault(),this.chooseMenuItem(t,l,r)}),d.addEventListener("keydown",u=>this.handleMenuKeydown(u,t,r)),s.appendChild(d)});let a=i.createElement("span");a.className="richclay-menu-wrap",a.append(r,s),this.root.appendChild(a),this.items.push({def:t,button:r,type:"menu",menu:s}),this.menus.set(t.id,{def:t,button:r,menu:s})}handleRootPointerDown(t){let n=t.target.closest?.("[data-richclay-control]");!n||!this.root.contains(n)||(Lt(t),this.editor.saveSelection())}handleRootClick(t){let n=t.target.closest?.("[data-richclay-control]");if(!n||!this.root.contains(n))return;t.preventDefault();let i=this.items.find(r=>r.button===n);if(!(!i||n.disabled)){if(this.activeIndex=this.items.indexOf(i),this.ensureSingleTabStop(),i.type==="menu"){this.toggleMenu(i.def.id);return}this.closeMenus(),this.editor.runControl(i.def)}}handleRootKeydown(t){let n=t.key,i={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1};if(n in i){t.preventDefault(),this.moveFocus(i[n]);return}if(n==="Home"){t.preventDefault(),this.setFocusIndex(0);return}if(n==="End"){t.preventDefault(),this.setFocusIndex(this.items.length-1);return}let r=this.items[this.activeIndex];if(r&&((n==="Enter"||n===" ")&&r.type==="menu"&&(t.preventDefault(),this.openMenu(r.def.id,"first")),n==="Escape")){let o=Array.from(this.menus.values()).some(s=>!s.menu.hidden);this.closeMenus(),o?r.button.focus():this.editor.focus()}}handleMenuKeydown(t,n,i){t.stopPropagation();let r=this.menus.get(n.id)?.menu,o=Array.from(r.querySelectorAll(".richclay-menu-item")),s=o.indexOf(t.currentTarget),a=s;if(t.key==="ArrowDown"&&(a=(s+1)%o.length),t.key==="ArrowUp"&&(a=(s-1+o.length)%o.length),t.key==="Home"&&(a=0),t.key==="End"&&(a=o.length-1),a!==s){t.preventDefault(),o[a].focus();return}if(t.key==="Escape"){t.preventDefault(),this.closeMenus(),i.focus();return}if(t.key==="Enter"||t.key===" "){t.preventDefault();let l=n.options[s];this.chooseMenuItem(n,l,i)}}handleDocumentPointerDown(t){this.root.contains(t.target)||this.closeMenus()}chooseMenuItem(t,n,i){this.closeMenus(),this.editor.runControl({...n,id:`${t.id}:${n.value}`,ariaLabel:n.label}),i.focus()}toggleMenu(t){let n=this.menus.get(t);n&&(n.menu.hidden?this.openMenu(t,"first"):this.closeMenus())}openMenu(t,n="first"){this.closeMenus(t);let i=this.menus.get(t);if(!i)return;i.menu.hidden=!1,i.button.setAttribute("aria-expanded","true"),this.updateMenuState(i);let r=Array.from(i.menu.querySelectorAll(".richclay-menu-item")),o=r.find(a=>a.getAttribute("aria-checked")==="true");(n==="active"&&o||r[0])?.focus()}closeMenus(t=null){this.menus.forEach((n,i)=>{i!==t&&(n.menu.hidden=!0,n.button.setAttribute("aria-expanded","false"))})}updateMenuState(t){Array.from(t.menu.querySelectorAll(".richclay-menu-item")).forEach((i,r)=>{let s=!!t.def.options[r].isActive?.(this.editor);i.setAttribute("aria-checked",s?"true":"false"),i.classList.toggle("is-active",s)})}moveFocus(t){if(!this.items.length)return;let n=this.activeIndex;do n=(n+t+this.items.length)%this.items.length;while(this.items[n].button.disabled&&n!==this.activeIndex);this.setFocusIndex(n)}setFocusIndex(t){this.activeIndex=Math.max(0,Math.min(t,this.items.length-1)),this.ensureSingleTabStop(),this.items[this.activeIndex]?.button.focus()}ensureSingleTabStop(){let t=this.items.filter(n=>!n.button.disabled);t.length&&(t.includes(this.items[this.activeIndex])||(this.activeIndex=this.items.indexOf(t[0])),this.items.forEach((n,i)=>{n.button.tabIndex=i===this.activeIndex?0:-1}))}};function fo(e,t){let n=e.createElement("button");n.type="button",n.className="richclay-button";let i=qr(t.shortcut,e.defaultView),r=i?`${t.ariaLabel||t.label} (${i})`:t.ariaLabel||t.label;return n.setAttribute("aria-label",r),n.title=r,n.innerHTML=`${t.icon||""}<span class="richclay-sr-only">${t.label}</span>`,n}function po(e){let t=e.createElement("span");return t.className="richclay-separator",t.setAttribute("role","separator"),t.setAttribute("aria-orientation","vertical"),t}function cl(e,t){return e?typeof e=="string"?t.querySelector(e):e:null}var mo=16,hl=[16,8,0],V=8,ul=4;function dl({anchor:e,bar:t,rail:n,viewport:i,current:r=null}){let o=p=>r===p?ul:0;if(e.bottom<=0||e.top>=i.height||e.right<=0||e.left>=i.width)return{mode:"hidden",x:0,y:0};let s=p=>Math.max(V,Math.min(e.left,i.width-p-V)),a=e.top-mo-t.height;if(a>=V-o("above"))return{mode:"above",x:s(t.width),y:a};let l=e.bottom+mo;if(l+t.height<=i.height-V+o("below"))return{mode:"below",x:s(t.width),y:l};let h=i.width-e.right-V,d=e.left-V,u=h>=d?[["rail-right",h],["rail-left",d]]:[["rail-left",d],["rail-right",h]];for(let[p,b]of u)for(let y of hl){if(n.width+y>b+o(p))continue;let E=p==="rail-right"?Math.min(e.right+y,i.width-n.width-V):Math.max(e.left-y-n.width,V),S=Math.min(e.bottom,i.height-V)-n.height,N=Math.max(V,Math.min(Math.max(e.top,V),S));return{mode:p,x:E,y:N,gap:y}}return{mode:"pinned",x:s(t.width),y:V}}var fl=10,pl=28;function on({anchor:e,box:t,viewport:n,gap:i=fl}){let r=n.height-V-e.bottom-i,o=e.top-i-V,s=r>=t.height||r>=o?"below":"above",a=s==="below"?e.bottom+i:e.top-i-t.height,l=Math.max(V,Math.min(a,n.height-V-t.height)),h=(e.left+e.right)/2,d=Math.max(V,Math.min(h-pl,n.width-V-t.width)),u=Math.max(14,Math.min(h-d,t.width-14));return{side:s,x:d,y:l,arrow:u}}function Q(e,t,n){e.style.setProperty(t,n,"important")}var rn=class{constructor(t,n){this.editor=t,this.mode=null,this.hidden=!1,this.frame=0,this.bar={width:0,height:0},this.rail={width:0,height:0};let i=t.element.ownerDocument;this.doc=i,this.win=i.defaultView||globalThis,this.root=i.createElement("div"),this.root.className="richclay-float",this.root.setAttribute("data-richclay-float",""),this.root.setAttribute("save-remove",""),ce(this.root),i.body.appendChild(this.root),this.toolbar=new st(t,n,{toolbarContainer:this.root}),this.onScroll=()=>this.schedule(),this.onResize=()=>{this.measure(),this.schedule()},i.addEventListener("scroll",this.onScroll,{capture:!0,passive:!0}),this.win.addEventListener("resize",this.onResize,{passive:!0}),this.win.visualViewport?.addEventListener("resize",this.onResize,{passive:!0}),this.win.visualViewport?.addEventListener("scroll",this.onScroll,{passive:!0}),this.resizeObserver=typeof this.win.ResizeObserver=="function"?new this.win.ResizeObserver(()=>this.schedule()):null,this.resizeObserver?.observe(t.element),this.measure(),this.reposition()}measure(){let t=this.root.classList.contains("richclay-float-rail");Q(this.root,"visibility","hidden"),this.root.classList.remove("richclay-float-rail"),this.bar={width:this.root.offsetWidth||0,height:this.root.offsetHeight||0},this.root.classList.add("richclay-float-rail"),this.rail={width:this.root.offsetWidth||0,height:this.root.offsetHeight||0},this.root.classList.toggle("richclay-float-rail",t),this.root.style.removeProperty("visibility")}schedule(){if(!this.win.requestAnimationFrame){this.reposition();return}this.frame||(this.frame=this.win.requestAnimationFrame(()=>{this.frame=0,this.reposition()}))}setVisible(t){this.hidden=!t,this.reposition()}reposition(){if(this.hidden){Q(this.root,"display","none");return}let t=this.editor.element.getBoundingClientRect(),n={width:this.win.visualViewport?.width??this.win.innerWidth,height:this.win.visualViewport?.height??this.win.innerHeight},i=dl({anchor:t,bar:this.bar,rail:this.rail,viewport:n,current:this.mode});if(this.mode=i.mode,i.mode==="hidden"){Q(this.root,"display","none");return}this.root.style.removeProperty("display"),this.root.classList.toggle("richclay-float-rail",i.mode==="rail-left"||i.mode==="rail-right"),this.root.classList.toggle("richclay-float-pinned",i.mode==="pinned"),Q(this.root,"transform",`translate(${Math.round(i.x)}px, ${Math.round(i.y)}px)`)}destroy(){this.frame&&this.win.cancelAnimationFrame?.(this.frame),this.frame=0,this.doc.removeEventListener("scroll",this.onScroll,{capture:!0}),this.win.removeEventListener("resize",this.onResize),this.win.visualViewport?.removeEventListener("resize",this.onResize),this.win.visualViewport?.removeEventListener("scroll",this.onScroll),this.resizeObserver?.disconnect(),this.toolbar.destroy(),this.root.remove()}};var ml={ALLOWED_TAGS:["a","b","blockquote","br","code","div","em","h1","h2","h3","h4","h5","h6","i","li","ol","p","pre","s","span","strong","sub","sup","u","ul"],ALLOWED_ATTR:["aria-label","href","rel","target","title"],ALLOW_DATA_ATTR:!1,ALLOW_ARIA_ATTR:!0,ALLOWED_URI_REGEXP:/^(?:(?:(?:f|ht)tps?|mailto|tel):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,FORBID_TAGS:["script","style","iframe","object","embed","form","input"],FORBID_ATTR:["style","srcset","onerror","onclick","onload"]};function bo(e={},t=document){let n=sn(t);return{sanitizeHTML(i){return ui(i,e,t,n)},sanitizeElement(i){return di(i,e,n)},sanitizeToDOMFragment(i,r){let o=r?.getRoot?.().ownerDocument||t;return gl(i,e,o,n)}}}function ui(e,t={},n=document,i=sn(n)){let r=n.createElement("template");return r.innerHTML=i.sanitize(String(e||""),fi(t)),mi(r.content),r.innerHTML}function di(e,t={},n=sn(e.ownerDocument)){let r=e.ownerDocument.createElement("div");for(;e.firstChild;)r.appendChild(e.firstChild);for(n.sanitize(r,{...fi(t),IN_PLACE:!0}),mi(r);r.firstChild;)e.appendChild(r.firstChild);return e}function gl(e,t={},n=document,i=sn(n)){let r=i.sanitize(String(e||""),{...fi(t),RETURN_DOM_FRAGMENT:!0}),o=r?.ownerDocument===n?r:n.importNode(r,!0);return mi(o),o||n.createDocumentFragment()}function fi(e){return{...ml,...e}}var yl=new Set(["http","https","mailto","tel"]),bl=new RegExp("[\\u0000-\\u0020\\u007F-\\u009F]","g");function pi(e){let n=(String(e??"").replace(bl,"").match(/^([a-z][a-z0-9+.\-]*):/i)||[])[1];return!n||yl.has(n.toLowerCase())}var Tl=/^[^\s/?#:]+\.(?:html?|pdf|txt|csv|json|xml|svg|png|jpe?g|gif|webp|docx?|xlsx?|pptx?|bib|tex|zip)(?:[?#]\S*)?$/i,_l=/^[^\s/?#:.]+\/\S*$/;function To(e){let t=String(e??"").trim();return!t||!pi(t)?"":/^(?:https?:|mailto:|tel:)/i.test(t)?t:/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)?`mailto:${t}`:/^(?:[#?]|\/|\.{1,2}\/)/.test(t)||Tl.test(t)||_l.test(t)?t:`https://${t}`}function sn(e){let t=globalThis.DOMPurify;if(t?.sanitize)return t;if(typeof t=="function")return t(e.defaultView||globalThis);throw new Error("RichClay requires DOMPurify. Load vendor/purify.min.js before richclay.js or provide globalThis.DOMPurify.")}function mi(e){e.querySelectorAll?.("a[href]").forEach(t=>{let n=t.getAttribute("href")||"";if(/^\s*javascript:/i.test(n)&&t.removeAttribute("href"),t.getAttribute("target")==="_blank"){let i=new Set((t.getAttribute("rel")||"").split(/\s+/).filter(Boolean));i.add("noopener"),i.add("noreferrer"),t.setAttribute("rel",Array.from(i).join(" "))}})}var go={ADD_TAGS:["img"],ADD_ATTR:["class","id","src","alt","width","height"]};function _o(e={}){return{...e,ADD_TAGS:[...new Set([...go.ADD_TAGS,...e.ADD_TAGS||[]])],ADD_ATTR:[...new Set([...go.ADD_ATTR,...e.ADD_ATTR||[]])],ALLOW_DATA_ATTR:e.ALLOW_DATA_ATTR??!0}}var yo="p, div, h1, h2, h3, h4, h5, h6, blockquote, pre, ul, ol, li, figure, figcaption, table, thead, tbody, tr, td, th";function Eo(e){let t=e.ownerDocument||document;e.querySelectorAll?.("br").forEach(i=>i.replaceWith(t.createTextNode(" ")));let n=e.querySelector?.(yo);for(;n;){let i=n.parentNode;for(i.insertBefore(t.createTextNode(" "),n);n.firstChild;)i.insertBefore(n.firstChild,n);i.insertBefore(t.createTextNode(" "),n),n.remove(),n=e.querySelector(yo)}return El(e,t),e}function El(e,t){e.normalize?.();let n=t.createTreeWalker(e,4),i=[];for(;n.nextNode();)i.push(n.currentNode);i.forEach(s=>{s.nodeValue=s.nodeValue.replace(/\s+/g," ")});let r=e.firstChild;r?.nodeType===3&&(r.nodeValue=r.nodeValue.replace(/^\s+/,""));let o=e.lastChild;o?.nodeType===3&&(o.nodeValue=o.nodeValue.replace(/\s+$/,""))}var vl=300,Sl=e=>e.replace(/^mailto:/i,"").replace(/^https?:\/\//i,""),an=class{constructor(t){this.editor=t,this.root=null,this.anchor=null,this.href=null,this.dismissed=null,this.hideTimer=null,this.pointerInside=!1,this.cleanup=null}currentAnchor(){let t=this.editor;return!t.active||t.options.readOnly||t.dialog||t.element.ownerDocument.hidden?null:t.currentLinkElement()}update(){let t=this.currentAnchor();if(!(t&&t===this.dismissed)){if(this.dismissed=null,!t){this.scheduleHide();return}this.cancelHide(),this.show(t)}}show(t){this.root||this.mount();let n=t.getAttribute("href")||"";if(t!==this.anchor||n!==this.href){this.anchor=t,this.href=n;let i=this.root.querySelector(".richclay-link-address");i.textContent=Sl(n)||n,i.title=n,n&&pi(n)?i.setAttribute("href",n):i.removeAttribute("href"),/^(?:mailto|tel):/i.test(n)?i.removeAttribute("target"):i.setAttribute("target","_blank")}this.position()}mount(){let t=this.editor,n=t.element.ownerDocument,i=n.defaultView||globalThis,r=n.createElement("div");r.className="richclay-dialog richclay-link-popover",r.setAttribute("role","group"),r.setAttribute("aria-label","Link"),r.setAttribute("data-richclay-link-popover",""),ce(r),r.setAttribute("save-remove",""),r.innerHTML=`
|
|
24
|
+
`+B),Le&&(B=Mt(B)),ie&&Ot?Ke(B):B},t.setConfig=function(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ln(g),pn=!0,mn=x,gn=k},t.clearConfig=function(){Ze=null,pn=!1,mn=null,gn=null,ie=un,Ie=""},t.isValidAttribute=function(g,c,f){Ze||Ln({});let m=O(g),T=O(c);return Yi(m,T,f)},t.addHook=function(g,c){typeof c=="function"&&K(M,g)&&et(M[g],c)},t.removeHook=function(g,c){if(K(M,g)){if(c!==void 0){let f=la(M[g],c);return f===-1?void 0:ca(M[g],f,1)[0]}return Cr(M[g])}},t.removeHooks=function(g){K(M,g)&&(M[g]=[])},t.removeAllHooks=function(){M=Pr()},t}var Ur=Fr();var z=(e,t="0 0 18 18")=>`<svg viewBox="${t}" width="18" height="18" aria-hidden="true" focusable="false">${e}</svg>`,I={bold:z('<path fill="currentColor" d="M178.48,115.7A44,44,0,0,0,148,40H80a8,8,0,0,0-8,8V200a8,8,0,0,0,8,8h80a48,48,0,0,0,18.48-92.3ZM88,56h60a28,28,0,0,1,0,56H88Zm72,136H88V128h72a32,32,0,0,1,0,64Z"/>',"0 0 256 256"),italic:z('<path fill="currentColor" d="M200,56a8,8,0,0,1-8,8H157.77L115.1,192H144a8,8,0,0,1,0,16H64a8,8,0,0,1,0-16H98.23L140.9,64H112a8,8,0,0,1,0-16h80A8,8,0,0,1,200,56Z"/>',"0 0 256 256"),underline:z('<path fill="currentColor" d="M200,224a8,8,0,0,1-8,8H64a8,8,0,0,1,0-16H192A8,8,0,0,1,200,224Zm-72-24a64.07,64.07,0,0,0,64-64V56a8,8,0,0,0-16,0v80a48,48,0,0,1-96,0V56a8,8,0,0,0-16,0v80A64.07,64.07,0,0,0,128,200Z"/>',"0 0 256 256"),strike:z('<path fill="currentColor" d="M224,128a8,8,0,0,1-8,8H175.93c9.19,7.11,16.07,17.2,16.07,32,0,13.34-7,25.7-19.75,34.79C160.33,211.31,144.61,216,128,216s-32.33-4.69-44.25-13.21C71,193.7,64,181.34,64,168a8,8,0,0,1,16,0c0,17.35,22,32,48,32s48-14.65,48-32c0-14.85-10.54-23.58-38.77-32H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128ZM76.33,104a8,8,0,0,0,7.61-10.49A17.3,17.3,0,0,1,83.11,88c0-18.24,19.3-32,44.89-32,18.84,0,34.16,7.42,41,19.85a8,8,0,0,0,14-7.7C173.33,50.52,152.77,40,128,40,93.29,40,67.11,60.63,67.11,88a33.73,33.73,0,0,0,1.62,10.49A8,8,0,0,0,76.33,104Z"/>',"0 0 256 256"),link:z('<path fill="currentColor" d="M240,88.23a54.43,54.43,0,0,1-16,37L189.25,160a54.27,54.27,0,0,1-38.63,16h-.05A54.63,54.63,0,0,1,96,119.84a8,8,0,0,1,16,.45A38.62,38.62,0,0,0,150.58,160h0a38.39,38.39,0,0,0,27.31-11.31l34.75-34.75a38.63,38.63,0,0,0-54.63-54.63l-11,11A8,8,0,0,1,135.7,59l11-11A54.65,54.65,0,0,1,224,48,54.86,54.86,0,0,1,240,88.23ZM109,185.66l-11,11A38.41,38.41,0,0,1,70.6,208h0a38.63,38.63,0,0,1-27.29-65.94L78,107.31A38.63,38.63,0,0,1,144,135.71a8,8,0,0,0,16,.45A54.86,54.86,0,0,0,144,96a54.65,54.65,0,0,0-77.27,0L32,130.75A54.62,54.62,0,0,0,70.56,224h0a54.28,54.28,0,0,0,38.64-16l11-11A8,8,0,0,0,109,185.66Z"/>',"0 0 256 256"),unlink:z('<path fill="currentColor" d="M198.63,57.37a32,32,0,0,0-45.19-.06L141.79,69.52a8,8,0,0,1-11.58-11l11.72-12.29a1.59,1.59,0,0,1,.13-.13,48,48,0,0,1,67.88,67.88,1.59,1.59,0,0,1-.13.13l-12.29,11.72a8,8,0,0,1-11-11.58l12.21-11.65A32,32,0,0,0,198.63,57.37ZM114.21,186.48l-11.65,12.21a32,32,0,0,1-45.25-45.25l12.21-11.65a8,8,0,0,0-11-11.58L46.19,141.93a1.59,1.59,0,0,0-.13.13,48,48,0,0,0,67.88,67.88,1.59,1.59,0,0,0,.13-.13l11.72-12.29a8,8,0,1,0-11.58-11ZM216,152H192a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16ZM40,104H64a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm120,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V192A8,8,0,0,0,160,184ZM96,72a8,8,0,0,0,8-8V40a8,8,0,0,0-16,0V64A8,8,0,0,0,96,72Z"/>',"0 0 256 256"),ul:z('<path fill="currentColor" d="M80,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H88A8,8,0,0,1,80,64Zm136,56H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm0,64H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16ZM44,52A12,12,0,1,0,56,64,12,12,0,0,0,44,52Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,116Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,180Z"/>',"0 0 256 256"),ol:z('<path fill="currentColor" d="M224,128a8,8,0,0,1-8,8H104a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128ZM104,72H216a8,8,0,0,0,0-16H104a8,8,0,0,0,0,16ZM216,184H104a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16ZM43.58,55.16,48,52.94V104a8,8,0,0,0,16,0V40a8,8,0,0,0-11.58-7.16l-16,8a8,8,0,0,0,7.16,14.32ZM79.77,156.72a23.73,23.73,0,0,0-9.6-15.95,24.86,24.86,0,0,0-34.11,4.7,23.63,23.63,0,0,0-3.57,6.46,8,8,0,1,0,15,5.47,7.84,7.84,0,0,1,1.18-2.13,8.76,8.76,0,0,1,12-1.59A7.91,7.91,0,0,1,63.93,159a7.64,7.64,0,0,1-1.57,5.78,1,1,0,0,0-.08.11L33.59,203.21A8,8,0,0,0,40,216H72a8,8,0,0,0,0-16H56l19.08-25.53A23.47,23.47,0,0,0,79.77,156.72Z"/>',"0 0 256 256"),quote:z('<path fill="currentColor" d="M100,56H40A16,16,0,0,0,24,72v64a16,16,0,0,0,16,16h60v8a32,32,0,0,1-32,32,8,8,0,0,0,0,16,48.05,48.05,0,0,0,48-48V72A16,16,0,0,0,100,56Zm0,80H40V72h60ZM216,56H156a16,16,0,0,0-16,16v64a16,16,0,0,0,16,16h60v8a32,32,0,0,1-32,32,8,8,0,0,0,0,16,48.05,48.05,0,0,0,48-48V72A16,16,0,0,0,216,56Zm0,80H156V72h60Z"/>',"0 0 256 256"),undo:z('<path fill="currentColor" d="M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"/>',"0 0 256 256"),redo:z('<path fill="currentColor" d="M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z"/>',"0 0 256 256"),clear:z('<path fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="square" stroke-linejoin="miter" d="M3 3l18 18M5 5v3M9 5h10v3M12 5v3M12 12v7M8 19h8"/>',"0 0 24 24"),code:z('<path fill="currentColor" d="M69.12,94.15,28.5,128l40.62,33.85a8,8,0,1,1-10.24,12.29l-48-40a8,8,0,0,1,0-12.29l48-40a8,8,0,0,1,10.24,12.3Zm176,27.7-48-40a8,8,0,1,0-10.24,12.3L227.5,128l-40.62,33.85a8,8,0,1,0,10.24,12.29l48-40a8,8,0,0,0,0-12.29ZM162.73,32.48a8,8,0,0,0-10.25,4.79l-64,176a8,8,0,0,0,4.79,10.26A8.14,8.14,0,0,0,96,224a8,8,0,0,0,7.52-5.27l64-176A8,8,0,0,0,162.73,32.48Z"/>',"0 0 256 256"),indent:z('<path fill="currentColor" d="M224,128a8,8,0,0,1-8,8H112a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128ZM112,72H216a8,8,0,0,0,0-16H112a8,8,0,0,0,0,16ZM216,184H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16ZM34.34,141.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0,0-11.32l-40-40A8,8,0,0,0,34.34,61.66L68.69,96,34.34,130.34A8,8,0,0,0,34.34,141.66Z"/>',"0 0 256 256"),outdent:z('<path fill="currentColor" d="M224,128a8,8,0,0,1-8,8H112a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128ZM112,72H216a8,8,0,0,0,0-16H112a8,8,0,0,0,0,16ZM216,184H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16ZM72,144a8,8,0,0,0,5.66-13.66L43.31,96,77.66,61.66A8,8,0,0,0,66.34,50.34l-40,40a8,8,0,0,0,0,11.32l40,40A8,8,0,0,0,72,144Z"/>',"0 0 256 256"),blocks:z('<path fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="square" stroke-linejoin="miter" d="M19 4h-9a4.5 4.5 0 0 0 0 9h3M13 4v16M17 4v16"/>',"0 0 24 24"),h1:z('<path fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" d="M3.5 5.5v12M12 5.5v12M3.5 11.5H12M17 12l3-2v10"/>',"0 0 24 24"),h2:z('<path fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" d="M3.5 5.5v12M12 5.5v12M3.5 11.5H12M16 12.5c0-3.5 6-3.5 6 0 0 2-2.5 3.5-6 7.5h6"/>',"0 0 24 24"),h3:z('<path fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" d="M3.5 5.5v12M12 5.5v12M3.5 11.5H12M16 11c1.5-1.5 6-1.5 6 1.5 0 1.5-1.5 2.5-3 2.5h-1M19 15c1.5 0 3 1 3 2.5 0 3-4.5 3-6 1.5"/>',"0 0 24 24")},Se=e=>e.blocksStayOut(),Da=e=>!!e.element.closest("a"),Et={minimal:["bold","italic","link","unorderedList"],inline:["bold","italic","underline","strikethrough","code","link","undo","redo","clearFormatting"],standard:["blockMenu","bold","italic","underline","strikethrough","code","link","unorderedList","orderedList","quote","outdent","indent","undo","redo","clearFormatting"]};function zr(){return new Map(Ia.map(e=>[e.id,e]))}function nt(e=globalThis){let t=e?.navigator;return t?/Mac|iPhone|iPad|iPod/.test(t.platform||t.userAgent||""):!1}function qr(e,t=globalThis){return e?e.replace("Mod",nt(t)?"Cmd":"Ctrl"):""}var Ia=[De("bold","Bold",I.bold,"Mod+B","inline",e=>e.toggleFormat("B","bold","removeBold")),De("italic","Italic",I.italic,"Mod+I","inline",e=>e.toggleFormat("I","italic","removeItalic")),De("underline","Underline",I.underline,"Mod+U","inline",e=>e.toggleFormat("U","underline","removeUnderline")),De("strikethrough","Strikethrough",I.strike,"Mod+Shift+7","inline",e=>e.toggleFormat("S","strikethrough","removeStrikethrough")),De("code","Code",I.code,null,"inline",e=>e.toggleCode(),e=>e.selectionHasFormat("CODE")||e.selectionHasFormat("PRE")),{id:"link",label:"Link",ariaLabel:"Insert or edit link",icon:I.link,group:"links",shortcut:"Mod+K",mutates:!1,isDisabled:Da,run:e=>e.openLinkDialog(),isActive:e=>!!e.currentLinkElement()},{id:"unlink",label:"Remove link",ariaLabel:"Remove link",icon:I.unlink,group:"links",run:e=>e.squire.removeLink()},De("unorderedList","Bulleted list",I.ul,"Mod+Shift+8","lists",e=>e.toggleList("UL"),e=>e.pathHas("UL"),Se),De("orderedList","Numbered list",I.ol,"Mod+Shift+9","lists",e=>e.toggleList("OL"),e=>e.pathHas("OL"),Se),De("quote","Quote",I.quote,null,"blocks",e=>e.pathHas("BLOCKQUOTE")?e.squire.decreaseQuoteLevel():e.squire.increaseQuoteLevel(),e=>e.pathHas("BLOCKQUOTE"),Se),{id:"outdent",label:"Outdent",ariaLabel:"Decrease indent",icon:I.outdent,group:"blocks",shortcut:"Mod+[",isDisabled:Se,run:e=>e.outdent()},{id:"indent",label:"Indent",ariaLabel:"Increase indent",icon:I.indent,group:"blocks",shortcut:"Mod+]",isDisabled:Se,run:e=>e.indent()},{id:"undo",label:"Undo",ariaLabel:"Undo",icon:I.undo,group:"history",shortcut:"Mod+Z",mutates:!1,run:e=>e.squire.undo()},{id:"redo",label:"Redo",ariaLabel:"Redo",icon:I.redo,group:"history",shortcut:"Mod+Shift+Z",mutates:!1,run:e=>e.squire.redo()},{id:"clearFormatting",label:"Clear formatting",ariaLabel:"Clear formatting",icon:I.clear,group:"cleanup",run:e=>e.squire.removeAllFormatting()},{id:"blockMenu",type:"menu",label:"Block style",ariaLabel:"Choose block style",icon:I.blocks,group:"blocks",isDisabled:Se,options:[Vt("Paragraph","P",I.blocks),Vt("Heading 1","H1",I.h1),Vt("Heading 2","H2",I.h2),Vt("Heading 3","H3",I.h3),{label:"Quote",icon:I.quote,value:"BLOCKQUOTE",isDisabled:Se,run:e=>e.squire.increaseQuoteLevel(),isActive:e=>e.pathHas("BLOCKQUOTE")},{label:"Code block",icon:I.code,value:"PRE",isDisabled:Se,run:e=>e.setBlockType("PRE"),isActive:e=>e.pathHas("PRE")}]}];function De(e,t,n,i,r,o,s=l=>l.selectionHasFormat(Ma(e)),a){return{id:e,label:t,ariaLabel:t,icon:n,group:r,shortcut:i,isDisabled:a,run:o,isActive:s}}function Ma(e){return{bold:"B",italic:"I",underline:"U",strikethrough:"S"}[e]}function Vt(e,t,n){return{label:e,icon:n,value:t,isDisabled:Se,run:i=>i.setBlockType(t),isActive:i=>i.pathHas(t)}}var Xn=/^(?:#text|A(?:BBR|CRONYM)?|B(?:R|D[IO])?|C(?:ITE|ODE)|D(?:ATA|EL|FN)|EM|FONT|HR|I(?:FRAME|MG|NPUT|NS)?|KBD|Q|R(?:P|T|UBY)|S(?:AMP|MALL|PAN|TR(?:IKE|ONG)|U[BP])?|TIME|U|VAR|WBR)$/,jt=/[^ \t\r\n]/;var Pa=new Set(["BR","HR","IFRAME","IMG","INPUT","WBR"]),Qn=e=>e?.nodeType===1&&e.matches('[editor-ui],[clay~="editor-ui"]'),St=new Set(["svg","math"]);function Zt(e){let t=e.nodeType;return t===3||t===8?!0:t!==1?!1:St.has(e.nodeName)?!0:Xn.test(e.nodeName)?Array.from(e.childNodes).every(Zt):!1}function At(e){return Array.from(e.childNodes).some(t=>!Zt(t))}var Yn=e=>e?.nodeType===1&&!St.has(e.nodeName)&&!Xn.test(e.nodeName);function Ct(e,t){let n=Array.from(e.childNodes),i=0;return n.forEach((r,o)=>{if(!(r.nodeType!==1||St.has(r.nodeName))&&(i+=Ct(r,t),!!Yn(r))){for(Yn(n[o-1])&&e.insertBefore(t(),r);r.firstChild;)e.insertBefore(r.firstChild,r);r.remove(),i+=1}}),i}var Jn=new Set(["TABLE","THEAD","TBODY","TFOOT","TR","COLGROUP"]);function Yt(e){return!!e.closest?.("p")||Jn.has(e.nodeName)}var Ba=new Set(["P","H1","H2","H3","H4","H5","H6","PRE","LABEL","LEGEND","LI","TD","TH","DT","DD","FIGCAPTION","SUMMARY","CAPTION"]);function Vr(e){return Ba.has(e.nodeName)||Xt(e)}var Gr=new Set(["AREA","BASE","BR","COL","EMBED","HR","IMG","INPUT","LINK","META","PARAM","SOURCE","TRACK","WBR"]),Ha=new Set(["SCRIPT","STYLE","TEXTAREA","TITLE","IFRAME","NOSCRIPT","XMP"]),jr="http://www.w3.org/1999/xhtml";function Zr(e){return Jn.has(e.nodeName)||Gr.has(e.nodeName)||Ha.has(e.nodeName)||e.nodeName==="TEMPLATE"||!!e.namespaceURI&&e.namespaceURI!==jr}function Yr(e){return Jn.has(e.nodeName)?"a table element cannot be an editable region. Move the editable attribute to a <td>, a <th>, or an element inside one.":e.namespaceURI&&e.namespaceURI!==jr?"an SVG or MathML element cannot be an editable region: an edit puts an HTML block inside it, and the next page load moves that text out of the graphic entirely. Put a <foreignObject> in the SVG and mark an HTML element inside it instead.":Gr.has(e.nodeName)?"this element cannot contain anything, so there is nothing to edit. Move the editable attribute to an element that holds text.":e.nodeName==="TEMPLATE"?"a <template> keeps its content out of the document, so edits to it are never saved.":"this element treats its content as plain text, so any edit would be saved as visible markup rather than formatting."}function Xt(e){return e.nodeType===1&&!St.has(e.nodeName)&&Xn.test(e.nodeName)}function Qt(e){return Array.from(e.querySelectorAll("*")).some(Yn)}function Xr(e,t={}){let{blockTag:n="DIV",wrapBareRoot:i=!1,onBareRootWrapped:r,blocksAllowed:o=!Yt(e)}=t;return eo(e),o&&za(e,n,i,r),e}var Fa=e=>Zt(e)&&e.nodeType!==8&&!Qn(e),Ua=e=>e.nodeType!==8&&!Qn(e)&&!(e.nodeType===3&&!jt.test(e.nodeValue));function Qr(e,{wrapBareRoot:t=!1,blocksAllowed:n=!Yt(e)}={}){return n?At(e)?Array.from(e.childNodes).some(Fa)||Jr(e):t:!1}function Jr(e){return Array.from(e.children).some(t=>At(t)?!ei(t)&&Array.from(t.childNodes).some(i=>i.nodeType===3&&!jt.test(i.nodeValue))||Jr(t):!1)}function eo(e){At(e)&&(ei(e)||Array.from(e.childNodes).forEach(t=>{t.nodeType===3&&!jt.test(t.nodeValue)&&t.remove()}),Array.from(e.children).forEach(eo))}function za(e,t,n,i){if(!At(e)){if(!n)return;let s=e.ownerDocument.createElement(t);if(!Array.from(e.childNodes).some(Ua)){s.appendChild(e.ownerDocument.createElement("BR")),e.appendChild(s);return}for(;e.firstChild;)s.appendChild(e.firstChild);e.appendChild(s),i?.(e,s);return}let r=[],o=()=>{let s=r;if(r=[],!s.some(l=>l.nodeType!==8))return;let a=e.ownerDocument.createElement(t);e.insertBefore(a,s[0]),s.forEach(l=>a.appendChild(l))};Array.from(e.childNodes).forEach(s=>{Qn(s)?o():Zt(s)?r.push(s):o()}),o()}function ei(e){return e.nodeName==="PRE"}function to(e,t){return{start:Wr(e,t.startContainer,t.startOffset),end:Wr(e,t.endContainer,t.endOffset),collapsed:t.collapsed}}function no(e,t,n){Kr(t,"setStart",e,n.start),n.collapsed?t.collapse(!0):Kr(t,"setEnd",e,n.end)}function Wr(e,t,n){if(!e.contains(t))return{scope:e,after:[],before:[]};if(t.nodeType===3){if(!qa(t))return{container:t,offset:n};let i=t.parentNode;return $r(i,Array.from(i.childNodes).indexOf(t))}return{container:t,offset:n,childCount:t.childNodes.length,...$r(t,n)}}function $r(e,t){let n=Array.from(e.childNodes),i=Math.max(0,t);return{scope:e,after:n.slice(i),before:n.slice(0,i).reverse()}}function Kr(e,t,n,i){let{container:r,childCount:o}=i;if(r&&n.contains(r)&&(o===void 0||o===r.childNodes.length)){e[t](r,Math.min(i.offset,Gt(r)));return}let s=i.after?.find(h=>n.contains(h));if(s){e[t](vt(s,!0),0);return}let a=i.before?.find(h=>n.contains(h));if(a){let h=vt(a,!1);e[t](h,Gt(h));return}let l=i.scope&&n.contains(i.scope)?i.scope:n;e[t](l,0)}function qa(e){return e.nodeType===3&&!jt.test(e.nodeValue)&&!!e.parentNode&&e.parentNode.nodeType===1&&At(e.parentNode)&&!ei(e.parentNode)}var it=e=>e.nodeType===1||e.nodeType===3;function vt(e,t=!0){let n=e;for(;n.nodeType===1&&!St.has(n.nodeName);){let i=Array.from(n.childNodes).filter(it),r=t?i[0]:i[i.length-1];if(!r||Pa.has(r.nodeName))break;n=r}return n}function Gt(e){return e.nodeType===3?e.nodeValue.length:e.childNodes.length}var de="[data-richclay], [richclay], [editable], [clay-editable]",Wa="[data-richclay], [richclay], [clay-editable]",$a=["editable","clay-editable"],ii=':is([editable~="single-line"], [clay-editable~="single-line"])';function oi(e){return!e||typeof e.matches!="function"?!1:e.tagName.includes("-")?e.matches(Wa):!0}var Ka="[data-richclay-toolbar], [data-richclay-menu], [data-richclay-dialog], [data-richclay-link-popover], [data-richclay-live], [data-richclay-float]",Va=["richclay-editor","richclay-inline","richclay-active","richclay-empty","richclay-focused"],ri=new WeakSet,io=new WeakSet,ro=["clay:ready","hyperclay:ready"];function oo(e){return[e.clay?.ready,e.hyperclay?.ready].find(t=>t&&typeof t.then=="function")||null}function so(e){return typeof e.clay?.isEditMode=="boolean"?e.clay.isEditMode:typeof e.hyperclay?.isEditMode=="boolean"?e.hyperclay.isEditMode:null}function Ga(e){let t=e.hyperclayModules,n=e.__hyperclayNoAutoExport===!1&&t&&typeof t=="object"&&typeof t.nodeType!="number";return so(e)!==null||!!oo(e)||!!n}function ja(e){return e.clay?.addDocumentTransform||e.hyperclay?.beforeSave||null}function Za(e){return e.clay?.onSnapshot||e.hyperclay?.onSnapshot||null}var Ya={boxSizing:"border-box",minWidth:"100%",overflow:"auto",width:"0"};function Jt(e={},t=window){return e.hyperclay===!1?!1:e.hyperclay===!0?!0:!!(Ga(t)||rl(t))}function si(e=window){let t=co(e);if(t!==null)return t;if(typeof e.__hyperclayEditMode=="boolean")return e.__hyperclayEditMode;let n=so(e);return n!==null?n:ol(e)}function ao(e={},t=window){return e.readOnly?!1:Jt(e,t)?si(t):!0}function lo(e){let t=$a.find(r=>e.hasAttribute(r));if(!t)return null;let n=new Set((e.getAttribute(t)||"").trim().split(/\s+/).filter(Boolean)),i={inline:!0,singleLine:n.has("single-line"),toolbarOnSelect:n.has("toolbar-on-select")};return n.has("no-toolbar")&&(i.toolbar=!1),n.has("link-label")&&(i.singleLine=!0,i.linkLabel=!0,i.toolbar=["link","undo","redo"]),i}function ai(e=window){if(ri.has(e))return;let t=Za(e)||ja(e);if(typeof t!="function"){Xa(e);return}t(n=>li(n)),ri.add(e)}function Xa(e){if(io.has(e))return;let t=e.document,n=oo(e);if(!t&&!n)return;io.add(e);let i=()=>{ai(e),ri.has(e)&&r()},r=()=>{t&&ro.forEach(o=>t.removeEventListener(o,i))};t&&ro.forEach(o=>t.addEventListener(o,i)),n&&n.then(i,()=>{})}function li(e){e.querySelectorAll?.(Ka).forEach(t=>t.remove()),e.querySelectorAll?.(de).forEach(t=>{if(t.getAttribute("data-richclay-active")!=="true")return;if(en(t,"save"),tl(t)){let i=t.ownerDocument,r=!!t.matches?.(ii);Ct(t,()=>r?i.createTextNode(" "):i.createElement("br")),t.querySelectorAll(t.localName).forEach(o=>{for(;o.firstChild;)o.parentNode.insertBefore(o.firstChild,o);o.remove()})}t.matches?.(ii)&&il(t),t.querySelectorAll("#squire-selection-start, #squire-selection-end").forEach(i=>{i.remove()}),t.querySelectorAll(".squire-image-resize-container").forEach(i=>i.remove()),nl(t),(t.matches?.("pre")?[t,...t.querySelectorAll("pre")]:Array.from(t.querySelectorAll("pre"))).filter(i=>i.hasAttribute("data-richclay-pre")).forEach(i=>{Object.entries(Ya).forEach(([r,o])=>{i.style[r]||(i.style[r]=o)}),i.removeAttribute("data-richclay-pre")})}),e.querySelectorAll?.("#squire-selection-start, #squire-selection-end").forEach(t=>t.remove())}var Qa="p, td, th, li, dl, dt, dd, table, blockquote, div, section, article, aside, main, header, footer, figure, figcaption",ti="data-richclay-measure";function Ja(e){let t=e.ownerDocument,n=e.closest(Qa)||e;e.setAttribute(ti,"");let i=t.createElement("div");try{i.innerHTML=n.outerHTML}finally{e.removeAttribute(ti)}let r=i.querySelector(`[${ti}]`);return!r||r.textContent!==e.textContent}var el=e=>!!e.querySelector(e.localName),tl=e=>!!e.matches?.(ii)||(Qt(e)||el(e))&&Ja(e);function en(e,t){let n=e.getAttribute("data-richclay-runtime-contenteditable");e.hasAttribute("contenteditable")&&(n==="true"?e.removeAttribute("contenteditable"):n?t==="destroy"?e.setAttribute("contenteditable",n):(e.setAttribute("inert-contenteditable",n),e.removeAttribute("contenteditable")):t==="save"&&(e.setAttribute("inert-contenteditable",e.getAttribute("contenteditable")),e.removeAttribute("contenteditable"))),Va.forEach(i=>e.classList.remove(i)),e.getAttribute("class")===""&&e.removeAttribute("class"),ni(e,"role","data-richclay-runtime-role"),ni(e,"aria-multiline","data-richclay-runtime-aria-multiline"),ni(e,"no-undo","data-richclay-runtime-no-undo"),e.getAttribute("data-richclay-runtime-display")==="true"&&(e.style.removeProperty("display"),e.getAttribute("style")===""&&e.removeAttribute("style")),sl(e),e.removeAttribute("data-richclay-active"),e.removeAttribute("data-richclay-placeholder"),e.removeAttribute("data-richclay-pre"),e.removeAttribute("data-richclay-runtime-role"),e.removeAttribute("data-richclay-runtime-aria-multiline"),e.removeAttribute("data-richclay-runtime-no-undo"),e.removeAttribute("data-richclay-runtime-describedby"),e.removeAttribute("data-richclay-runtime-contenteditable"),e.removeAttribute("data-richclay-runtime-display"),e.getAttribute("data-richclay-runtime-marker")==="true"&&e.removeAttribute("data-richclay"),e.removeAttribute("data-richclay-runtime-marker")}function nl(e){let n=[e];for(;n.length;)n.pop().childNodes.forEach(r=>{r.nodeType===3?r.nodeValue.includes("\u200B")&&(r.nodeValue=r.nodeValue.split("\u200B").join("")):r.nodeType===1&&n.push(r)});e.querySelectorAll("b, i, u, s, em, strong, code, sub, sup, span").forEach(i=>{i.children.length===0&&(i.textContent||"")===""&&i.attributes.length===0&&i.remove()})}function il(e){let t=Array.from(e.childNodes).filter(i=>i.nodeType!==3||(i.nodeValue||"").trim()!=="");if(t.length!==1)return;let n=t[0];if(!(n.nodeType!==1||n.nodeName!=="P"||n.attributes.length>0)){for(;n.firstChild;)e.insertBefore(n.firstChild,n);n.remove()}}function ci(e){if(!e.hasAttribute("inert-contenteditable"))return null;let t=e.getAttribute("inert-contenteditable");return["false","plaintext-only"].includes(t)||(t="true"),e.setAttribute("contenteditable",t),e.removeAttribute("inert-contenteditable"),t==="true"&&e.setAttribute("data-richclay-runtime-contenteditable","true"),t}function ce(e){return e.setAttribute("snapshot-remove",""),e.setAttribute("no-watch",""),e}function co(e){try{let t=new URLSearchParams(e.location?.search||"");if(t.get("editmode")==="true")return!0;if(t.get("editmode")==="false")return!1}catch{return null}return null}function rl(e){return co(e)!==null||typeof e.__hyperclayEditMode=="boolean"}function ol(e){let n=(e.document?.cookie||"").match(/(?:^|;\s*)isAdminOfCurrentResource=([^;]*)/);return!!(n&&n[1]!=="")}function ni(e,t,n){e.hasAttribute(n)&&e.removeAttribute(t)}function sl(e){let t=e.getAttribute("data-richclay-runtime-describedby");if(!t)return;let n=(e.getAttribute("aria-describedby")||"").split(/\s+/).filter(Boolean).filter(i=>i!==t);n.length?e.setAttribute("aria-describedby",n.join(" ")):e.removeAttribute("aria-describedby")}var al=0;function ho(e=document){let t=e.createElement("div");return t.id=`richclay-live-${++al}`,t.className="richclay-sr-only",t.setAttribute("aria-live","polite"),t.setAttribute("aria-atomic","true"),t.setAttribute("data-richclay-live",""),ce(t),e.body.appendChild(t),t}function rt(e,t){!e||!t||(e.textContent="",e.ownerDocument.defaultView.setTimeout(()=>{e.textContent=t},20))}function Lt(e){e.preventDefault()}function hi(e){try{return e?.cloneRange?.()||null}catch{return null}}function ot(e){try{return hi(e?.getSelection?.())}catch{return null}}function tn(e,t){if(!e||!t)return!1;try{return e.setSelection(t),!0}catch{return!1}}function nn(e,t,n,i){e.hasAttribute(t)||e.setAttribute(i,"true"),e.setAttribute(t,n)}function uo(e,t){let n=new Set((e.getAttribute("aria-describedby")||"").split(/\s+/).filter(Boolean));n.add(t.id),e.setAttribute("aria-describedby",Array.from(n).join(" ")),e.setAttribute("data-richclay-runtime-describedby",t.id)}var ll=0,st=class{constructor(t,n,i={}){this.editor=t,this.controls=n,this.options=i,this.id=++ll,this.items=[],this.menus=new Map,this.activeIndex=0,this.root=this.createRoot(),this.onRootKeydown=r=>this.handleRootKeydown(r),this.onRootClick=r=>this.handleRootClick(r),this.onRootPointerDown=r=>this.handleRootPointerDown(r),this.onDocumentPointerDown=r=>this.handleDocumentPointerDown(r),this.render(),this.root.addEventListener("keydown",this.onRootKeydown),this.root.addEventListener("click",this.onRootClick),this.root.addEventListener("mousedown",this.onRootPointerDown),this.root.ownerDocument.addEventListener("mousedown",this.onDocumentPointerDown)}destroy(){this.closeMenus(),this.root.removeEventListener("keydown",this.onRootKeydown),this.root.removeEventListener("click",this.onRootClick),this.root.removeEventListener("mousedown",this.onRootPointerDown),this.root.ownerDocument.removeEventListener("mousedown",this.onDocumentPointerDown),this.root.remove()}update(){this.items.forEach(t=>{let{def:n,button:i}=t;if(typeof n.isActive=="function"){let r=!!n.isActive(this.editor);i.setAttribute("aria-pressed",r?"true":"false"),i.classList.toggle("is-active",r)}typeof n.isDisabled=="function"&&(i.disabled=!!n.isDisabled(this.editor))}),this.ensureSingleTabStop()}focusFirst(){this.activeIndex=0,this.ensureSingleTabStop(),this.items[0]?.button.focus()}createRoot(){let t=this.editor.element.ownerDocument,n=t.createElement("div");n.className="richclay-toolbar",n.setAttribute("role","toolbar"),n.setAttribute("aria-label",this.options.ariaLabel||"Rich text formatting"),n.setAttribute("data-richclay-toolbar",""),ce(n);let i=cl(this.options.toolbarContainer,t);return i?i.appendChild(n):this.editor.element.insertAdjacentElement("beforebegin",n),n}render(){this.root.textContent="",this.items=[],this.menus.clear();let t=null;this.visibleControls().forEach((n,i)=>{if(n.type==="separator"){this.root.appendChild(po(this.root.ownerDocument)),t=null;return}t&&n.group&&n.group!==t&&this.root.appendChild(po(this.root.ownerDocument)),t=n.group||t,n.type==="menu"?this.renderMenu(n,i):this.renderButton(n,i)}),this.ensureSingleTabStop(),this.update()}visibleControls(){let t=this.controls.filter(i=>i.type==="separator"||!i.isDisabled?.(this.editor)),n=[];for(t.forEach(i=>{let r=n[n.length-1];i.type==="separator"&&(!r||r.type==="separator")||n.push(i)});n[n.length-1]?.type==="separator";)n.pop();return n}renderButton(t,n){let i=fo(this.root.ownerDocument,t);i.dataset.richclayControl=t.id,i.dataset.richclayIndex=String(n),typeof t.isActive=="function"&&i.setAttribute("aria-pressed","false"),this.root.appendChild(i),this.items.push({def:t,button:i,type:"button"})}renderMenu(t,n){let i=this.root.ownerDocument,r=fo(i,t),o=`richclay-menu-${this.id}-${t.id}`;r.dataset.richclayControl=t.id,r.dataset.richclayIndex=String(n),r.setAttribute("aria-haspopup","menu"),r.setAttribute("aria-expanded","false"),r.setAttribute("aria-controls",o);let s=i.createElement("div");s.id=o,s.className="richclay-menu",s.hidden=!0,s.setAttribute("role","menu"),s.setAttribute("data-richclay-menu",""),ce(s),t.options.forEach((l,h)=>{let d=i.createElement("button");d.type="button",d.className="richclay-menu-item",d.setAttribute("role","menuitemradio"),d.setAttribute("tabindex","-1"),d.dataset.richclayMenuItem=t.id,d.dataset.richclayOptionIndex=String(h),d.innerHTML=l.icon||"",d.appendChild(i.createTextNode(l.label)),d.addEventListener("mousedown",Lt),d.addEventListener("click",u=>{u.preventDefault(),this.chooseMenuItem(t,l,r)}),d.addEventListener("keydown",u=>this.handleMenuKeydown(u,t,r)),s.appendChild(d)});let a=i.createElement("span");a.className="richclay-menu-wrap",a.append(r,s),this.root.appendChild(a),this.items.push({def:t,button:r,type:"menu",menu:s}),this.menus.set(t.id,{def:t,button:r,menu:s})}handleRootPointerDown(t){let n=t.target.closest?.("[data-richclay-control]");!n||!this.root.contains(n)||(Lt(t),this.editor.saveSelection())}handleRootClick(t){let n=t.target.closest?.("[data-richclay-control]");if(!n||!this.root.contains(n))return;t.preventDefault();let i=this.items.find(r=>r.button===n);if(!(!i||n.disabled)){if(this.activeIndex=this.items.indexOf(i),this.ensureSingleTabStop(),i.type==="menu"){this.toggleMenu(i.def.id);return}this.closeMenus(),this.editor.runControl(i.def)}}handleRootKeydown(t){let n=t.key,i={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1};if(n in i){t.preventDefault(),this.moveFocus(i[n]);return}if(n==="Home"){t.preventDefault(),this.setFocusIndex(0);return}if(n==="End"){t.preventDefault(),this.setFocusIndex(this.items.length-1);return}let r=this.items[this.activeIndex];if(r&&((n==="Enter"||n===" ")&&r.type==="menu"&&(t.preventDefault(),this.openMenu(r.def.id,"first")),n==="Escape")){let o=Array.from(this.menus.values()).some(s=>!s.menu.hidden);this.closeMenus(),o?r.button.focus():this.editor.focus()}}handleMenuKeydown(t,n,i){t.stopPropagation();let r=this.menus.get(n.id)?.menu,o=Array.from(r.querySelectorAll(".richclay-menu-item")),s=o.indexOf(t.currentTarget),a=s;if(t.key==="ArrowDown"&&(a=(s+1)%o.length),t.key==="ArrowUp"&&(a=(s-1+o.length)%o.length),t.key==="Home"&&(a=0),t.key==="End"&&(a=o.length-1),a!==s){t.preventDefault(),o[a].focus();return}if(t.key==="Escape"){t.preventDefault(),this.closeMenus(),i.focus();return}if(t.key==="Enter"||t.key===" "){t.preventDefault();let l=n.options[s];this.chooseMenuItem(n,l,i)}}handleDocumentPointerDown(t){this.root.contains(t.target)||this.closeMenus()}chooseMenuItem(t,n,i){this.closeMenus(),this.editor.runControl({...n,id:`${t.id}:${n.value}`,ariaLabel:n.label}),i.focus()}toggleMenu(t){let n=this.menus.get(t);n&&(n.menu.hidden?this.openMenu(t,"first"):this.closeMenus())}openMenu(t,n="first"){this.closeMenus(t);let i=this.menus.get(t);if(!i)return;i.menu.hidden=!1,i.button.setAttribute("aria-expanded","true"),this.updateMenuState(i);let r=Array.from(i.menu.querySelectorAll(".richclay-menu-item")),o=r.find(a=>a.getAttribute("aria-checked")==="true");(n==="active"&&o||r[0])?.focus()}closeMenus(t=null){this.menus.forEach((n,i)=>{i!==t&&(n.menu.hidden=!0,n.button.setAttribute("aria-expanded","false"))})}updateMenuState(t){Array.from(t.menu.querySelectorAll(".richclay-menu-item")).forEach((i,r)=>{let s=!!t.def.options[r].isActive?.(this.editor);i.setAttribute("aria-checked",s?"true":"false"),i.classList.toggle("is-active",s)})}moveFocus(t){if(!this.items.length)return;let n=this.activeIndex;do n=(n+t+this.items.length)%this.items.length;while(this.items[n].button.disabled&&n!==this.activeIndex);this.setFocusIndex(n)}setFocusIndex(t){this.activeIndex=Math.max(0,Math.min(t,this.items.length-1)),this.ensureSingleTabStop(),this.items[this.activeIndex]?.button.focus()}ensureSingleTabStop(){let t=this.items.filter(n=>!n.button.disabled);t.length&&(t.includes(this.items[this.activeIndex])||(this.activeIndex=this.items.indexOf(t[0])),this.items.forEach((n,i)=>{n.button.tabIndex=i===this.activeIndex?0:-1}))}};function fo(e,t){let n=e.createElement("button");n.type="button",n.className="richclay-button";let i=qr(t.shortcut,e.defaultView),r=i?`${t.ariaLabel||t.label} (${i})`:t.ariaLabel||t.label;return n.setAttribute("aria-label",r),n.title=r,n.innerHTML=`${t.icon||""}<span class="richclay-sr-only">${t.label}</span>`,n}function po(e){let t=e.createElement("span");return t.className="richclay-separator",t.setAttribute("role","separator"),t.setAttribute("aria-orientation","vertical"),t}function cl(e,t){return e?typeof e=="string"?t.querySelector(e):e:null}var mo=16,hl=[16,8,0],V=8,ul=4;function dl({anchor:e,bar:t,rail:n,viewport:i,current:r=null}){let o=p=>r===p?ul:0;if(e.bottom<=0||e.top>=i.height||e.right<=0||e.left>=i.width)return{mode:"hidden",x:0,y:0};let s=p=>Math.max(V,Math.min(e.left,i.width-p-V)),a=e.top-mo-t.height;if(a>=V-o("above"))return{mode:"above",x:s(t.width),y:a};let l=e.bottom+mo;if(l+t.height<=i.height-V+o("below"))return{mode:"below",x:s(t.width),y:l};let h=i.width-e.right-V,d=e.left-V,u=h>=d?[["rail-right",h],["rail-left",d]]:[["rail-left",d],["rail-right",h]];for(let[p,b]of u)for(let y of hl){if(n.width+y>b+o(p))continue;let E=p==="rail-right"?Math.min(e.right+y,i.width-n.width-V):Math.max(e.left-y-n.width,V),S=Math.min(e.bottom,i.height-V)-n.height,N=Math.max(V,Math.min(Math.max(e.top,V),S));return{mode:p,x:E,y:N,gap:y}}return{mode:"pinned",x:s(t.width),y:V}}var fl=10,pl=28;function on({anchor:e,box:t,viewport:n,gap:i=fl}){let r=n.height-V-e.bottom-i,o=e.top-i-V,s=r>=t.height||r>=o?"below":"above",a=s==="below"?e.bottom+i:e.top-i-t.height,l=Math.max(V,Math.min(a,n.height-V-t.height)),h=(e.left+e.right)/2,d=Math.max(V,Math.min(h-pl,n.width-V-t.width)),u=Math.max(14,Math.min(h-d,t.width-14));return{side:s,x:d,y:l,arrow:u}}function Q(e,t,n){e.style.setProperty(t,n,"important")}var rn=class{constructor(t,n){this.editor=t,this.mode=null,this.hidden=!1,this.frame=0,this.bar={width:0,height:0},this.rail={width:0,height:0};let i=t.element.ownerDocument;this.doc=i,this.win=i.defaultView||globalThis,this.root=i.createElement("div"),this.root.className="richclay-float",this.root.setAttribute("data-richclay-float",""),this.root.setAttribute("save-remove",""),ce(this.root),i.body.appendChild(this.root),this.toolbar=new st(t,n,{toolbarContainer:this.root}),this.onScroll=()=>this.schedule(),this.onResize=()=>{this.measure(),this.schedule()},i.addEventListener("scroll",this.onScroll,{capture:!0,passive:!0}),this.win.addEventListener("resize",this.onResize,{passive:!0}),this.win.visualViewport?.addEventListener("resize",this.onResize,{passive:!0}),this.win.visualViewport?.addEventListener("scroll",this.onScroll,{passive:!0}),this.resizeObserver=typeof this.win.ResizeObserver=="function"?new this.win.ResizeObserver(()=>this.schedule()):null,this.resizeObserver?.observe(t.element),this.measure(),this.reposition()}measure(){let t=this.root.classList.contains("richclay-float-rail");Q(this.root,"visibility","hidden"),this.root.classList.remove("richclay-float-rail"),this.bar={width:this.root.offsetWidth||0,height:this.root.offsetHeight||0},this.root.classList.add("richclay-float-rail"),this.rail={width:this.root.offsetWidth||0,height:this.root.offsetHeight||0},this.root.classList.toggle("richclay-float-rail",t),this.root.style.removeProperty("visibility")}schedule(){if(!this.win.requestAnimationFrame){this.reposition();return}this.frame||(this.frame=this.win.requestAnimationFrame(()=>{this.frame=0,this.reposition()}))}setVisible(t){this.hidden=!t,this.reposition()}reposition(){if(this.hidden){Q(this.root,"display","none");return}let t=this.editor.element.getBoundingClientRect(),n={width:this.win.visualViewport?.width??this.win.innerWidth,height:this.win.visualViewport?.height??this.win.innerHeight},i=dl({anchor:t,bar:this.bar,rail:this.rail,viewport:n,current:this.mode});if(this.mode=i.mode,i.mode==="hidden"){Q(this.root,"display","none");return}this.root.style.removeProperty("display"),this.root.classList.toggle("richclay-float-rail",i.mode==="rail-left"||i.mode==="rail-right"),this.root.classList.toggle("richclay-float-pinned",i.mode==="pinned"),Q(this.root,"transform",`translate(${Math.round(i.x)}px, ${Math.round(i.y)}px)`)}destroy(){this.frame&&this.win.cancelAnimationFrame?.(this.frame),this.frame=0,this.doc.removeEventListener("scroll",this.onScroll,{capture:!0}),this.win.removeEventListener("resize",this.onResize),this.win.visualViewport?.removeEventListener("resize",this.onResize),this.win.visualViewport?.removeEventListener("scroll",this.onScroll),this.resizeObserver?.disconnect(),this.toolbar.destroy(),this.root.remove()}};var ml={ALLOWED_TAGS:["a","b","blockquote","br","code","div","em","h1","h2","h3","h4","h5","h6","i","li","ol","p","pre","s","span","strong","sub","sup","u","ul"],ALLOWED_ATTR:["aria-label","href","rel","target","title"],ALLOW_DATA_ATTR:!1,ALLOW_ARIA_ATTR:!0,ALLOWED_URI_REGEXP:/^(?:(?:(?:f|ht)tps?|mailto|tel):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,FORBID_TAGS:["script","style","iframe","object","embed","form","input"],FORBID_ATTR:["style","srcset","onerror","onclick","onload"]};function bo(e={},t=document){let n=sn(t);return{sanitizeHTML(i){return ui(i,e,t,n)},sanitizeElement(i){return di(i,e,n)},sanitizeToDOMFragment(i,r){let o=r?.getRoot?.().ownerDocument||t;return gl(i,e,o,n)}}}function ui(e,t={},n=document,i=sn(n)){let r=n.createElement("template");return r.innerHTML=i.sanitize(String(e||""),fi(t)),mi(r.content),r.innerHTML}function di(e,t={},n=sn(e.ownerDocument)){let r=e.ownerDocument.createElement("div");for(;e.firstChild;)r.appendChild(e.firstChild);for(n.sanitize(r,{...fi(t),IN_PLACE:!0}),mi(r);r.firstChild;)e.appendChild(r.firstChild);return e}function gl(e,t={},n=document,i=sn(n)){let r=i.sanitize(String(e||""),{...fi(t),RETURN_DOM_FRAGMENT:!0}),o=r?.ownerDocument===n?r:n.importNode(r,!0);return mi(o),o||n.createDocumentFragment()}function fi(e){return{...ml,...e}}var yl=new Set(["http","https","mailto","tel"]),bl=new RegExp("[\\u0000-\\u0020\\u007F-\\u009F]","g");function pi(e){let n=(String(e??"").replace(bl,"").match(/^([a-z][a-z0-9+.\-]*):/i)||[])[1];return!n||yl.has(n.toLowerCase())}var Tl=/^[^\s/?#:]+\.(?:html?|pdf|txt|csv|json|xml|svg|png|jpe?g|gif|webp|docx?|xlsx?|pptx?|bib|tex|zip)(?:[?#]\S*)?$/i,_l=/^[^\s/?#:.]+\/\S*$/;function To(e){let t=String(e??"").trim();return!t||!pi(t)?"":/^(?:https?:|mailto:|tel:)/i.test(t)?t:/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)?`mailto:${t}`:/^(?:[#?]|\/|\.{1,2}\/)/.test(t)||Tl.test(t)||_l.test(t)?t:`https://${t}`}function sn(e){let t=globalThis.DOMPurify;if(t?.sanitize)return t;if(typeof t=="function")return t(e.defaultView||globalThis);throw new Error("RichClay requires DOMPurify. Load vendor/purify.min.js before richclay.js or provide globalThis.DOMPurify.")}function mi(e){e.querySelectorAll?.("a[href]").forEach(t=>{let n=t.getAttribute("href")||"";if(/^\s*javascript:/i.test(n)&&t.removeAttribute("href"),t.getAttribute("target")==="_blank"){let i=new Set((t.getAttribute("rel")||"").split(/\s+/).filter(Boolean));i.add("noopener"),i.add("noreferrer"),t.setAttribute("rel",Array.from(i).join(" "))}})}var go={ADD_TAGS:["img"],ADD_ATTR:["class","id","src","alt","width","height"]};function _o(e={}){return{...e,ADD_TAGS:[...new Set([...go.ADD_TAGS,...e.ADD_TAGS||[]])],ADD_ATTR:[...new Set([...go.ADD_ATTR,...e.ADD_ATTR||[]])],ALLOW_DATA_ATTR:e.ALLOW_DATA_ATTR??!0}}var yo="p, div, h1, h2, h3, h4, h5, h6, blockquote, pre, ul, ol, li, figure, figcaption, table, thead, tbody, tr, td, th";function Eo(e){let t=e.ownerDocument||document;e.querySelectorAll?.("br").forEach(i=>i.replaceWith(t.createTextNode(" ")));let n=e.querySelector?.(yo);for(;n;){let i=n.parentNode;for(i.insertBefore(t.createTextNode(" "),n);n.firstChild;)i.insertBefore(n.firstChild,n);i.insertBefore(t.createTextNode(" "),n),n.remove(),n=e.querySelector(yo)}return El(e,t),e}function El(e,t){e.normalize?.();let n=t.createTreeWalker(e,4),i=[];for(;n.nextNode();)i.push(n.currentNode);i.forEach(s=>{s.nodeValue=s.nodeValue.replace(/\s+/g," ")});let r=e.firstChild;r?.nodeType===3&&(r.nodeValue=r.nodeValue.replace(/^\s+/,""));let o=e.lastChild;o?.nodeType===3&&(o.nodeValue=o.nodeValue.replace(/\s+$/,""))}var vl=300,Sl=e=>e.replace(/^mailto:/i,"").replace(/^https?:\/\//i,""),an=class{constructor(t){this.editor=t,this.root=null,this.anchor=null,this.href=null,this.dismissed=null,this.hideTimer=null,this.pointerInside=!1,this.cleanup=null}currentAnchor(){let t=this.editor;if(!t.active||t.options.readOnly||t.dialog)return null;let n=t.element.ownerDocument;if(n.hidden)return null;let i=n.getSelection?.();return!i||!i.rangeCount||!t.element.contains(i.anchorNode)?null:t.currentLinkElement()}update(){let t=this.currentAnchor();if(!(t&&t===this.dismissed)){if(this.dismissed=null,!t){this.scheduleHide();return}this.cancelHide(),this.show(t)}}show(t){this.root||this.mount();let n=t.getAttribute("href")||"";if(t!==this.anchor||n!==this.href){this.anchor=t,this.href=n;let i=this.root.querySelector(".richclay-link-address");i.textContent=Sl(n)||n,i.title=n,n&&pi(n)?i.setAttribute("href",n):i.removeAttribute("href"),/^(?:mailto|tel):/i.test(n)?i.removeAttribute("target"):i.setAttribute("target","_blank")}this.position()}mount(){let t=this.editor,n=t.element.ownerDocument,i=n.defaultView||globalThis,r=n.createElement("div");r.className="richclay-dialog richclay-link-popover",r.setAttribute("role","group"),r.setAttribute("aria-label","Link"),r.setAttribute("data-richclay-link-popover",""),ce(r),r.setAttribute("save-remove",""),r.innerHTML=`
|
|
25
25
|
<a class="richclay-link-address" rel="noopener noreferrer"></a>
|
|
26
26
|
<button type="button" class="richclay-secondary" data-richclay-link-edit>Edit</button>
|
|
27
27
|
<button type="button" class="richclay-secondary" data-richclay-link-remove>Remove</button>
|
|
@@ -5,5 +5,5 @@ var SapCoreBundle=(()=>{var At=Object.defineProperty;var rn=Object.getOwnPropert
|
|
|
5
5
|
`)),s}error(e,r,n={}){let o=this.block(e,r,n);return this.errors.push(o),o}warn(e,r,n={}){let o=this.block(e,r,n);return this.warnings.push(o),o}report(){return{ok:this.errors.length===0&&!this.halted,app:this.appName,halted:this.halted,haltReason:this.haltReason,errors:this.errors.slice(),warnings:this.warnings.slice()}}};function B(t,e){t&&t.getAttribute("sap-error")!==e&&t.setAttribute("sap-error",e)}function zt(t){t&&t.hasAttribute("sap-error")&&t.removeAttribute("sap-error")}function vt(t,e){let r=null,n=3;for(let o of e){let s=fn(t,o);s<n&&(n=s,r=o)}return r}function fn(t,e){let r=t.length,n=e.length,o=Array.from({length:r+1},(s,i)=>[i,...new Array(n).fill(0)]);for(let s=0;s<=n;s++)o[0][s]=s;for(let s=1;s<=r;s++)for(let i=1;i<=n;i++)o[s][i]=Math.min(o[s-1][i]+1,o[s][i-1]+1,o[s-1][i-1]+(t[s-1]===e[i-1]?0:1));return o[r][n]}var dn=new Set(z),pn={readonly:"readOnly",novalidate:"noValidate"},mn=0,Ut=new WeakMap;function qt(t,e="sap"){let r=t.getAttribute("data-id");if(r)return r;if(t.id)return t.id;let n=Ut.get(t);return n||(n=`${e}-${(mn++).toString(36)}`,Ut.set(t,n)),n}function Vt(t){let e=[];for(let r=t.firstElementChild;r;r=r.nextElementSibling)r.hasAttribute("item")&&!r.hasAttribute("template")&&!r.hasAttribute("cms-template")&&e.push(r);return e}function St(t,e){if(!t||!e)return null;let r=[...t.querySelectorAll(`template[items="${e}"]`)].find(o=>o.closest("[sap]")===t),n=r&&r.content.firstElementChild;return n&&n.hasAttribute("item")?n:null}function Yt(t){for(let e=t.firstElementChild;e;e=e.nextElementSibling)if(e.hasAttribute("item")&&e.hasAttribute("template"))return e;return St(t.closest("[sap]"),t.getAttribute("items"))}function it(t){let e=[];if(!t)return e;for(let r of t.trim().split(/\s+/)){if(!r)continue;let n=r,o,s=n.indexOf("=");s>=0&&(o=n.slice(s+1),n=n.slice(0,s));let i=n.split(":"),f=i[0],c="string",l=!1;for(let p of i.slice(1))p==="num"?c="num":p==="bool"?c="bool":p==="presence"?c="presence":p==="transient"&&(l=!0);let a=f,d=a.startsWith("data-")&&a.length>5?a.slice(5).replace(/-([a-z])/g,(p,v)=>v.toUpperCase()):a;e.push({name:d,attr:a,type:c,default:o,transient:l})}return e}function st(t,e){if(e==="num"){if(t==null||t==="")return 0;let r=Number(t);return Number.isNaN(r)?0:r}return e==="bool"?t==="true"||t===""||t==="1":t??""}function Gt(t,e){return e==="bool"?t?"true":"false":t==null?"":String(t)}function kt(t,e){return dn.has(e)&&typeof t[pn[e]||e]=="boolean"}function Nt(t,e){return e.type==="presence"||e.type!=="num"&&kt(t,e.attr||e.name)}function Tt(t){return t.default!=null?t.default:t.type==="num"?"0":t.type==="bool"?"false":""}function Xt(t,e){let r=e.attr||e.name,n=t._sapTransient||(t._sapTransient={});if(!(e.name in n)){let o=t.getAttribute(r);o==null&&(o=Tt(e)),n[e.name]=st(o,e.type)}return t.hasAttribute(r)&&t.removeAttribute(r),n[e.name]}function P(t){if(typeof t=="number")return t;if(t==null||t==="")return 0;let e=Number(typeof t=="string"?t.replace(/[$,%\s]/g,""):t);return Number.isNaN(e)?0:e}function at(t,e){return Array.isArray(t)?e==null?t:t.map(r=>typeof e=="function"?e(r):r?.[e]):[]}function Rt(t,e){return at(t,e).reduce((r,n)=>r+P(n),0)}function Kt(t,e){return Array.isArray(t)?e==null?t.length:t.reduce((r,n)=>r+(e(n)?1:0),0):0}function Jt(t,e){let r=at(t,e);return r.length?Rt(t,e)/r.length:0}function Qt(t,e){let r=at(t,e).filter(n=>n!=null&&n!=="");return r.length?r.every(n=>typeof n=="number"||!Number.isNaN(Number(n)))?Math.min(...r.map(Number)):r.reduce((n,o)=>String(n)<=String(o)?n:o):0}function Zt(t,e){let r=at(t,e).filter(n=>n!=null&&n!=="");return r.length?r.every(n=>typeof n=="number"||!Number.isNaN(Number(n)))?Math.max(...r.map(Number)):r.reduce((n,o)=>String(n)>=String(o)?n:o):0}function te(t,e,r){let n=P(t)===1?e:r??e+"s";return`${t} ${n}`}function ee(t,e){let r=new Date(t),n=new Date(e);return Number.isNaN(+r)||Number.isNaN(+n)?0:Math.round((n-r)/864e5)}function O(t){return typeof t=="number"?t:Number(t)}var U={usd:t=>"$"+O(t).toLocaleString("en-US",{maximumFractionDigits:0}),usd2:t=>"$"+O(t).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}),pct:t=>Math.round(O(t))+"%",pct1:t=>O(t).toFixed(1)+"%",int:t=>Math.round(O(t)).toLocaleString("en-US"),num:t=>O(t).toLocaleString("en-US"),num2:t=>O(t).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}),compact:t=>O(t).toLocaleString("en-US",{notation:"compact"}),date:t=>{let e=new Date(t);return Number.isNaN(+e)?String(t):e.toLocaleDateString("en-US")},clock:t=>{let e=O(t),r=Math.floor(e/100),n=r%10,o=Math.floor(r/10)%60;return`${Math.floor(r/600)}:${String(o).padStart(2,"0")}.${n}`}},hn=new Set(["usd","usd2","pct","pct1","int","num","num2","compact","clock"]);function ne(t,e){if(!t)return e==null?"":String(e);let r=U[t];if(typeof r!="function"){let n=new Error(`unknown format "${t}"`);throw n.sapCode="E22",n}if(hn.has(t)){let n=typeof e=="number"?e:Number(e);if(!Number.isFinite(n)){let o=new Error(`format "${t}" received ${typeof e=="string"?`"${e}"`:e}`);throw o.sapCode="E22",o}}return r(e)}var bn=["state","item","el","root","fmt","num","sum","count","avg","min","max","plural","days"],ut=new Map,re=/\bstate\.([a-z][a-z0-9_]*)/g,oe=/\bitem\.([a-z][a-z0-9_]*)/g;function gn(t){let e=new Set,r=new Set,n;for(re.lastIndex=0;n=re.exec(t);)e.add(n[1]);for(oe.lastIndex=0;n=oe.exec(t);)r.add(n[1]);return{state:e,item:r}}function M(t,e=!1){let r=(e?"!":"")+t,n=ut.get(r);if(n)return n;ut.size>512&&ut.clear();try{let o=e?`"use strict";
|
|
6
6
|
${t}`:`"use strict"; return (${t});`;n={fn:new Function(...bn,o),src:t,statement:e,deps:gn(t),error:null}}catch(o){n={fn:null,src:t,statement:e,deps:{state:new Set,item:new Set},error:o}}return ut.set(r,n),n}function ie(t,e,r,n,o){if(t.error)throw t.error;return t.fn(e,r,n,o,U,P,Rt,Kt,Jt,Qt,Zt,te,ee)}var J={},K=null,ae=!0,lt=!1;function ue(){J={}}function ce(t){let e=lt;return K?fe(K.takeRecords()):ae&&yn(),lt=!!K&&t.getRootNode()===document,e}function le(t){lt=t}function yn(){if(typeof document>"u"||typeof MutationObserver!="function"){ae=!1;return}K=new MutationObserver(fe),K.observe(document,{attributes:!0,childList:!0,subtree:!0})}function fe(t){for(let e of t)if(e.type==="attributes")e.target._sapPlan&&(e.target._sapPlan=null);else for(let r of e.addedNodes)r.nodeType===1&&de(r)}function de(t){t._sapPlan&&(t._sapPlan=null);for(let e=t.firstElementChild;e;e=e.nextElementSibling)de(e)}function ft(t){if(!lt)return se(t);let e=t._sapPlan;return e&&e.gen===J?e:t._sapPlan=se(t)}function se(t){let e={gen:J,inert:t.tagName==="TEMPLATE",template:!1,cms:!1,item:!1,scope:!1,items:!1,detail:!1,each:!1,boundary:null,bind:null,transient:!1,decls:null,calcs:null,paints:null,effects:null,invalids:null};for(let r of t.attributes){let n=r.name,o=r.value,s=n.indexOf(":");if(s<0){switch(n){case"sap-ignore":e.inert=!0;break;case"cms-template":e.inert=!0,e.cms=!0;break;case"template":e.inert=!0,e.template=!0;break;case"item":e.item=!0;break;case"scope":e.scope=!0;break;case"items":e.items=!0;break;case"detail":e.detail=!0;break;case"each":e.each=!0;break;case"bind":e.bind=o;break;case"transient":e.transient=!0;break;case"state":e.decls=it(o);break;case"text":(e.paints||(e.paints=[])).push({kind:"text",fmt:null,entry:M(o)});break;case"show":(e.paints||(e.paints=[])).push({kind:"show",entry:M(o)});break;case"effect":(e.effects||(e.effects=[])).push({entry:M(o,!0)});break;case"invalid":(e.invalids||(e.invalids=[])).push({entry:M(o)});break}continue}let i=n.slice(0,s),f=n.slice(s+1);switch(i){case"calc":(e.calcs||(e.calcs=[])).push({name:f,entry:M(o)});break;case"text":(e.paints||(e.paints=[])).push({kind:"text",fmt:f,entry:M(o)});break;case"attr":(e.paints||(e.paints=[])).push({kind:"attr",arg:f,entry:M(o)});break;case"class":(e.paints||(e.paints=[])).push({kind:"class",arg:f,entry:M(o)});break;case"css":(e.paints||(e.paints=[])).push({kind:"css",arg:f,entry:M(o)});break;case"show-when":case"option":(e.paints||(e.paints=[])).push({kind:"when",match:"show",field:f,values:o.split("|")});break;case"hide-when":(e.paints||(e.paints=[])).push({kind:"when",match:"hide",field:f,values:o.split("|")});break;case"option-not":(e.paints||(e.paints=[])).push({kind:"when",match:"show-not",field:f,values:o.split("|")});break}}return e.boundary=e.scope?"scope":e.items?"items":e.detail?"detail":e.each?"each":null,An(e)?wn():e}var ct=null;function wn(){return(!ct||ct.gen!==J)&&(ct=Object.freeze({gen:J,inert:!1,template:!1,cms:!1,item:!1,scope:!1,items:!1,detail:!1,each:!1,boundary:null,bind:null,transient:!1,decls:null,calcs:null,paints:null,effects:null,invalids:null})),ct}function An(t){return!t.inert&&!t.item&&t.boundary===null&&t.bind===null&&!t.transient&&!t.decls&&!t.calcs&&!t.paints&&!t.effects&&!t.invalids}var F=new WeakMap,j=new WeakMap,q=null,D=!1;function me(){F=new WeakMap,j=new WeakMap}function pe(t){for(let e of t){let r=e.target.nodeType===1?e.target:e.target.parentElement;for(let n=r;n;n=n.parentElement)j.delete(n);if(e.type==="attributes"){F.delete(e.target);continue}for(let n=r;n;n=n.parentElement)F.delete(n);for(let n of e.addedNodes||[])if(n.nodeType===1){F.delete(n),j.delete(n);for(let o of n.querySelectorAll("*"))F.delete(o),j.delete(o)}}}function he(){return D}function be(t){return D?j.get(t):void 0}function ge(t,e){D&&j.set(t,e)}function ye(t){j.delete(t)}function we(t){let e=D;return!q&&typeof MutationObserver=="function"&&(q=new MutationObserver(pe),q.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})),q&&pe(q.takeRecords()),D=!!q&&t.getRootNode()===document,e}function Ae(t){D=t}function Ee(t){let e=F.get(t);return e||F.set(t,e={attrs:new Map,hasText:!1,text:""}),e}function xe(t,e){if(!D)return t.getAttribute(e);let r=Ee(t);return r.attrs.has(e)||r.attrs.set(e,t.getAttribute(e)),r.attrs.get(e)}function ve(t){if(!D)return t.textContent;let e=Ee(t);return e.hasText||(e.text=t.textContent,e.hasText=!0),e.text}function Se(t){return(t.getAttribute("type")||"text").toLowerCase()}function V(t){let e=t.tagName;if(e==="INPUT"){let r=Se(t);r==="checkbox"||r==="radio"?t.checked?t.setAttribute("checked",""):t.removeAttribute("checked"):t.setAttribute("value",t.value);return}if(e==="TEXTAREA"){t.setAttribute("data-value",t.value);return}if(e==="SELECT"){let r=t.options;for(let n=0;n<r.length;n++)r[n].selected?r[n].setAttribute("selected",""):r[n].removeAttribute("selected")}}function ke(t,e=t){let r=t.tagName;if(r==="INPUT"){let n=Se(t);n==="checkbox"||n==="radio"?e.checked?t.hasAttribute("checked")||t.setAttribute("checked",""):t.removeAttribute("checked"):e.value!==(t.getAttribute("value")??"")&&t.setAttribute("value",e.value);return}if(r==="TEXTAREA"){let n=e.value.startsWith(`
|
|
7
7
|
`)?`
|
|
8
|
-
`+e.value:e.value;t.textContent!==n&&(t.textContent=n),t.removeAttribute("data-value");return}if(r==="SELECT"){let n=t.options,o=e.options;for(let s=0;s<n.length;s++)o[s]&&o[s].selected?n[s].hasAttribute("selected")||n[s].setAttribute("selected",""):n[s].removeAttribute("selected")}}function dt(t){t.tagName!=="TEXTAREA"||!t.hasAttribute("data-value")||t!==t.ownerDocument.activeElement&&(t.textContent=t.getAttribute("data-value"),t.removeAttribute("data-value"))}function T(t){if(typeof window>"u")return null;let e=window.clay,r=window.hyperclay;return t==="consent"?e?.confirm||r?.consent||null:e?.[t]||r?.[t]||null}function Ne(){let t=T("visitorDrafts");return!!(t&&typeof t.restored=="function"&&t.restored()?.restored)}var Lt=["clay:mutation-ready","hyperclay:mutation-ready"],En=["clay:sync-applied","hyperclay:livesync-applied"],xn=["clay:ready","hyperclay:ready"],vn=["clay:route"],Sn=["clay:modechange"];function Q(t,e,r){let n=null,o=s=>{n!==null&&n!==s.type||(n=s.type,queueMicrotask(()=>{n=null}),r(s))};for(let s of e)t.addEventListener(s,o);return()=>{for(let s of e)t.removeEventListener(s,o)}}function Te(t){let e=typeof window<"u"&&window.clay&&window.clay.ready;e&&typeof e.then=="function"?e.then(()=>t(),()=>t()):t()}function pt(t){let e=T("region");return!e||typeof e.resolveRegionPolicy!="function"||typeof e.skipForPolicy!="function"?!1:e.skipForPolicy(e.resolveRegionPolicy(t),void 0,["no-save","freeze"])}function Re(){return typeof window>"u"?null:window.clay?.modeLifecycle||null}function mt(t,{transient:e=!1}={}){if(e)return!0;let r=Re();return typeof r?.canWrite!="function"||T("region")?.resolveRegionPolicy?.(t)?.persist==="none"?!0:r.canWrite()}function Le(t,e){if(typeof e!="function")throw new Error("Sap.batch(label, fn): fn must be a function");let r=T("undo");r&&r.flush&&r.flush();let n=e();if(n&&typeof n.then=="function")throw new Error("Sap.batch fn must be synchronous (it returned a promise)");return r&&r.commitCaptured&&r.commitCaptured(t),n}function _e(t){if(typeof window>"u"||typeof document>"u")return;let e=()=>{let p=!1;for(let v of t.apps())v.root.isConnected?t.runNow(v,"platform"):p=!0;p&&t.pruneDisconnected(),t.remountIfPresent()},r=T("derived"),n=r&&typeof r.register=="function"?r.register(e):null,o=typeof n=="function"?null:Q(document,En,e),s=Q(document,vn,e),i=null,f=!1,c=()=>{let p=i;i=null,p&&(p[2](),p[3]())},l=()=>{if(f)return!1;let p=T("undo"),v=Re()?.state?.generation;if(i&&i[0]===p&&i[1]===v)return!0;if(c(),!p||typeof p.on!="function")return!1;let R=p.on("undo",e);if(typeof R!="function")return!1;let _=p.on("redo",e);return typeof _!="function"?(R(),!1):(i=[p,v,R,_],!0)};l();let a=[Lt,xn,Sn].map(p=>Q(document,p,l)),d=T("ready");return d&&typeof d.then=="function"&&d.then(l,()=>{}),()=>{f=!0,typeof n=="function"&&n(),o&&o(),s();for(let p of a)p();c()}}function _t(t){let e=t.tagName;if(e==="INPUT"){let r=(t.getAttribute("type")||"text").toLowerCase();return r==="checkbox"?"checkbox":r==="radio"?"radio":r==="number"||r==="range"?"number":r==="hidden"?"hidden":"text"}return e==="TEXTAREA"?"text":e==="SELECT"?t.multiple?"select-multiple":"select-one":"leaf"}function kn(t){if(t.validity&&t.validity.badInput)return t.hasAttribute("value")?Number(t.getAttribute("value"))||0:t._sapLastGood??0;if(t.value==="")return 0;let e=Number(t.value);return Number.isNaN(e)?t._sapLastGood??0:(t._sapLastGood=e,e)}function $e(t,e){switch(e){case"checkbox":return t.checked;case"radio":return t.checked?t.value:void 0;case"number":return kn(t);case"select-one":return t.value;case"select-multiple":return[...t.selectedOptions].map(r=>r.value);case"hidden":case"text":return t.value;case"leaf":return t.textContent;default:return t.value}}function Nn(t,e,r){switch(e){case"checkbox":t.checked=!!r;break;case"radio":t.checked=String(t.value)===String(r);break;case"number":case"text":case"hidden":t.value=r==null?"":String(r);break;case"select-one":t.value=r==null?"":String(r);break;case"select-multiple":{let n=new Set((Array.isArray(r)?r:[r]).map(String));for(let o of t.options)o.selected=n.has(o.value);break}case"leaf":t.textContent=r==null?"":String(r);break;default:t.value=r==null?"":String(r)}}function Ce(t){if(t.hasAttribute("transient")){t.removeAttribute("value"),t.removeAttribute("checked"),t.removeAttribute("data-value");return}pt(t)||V(t)}function Tn(t){t.dispatchEvent(new Event("input",{bubbles:!0})),t.dispatchEvent(new Event("change",{bubbles:!0}))}function Pe(t,e){return $e(t,e)}function Me(t){let e=_t(t);return{el:t,kind:e,read(){return $e(t,e)},write(r,n={}){Nn(t,e,r),n.noMirror||Ce(t),n.silent||Tn(t)},mirror(){Ce(t)}}}var I=null,bt=!1,Y=null;function Oe(t){let e=null;return{kind:"hub",subscribe(r){let n=t.onAnyChange({debounce:0,require:"observed"},r);typeof n=="function"&&(e=n)},suppress(r){t.pause();try{return r()}finally{t.resume()}},teardown(){if(e){try{e()}catch{}e=null}}}}function Rn(){let t=null;return{kind:"native",subscribe(e){t=new MutationObserver(n=>e(Ln(n)));let r=typeof document<"u"&&document.body||typeof document<"u"&&document.documentElement;r&&t.observe(r,{childList:!0,subtree:!0,attributes:!0,characterData:!0})},suppress(e){let r=T("undo");r&&r.pause&&r.pause();try{return e()}finally{t&&t.takeRecords(),r&&r.resume&&r.resume()}},teardown(){t&&(t.disconnect(),t=null)}}}function Ln(t){let e=[];for(let r of t)if(r.type==="attributes"){let n=r.target;n&&n.nodeType===1&&!ht(n)&&e.push({type:"attribute",element:n})}else if(r.type==="characterData"){let n=r.target&&r.target.parentElement;n&&!ht(n)&&e.push({type:"characterData",element:n})}else if(r.type==="childList"){for(let n of r.addedNodes)if(!(n.nodeType!==1||ht(n))&&(e.push({type:"add",element:n}),n.querySelectorAll))for(let o of n.querySelectorAll("*"))ht(o)||e.push({type:"add",element:o});for(let n of r.removedNodes)n.nodeType===1&&e.push({type:"remove",element:n,parent:r.target})}return e}function ht(t){return!!(t.closest&&t.closest("[sap-ignore],[template],[cms-template]"))}function _n(t,e){t.pruneDisconnected();let r=new Set,n=!1;for(let o of e){let s=o.type==="remove"?o.parent:o.element,i=s&&t.appFor(s);i&&r.add(i),o.type==="add"&&o.element&&o.element.nodeType===1&&o.element.hasAttribute&&o.element.hasAttribute("sap")&&!(t.isRegistered&&t.isRegistered(o.element))&&(n=!0)}n&&t.remountIfPresent();for(let o of r)o.root.isConnected&&t.schedule(o,"mutation")}function De(t){if(I)return I.suppress(t);let e=T("undo");if(e&&e.pause&&e.resume){e.pause();try{return t()}finally{e.resume()}}return t()}function Ct(t,e){bt=!0,I=t,t.subscribe(r=>_n(e,r))}function $t(t){if(bt||typeof window>"u"||typeof document>"u")return;let e=T("Mutation");if(e&&typeof e.onAnyChange=="function"){Ct(Oe(e),t);return}typeof MutationObserver=="function"&&(Ct(Rn(),t),Y=Q(document,Lt,function(){let n=T("Mutation");n&&(Y(),Y=null,I&&I.teardown(),bt=!1,Ct(Oe(n),t))}))}function Pt(){if(I)try{I.teardown()}catch{}Y&&typeof document<"u"&&Y(),I=null,bt=!1,Y=null}var Cn=new Set(z),gt=Object.freeze([]),W=[],We={},Be={};function Fe(t){W.includes(t)||(W.push(t),t.boundary&&Object.assign(We,t.boundary),t.paintKinds&&Object.assign(Be,t.paintKinds))}function yt(t,e={}){if(e.breaker){t.diag.error("E26",t.root,{problem:"recompute loop halted after 50 passes; recent triggers: "+(t._breakerRing||[]).join(", ")}),B(t.root,"loop");return}e.full&&(ue(),me());let r=ce(t.root);try{De(()=>$n(t,e))}finally{le(r)}t._viewsChanged&&(t._viewsChanged=!1,t.root.dispatchEvent(new CustomEvent("sap:views-updated",{bubbles:!0})))}function $n(t,e){let r=t.root,n={},o=[],s=[],i=new Set;t.diag.errors=[];let f={root:n,state:n,item:null,ownerEl:r,projection:!1},c=null;function l(u,h,b=!1){let m=h.attr||h.name,g=b?xe(u,m):u.getAttribute(m);return g==null&&(g=Tt(h),s.push({el:u,name:h.name,attr:m,value:Gt(st(g,h.type),h.type)})),st(g,h.type)}function a(u,h,b,m){let g=h.decls;if(!g)return;let E=!!m.item&&!m.projection&&!m.view;for(let k of g){if(k.transient){c&&(c.pure=!1),b[k.name]=Xt(u,k);continue}if(Nt(u,k)){b[k.name]=u.hasAttribute(k.attr);continue}b[k.name]=l(u,k,E)}}function d(u,h,b){let m=h.bind,g=b.item||b.state,E=_t(u);c&&(E!=="leaf"||h.transient)&&(c.pure=!1),E==="radio"?(m in g||(g[m]=""),u.checked&&(g[m]=u.value)):E==="leaf"&&b.item&&!b.projection&&!b.view?g[m]=ve(u):g[m]=Pe(u,E),h.transient&&(u.removeAttribute("value"),u.removeAttribute("checked"))}function p(u,h,b){let m=!1;if(h.paints){m=!0;for(let g of h.paints)g.kind==="when"&&i.add(g.field),o.push({def:g,el:u,ctx:b})}for(let g of W)g.collect&&g.collect(A,u,h,b)!==!1&&(m=!0);c&&m&&(h.calcs&&(c.pure=!1),c.collects.push(u,h))}function v(u,h,b){Object.defineProperty(u,"$key",{value:qt(h,"row"),enumerable:!1}),Object.defineProperty(u,"$index",{value:b,enumerable:!1,configurable:!0}),Object.defineProperty(u,"$el",{value:h,enumerable:!1})}function R(u,h,b){let m=ft(u);a(u,m,h,b),u._sapScope=h,!b.projection&&m.bind!=null&&d(u,m,b),p(u,m,b),m.items?nt(u,h,b):_(u,h,b)}function _(u,h,b){for(let m=u.firstElementChild;m;m=m.nextElementSibling)$(m,h,b)}function $(u,h,b){let m=ft(u);if(!m.inert){if(m.boundary){c&&(c.pure=!1),m.boundary==="scope"?et(u,h,b):m.boundary==="items"?(p(u,m,b),nt(u,h,b)):We[m.boundary](A,u,m,h,b);return}!b.projection&&!b.view&&m.bind!=null&&d(u,m,b),p(u,m,b);for(let g=u.firstElementChild;g;g=g.nextElementSibling)$(g,h,b)}}function et(u,h,b){let m=u.getAttribute("scope"),g={};h[m]=g;let E={root:b.root,state:g,item:null,ownerEl:u,projection:b.projection};R(u,g,E)}function nt(u,h,b){c&&(c.pure=!1);let m=u.getAttribute("items"),g=[];h[m]=g,u._sapList=g;let E=!b.projection&&!b.view&&he(),k=0;for(let N=u.firstElementChild;N;N=N.nextElementSibling){let x=ft(N);if(!x.item||x.template||x.cms)continue;let L=E?be(N):void 0;g.push(L&&L.plan===x&&Object.isExtensible(L.obj)&&rt(L,N,k,b)||X(N,x,k,b,E)),k++}}function X(u,h,b,m,g){let E={};v(E,u,b);let k={root:m.root,state:m.state,item:E,ownerEl:u,projection:m.projection};if(!g)return R(u,E,k),E;let N=c,x={plan:h,obj:E,fields:null,presence:gt,pending:gt,collects:[],pure:!0},L=s.length,nn=t.diag.errors.length;c=x;try{R(u,E,k)}finally{c=N}if(!x.pure||t.halted||t.diag.errors.length!==nn)return E;let Ft=[];for(let H of Object.keys(E)){let wt=E[H];if(wt!==null&&typeof wt=="object")return E;Ft.push(H,wt)}if(h.decls)for(let H of h.decls)Nt(u,H)&&(x.presence===gt?x.presence=[]:x.presence).push(H.name,H.attr);return s.length>L&&(x.pending=s.slice(L)),x.collects.length||(x.collects=gt),x.fields=Ft,ge(u,x),E}function rt(u,h,b,m){let g=u.obj;try{g.$index!==b&&Object.defineProperty(g,"$index",{value:b,enumerable:!1,configurable:!0});let N=u.presence;for(let L=0;L<N.length;L+=2)g[N[L]]=h.hasAttribute(N[L+1]);let x=u.fields;for(let L=0;L<x.length;L+=2)g[x[L]]=x[L+1]}catch{return ye(h),null}h._sapScope=g;let E=u.pending;for(let N=0;N<E.length;N++)s.push(E[N]);let k=u.collects;if(k.length){let N={root:m.root,state:m.state,item:g,ownerEl:h,projection:m.projection};for(let x=0;x<k.length;x+=2)p(k[x],k[x+1],N)}return g}let A={app:t,root:r,rootObj:n,paints:o,stats:{calcs:0,lists:0},resolveDefault:l,collectEl:p,walkScope:_};for(let u of W)u.begin&&u.begin(A);let w=e.cacheReads===!1?null:we(r);try{R(r,n,f)}finally{e.cacheReads!==!1&&Ae(w)}if(t.halted)return;for(let u of W)u.afterIntake&&u.afterIntake(A);if(s.length&&i.size)for(let u of s)i.has(u.attr)&&u.el.getAttribute(u.attr)==null&&u.el.setAttribute(u.attr,u.value);for(let u of W)u.compute&&u.compute(A);let y=0;for(let u of W)u.reconcile&&(y+=u.reconcile(A));let S=0,C=y;for(let u of o){let h=Mn(u,t);u.ctx.view?C+=h:S+=h}for(let u of W)u.afterPaint&&u.afterPaint(A);t._state=n,t._stats={fields:Object.keys(n).filter(u=>typeof n[u]!="function").length,calcs:A.stats.calcs,paints:o.length,lists:A.stats.lists,writes:S,viewWrites:C},t._viewsChanged=C>0,t._lastPass={trigger:e.trigger||"refresh",writes:S},t._debug&&console.log(`sap pass \xB7 trigger: ${t._lastPass.trigger} \xB7 writes ${S}/${o.length}`)}function Pn(t){return t.kind==="text"?t.fmt?"text:"+t.fmt:"text":t.kind==="attr"?"attr:"+t.arg:t.kind==="class"?"class:"+t.arg:t.kind==="css"?"css:"+t.arg:t.kind==="when"?(t.match==="hide"?"hide-when:":t.match==="show-not"?"option-not:":"show-when:")+t.field:t.kind}function Mt(t,e,r,n){let o=t;for(;o&&o.nodeType===1;){if(o.hasAttribute&&o.hasAttribute(e)){let s=r.includes(o.getAttribute(e));if(n?!s:s)return!0}o=o.parentElement}return!1}function Mn(t,e){let r=t.def,n=t.el,o=Be[r.kind];if(o)return o(t,e);if(r.kind==="when")return Ie(r,n,null);try{let s=ie(r.entry,t.ctx.state,t.ctx.item,n,t.ctx.root),i=Ie(r,n,s);return zt(n),i}catch(s){return e.diag.error(s.sapCode==="E22"?"E22":"E24",n,{attr:Pn(r),expr:r.entry&&r.entry.src,problem:String(s.message)}),B(n,s.sapCode||"E24"),0}}function Ie(t,e,r){switch(t.kind){case"text":{let n=t.fmt!=null?ne(t.fmt,r):r==null?"":String(r);return e.textContent!==n?(e.textContent=n,1):0}case"show":{let n=!r;return e.hidden!==n?(e.hidden=n,1):0}case"when":{let n=T("optionVisibility");if(n&&n._started)return e._sapWhen&&e.hidden?(e.hidden=!1,e._sapWhen=!1,1):0;let o;t.match==="hide"?o=!Mt(e,t.field,t.values,!1):t.match==="show-not"?o=Mt(e,t.field,t.values,!0):o=Mt(e,t.field,t.values,!1),e._sapWhen=!0;let s=!o;return e.hidden!==s?(e.hidden=s,1):0}case"attr":{let n=t.arg;if((n==="checked"||n==="selected")&&typeof e[n]=="boolean"&&!e.hasAttribute("bind")&&!e.closest("select[bind]")){let s=0;return e[n]!==!!r&&(e[n]=!!r,s=1),!!r!==e.hasAttribute(n)&&(r?e.setAttribute(n,""):e.removeAttribute(n),s=1),s}if(Cn.has(n)){let s=e.hasAttribute(n);return r&&!s?(e.setAttribute(n,""),1):!r&&s?(e.removeAttribute(n),1):0}let o=typeof r=="boolean"?String(r):r==null?"":String(r);return e.getAttribute(n)!==o?(e.setAttribute(n,o),1):0}case"class":{let n=!!r;return e.classList.contains(t.arg)!==n?(e.classList.toggle(t.arg,n),1):0}case"css":{let n=r==null?"":String(r);return e.style.getPropertyValue("--"+t.arg)!==n?(e.style.setProperty("--"+t.arg,n),1):0}default:return 0}}var On=new Set(z),je=new Set(["calc","text","attr","class","css","set","move","sort","option","option-not","show-when","hide-when","editmode","viewmode"]),Dn=new Set(["show-when","hide-when","option","option-not"]),In=/\b(?:state|item|root)\.|===|!==|&&|\|\||[()]|^\s*!/,He=new Set(["sap","scope","items","item","template","bind","show","effect","invalid","detail","state","transient","confirm","default","persist","sortable","trigger-add","trigger-remove","trigger-reset","sap-ignore","sap-error","no-save","no-watch","no-undo","no-trigger-autosave","freeze","mutations-ignore","save-remove","save-ignore","save-freeze"]),Dt=[];function ze(t){Dt.includes(t)||Dt.push(t)}function Wn(t){return t.tagName==="INPUT"||t.tagName==="SELECT"||t.tagName==="TEXTAREA"}function Ot(t){return t.hasAttribute("bind")}function Bn(t,e){e(t);for(let n=t.firstElementChild;n;n=n.nextElementSibling)r(n);function r(n){if(!n.hasAttribute("sap-ignore")){if(n.tagName==="TEMPLATE"){if(n.hasAttribute("items"))for(let o=n.content.firstElementChild;o;o=o.nextElementSibling)r(o);return}e(n);for(let o=n.firstElementChild;o;o=o.nextElementSibling)r(o)}}}function Ue(t,e){let r=!1,n=(i,f,c)=>{e.error(i,f,c),r=!0},o=t.ownerDocument.createTreeWalker(t,4),s;for(;s=o.nextNode();)if(/\{\{.*\}\}/.test(s.nodeValue||"")){n("E02",s.parentElement||t,{problem:"moustaches in text content are not a Sap feature",fix:'move the expression onto the element: text="state.x"'});break}return Bn(t,i=>{let f=new Set;for(let l of Dt)l(i,n,a=>f.add(a));let c=i.closest&&i.closest("[detail]");for(let l of[...i.attributes]){let a=l.name;if(f.has(a))continue;if(a.includes(":")){let p=a.slice(0,a.indexOf(":"));if(je.has(p)){if(Dn.has(p)&&In.test(l.value)){let v=a.slice(a.indexOf(":")+1);e.warn("W04",i,{attr:a,expr:l.value,problem:`${p}: compares the "${v}" attribute against a literal value, not a JS expression`,fix:`use show="${l.value}" for an expression, or a literal like ${p}:${v}="overview"`})}}else{let v=vt(p,[...je]);e.warn("W03",i,{attr:a,problem:`unknown "${p}:" attribute`,didYouMean:v?`${v}:`:null})}}else if(!He.has(a)&&!xt.has(a)&&!On.has(a)&&!/^(data-|aria-|on)/.test(a)&&!(a in i)){let p=vt(a,[...He]);p&&e.warn("W03",i,{attr:a,problem:`unknown "${a}" attribute`,didYouMean:p})}a==="attr:hidden"&&e.warn("W03",i,{attr:a,problem:"attr:hidden paints the wrong attribute",fix:'use show="expr"'});let d=Ot(i)||a==="attr:selected"&&i.tagName==="OPTION"&&!!i.closest("select[bind]");(a==="attr:value"||a==="attr:checked"||a==="attr:selected")&&d&&n("E30",i,{attr:a,problem:"attr: on a bound control collides with persist ownership",fix:"remove it; bind owns this attribute"}),a==="effect"&&Ot(i)&&/\b(value|checked)\s*=[^=]/.test(l.value)&&n("E30",i,{attr:a,expr:l.value,problem:"effect writes value/checked on a bound control (writes a stale value with no synthetic event)",fix:"write through onclick + Sap(this) instead"}),(a==="text"||a.startsWith("text:")||a==="show")&&Wn(i)&&(a==="show"||n("E18",i,{attr:a,problem:"paint belongs on output elements, not form controls",fix:"move the paint to an <output> or <span>"}))}if(i.hasAttribute("state")){let l=it(i.getAttribute("state")),a=new Set;for(let d of l){d.name.includes("-")&&n("E08",i,{attr:"state",problem:`field "${d.name}" is not a valid identifier (the hyphen parses as subtraction)`,fix:`rename to ${d.name.replace(/-/g,"")}`}),a.has(d.name)&&n("E04",i,{attr:"state",problem:`field "${d.name}" is declared twice in one scope`}),a.add(d.name),Ht.has(d.attr)&&n("E05",i,{attr:"state",problem:`"${d.name}" is a reserved Sap word`}),xt.has(d.attr)&&n("E06",i,{attr:"state",problem:`"${d.name}" is a global HTML attribute name; pick another field name`}),d.name==="open"&&i.tagName==="DIALOG"&&n("E33",i,{attr:"state",problem:"dialog open is transient",fix:"use showModal() \u2014 declare state= only on <details> or popovers"});let p=kt(i,d.attr);p&&(d.attr==="checked"||d.attr==="selected")&&n("E35",i,{attr:"state",problem:`"${d.attr}" on a form control is the control's own state, not a declared field`,fix:'bind the control instead, e.g. <input type="checkbox" bind="done">'}),p&&d.type==="num"&&n("E35",i,{attr:"state",problem:`"${d.attr}" is an HTML boolean attribute; it cannot hold a number`,fix:`declare it bare: state="${d.attr}"`}),d.transient&&(p||d.type==="presence")&&n("E35",i,{attr:"state",problem:`"${d.name}" is carried by attribute presence, which transient would strip`,fix:"declare a separate name:bool:transient field and paint the attribute from it"})}}if(Ot(i)){if(i.hasAttribute("-"),i.tagName==="INPUT"){let l=(i.getAttribute("type")||"text").toLowerCase();l==="file"&&n("E32",i,{attr:"bind",problem:"files never serialize into an HTML file",fix:"use no-save + effect instead of bind"}),l==="password"&&!i.hasAttribute("transient")&&n("E31",i,{attr:"bind",problem:"a password must never serialize into a world-readable file",fix:"add transient to the password input"})}else if(i.tagName!=="SELECT"&&i.tagName!=="TEXTAREA"){let l=i.getAttribute("contenteditable");!(l!=null&&l!=="false")&&i.children.length>0&&n("E20",i,{attr:"bind",problem:"bind on a container element is not a control; a write would overwrite its children",fix:"bind a control (input/select/textarea), a contenteditable, or an empty text leaf"})}}if(i.hasAttribute("transient")&&i.hasAttribute("persist")&&n("E34",i,{problem:"transient and persist are opposite: persist forces the live value into the saved bytes, leaking exactly what transient drops",fix:"remove one \u2014 transient to keep it out of the file, or persist to save it"}),i.tagName==="DIALOG"&&i.hasAttribute("detail")&&!(i.parentElement&&i.parentElement.closest('[clay~="freeze"], [freeze], [save-freeze]'))&&e.warn("W31",i,{attr:"detail",problem:"a detail dialog writes open when it opens, and that attribute would be saved into the file",fix:'wrap the dialog in an element with clay="freeze" (not editor-ui, which removes it from the file), and make its key field transient'}),i.hasAttribute("item")&&!i.hasAttribute("template")&&i.parentNode&&i.parentNode.nodeType===1){let l=i.parentElement;(!l||!l.hasAttribute("items"))&&n("E10",i,{problem:"an [item] must be a direct child of an [items] list",fix:'wrap it in a container with items="name"'})}if(i.hasAttribute("items")&&c&&n("E17",i,{attr:"items",problem:"nested items inside a detail panel is a v1 mount error (nested collections ship in v1.1)"}),i.hasAttribute("items")){let l=t.querySelector(`[trigger-add="${i.getAttribute("items")}"]`);!Yt(i)&&!St(t,i.getAttribute("items"))&&Vt(i).length===0&&l&&n("E17",i,{attr:"items",problem:`trigger-add targets items="${i.getAttribute("items")}" but it has no [item template] to clone`})}}),r&&(e.halted=!0,e.haltReason=e.errors[0]?e.errors[0].code:"halt",B(t,e.haltReason)),!r}var qe="sap-styles",Ve="[item][template]{display:none!important}[hidden]{display:none!important}[sap-error]{outline:2px solid #e5484d;outline-offset:1px}",It=new WeakSet;function Fn(t){if(It.has(t))return;let e=t.defaultView,r=e&&e.CSSStyleSheet;if(r&&"adoptedStyleSheets"in t)try{let n=new r;n.replaceSync(Ve),t.adoptedStyleSheets=[...t.adoptedStyleSheets,n],It.add(t);return}catch{}if(!t.getElementById(qe)){let n=t.createElement("style");n.id=qe,n.textContent=Ve,(t.head||t.documentElement).appendChild(n)}It.add(t)}var jn=0;function Ye(){return typeof performance<"u"&&performance.now?performance.now():0}function Wt(t){let e=t.id||t.getAttribute("sap")||`app-${jn++}`,r=new ot(e),n={root:t,name:e,diag:r,_state:null,_stats:null,_lastPass:null,_passes:0,_broken:!1,_mountMs:0,_mountWrites:0};if(!Ue(t,r))return n.halted=!0,n;Fn(t.ownerDocument);for(let i of t.querySelectorAll("textarea[data-value]"))dt(i);let s=Ye();return yt(n,{trigger:"mount",full:!0}),n._mountMs=Ye()-s,n._mountWrites=n._stats?n._stats.writes:0,n._mountWrites>0&&!Ne()&&!T("derived")&&r.warn("W30",t,{problem:`${n._mountWrites} paint(s) ran at mount; the saved file was out of sync with its declared state`,fix:"re-save once so the file mounts clean (a settled file writes nothing)"}),n}var Ge=/^(set:|move:|sort:|trigger-add$|trigger-remove$|trigger-reset$)/;function Hn(t){return`${t.tagName.toLowerCase()}[sap]`}function zn(t){let e=0;for(let r of t.querySelectorAll("*"))for(let n of r.attributes)if(Ge.test(n.name)){e++;break}for(let r of t.attributes)if(Ge.test(r.name)){e++;break}return e}function Xe(t){function e(f){let c=f._stats||{},l=f.root;return{root:Hn(l),fields:c.fields||0,calcs:c.calcs||0,paints:c.paints||0,actions:zn(l),lists:(l.hasAttribute("items")?1:0)+l.querySelectorAll("[items]").length,rows:l.querySelectorAll("[item]:not([template])").length,warnings:f.diag.warnings.length,errors:f.diag.errors.length,mountWrites:f._mountWrites||0,ms:Math.round((f._mountMs||0)*10)/10,passes:f._passes||0,lastPass:f._lastPass||null,ok:f.diag.errors.length===0&&!f.halted}}function r(){let f=t.apps().map(e);return{ok:f.every(c=>c.ok),apps:f}}function n(f){let c=e(f);return c.ok?`sap \u2713 ${c.root} \xB7 fields ${c.fields} \xB7 calcs ${c.calcs} \xB7 paints ${c.paints} \xB7 actions ${c.actions} \xB7 lists ${c.lists} \xB7 rows ${c.rows} \xB7 warnings ${c.warnings} \xB7 mount writes ${c.mountWrites} \xB7 ${c.ms}ms`:`sap \u2717 ${c.root} \xB7 errors ${c.errors} \xB7 warnings ${c.warnings} \xB7 ${c.ms}ms`}function o(){for(let f of t.apps()){let c=n(f);f.diag.errors.length||f.halted?console.error(c):console.log(c)}}function s(){let f=[],c=[];for(let l of t.apps())f.push(...l.diag.errors),c.push(...l.diag.warnings);return{ok:f.length===0,errors:f,warnings:c,counts:{errors:f.length,warnings:c.length}}}function i(f){let c=f===void 0?!0:!!f;for(let l of t.apps())l._debug=c;return console.log(`sap debug ${c?"on":"off"} \u2014 per-pass headers will ${c?"":"no longer "}log`),c}return{status:r,report:s,debug:i,greenLine:n,printGreenLines:o,REGISTRY:Et}}var Ke="0.7.1";function Je({createAccessor:t,installInput:e,debugExtras:r}){let n=new Map,o=[],s=jt(yt);function i(w){let y=w;for(;y;){if(y.nodeType===1&&y.hasAttribute&&y.hasAttribute("sap"))return n.get(y)||null;y=y.parentNode&&y.parentNode.host?y.parentNode.host:y.parentElement}return null}function f(){for(let w=o.length-1;w>=0;w--){let y=o[w];y.root.isConnected||(n.delete(y.root),o.splice(w,1))}}function c(w,y){if(w.moveBefore)try{w.moveBefore(y,null);return}catch{}w.appendChild(y)}function l(w,y){let S=y.parentElement;if(S){if(S.moveBefore)try{S.moveBefore(w,y);return}catch{}S.insertBefore(w,y)}}let a={apps:()=>o.slice(),appFor:i,isRegistered:w=>n.has(w),pruneDisconnected:f,schedule:(w,y)=>s.schedule(w,y),runNow:(w,y)=>s.runNow(w,y),moveInto:c,placeBefore:l,remountIfPresent:()=>X()},d=t(a),p=Xe(a),v=r?r(a,p):{},R=!1,_=!1,$=null;function et(){R||(R=!0,e(a,d,document),$=_e(a))}function nt(){let w=T("derived");w&&typeof w.mounted=="function"&&w.mounted()}function X(w=document){if(_)return[];et(),$t(a);let y=w.querySelectorAll("[sap]"),S=[];for(let C of y){if(n.has(C))continue;let u=Wt(C);n.set(C,u),o.push(u),S.push(u)}for(let C of S){let u=p.greenLine(C);C.diag.errors.length||C.halted?console.error(u):console.log(u)}return nt(),S}function rt(w){if(_)return null;if(et(),$t(a),!w)return X();let y=typeof w=="string"?document.querySelector(w):w;if(!y)return null;if(n.has(y))return n.get(y);let S=Wt(y);n.set(y,S),o.push(S);let C=p.greenLine(S);return S.diag.errors.length||S.halted?console.error(C):console.log(C),S}let A=d.Sap;return A.version=Ke,A.refresh=function(){for(let y of o)y.root.isConnected&&s.runNow(y,"refresh")},A.batch=Le,A.status=p.status,A.report=p.report,A.why=v.why,A.debug=p.debug,A.doctor=v.doctor,A.greenLine=p.greenLine,A.formats=U,A.serializeControlToAttributes=V,A.finalizeControlForSave=ke,A.rehydrateControlFromAttributes=dt,A.mount=rt,A.config=function(y={}){return y.formats&&Object.assign(U,y.formats),A},A._registry=n,A._reset=function(){n.clear(),o.length=0,Pt()},A.unmount=function(){_=!0,n.clear(),o.length=0,Pt(),typeof $=="function"&&$()},{Sap:A,mountAll:X,mount:rt,runtime:a}}function Qe(t){if(typeof document>"u")return;let e=()=>Te(()=>t());document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e):e()}function Ze(t){let e=[];function r(c){let l=c.target;if(!l||l.nodeType!==1)return;let a=t.appFor(l);if(a){l.hasAttribute("persist")&&!pt(l)&&mt(l)&&V(l);for(let d of e)if(d(l,a))return;t.schedule(a,c.type+" "+(l.id||l.tagName.toLowerCase()))}}function n(c){let l=c.target,a=t.appFor(l);a&&[...l.querySelectorAll("[bind]")].every(d=>mt(d))&&setTimeout(()=>{l.querySelectorAll("[bind]").forEach(d=>{d.dispatchEvent(new Event("input",{bubbles:!0})),d.dispatchEvent(new Event("change",{bubbles:!0}))}),t.schedule(a,"reset")},0)}function o(c){let l=t.appFor(c.target);l&&t.schedule(l,"toggle")}function s(c){let l=c.detail||{};for(let a of[l.from,l.to,c.target]){if(!a||a.nodeType!==1)continue;let d=t.appFor(a);d&&t.schedule(d,"sorted")}}function i(c){if(c.key!=="ArrowUp"&&c.key!=="ArrowDown")return;let l=c.target;if(!l||l.nodeType!==1||l.tagName!=="INPUT"||!l.hasAttribute("bind")||!l.hasAttribute("step"))return;let a=(l.getAttribute("type")||"text").toLowerCase();if(a!=="text"&&a!=="tel"&&a!=="search"||!t.appFor(l)||!mt(l))return;c.preventDefault();let p=P(l.getAttribute("step"))||1,v=c.key==="ArrowUp"?1:-1,R=P(l.value)+p*(c.shiftKey?10:1)*v,_=l.getAttribute("min"),$=l.getAttribute("max");_!==null&&_!==""&&R<P(_)&&(R=P(_)),$!==null&&$!==""&&R>P($)&&(R=P($)),Me(l).write(String(Number(R.toFixed(2))))}function f(c=document){c.addEventListener("reset",n),c.addEventListener("toggle",o,!0),c.addEventListener("input",r),c.addEventListener("change",r),c.addEventListener("clay:sorted",s),c.addEventListener("keydown",i)}return{install:f,addRouter:c=>e.push(c)}}var Z="https://clayjs.com/v1/sap.js",Un=/^(calc|set|move|sort):/,qn=new Set(["each","detail","effect","invalid","confirm","trigger-add","trigger-remove","trigger-reset"]);function Bt(t){return Un.test(t)||qn.has(t)}ze((t,e)=>{for(let r of t.attributes)Bt(r.name)&&e("E50",t,{attr:r.name,expr:r.value,problem:`${r.name} is full sapjs; the sapjs core only paints declared state`,fix:`load ${Z}; the markup stays as it is`})});function G(t,e,r){t.app.diag.error("E50",e,{attr:r,problem:`${r} is full sapjs; the sapjs core only paints declared state`,fix:`load ${Z}; the markup stays as it is`}),B(e,"E50"),t.app.halted=!0}Fe({name:"core-only",collect(t,e,r){r.calcs&&G(t,e,"calc:"+r.calcs[0].name),r.effects&&G(t,e,"effect"),r.invalids&&G(t,e,"invalid");for(let n of e.attributes)Bt(n.name)&&(n.name.startsWith("calc:")&&r.calcs||n.name==="effect"&&r.effects||n.name==="invalid"&&r.invalids||G(t,e,n.name));return!1},boundary:{each(t,e){G(t,e,"each")},detail(t,e){G(t,e,"detail")}}});function Vn(){return{Sap:function(){throw new Error(`Sap(el) is full sapjs; load ${Z}`)}}}var tn=t=>()=>(console.warn(`Sap.${t} is full sapjs; load ${Z}`),null),{Sap:tt,mountAll:en,mount:Yn,runtime:Gn}=Je({createAccessor:Vn,debugExtras:()=>({why:tn("why"),doctor:tn("doctor")}),installInput(t,e,r){Ze(t).install(r)}});tt.core=!0;var Xn=typeof window<"u"&&window.Sap&&!window.Sap.core;Xn?tt.unmount():Qe(en);typeof window<"u"&&!window.Sap&&(window.Sap=tt);var Kn=tt;return cn(Jn);})();
|
|
8
|
+
`+e.value:e.value;t.textContent!==n&&(t.textContent=n),t.removeAttribute("data-value");return}if(r==="SELECT"){let n=t.options,o=e.options;for(let s=0;s<n.length;s++)o[s]&&o[s].selected?n[s].hasAttribute("selected")||n[s].setAttribute("selected",""):n[s].removeAttribute("selected")}}function dt(t){t.tagName!=="TEXTAREA"||!t.hasAttribute("data-value")||t!==t.ownerDocument.activeElement&&(t.textContent=t.getAttribute("data-value"),t.removeAttribute("data-value"))}function T(t){if(typeof window>"u")return null;let e=window.clay,r=window.hyperclay;return t==="consent"?e?.confirm||r?.consent||null:e?.[t]||r?.[t]||null}function Ne(){let t=T("visitorDrafts");return!!(t&&typeof t.restored=="function"&&t.restored()?.restored)}var Lt=["clay:mutation-ready","hyperclay:mutation-ready"],En=["clay:sync-applied","hyperclay:livesync-applied"],xn=["clay:ready","hyperclay:ready"],vn=["clay:route"],Sn=["clay:modechange"];function Q(t,e,r){let n=null,o=s=>{n!==null&&n!==s.type||(n=s.type,queueMicrotask(()=>{n=null}),r(s))};for(let s of e)t.addEventListener(s,o);return()=>{for(let s of e)t.removeEventListener(s,o)}}function Te(t){let e=typeof window<"u"&&window.clay&&window.clay.ready;e&&typeof e.then=="function"?e.then(()=>t(),()=>t()):t()}function pt(t){let e=T("region");return!e||typeof e.resolveRegionPolicy!="function"||typeof e.skipForPolicy!="function"?!1:e.skipForPolicy(e.resolveRegionPolicy(t),void 0,["no-save","freeze"])}function Re(){return typeof window>"u"?null:window.clay?.modeLifecycle||null}function mt(t,{transient:e=!1}={}){if(e)return!0;let r=Re();return typeof r?.canWrite!="function"||T("region")?.resolveRegionPolicy?.(t)?.persist==="none"?!0:r.canWrite()}function Le(t,e){if(typeof e!="function")throw new Error("Sap.batch(label, fn): fn must be a function");let r=T("undo");r&&r.flush&&r.flush();let n=e();if(n&&typeof n.then=="function")throw new Error("Sap.batch fn must be synchronous (it returned a promise)");return r&&r.commitCaptured&&r.commitCaptured(t),n}function _e(t){if(typeof window>"u"||typeof document>"u")return;let e=()=>{let p=!1;for(let v of t.apps())v.root.isConnected?t.runNow(v,"platform"):p=!0;p&&t.pruneDisconnected(),t.remountIfPresent()},r=T("derived"),n=r&&typeof r.register=="function"?r.register(e):null,o=typeof n=="function"?null:Q(document,En,e),s=Q(document,vn,e),i=null,f=!1,c=()=>{let p=i;i=null,p&&(p[2](),p[3]())},l=()=>{if(f)return!1;let p=T("undo"),v=Re()?.state?.generation;if(i&&i[0]===p&&i[1]===v)return!0;if(c(),!p||typeof p.on!="function")return!1;let R=p.on("undo",e);if(typeof R!="function")return!1;let _=p.on("redo",e);return typeof _!="function"?(R(),!1):(i=[p,v,R,_],!0)};l();let a=[Lt,xn,Sn].map(p=>Q(document,p,l)),d=T("ready");return d&&typeof d.then=="function"&&d.then(l,()=>{}),()=>{f=!0,typeof n=="function"&&n(),o&&o(),s();for(let p of a)p();c()}}function _t(t){let e=t.tagName;if(e==="INPUT"){let r=(t.getAttribute("type")||"text").toLowerCase();return r==="checkbox"?"checkbox":r==="radio"?"radio":r==="number"||r==="range"?"number":r==="hidden"?"hidden":"text"}return e==="TEXTAREA"?"text":e==="SELECT"?t.multiple?"select-multiple":"select-one":"leaf"}function kn(t){if(t.validity&&t.validity.badInput)return t.hasAttribute("value")?Number(t.getAttribute("value"))||0:t._sapLastGood??0;if(t.value==="")return 0;let e=Number(t.value);return Number.isNaN(e)?t._sapLastGood??0:(t._sapLastGood=e,e)}function $e(t,e){switch(e){case"checkbox":return t.checked;case"radio":return t.checked?t.value:void 0;case"number":return kn(t);case"select-one":return t.value;case"select-multiple":return[...t.selectedOptions].map(r=>r.value);case"hidden":case"text":return t.value;case"leaf":return t.textContent;default:return t.value}}function Nn(t,e,r){switch(e){case"checkbox":t.checked=!!r;break;case"radio":t.checked=String(t.value)===String(r);break;case"number":case"text":case"hidden":t.value=r==null?"":String(r);break;case"select-one":t.value=r==null?"":String(r);break;case"select-multiple":{let n=new Set((Array.isArray(r)?r:[r]).map(String));for(let o of t.options)o.selected=n.has(o.value);break}case"leaf":t.textContent=r==null?"":String(r);break;default:t.value=r==null?"":String(r)}}function Ce(t){if(t.hasAttribute("transient")){t.removeAttribute("value"),t.removeAttribute("checked"),t.removeAttribute("data-value");return}pt(t)||V(t)}function Tn(t){t.dispatchEvent(new Event("input",{bubbles:!0})),t.dispatchEvent(new Event("change",{bubbles:!0}))}function Pe(t,e){return $e(t,e)}function Me(t){let e=_t(t);return{el:t,kind:e,read(){return $e(t,e)},write(r,n={}){Nn(t,e,r),n.noMirror||Ce(t),n.silent||Tn(t)},mirror(){Ce(t)}}}var I=null,bt=!1,Y=null;function Oe(t){let e=null;return{kind:"hub",subscribe(r){let n=t.onAnyChange({debounce:0,require:"observed"},r);typeof n=="function"&&(e=n)},suppress(r){t.pause();try{return r()}finally{t.resume()}},teardown(){if(e){try{e()}catch{}e=null}}}}function Rn(){let t=null;return{kind:"native",subscribe(e){t=new MutationObserver(n=>e(Ln(n)));let r=typeof document<"u"&&document.body||typeof document<"u"&&document.documentElement;r&&t.observe(r,{childList:!0,subtree:!0,attributes:!0,characterData:!0})},suppress(e){let r=T("undo");r&&r.pause&&r.pause();try{return e()}finally{t&&t.takeRecords(),r&&r.resume&&r.resume()}},teardown(){t&&(t.disconnect(),t=null)}}}function Ln(t){let e=[];for(let r of t)if(r.type==="attributes"){let n=r.target;n&&n.nodeType===1&&!ht(n)&&e.push({type:"attribute",element:n})}else if(r.type==="characterData"){let n=r.target&&r.target.parentElement;n&&!ht(n)&&e.push({type:"characterData",element:n})}else if(r.type==="childList"){for(let n of r.addedNodes)if(!(n.nodeType!==1||ht(n))&&(e.push({type:"add",element:n}),n.querySelectorAll))for(let o of n.querySelectorAll("*"))ht(o)||e.push({type:"add",element:o});for(let n of r.removedNodes)n.nodeType===1&&e.push({type:"remove",element:n,parent:r.target})}return e}function ht(t){return!!(t.closest&&t.closest("[sap-ignore],[template],[cms-template]"))}function _n(t,e){t.pruneDisconnected();let r=new Set,n=!1;for(let o of e){let s=o.type==="remove"?o.parent:o.element,i=s&&t.appFor(s);i&&r.add(i),o.type==="add"&&o.element&&o.element.nodeType===1&&o.element.hasAttribute&&o.element.hasAttribute("sap")&&!(t.isRegistered&&t.isRegistered(o.element))&&(n=!0)}n&&t.remountIfPresent();for(let o of r)o.root.isConnected&&t.schedule(o,"mutation")}function De(t){if(I)return I.suppress(t);let e=T("undo");if(e&&e.pause&&e.resume){e.pause();try{return t()}finally{e.resume()}}return t()}function Ct(t,e){bt=!0,I=t,t.subscribe(r=>_n(e,r))}function $t(t){if(bt||typeof window>"u"||typeof document>"u")return;let e=T("Mutation");if(e&&typeof e.onAnyChange=="function"){Ct(Oe(e),t);return}typeof MutationObserver=="function"&&(Ct(Rn(),t),Y=Q(document,Lt,function(){let n=T("Mutation");n&&(Y(),Y=null,I&&I.teardown(),bt=!1,Ct(Oe(n),t))}))}function Pt(){if(I)try{I.teardown()}catch{}Y&&typeof document<"u"&&Y(),I=null,bt=!1,Y=null}var Cn=new Set(z),gt=Object.freeze([]),W=[],We={},Be={};function Fe(t){W.includes(t)||(W.push(t),t.boundary&&Object.assign(We,t.boundary),t.paintKinds&&Object.assign(Be,t.paintKinds))}function yt(t,e={}){if(e.breaker){t.diag.error("E26",t.root,{problem:"recompute loop halted after 50 passes; recent triggers: "+(t._breakerRing||[]).join(", ")}),B(t.root,"loop");return}e.full&&(ue(),me());let r=ce(t.root);try{De(()=>$n(t,e))}finally{le(r)}t._viewsChanged&&(t._viewsChanged=!1,t.root.dispatchEvent(new CustomEvent("sap:views-updated",{bubbles:!0})))}function $n(t,e){let r=t.root,n={},o=[],s=[],i=new Set;t.diag.errors=[];let f={root:n,state:n,item:null,ownerEl:r,projection:!1},c=null;function l(u,h,b=!1){let m=h.attr||h.name,g=b?xe(u,m):u.getAttribute(m);return g==null&&(g=Tt(h),s.push({el:u,name:h.name,attr:m,value:Gt(st(g,h.type),h.type)})),st(g,h.type)}function a(u,h,b,m){let g=h.decls;if(!g)return;let E=!!m.item&&!m.projection&&!m.view;for(let k of g){if(k.transient){c&&(c.pure=!1),b[k.name]=Xt(u,k);continue}if(Nt(u,k)){b[k.name]=u.hasAttribute(k.attr);continue}b[k.name]=l(u,k,E)}}function d(u,h,b){let m=h.bind,g=b.item||b.state,E=_t(u);c&&(E!=="leaf"||h.transient)&&(c.pure=!1),E==="radio"?(m in g||(g[m]=""),u.checked&&(g[m]=u.value)):E==="leaf"&&b.item&&!b.projection&&!b.view?g[m]=ve(u):g[m]=Pe(u,E),h.transient&&(u.removeAttribute("value"),u.removeAttribute("checked"))}function p(u,h,b){let m=!1;if(h.paints){m=!0;for(let g of h.paints)g.kind==="when"&&i.add(g.field),o.push({def:g,el:u,ctx:b})}for(let g of W)g.collect&&g.collect(A,u,h,b)!==!1&&(m=!0);c&&m&&(h.calcs&&(c.pure=!1),c.collects.push(u,h))}function v(u,h,b){Object.defineProperty(u,"$key",{value:qt(h,"row"),enumerable:!1}),Object.defineProperty(u,"$index",{value:b,enumerable:!1,configurable:!0}),Object.defineProperty(u,"$el",{value:h,enumerable:!1})}function R(u,h,b){let m=ft(u);a(u,m,h,b),u._sapScope=h,!b.projection&&m.bind!=null&&d(u,m,b),p(u,m,b),m.items?nt(u,h,b):_(u,h,b)}function _(u,h,b){for(let m=u.firstElementChild;m;m=m.nextElementSibling)$(m,h,b)}function $(u,h,b){let m=ft(u);if(!m.inert){if(m.boundary){c&&(c.pure=!1),m.boundary==="scope"?et(u,h,b):m.boundary==="items"?(p(u,m,b),nt(u,h,b)):We[m.boundary](A,u,m,h,b);return}!b.projection&&!b.view&&m.bind!=null&&d(u,m,b),p(u,m,b);for(let g=u.firstElementChild;g;g=g.nextElementSibling)$(g,h,b)}}function et(u,h,b){let m=u.getAttribute("scope"),g={};h[m]=g;let E={root:b.root,state:g,item:null,ownerEl:u,projection:b.projection};R(u,g,E)}function nt(u,h,b){c&&(c.pure=!1);let m=u.getAttribute("items"),g=[];h[m]=g,u._sapList=g;let E=!b.projection&&!b.view&&he(),k=0;for(let N=u.firstElementChild;N;N=N.nextElementSibling){let x=ft(N);if(!x.item||x.template||x.cms)continue;let L=E?be(N):void 0;g.push(L&&L.plan===x&&Object.isExtensible(L.obj)&&rt(L,N,k,b)||X(N,x,k,b,E)),k++}}function X(u,h,b,m,g){let E={};v(E,u,b);let k={root:m.root,state:m.state,item:E,ownerEl:u,projection:m.projection};if(!g)return R(u,E,k),E;let N=c,x={plan:h,obj:E,fields:null,presence:gt,pending:gt,collects:[],pure:!0},L=s.length,nn=t.diag.errors.length;c=x;try{R(u,E,k)}finally{c=N}if(!x.pure||t.halted||t.diag.errors.length!==nn)return E;let Ft=[];for(let H of Object.keys(E)){let wt=E[H];if(wt!==null&&typeof wt=="object")return E;Ft.push(H,wt)}if(h.decls)for(let H of h.decls)Nt(u,H)&&(x.presence===gt?x.presence=[]:x.presence).push(H.name,H.attr);return s.length>L&&(x.pending=s.slice(L)),x.collects.length||(x.collects=gt),x.fields=Ft,ge(u,x),E}function rt(u,h,b,m){let g=u.obj;try{g.$index!==b&&Object.defineProperty(g,"$index",{value:b,enumerable:!1,configurable:!0});let N=u.presence;for(let L=0;L<N.length;L+=2)g[N[L]]=h.hasAttribute(N[L+1]);let x=u.fields;for(let L=0;L<x.length;L+=2)g[x[L]]=x[L+1]}catch{return ye(h),null}h._sapScope=g;let E=u.pending;for(let N=0;N<E.length;N++)s.push(E[N]);let k=u.collects;if(k.length){let N={root:m.root,state:m.state,item:g,ownerEl:h,projection:m.projection};for(let x=0;x<k.length;x+=2)p(k[x],k[x+1],N)}return g}let A={app:t,root:r,rootObj:n,paints:o,stats:{calcs:0,lists:0},resolveDefault:l,collectEl:p,walkScope:_};for(let u of W)u.begin&&u.begin(A);let w=e.cacheReads===!1?null:we(r);try{R(r,n,f)}finally{e.cacheReads!==!1&&Ae(w)}if(t.halted)return;for(let u of W)u.afterIntake&&u.afterIntake(A);if(s.length&&i.size)for(let u of s)i.has(u.attr)&&u.el.getAttribute(u.attr)==null&&u.el.setAttribute(u.attr,u.value);for(let u of W)u.compute&&u.compute(A);let y=0;for(let u of W)u.reconcile&&(y+=u.reconcile(A));let S=0,C=y;for(let u of o){let h=Mn(u,t);u.ctx.view?C+=h:S+=h}for(let u of W)u.afterPaint&&u.afterPaint(A);t._state=n,t._stats={fields:Object.keys(n).filter(u=>typeof n[u]!="function").length,calcs:A.stats.calcs,paints:o.length,lists:A.stats.lists,writes:S,viewWrites:C},t._viewsChanged=C>0,t._lastPass={trigger:e.trigger||"refresh",writes:S},t._debug&&console.log(`sap pass \xB7 trigger: ${t._lastPass.trigger} \xB7 writes ${S}/${o.length}`)}function Pn(t){return t.kind==="text"?t.fmt?"text:"+t.fmt:"text":t.kind==="attr"?"attr:"+t.arg:t.kind==="class"?"class:"+t.arg:t.kind==="css"?"css:"+t.arg:t.kind==="when"?(t.match==="hide"?"hide-when:":t.match==="show-not"?"option-not:":"show-when:")+t.field:t.kind}function Mt(t,e,r,n){let o=t;for(;o&&o.nodeType===1;){if(o.hasAttribute&&o.hasAttribute(e)){let s=r.includes(o.getAttribute(e));if(n?!s:s)return!0}o=o.parentElement}return!1}function Mn(t,e){let r=t.def,n=t.el,o=Be[r.kind];if(o)return o(t,e);if(r.kind==="when")return Ie(r,n,null);try{let s=ie(r.entry,t.ctx.state,t.ctx.item,n,t.ctx.root),i=Ie(r,n,s);return zt(n),i}catch(s){return e.diag.error(s.sapCode==="E22"?"E22":"E24",n,{attr:Pn(r),expr:r.entry&&r.entry.src,problem:String(s.message)}),B(n,s.sapCode||"E24"),0}}function Ie(t,e,r){switch(t.kind){case"text":{let n=t.fmt!=null?ne(t.fmt,r):r==null?"":String(r);return e.textContent!==n?(e.textContent=n,1):0}case"show":{let n=!r;return e.hidden!==n?(e.hidden=n,1):0}case"when":{let n=T("optionVisibility");if(n&&n._started)return e._sapWhen&&e.hidden?(e.hidden=!1,e._sapWhen=!1,1):0;let o;t.match==="hide"?o=!Mt(e,t.field,t.values,!1):t.match==="show-not"?o=Mt(e,t.field,t.values,!0):o=Mt(e,t.field,t.values,!1),e._sapWhen=!0;let s=!o;return e.hidden!==s?(e.hidden=s,1):0}case"attr":{let n=t.arg;if((n==="checked"||n==="selected")&&typeof e[n]=="boolean"&&!e.hasAttribute("bind")&&!e.closest("select[bind]")){let s=0;return e[n]!==!!r&&(e[n]=!!r,s=1),!!r!==e.hasAttribute(n)&&(r?e.setAttribute(n,""):e.removeAttribute(n),s=1),s}if(Cn.has(n)){let s=e.hasAttribute(n);return r&&!s?(e.setAttribute(n,""),1):!r&&s?(e.removeAttribute(n),1):0}let o=typeof r=="boolean"?String(r):r==null?"":String(r);return e.getAttribute(n)!==o?(e.setAttribute(n,o),1):0}case"class":{let n=!!r;return e.classList.contains(t.arg)!==n?(e.classList.toggle(t.arg,n),1):0}case"css":{let n=r==null?"":String(r);return e.style.getPropertyValue("--"+t.arg)!==n?(e.style.setProperty("--"+t.arg,n),1):0}default:return 0}}var On=new Set(z),je=new Set(["calc","text","attr","class","css","set","move","sort","option","option-not","show-when","hide-when","editmode","viewmode"]),Dn=new Set(["show-when","hide-when","option","option-not"]),In=/\b(?:state|item|root)\.|===|!==|&&|\|\||[()]|^\s*!/,He=new Set(["sap","scope","items","item","template","bind","show","effect","invalid","detail","state","transient","confirm","default","persist","sortable","trigger-add","trigger-remove","trigger-reset","sap-ignore","sap-error","no-save","no-watch","no-undo","no-trigger-autosave","freeze","mutations-ignore","save-remove","save-ignore","save-freeze"]),Dt=[];function ze(t){Dt.includes(t)||Dt.push(t)}function Wn(t){return t.tagName==="INPUT"||t.tagName==="SELECT"||t.tagName==="TEXTAREA"}function Ot(t){return t.hasAttribute("bind")}function Bn(t,e){e(t);for(let n=t.firstElementChild;n;n=n.nextElementSibling)r(n);function r(n){if(!n.hasAttribute("sap-ignore")){if(n.tagName==="TEMPLATE"){if(n.hasAttribute("items"))for(let o=n.content.firstElementChild;o;o=o.nextElementSibling)r(o);return}e(n);for(let o=n.firstElementChild;o;o=o.nextElementSibling)r(o)}}}function Ue(t,e){let r=!1,n=(i,f,c)=>{e.error(i,f,c),r=!0},o=t.ownerDocument.createTreeWalker(t,4),s;for(;s=o.nextNode();)if(/\{\{.*\}\}/.test(s.nodeValue||"")){n("E02",s.parentElement||t,{problem:"moustaches in text content are not a Sap feature",fix:'move the expression onto the element: text="state.x"'});break}return Bn(t,i=>{let f=new Set;for(let l of Dt)l(i,n,a=>f.add(a));let c=i.closest&&i.closest("[detail]");for(let l of[...i.attributes]){let a=l.name;if(f.has(a))continue;if(a.includes(":")){let p=a.slice(0,a.indexOf(":"));if(je.has(p)){if(Dn.has(p)&&In.test(l.value)){let v=a.slice(a.indexOf(":")+1);e.warn("W04",i,{attr:a,expr:l.value,problem:`${p}: compares the "${v}" attribute against a literal value, not a JS expression`,fix:`use show="${l.value}" for an expression, or a literal like ${p}:${v}="overview"`})}}else{let v=vt(p,[...je]);e.warn("W03",i,{attr:a,problem:`unknown "${p}:" attribute`,didYouMean:v?`${v}:`:null})}}else if(!He.has(a)&&!xt.has(a)&&!On.has(a)&&!/^(data-|aria-|on)/.test(a)&&!(a in i)){let p=vt(a,[...He]);p&&e.warn("W03",i,{attr:a,problem:`unknown "${a}" attribute`,didYouMean:p})}a==="attr:hidden"&&e.warn("W03",i,{attr:a,problem:"attr:hidden paints the wrong attribute",fix:'use show="expr"'});let d=Ot(i)||a==="attr:selected"&&i.tagName==="OPTION"&&!!i.closest("select[bind]");(a==="attr:value"||a==="attr:checked"||a==="attr:selected")&&d&&n("E30",i,{attr:a,problem:"attr: on a bound control collides with persist ownership",fix:"remove it; bind owns this attribute"}),a==="effect"&&Ot(i)&&/\b(value|checked)\s*=[^=]/.test(l.value)&&n("E30",i,{attr:a,expr:l.value,problem:"effect writes value/checked on a bound control (writes a stale value with no synthetic event)",fix:"write through onclick + Sap(this) instead"}),(a==="text"||a.startsWith("text:")||a==="show")&&Wn(i)&&(a==="show"||n("E18",i,{attr:a,problem:"paint belongs on output elements, not form controls",fix:"move the paint to an <output> or <span>"}))}if(i.hasAttribute("state")){let l=it(i.getAttribute("state")),a=new Set;for(let d of l){d.name.includes("-")&&n("E08",i,{attr:"state",problem:`field "${d.name}" is not a valid identifier (the hyphen parses as subtraction)`,fix:`rename to ${d.name.replace(/-/g,"")}`}),a.has(d.name)&&n("E04",i,{attr:"state",problem:`field "${d.name}" is declared twice in one scope`}),a.add(d.name),Ht.has(d.attr)&&n("E05",i,{attr:"state",problem:`"${d.name}" is a reserved Sap word`}),xt.has(d.attr)&&n("E06",i,{attr:"state",problem:`"${d.name}" is a global HTML attribute name; pick another field name`}),d.name==="open"&&i.tagName==="DIALOG"&&n("E33",i,{attr:"state",problem:"dialog open is transient",fix:"use showModal() \u2014 declare state= only on <details> or popovers"});let p=kt(i,d.attr);p&&(d.attr==="checked"||d.attr==="selected")&&n("E35",i,{attr:"state",problem:`"${d.attr}" on a form control is the control's own state, not a declared field`,fix:'bind the control instead, e.g. <input type="checkbox" bind="done">'}),p&&d.type==="num"&&n("E35",i,{attr:"state",problem:`"${d.attr}" is an HTML boolean attribute; it cannot hold a number`,fix:`declare it bare: state="${d.attr}"`}),d.transient&&(p||d.type==="presence")&&n("E35",i,{attr:"state",problem:`"${d.name}" is carried by attribute presence, which transient would strip`,fix:"declare a separate name:bool:transient field and paint the attribute from it"})}}if(Ot(i)){if(i.hasAttribute("-"),i.tagName==="INPUT"){let l=(i.getAttribute("type")||"text").toLowerCase();l==="file"&&n("E32",i,{attr:"bind",problem:"files never serialize into an HTML file",fix:"use no-save + effect instead of bind"}),l==="password"&&!i.hasAttribute("transient")&&n("E31",i,{attr:"bind",problem:"a password must never serialize into a world-readable file",fix:"add transient to the password input"})}else if(i.tagName!=="SELECT"&&i.tagName!=="TEXTAREA"){let l=i.getAttribute("contenteditable");!(l!=null&&l!=="false")&&i.children.length>0&&n("E20",i,{attr:"bind",problem:"bind on a container element is not a control; a write would overwrite its children",fix:"bind a control (input/select/textarea), a contenteditable, or an empty text leaf"})}}if(i.hasAttribute("transient")&&i.hasAttribute("persist")&&n("E34",i,{problem:"transient and persist are opposite: persist forces the live value into the saved bytes, leaking exactly what transient drops",fix:"remove one \u2014 transient to keep it out of the file, or persist to save it"}),i.tagName==="DIALOG"&&i.hasAttribute("detail")&&!(i.parentElement&&i.parentElement.closest('[clay~="freeze"], [freeze], [save-freeze]'))&&e.warn("W31",i,{attr:"detail",problem:"a detail dialog writes open when it opens, and that attribute would be saved into the file",fix:'wrap the dialog in an element with clay="freeze" (not editor-ui, which removes it from the file), and make its key field transient'}),i.hasAttribute("item")&&!i.hasAttribute("template")&&i.parentNode&&i.parentNode.nodeType===1){let l=i.parentElement;(!l||!l.hasAttribute("items"))&&n("E10",i,{problem:"an [item] must be a direct child of an [items] list",fix:'wrap it in a container with items="name"'})}if(i.hasAttribute("items")&&c&&n("E17",i,{attr:"items",problem:"nested items inside a detail panel is a v1 mount error (nested collections ship in v1.1)"}),i.hasAttribute("items")){let l=t.querySelector(`[trigger-add="${i.getAttribute("items")}"]`);!Yt(i)&&!St(t,i.getAttribute("items"))&&Vt(i).length===0&&l&&n("E17",i,{attr:"items",problem:`trigger-add targets items="${i.getAttribute("items")}" but it has no [item template] to clone`})}}),r&&(e.halted=!0,e.haltReason=e.errors[0]?e.errors[0].code:"halt",B(t,e.haltReason)),!r}var qe="sap-styles",Ve="[item][template]{display:none!important}[hidden]{display:none!important}[sap-error]{outline:2px solid #e5484d;outline-offset:1px}",It=new WeakSet;function Fn(t){if(It.has(t))return;let e=t.defaultView,r=e&&e.CSSStyleSheet;if(r&&"adoptedStyleSheets"in t)try{let n=new r;n.replaceSync(Ve),t.adoptedStyleSheets=[...t.adoptedStyleSheets,n],It.add(t);return}catch{}if(!t.getElementById(qe)){let n=t.createElement("style");n.id=qe,n.textContent=Ve,(t.head||t.documentElement).appendChild(n)}It.add(t)}var jn=0;function Ye(){return typeof performance<"u"&&performance.now?performance.now():0}function Wt(t){let e=t.id||t.getAttribute("sap")||`app-${jn++}`,r=new ot(e),n={root:t,name:e,diag:r,_state:null,_stats:null,_lastPass:null,_passes:0,_broken:!1,_mountMs:0,_mountWrites:0};if(!Ue(t,r))return n.halted=!0,n;Fn(t.ownerDocument);for(let i of t.querySelectorAll("textarea[data-value]"))dt(i);let s=Ye();return yt(n,{trigger:"mount",full:!0}),n._mountMs=Ye()-s,n._mountWrites=n._stats?n._stats.writes:0,n._mountWrites>0&&!Ne()&&!T("derived")&&r.warn("W30",t,{problem:`${n._mountWrites} paint(s) ran at mount; the saved file was out of sync with its declared state`,fix:"re-save once so the file mounts clean (a settled file writes nothing)"}),n}var Ge=/^(set:|move:|sort:|trigger-add$|trigger-remove$|trigger-reset$)/;function Hn(t){return`${t.tagName.toLowerCase()}[sap]`}function zn(t){let e=0;for(let r of t.querySelectorAll("*"))for(let n of r.attributes)if(Ge.test(n.name)){e++;break}for(let r of t.attributes)if(Ge.test(r.name)){e++;break}return e}function Xe(t){function e(f){let c=f._stats||{},l=f.root;return{root:Hn(l),fields:c.fields||0,calcs:c.calcs||0,paints:c.paints||0,actions:zn(l),lists:(l.hasAttribute("items")?1:0)+l.querySelectorAll("[items]").length,rows:l.querySelectorAll("[item]:not([template])").length,warnings:f.diag.warnings.length,errors:f.diag.errors.length,mountWrites:f._mountWrites||0,ms:Math.round((f._mountMs||0)*10)/10,passes:f._passes||0,lastPass:f._lastPass||null,ok:f.diag.errors.length===0&&!f.halted}}function r(){let f=t.apps().map(e);return{ok:f.every(c=>c.ok),apps:f}}function n(f){let c=e(f);return c.ok?`sap \u2713 ${c.root} \xB7 fields ${c.fields} \xB7 calcs ${c.calcs} \xB7 paints ${c.paints} \xB7 actions ${c.actions} \xB7 lists ${c.lists} \xB7 rows ${c.rows} \xB7 warnings ${c.warnings} \xB7 mount writes ${c.mountWrites} \xB7 ${c.ms}ms`:`sap \u2717 ${c.root} \xB7 errors ${c.errors} \xB7 warnings ${c.warnings} \xB7 ${c.ms}ms`}function o(){for(let f of t.apps()){let c=n(f);f.diag.errors.length||f.halted?console.error(c):console.log(c)}}function s(){let f=[],c=[];for(let l of t.apps())f.push(...l.diag.errors),c.push(...l.diag.warnings);return{ok:f.length===0,errors:f,warnings:c,counts:{errors:f.length,warnings:c.length}}}function i(f){let c=f===void 0?!0:!!f;for(let l of t.apps())l._debug=c;return console.log(`sap debug ${c?"on":"off"} \u2014 per-pass headers will ${c?"":"no longer "}log`),c}return{status:r,report:s,debug:i,greenLine:n,printGreenLines:o,REGISTRY:Et}}var Ke="0.8.0";function Je({createAccessor:t,installInput:e,debugExtras:r}){let n=new Map,o=[],s=jt(yt);function i(w){let y=w;for(;y;){if(y.nodeType===1&&y.hasAttribute&&y.hasAttribute("sap"))return n.get(y)||null;y=y.parentNode&&y.parentNode.host?y.parentNode.host:y.parentElement}return null}function f(){for(let w=o.length-1;w>=0;w--){let y=o[w];y.root.isConnected||(n.delete(y.root),o.splice(w,1))}}function c(w,y){if(w.moveBefore)try{w.moveBefore(y,null);return}catch{}w.appendChild(y)}function l(w,y){let S=y.parentElement;if(S){if(S.moveBefore)try{S.moveBefore(w,y);return}catch{}S.insertBefore(w,y)}}let a={apps:()=>o.slice(),appFor:i,isRegistered:w=>n.has(w),pruneDisconnected:f,schedule:(w,y)=>s.schedule(w,y),runNow:(w,y)=>s.runNow(w,y),moveInto:c,placeBefore:l,remountIfPresent:()=>X()},d=t(a),p=Xe(a),v=r?r(a,p):{},R=!1,_=!1,$=null;function et(){R||(R=!0,e(a,d,document),$=_e(a))}function nt(){let w=T("derived");w&&typeof w.mounted=="function"&&w.mounted()}function X(w=document){if(_)return[];et(),$t(a);let y=w.querySelectorAll("[sap]"),S=[];for(let C of y){if(n.has(C))continue;let u=Wt(C);n.set(C,u),o.push(u),S.push(u)}for(let C of S){let u=p.greenLine(C);C.diag.errors.length||C.halted?console.error(u):console.log(u)}return nt(),S}function rt(w){if(_)return null;if(et(),$t(a),!w)return X();let y=typeof w=="string"?document.querySelector(w):w;if(!y)return null;if(n.has(y))return n.get(y);let S=Wt(y);n.set(y,S),o.push(S);let C=p.greenLine(S);return S.diag.errors.length||S.halted?console.error(C):console.log(C),S}let A=d.Sap;return A.version=Ke,A.refresh=function(){for(let y of o)y.root.isConnected&&s.runNow(y,"refresh")},A.batch=Le,A.status=p.status,A.report=p.report,A.why=v.why,A.debug=p.debug,A.doctor=v.doctor,A.greenLine=p.greenLine,A.formats=U,A.serializeControlToAttributes=V,A.finalizeControlForSave=ke,A.rehydrateControlFromAttributes=dt,A.mount=rt,A.config=function(y={}){return y.formats&&Object.assign(U,y.formats),A},A._registry=n,A._reset=function(){n.clear(),o.length=0,Pt()},A.unmount=function(){_=!0,n.clear(),o.length=0,Pt(),typeof $=="function"&&$()},{Sap:A,mountAll:X,mount:rt,runtime:a}}function Qe(t){if(typeof document>"u")return;let e=()=>Te(()=>t());document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e):e()}function Ze(t){let e=[];function r(c){let l=c.target;if(!l||l.nodeType!==1)return;let a=t.appFor(l);if(a){l.hasAttribute("persist")&&!pt(l)&&mt(l)&&V(l);for(let d of e)if(d(l,a))return;t.schedule(a,c.type+" "+(l.id||l.tagName.toLowerCase()))}}function n(c){let l=c.target,a=t.appFor(l);a&&[...l.querySelectorAll("[bind]")].every(d=>mt(d))&&setTimeout(()=>{l.querySelectorAll("[bind]").forEach(d=>{d.dispatchEvent(new Event("input",{bubbles:!0})),d.dispatchEvent(new Event("change",{bubbles:!0}))}),t.schedule(a,"reset")},0)}function o(c){let l=t.appFor(c.target);l&&t.schedule(l,"toggle")}function s(c){let l=c.detail||{};for(let a of[l.from,l.to,c.target]){if(!a||a.nodeType!==1)continue;let d=t.appFor(a);d&&t.schedule(d,"sorted")}}function i(c){if(c.key!=="ArrowUp"&&c.key!=="ArrowDown")return;let l=c.target;if(!l||l.nodeType!==1||l.tagName!=="INPUT"||!l.hasAttribute("bind")||!l.hasAttribute("step"))return;let a=(l.getAttribute("type")||"text").toLowerCase();if(a!=="text"&&a!=="tel"&&a!=="search"||!t.appFor(l)||!mt(l))return;c.preventDefault();let p=P(l.getAttribute("step"))||1,v=c.key==="ArrowUp"?1:-1,R=P(l.value)+p*(c.shiftKey?10:1)*v,_=l.getAttribute("min"),$=l.getAttribute("max");_!==null&&_!==""&&R<P(_)&&(R=P(_)),$!==null&&$!==""&&R>P($)&&(R=P($)),Me(l).write(String(Number(R.toFixed(2))))}function f(c=document){c.addEventListener("reset",n),c.addEventListener("toggle",o,!0),c.addEventListener("input",r),c.addEventListener("change",r),c.addEventListener("clay:sorted",s),c.addEventListener("keydown",i)}return{install:f,addRouter:c=>e.push(c)}}var Z="https://clayjs.com/v1/sap.js",Un=/^(calc|set|move|sort):/,qn=new Set(["each","detail","effect","invalid","confirm","trigger-add","trigger-remove","trigger-reset"]);function Bt(t){return Un.test(t)||qn.has(t)}ze((t,e)=>{for(let r of t.attributes)Bt(r.name)&&e("E50",t,{attr:r.name,expr:r.value,problem:`${r.name} is full sapjs; the sapjs core only paints declared state`,fix:`load ${Z}; the markup stays as it is`})});function G(t,e,r){t.app.diag.error("E50",e,{attr:r,problem:`${r} is full sapjs; the sapjs core only paints declared state`,fix:`load ${Z}; the markup stays as it is`}),B(e,"E50"),t.app.halted=!0}Fe({name:"core-only",collect(t,e,r){r.calcs&&G(t,e,"calc:"+r.calcs[0].name),r.effects&&G(t,e,"effect"),r.invalids&&G(t,e,"invalid");for(let n of e.attributes)Bt(n.name)&&(n.name.startsWith("calc:")&&r.calcs||n.name==="effect"&&r.effects||n.name==="invalid"&&r.invalids||G(t,e,n.name));return!1},boundary:{each(t,e){G(t,e,"each")},detail(t,e){G(t,e,"detail")}}});function Vn(){return{Sap:function(){throw new Error(`Sap(el) is full sapjs; load ${Z}`)}}}var tn=t=>()=>(console.warn(`Sap.${t} is full sapjs; load ${Z}`),null),{Sap:tt,mountAll:en,mount:Yn,runtime:Gn}=Je({createAccessor:Vn,debugExtras:()=>({why:tn("why"),doctor:tn("doctor")}),installInput(t,e,r){Ze(t).install(r)}});tt.core=!0;var Xn=typeof window<"u"&&window.Sap&&!window.Sap.core;Xn?tt.unmount():Qe(en);typeof window<"u"&&!window.Sap&&(window.Sap=tt);var Kn=tt;return cn(Jn);})();
|
|
9
9
|
export default SapCoreBundle.default;
|