@panphora/clayjs 1.26.0 → 1.26.2
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 +5 -4
- package/dist/m/{c-EQ5NBOGA.js → c-26W3BMWK.js} +1 -1
- package/dist/m/{c-AQVQKFKB.js → c-3JQY5MB2.js} +1 -1
- package/dist/m/{c-MKAUC6DB.js → c-3KG4SDZ5.js} +1 -1
- package/dist/m/{c-HYNM5U6B.js → c-5CJCIAFK.js} +1 -1
- package/dist/m/{c-O3DPFZCE.js → c-6266A3CU.js} +1 -1
- package/dist/m/{c-WOJ2RTV4.js → c-627JDXWT.js} +1 -1
- package/dist/m/{c-MMEVDN6D.js → c-7PZS45FY.js} +1 -1
- package/dist/m/{c-NYJ577NL.js → c-7RJCYD4F.js} +1 -1
- package/dist/m/{c-EHAR4RJJ.js → c-CKG4NF7J.js} +2 -2
- package/dist/m/{c-EXZOA6XY.js → c-E37MV4WS.js} +1 -1
- package/dist/m/{c-N4GEJMXW.js → c-EFXPKDJP.js} +1 -1
- package/dist/m/{c-ZPI7M5U5.js → c-G426P2SE.js} +1 -1
- package/dist/m/{c-BJ2RRQBQ.js → c-GXOUAT7E.js} +1 -1
- package/dist/m/{c-VU4WEWPH.js → c-H25R2UF3.js} +1 -1
- package/dist/m/{c-VO6RSFCO.js → c-HBSBQBD7.js} +1 -1
- package/dist/m/{c-CL5LSATX.js → c-I4ZVJZC7.js} +1 -1
- package/dist/m/{c-67TBU56I.js → c-I62KCFMW.js} +1 -1
- package/dist/m/{c-Y3MPVURA.js → c-IJ4VUYDN.js} +1 -1
- package/dist/m/{c-FC5RUFPR.js → c-IOJOJTPL.js} +1 -1
- package/dist/m/{c-HXGNH6GY.js → c-IPCSVZAB.js} +1 -1
- package/dist/m/c-JEWSJHMK.js +1 -0
- package/dist/m/{c-3F3AADKG.js → c-JOA4OJGK.js} +1 -1
- package/dist/m/{c-GFASNR55.js → c-JUSHNY3I.js} +1 -1
- package/dist/m/{c-7RHOMAMR.js → c-K5HRHUTK.js} +1 -1
- package/dist/m/{c-H3M6UDNV.js → c-KFXW6SZO.js} +1 -1
- package/dist/m/{c-EAV7A6BT.js → c-MB5FZ2PD.js} +1 -1
- package/dist/m/{c-2EPHRF47.js → c-MIQYK2VM.js} +1 -1
- package/dist/m/{c-ARO6CPMA.js → c-O3BSWMVD.js} +1 -1
- package/dist/m/{c-U35T5NAY.js → c-O54PVIAQ.js} +1 -1
- package/dist/m/{c-H4M2T4A6.js → c-OEEJRV2M.js} +1 -1
- package/dist/m/{c-KU3PX7LL.js → c-OSGTRM4C.js} +1 -1
- package/dist/m/{c-YZGWSCMT.js → c-QLGTY326.js} +1 -1
- package/dist/m/{c-WOWGGNCJ.js → c-RC37IFYT.js} +1 -1
- package/dist/m/{c-SMLAJASY.js → c-RHYX6KUH.js} +1 -1
- package/dist/m/{c-RGFPLQGV.js → c-SMCZC3V6.js} +1 -1
- package/dist/m/{c-P73XPAOA.js → c-T6RRRHX7.js} +1 -1
- package/dist/m/{c-3S5TNRZA.js → c-USO6XV23.js} +1 -1
- package/dist/m/{c-ZFAPQQIB.js → c-VPUSMVKE.js} +1 -1
- package/dist/m/{c-YYIN4NAF.js → c-VXJJ7BJL.js} +1 -1
- package/dist/m/{c-EEWPNUM2.js → c-W3DMFFGK.js} +1 -1
- package/dist/m/{c-755ZOHOM.js → c-W5HY5JHM.js} +1 -1
- package/dist/m/{c-C5UGNOC2.js → c-WJVW76R6.js} +1 -1
- package/dist/m/{c-Q2CB57UG.js → c-X3WLDGBX.js} +1 -1
- package/dist/m/{c-SRW5OBCF.js → c-XLVZN7DT.js} +1 -1
- package/dist/m/{c-3WX5FABT.js → c-YIFBOWQE.js} +1 -1
- package/dist/m/{c-34J5HC7N.js → c-YJS2V3MX.js} +1 -1
- package/dist/m/core/{admin-attrs-43JBA6JB.js → admin-attrs-H26XE2AE.js} +1 -1
- package/dist/m/core/{autosave-HD7Y7UNV.js → autosave-U5UIKPM3.js} +1 -1
- package/dist/m/core/{conflict-notice-UNDOD4BL.js → conflict-notice-HTF6CECH.js} +1 -1
- package/dist/m/core/{host-permission-5BYP24GC.js → host-permission-JHMPKRPO.js} +1 -1
- package/dist/m/core/{is-edit-mode-73OXKK5H.js → is-edit-mode-QBJUFMVF.js} +1 -1
- package/dist/m/core/{persist-MX3VYVBN.js → persist-TRXZPS6T.js} +1 -1
- package/dist/m/core/{recovery-VZF7RJZF.js → recovery-YJS7CI66.js} +1 -1
- package/dist/m/core/{save-JZ7R4ET2.js → save-KY3ZMPU4.js} +1 -1
- package/dist/m/core/{save-core-I4N6S4ED.js → save-core-LBW6DNJ6.js} +1 -1
- package/dist/m/core/{site-edits-C22O53GS.js → site-edits-M44KWAQN.js} +1 -1
- package/dist/m/core/{unsaved-warning-BP6ZY3PG.js → unsaved-warning-2X7NJNHZ.js} +1 -1
- package/dist/m/internals/{index-3LAVREAU.js → index-CDXUFQZK.js} +1 -1
- package/dist/m/{loader-DCKCZKY6.js → loader-CRCEH7TD.js} +1 -1
- package/dist/m/manifest-6D031725.js +1 -0
- package/dist/m/{manifest-edit-93AA79D7.js → manifest-edit-A75598BC.js} +1 -1
- package/dist/m/manifest.json +593 -593
- package/dist/m/plugins/{ai-edit-WDV2GLDU.js → ai-edit-T2SM7TRD.js} +1 -1
- package/dist/m/plugins/{demo-LMCMBILC.js → demo-57MJ3GOO.js} +1 -1
- package/dist/m/plugins/{derive-R4USHZ7P.js → derive-TRMYDN7J.js} +1 -1
- package/dist/m/plugins/{indicator-OLPZ4WFI.js → indicator-D5PZJGVS.js} +1 -1
- package/dist/m/plugins/{live-DF5YS5AH.js → live-J52JO243.js} +1 -1
- package/dist/m/plugins/{menu-ESEFQARM.js → menu-KCCEDUMJ.js} +1 -1
- package/dist/m/plugins/{page-GZSU77JS.js → page-F7JG3JZX.js} +2 -2
- package/dist/m/plugins/{page-view-7MM3FEAR.js → page-view-QPRXXAT3.js} +1 -1
- package/dist/m/plugins/{people-EBWE337I.js → people-FEMXINJK.js} +1 -1
- package/dist/m/plugins/{richclay-MXH2GFAZ.js → richclay-XL64ZGOZ.js} +2 -2
- package/dist/m/plugins/{sortable-BAG3MSWS.js → sortable-HE7Q4KKP.js} +1 -1
- package/dist/m/plugins/{source-OYHDXKTB.js → source-5RTLTD75.js} +1 -1
- package/dist/m/plugins/{undo-KLHAGV75.js → undo-5MFW3OD5.js} +1 -1
- package/dist/m/plugins/{upgrade-SZQJYEQQ.js → upgrade-ORK24FK6.js} +1 -1
- package/dist/m/plugins/{upload-NZET3DNQ.js → upload-YMBDWTLR.js} +1 -1
- package/dist/m/plugins/{visitor-drafts-ZE6PCAFP.js → visitor-drafts-DCVGLCBX.js} +2 -2
- package/dist/m/plugins/{visitor-drafts-owner-TLECTYWS.js → visitor-drafts-owner-QLF6IALP.js} +1 -1
- package/dist/m/plugins/{visitor-menu-5XY57JQA.js → visitor-menu-VNWJZ6PV.js} +1 -1
- package/dist/m/plugins/{wire-S5ATC4QI.js → wire-I3TDGBGZ.js} +1 -1
- package/dist/m/{reader-core-AHOAP5DH.js → reader-core-7JOVUCEQ.js} +2 -2
- package/dist/m/sync/{live-sync-RZQSDMZW.js → live-sync-2UYQQSD7.js} +1 -1
- package/dist/m/vendor/{sap-core.vendor-5TWOJYVM.js → sap-core.vendor-UYOHDPAV.js} +1 -1
- package/dist/offline-manifest.json +388 -388
- package/entries/sap.js +1 -1
- package/package.json +1 -1
- package/src/core/mode-receipt.js +7 -5
- package/src/vendor/sap-core.vendor.js +1 -1
- package/dist/m/c-C7SUMNMI.js +0 -1
- package/dist/m/manifest-7954CBE3.js +0 -1
- /package/dist/m/plugins/{richclay-MXH2GFAZ.js.LEGAL.txt → richclay-XL64ZGOZ.js.LEGAL.txt} +0 -0
package/entries/sap.js
CHANGED
|
@@ -7,7 +7,7 @@ var Sap=(()=>{var xe=Object.defineProperty;var Sr=Object.getOwnPropertyDescripto
|
|
|
7
7
|
${t}`:`"use strict"; return (${t});`;n={fn:Re.length?new Function(...Re,`return function(${Te}){${o}
|
|
8
8
|
}`)(...dn):new Function(...Te,o),src:t,statement:e,deps:qr(t),error:null,waits:Vt(t)}}catch(o){n={fn:null,src:t,statement:e,deps:{state:new Set,item:new Set},error:o,waits:null}}return n.waits||Bt.set(r,n),n}function et(t,e){return H(t,e.state,e.item,e.el??null,e.root)}function H(t,e,r,n,o){if(t.error)throw t.error;return t.fn(e,r,n,o,tt,K,Ne,on,sn,an,un,cn,ln)}function bn(t){let e=new Map;for(let s of t)e.set(s.name,s);let r=[],n=new Map,o=[];function i(s){let g=n.get(s.name);if(g!==1){if(g===0){let k=[...o.slice(o.indexOf(s.name)),s.name].join(" -> "),h=new Error(`calc: cycle: ${k}`);throw h.sapCode="E07",h.cycle=k,h}n.set(s.name,0),o.push(s.name);for(let k of s.entry.deps.state){let h=e.get(k);h&&h!==s&&i(h)}for(let k of s.entry.deps.item){let h=e.get(k);h&&h!==s&&i(h)}o.pop(),n.set(s.name,1),r.push(s)}}for(let s of t)i(s);return r}var qt={},ft=null,An=!0,ue=!1;function ce(){qt={}}function vn(t){let e=ue;return ft?Oe(ft.takeRecords()):An&&Hr(),ue=!!ft&&t.getRootNode()===document,e}function En(t){ue=t}function At(){ft&&Oe(ft.takeRecords())}function Hr(){if(typeof document>"u"||typeof MutationObserver!="function"){An=!1;return}ft=new MutationObserver(Oe),ft.observe(document,{attributes:!0,childList:!0,subtree:!0})}function Oe(t){for(let e of t)if(e.type==="attributes")gn(e.target);else if(e.addedNodes.length&&!(e.target.nodeType===1&>(e.target)))for(let r of e.addedNodes)r.nodeType===1&&Y(r,gn)}function gn(t){t._sapPlan&&(t._sapPlan=null)}function X(t){if(!ue)return wn(t);let e=t._sapPlan;return e&&e.gen===qt?e:t._sapPlan=wn(t)}function nt(t,e,r){let n=G(e,r);return n.waits&&(t.waits=n.waits),n}function wn(t){let e={gen:qt,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,waits:null,wants:null,ext:!1,impure:!1};for(let n of t.attributes){let o=n.name,i=n.value,s=o.indexOf(":");if(s<0){switch(o){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,e.waits=Vt(i)||e.waits;break;case"each":e.each=!0,e.waits=Vt(i)||Vt(t.getAttribute("key"))||e.waits;break;case"bind":e.bind=i;break;case"transient":e.transient=!0;break;case"state":e.decls=B(i);break;case"text":(e.paints||(e.paints=[])).push({kind:"text",fmt:null,entry:nt(e,i)});break;case"show":(e.paints||(e.paints=[])).push({kind:"show",entry:nt(e,i)});break;case"effect":(e.effects||(e.effects=[])).push({entry:nt(e,i,!0)});break;case"invalid":(e.invalids||(e.invalids=[])).push({entry:nt(e,i)});break;default:yn(e,o,"",i)}continue}let g=o.slice(0,s),k=o.slice(s+1);switch(g){case"calc":(e.calcs||(e.calcs=[])).push({name:k,entry:nt(e,i)});break;case"text":(e.paints||(e.paints=[])).push({kind:"text",fmt:k,entry:nt(e,i)});break;case"attr":(e.paints||(e.paints=[])).push({kind:"attr",arg:k,entry:nt(e,i)});break;case"class":(e.paints||(e.paints=[])).push({kind:"class",arg:k,entry:nt(e,i)});break;case"css":(e.paints||(e.paints=[])).push({kind:"css",arg:k,entry:nt(e,i)});break;case"show-when":case"option":(e.paints||(e.paints=[])).push({kind:"when",match:"show",field:k,values:i.split("|")});break;case"hide-when":(e.paints||(e.paints=[])).push({kind:"when",match:"hide",field:k,values:i.split("|")});break;case"option-not":(e.paints||(e.paints=[])).push({kind:"when",match:"show-not",field:k,values:i.split("|")});break;default:yn(e,g+":",k,i)}}let r=Ot(t);return e.boundary=e.scope?"scope":e.items?"items":e.detail?"detail":e.each?"each":r?r.name:null,r&&!r.installed&&(e.wants||=[]).push(r.plugin),Ur(e)?zr():e}function yn(t,e,r,n){let o=Je(e);if(!o)return;if(!o.parse){(t.wants||=[]).push(o.plugin);return}let i=o.parse(r,n);i!==void 0&&((t[o.key]||(t[o.key]=[])).push(i),t.ext=!0,o.impure&&(t.impure=!0),i&&i.entry&&i.entry.waits&&(t.waits=i.entry.waits))}var ae=null;function zr(){return(!ae||ae.gen!==qt)&&(ae=Object.freeze({gen:qt,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,waits:null,wants:null,ext:!1,impure:!1})),ae}function Ur(t){return!t.inert&&!t.item&&t.boundary===null&&t.bind===null&&!t.transient&&!t.decls&&!t.calcs&&!t.paints&&!t.effects&&!t.invalids&&!t.wants&&!t.ext}var Et=new WeakMap,xt=new WeakMap,vt=null,at=!1;function kn(){Et=new WeakMap,xt=new WeakMap}function xn(t){for(let e of t){let r=e.target.nodeType===1?e.target:e.target.parentElement;for(let o=r;o;o=o.parentElement)xt.delete(o);if(e.type==="attributes"){Et.delete(e.target);continue}for(let o=r;o;o=o.parentElement)Et.delete(o);let n=e.addedNodes;if(!(!n||!n.length||r&>(r)))for(let o of n)o.nodeType===1&&Y(o,Gr)}}function Gr(t){Et.delete(t),xt.delete(t)}function Sn(){return at}function $n(t){return at?xt.get(t):void 0}function _n(t,e){at&&xt.set(t,e)}function kt(t){xt.delete(t)}function Nn(t){let e=at;return!vt&&typeof MutationObserver=="function"&&(vt=new MutationObserver(xn),vt.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})),vt&&xn(vt.takeRecords()),at=!!vt&&t.getRootNode()===document,e}function Tn(t){at=t}function Rn(t){let e=Et.get(t);return e||Et.set(t,e={attrs:new Map,hasText:!1,text:""}),e}function Ln(t,e){if(!at)return t.getAttribute(e);let r=Rn(t);return r.attrs.has(e)||r.attrs.set(e,t.getAttribute(e)),r.attrs.get(e)}function Cn(t){if(!at)return t.textContent;let e=Rn(t);return e.hasText||(e.text=t.textContent,e.hasText=!0),e.text}function On(t){return(t.getAttribute("type")||"text").toLowerCase()}function St(t){let e=t.tagName;if(e==="INPUT"){let r=On(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 Pn(t,e=t){let r=t.tagName;if(r==="INPUT"){let n=On(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(`
|
|
9
9
|
`)?`
|
|
10
|
-
`+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 i=0;i<n.length;i++)o[i]&&o[i].selected?n[i].hasAttribute("selected")||n[i].setAttribute("selected",""):n[i].removeAttribute("selected")}}function le(t){t.tagName!=="TEXTAREA"||!t.hasAttribute("data-value")||t!==t.ownerDocument.activeElement&&(t.textContent=t.getAttribute("data-value"),t.removeAttribute("data-value"))}function W(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 Dn(){let t=W("visitorDrafts");return!!(t&&typeof t.restored=="function"&&t.restored()?.restored)}var Pe=["clay:mutation-ready","hyperclay:mutation-ready"],Yr=["clay:sync-applied","hyperclay:livesync-applied"],Kr=["clay:ready","hyperclay:ready"],Xr=["clay:route"],Jr=["clay:modechange"];function Ht(t,e,r){let n=null,o=i=>{n!==null&&n!==i.type||(n=i.type,queueMicrotask(()=>{n=null}),r(i))};for(let i of e)t.addEventListener(i,o);return()=>{for(let i of e)t.removeEventListener(i,o)}}function Fn(t){let e=typeof window<"u"&&window.clay&&window.clay.ready;e&&typeof e.then=="function"?e.then(()=>t(),()=>t()):t()}function fe(t){let e=W("region");return!e||typeof e.resolveRegionPolicy!="function"||typeof e.skipForPolicy!="function"?!1:e.skipForPolicy(e.resolveRegionPolicy(t),void 0,["no-save","freeze"])}function zt(){return typeof window>"u"?null:window.clay?.modeLifecycle||null}function I(t,{transient:e=!1}={}){if(e)return!0;let r=zt();return typeof r?.canWrite!="function"||W("region")?.resolveRegionPolicy?.(t)?.persist==="none"?!0:r.canWrite()}function Mn(){let t=W("consent");return typeof t=="function"?t:null}function In(t,e){if(typeof e!="function")throw new Error("Sap.batch(label, fn): fn must be a function");let r=W("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 Wn(t){if(typeof window>"u"||typeof document>"u")return;let e=()=>{let p=!1;for(let R of t.apps())R.root.isConnected?t.runNow(R,"platform"):p=!0;p&&t.pruneDisconnected(),t.remountIfPresent()},r=W("derived"),n=r&&typeof r.register=="function"?r.register(e):null,o=typeof n=="function"?null:Ht(document,Yr,e),i=Ht(document,Xr,e),s=null,g=!1,k=()=>{let p=s;s=null,p&&(p[2](),p[3]())},h=()=>{if(g)return!1;let p=W("undo"),R=zt()?.state?.generation;if(s&&s[0]===p&&s[1]===R)return!0;if(k(),!p||typeof p.on!="function")return!1;let D=p.on("undo",e);if(typeof D!="function")return!1;let f=p.on("redo",e);return typeof f!="function"?(D(),!1):(s=[p,R,D,f],!0)};h();let l=[Pe,Kr,Jr].map(p=>Ht(document,p,h)),d=W("ready");return d&&typeof d.then=="function"&&d.then(h,()=>{}),()=>{g=!0,typeof n=="function"&&n(),o&&o(),i();for(let p of l)p();k()}}function Ut(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 Qr(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 Bn(t,e){switch(e){case"checkbox":return t.checked;case"radio":return t.checked?t.value:void 0;case"number":return Qr(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 jn(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 De(t){if(t.hasAttribute("transient")){t.removeAttribute("value"),t.removeAttribute("checked"),t.removeAttribute("data-value");return}fe(t)||St(t)}function Zr(t){t.dispatchEvent(new Event("input",{bubbles:!0})),t.dispatchEvent(new Event("change",{bubbles:!0}))}function de(t,e){return Bn(t,e)}function Vn(t,e,r){jn(t,e,r),De(t)}function q(t){let e=Ut(t);return{el:t,kind:e,read(){return Bn(t,e)},write(r,n={}){jn(t,e,r),n.noMirror||De(t),n.silent||Zr(t)},mirror(){De(t)}}}var to=[],Q=null,pe=0,Me=null,me=!1,$t=null;function qn(t){let e=null;return{kind:"hub",flush(){t.pause(),t.resume()},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 eo(){let t=null,e=null;function r(){let n=t?t.takeRecords():to;n.length&&e(Hn(n))}return{kind:"native",flush:r,subscribe(n){e=n,t=new MutationObserver(i=>n(Hn(i)));let o=document.body||document.documentElement;o&&t.observe(o,{childList:!0,subtree:!0,attributes:!0,characterData:!0})},suppress(n,o){let i=W("undo");o&&r(),i&&i.pause&&i.pause();try{return n()}finally{t&&t.takeRecords(),i&&i.resume&&i.resume()}},teardown(){t&&(t.disconnect(),t=null)}}}function Hn(t){let e=[];for(let r of t)if(r.type==="attributes"){let n=r.target;n&&n.nodeType===1&&!Gt(n)&&e.push({type:"attribute",element:n,attribute:r.attributeName})}else if(r.type==="characterData"){let n=r.target&&r.target.parentElement;n&&!Gt(n)&&e.push({type:"characterData",element:n})}else if(r.type==="childList"){let n=r.target;n.nodeType===1&&[...r.addedNodes,...r.removedNodes].some(i=>i.nodeType===3)&&!Gt(n)&&e.push({type:"characterData",element:n});let o=r.addedNodes.length>0&&n.nodeType===1&>(n);for(let i of r.addedNodes)i.nodeType!==1||Gt(i)||(o?e.push({type:"add",element:i,parent:n}):Y(i,s=>{(s===i||!Gt(s))&&e.push({type:"add",element:s,parent:n})}));for(let i of r.removedNodes)i.nodeType===1&&e.push({type:"remove",element:i,parent:n})}return e}function Gt(t){return!!(t.closest&&t.closest("[sap-ignore],[template],[cms-template]"))}function no(t,e){t.pruneDisconnected();let r=new Map,n=!1;for(let o of e){let i=o.type==="remove"?o.parent:o.element,s=i&&t.appFor(i);if(s){let g=r.get(s);g?g.push(o):r.set(s,[o])}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&&(Me=t.remountIfPresent,pe?queueMicrotask(Ie):Ie());for(let[o,i]of r)o.root.isConnected&&t.schedule(o,"mutation",i)}function Ie(){let t=Me;Me=null,t?.()}function _t(t){if(Q){let r=!pe++;try{return Q.suppress(t,r)}finally{pe--}}let e=W("undo");if(e&&e.pause&&e.resume){e.pause();try{return t()}finally{e.resume()}}return t()}function Fe(t,e){me=!0,Q=t,t.subscribe(r=>no(e,r))}function We(t){if(me||typeof window>"u"||typeof document>"u")return;let e=W("Mutation");if(e&&typeof e.onAnyChange=="function"){Fe(qn(e),t);return}typeof MutationObserver=="function"&&(Fe(eo(),t),$t=Ht(document,Pe,function(){let n=W("Mutation");n&&($t(),$t=null,Q&&Q.teardown(),me=!1,Fe(qn(n),t))}))}function Be(){if(Q)try{Q.teardown()}catch{}$t&&typeof document<"u"&&$t(),Q=null,me=!1,$t=null}function zn(){pe||(Q&&Q.flush(),Ie())}var ro=new Set(ht),Yt=Object.freeze([]),rt=[],Gn={},Yn={},je=null;function he(t){rt.includes(t)||(rt.push(t),rt.sort((e,r)=>(e.order??100)-(r.order??100)),t.boundary&&Object.assign(Gn,t.boundary),t.paintKinds&&Object.assign(Yn,t.paintKinds))}function Kn(t){je=t}function Nt(t,e={}){if(e.breaker){t.diag.error("E26",t.root,{problem:"recompute loop halted after 50 passes; recent triggers: "+(t._breakerRing||[]).join(", ")}),z(t.root,"loop");return}e.full&&(ce(),kn()),t._inPass=!0;let r=vn(t.root),n=null;try{_t(()=>{n=oo(t,e)})}finally{t._inPass=!1,En(r)}je&&n&&je(t,n),t._viewsChanged&&(t._viewsChanged=!1,t.root.dispatchEvent(new CustomEvent("sap:views-updated",{bubbles:!0})))}function oo(t,e){let r=t.root,n={},o=[],i=[],s=new Set;t.diag.errors=[];let g=e.full||t._changes===!1?null:t._changes||Yt;t._changes=null;let k=new Set,h=new Map,l=(m,a)=>m.map(A=>h.get(A)?.push(a)??h.set(A,[a])),d={root:n,state:n,item:null,ownerEl:r,projection:!1},p=null;function R(m,a,A=!1){let S=a.attr||a.name,_=A?Ln(m,S):m.getAttribute(S);return _==null&&(_=Ft(a),i.push({el:m,name:a.name,attr:S,value:$e(ut(_,a.type),a.type)})),ut(_,a.type)}function D(m,a,A,S){let _=a.decls;if(!_)return;let T=!!S.item&&!S.projection&&!S.view;for(let F of _){if(F.transient){p&&(p.pure=!1),A[F.name]=ie(m,F);continue}if(it(m,F)){A[F.name]=m.hasAttribute(F.attr);continue}A[F.name]=R(m,F,T)}}function f(m,a,A){let S=a.bind,_=A.item||A.state,T=Ut(m);p&&(T!=="leaf"||a.transient)&&(p.pure=!1),T==="radio"?(S in _||(_[S]=""),m.checked&&(_[S]=m.value)):T==="leaf"&&A.item&&!A.projection&&!A.view?_[S]=Cn(m):_[S]=de(m,T),a.transient&&(m.removeAttribute("value"),m.removeAttribute("checked"))}function y(m,a,A){let S=!1;if(a.waits&&k.add(a.waits),a.wants&&(l(a.wants,m),S=!0),p&&a.impure&&(p.pure=!1),a.paints){S=!0;for(let _ of a.paints)_.kind==="when"&&s.add(_.field),o.push({def:_,el:m,ctx:A})}for(let _ of rt)_.collect&&_.collect(N,m,a,A)!==!1&&(S=!0);p&&S&&(a.calcs&&(p.pure=!1),p.collects.push(m,a))}function b(m,a,A){Object.defineProperty(m,"$key",{value:ee(a,"row"),enumerable:!1}),Object.defineProperty(m,"$index",{value:A,enumerable:!1,configurable:!0}),Object.defineProperty(m,"$el",{value:a,enumerable:!1})}function v(m,a,A){let S=X(m);D(m,S,a,A),m._sapScope=a,!A.projection&&S.bind!=null&&f(m,S,A),y(m,S,A),S.items?E(m,a,A):$(m,a,A)}function $(m,a,A){for(let S=m.firstElementChild;S;S=S.nextElementSibling)c(S,a,A)}function c(m,a,A){let S=X(m);if(!S.inert){if(S.boundary){if(p&&(p.pure=!1),S.boundary==="scope")u(m,a,A);else if(S.boundary==="items")y(m,S,A),E(m,a,A);else if(S.waits)k.add(S.waits);else{let _=Gn[S.boundary];_?_(N,m,S,a,A):S.wants&&l(S.wants,m)}return}!A.projection&&!A.view&&S.bind!=null&&f(m,S,A),y(m,S,A);for(let _=m.firstElementChild;_;_=_.nextElementSibling)c(_,a,A)}}function u(m,a,A){let S=m.getAttribute("scope"),_={};a[S]=_;let T={root:A.root,state:_,item:null,ownerEl:m,projection:A.projection};v(m,_,T)}function E(m,a,A){p&&(p.pure=!1);let S=m.getAttribute("items"),_=[];a[S]=_,m._sapList=_;let T=!A.projection&&!A.view&&Sn(),F=0;for(let M=m.firstElementChild;M;M=M.nextElementSibling){let P=X(M);if(!P.item||P.template||P.cms)continue;let L=T?$n(M):void 0;_.push(L&&L.plan===P&&Object.isExtensible(L.obj)&&w(L,M,F,A)||x(M,P,F,A,T)),F++}}function x(m,a,A,S,_){let T={};b(T,m,A);let F={root:S.root,state:S.state,item:T,ownerEl:m,projection:S.projection};if(!_)return v(m,T,F),T;let M=p,P={plan:a,obj:T,fields:null,presence:Yt,pending:Yt,collects:[],pure:!0},L=i.length,ve=t.diag.errors.length;p=P;try{v(m,T,F)}finally{p=M}if(!P.pure||t.halted||t.diag.errors.length!==ve)return T;let dt=[];for(let pt of Object.keys(T)){let Ee=T[pt];if(Ee!==null&&typeof Ee=="object")return T;dt.push(pt,Ee)}if(a.decls)for(let pt of a.decls)it(m,pt)&&(P.presence===Yt?P.presence=[]:P.presence).push(pt.name,pt.attr);return i.length>L&&(P.pending=i.slice(L)),P.collects.length||(P.collects=Yt),P.fields=dt,_n(m,P),T}function w(m,a,A,S){let _=m.obj;try{_.$index!==A&&Object.defineProperty(_,"$index",{value:A,enumerable:!1,configurable:!0});let M=m.presence;for(let L=0;L<M.length;L+=2)_[M[L]]=a.hasAttribute(M[L+1]);let P=m.fields;for(let L=0;L<P.length;L+=2)_[P[L]]=P[L+1]}catch{return kt(a),null}a._sapScope=_;let T=m.pending;for(let M=0;M<T.length;M++)i.push(T[M]);let F=m.collects;if(F.length){let M={root:S.root,state:S.state,item:_,ownerEl:a,projection:S.projection};for(let P=0;P<F.length;P+=2)y(F[P],F[P+1],M)}return _}let N={app:t,root:r,rootObj:n,paints:o,stats:{calcs:0,lists:0},resolveDefault:R,collectEl:y,walkScope:$,changes:g,full:g===null,trigger:e.cause||e.trigger||"refresh",waiting:k,wanted:h};for(let m of rt)m.begin&&m.begin(N);let C=e.cacheReads===!1?null:Nn(r);try{v(r,n,d)}finally{e.cacheReads!==!1&&Tn(C)}if(t.halted||k.size)return N;for(let m of rt)m.afterIntake&&m.afterIntake(N);if(i.length&&s.size)for(let m of i)s.has(m.attr)&&m.el.getAttribute(m.attr)==null&&m.el.setAttribute(m.attr,m.value);for(let m of rt)m.compute&&m.compute(N);let O=0;for(let m of rt)m.reconcile&&(O+=m.reconcile(N));let j=0,V=O;for(let m of o){let a=ao(m,t);m.ctx.view?V+=a:j+=a}for(let m of rt)m.afterPaint&&m.afterPaint(N);return t._state=n,t._stats={fields:Object.keys(n).filter(m=>typeof n[m]!="function").length,calcs:N.stats.calcs,paints:o.length,lists:N.stats.lists,writes:j,viewWrites:V},t._viewsChanged=V>0,t._lastPass={trigger:e.trigger||"refresh",writes:j},t._debug&&console.log(`sap pass \xB7 trigger: ${t._lastPass.trigger} \xB7 writes ${j}/${o.length}`),N}function io(t){let e=t.kind==="text"?t.fmt||null:t.arg;return e==null?t.kind:t.kind+":"+e}function so(t,e,r,n){let o=t;for(;o&&o.nodeType===1;){if(o.hasAttribute&&o.hasAttribute(e)){let i=r.includes(o.getAttribute(e));if(n?!i:i)return!0}o=o.parentElement}return!1}function ao(t,e){let r=t.def,n=t.el,o=Yn[r.kind];if(o)return o(t,e);if(r.kind==="when")return Un(r,n,null);try{let i=H(r.entry,t.ctx.state,t.ctx.item,n,t.ctx.root),s=Un(r,n,i);return Z(n),s}catch(i){return e.diag.error(i.sapCode==="E22"?"E22":"E24",n,{attr:io(r),expr:r.entry&&r.entry.src,problem:String(i.message)}),z(n,i.sapCode||"E24"),0}}function Un(t,e,r){switch(t.kind){case"text":{let n=t.fmt!=null?fn(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=W("optionVisibility");if(n&&n._started)return e._sapWhen&&e.hidden?(e.hidden=!1,e._sapWhen=!1,1):0;e._sapWhen=!0;let o=so(e,t.field,t.values,t.match==="show-not")===(t.match==="hide");return e.hidden!==o?(e.hidden=o,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 i=0;return e[n]!==!!r&&(e[n]=!!r,i=1),!!r!==e.hasAttribute(n)&&(r?e.setAttribute(n,""):e.removeAttribute(n),i=1),i}if(ro.has(n)){let i=e.hasAttribute(n);return r&&!i?(e.setAttribute(n,""),1):!r&&i?(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 uo=new Set(ht),Xn=new Set(["calc","text","attr","class","css","set","move","sort","option","option-not","show-when","hide-when","editmode","viewmode"]),co=new Set(["show-when","hide-when","option","option-not"]),lo=/\b(?:state|item|root)\.|===|!==|&&|\|\||[()]|^\s*!/,Jn=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"]),qe=[];function be(t){qe.includes(t)||qe.push(t)}function fo(t){return t.tagName==="INPUT"||t.tagName==="SELECT"||t.tagName==="TEXTAREA"}function Ve(t){return t.hasAttribute("bind")}function po(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}if(e(n),!bt(n))for(let o=n.firstElementChild;o;o=o.nextElementSibling)r(o)}}}function ge(t,e){let r=!1,n=(s,g,k)=>{e.error(s,g,k),r=!0},o=t.ownerDocument.createTreeWalker(t,5,{acceptNode:s=>s.nodeType===3?1:bt(s)||s.hasAttribute("bind")||s.hasAttribute("sap-ignore")?2:3}),i;for(;i=o.nextNode();)if(/\{\{.*\}\}/.test(i.nodeValue||"")){n("E02",i.parentElement||t,{problem:"moustaches in text content are not a Sap feature",fix:'move the expression onto the element: text="state.x"'});break}return po(t,s=>{let g=new Set;for(let h of qe)h(s,n,l=>g.add(l));let k=s.closest&&s.closest("[detail]");for(let h of[...s.attributes]){let l=h.name;if(g.has(l))continue;if(l.includes(":")){let p=l.slice(0,l.indexOf(":"));if(!Xn.has(p)&&!ke(l)){let R=Rt(p,[...Xn]);e.warn("W03",s,{attr:l,problem:`unknown "${p}:" attribute`,didYouMean:R?`${R}:`:null})}else if(co.has(p)&&lo.test(h.value)){let R=l.slice(l.indexOf(":")+1);e.warn("W04",s,{attr:l,expr:h.value,problem:`${p}: compares the "${R}" attribute against a literal value, not a JS expression`,fix:`use show="${h.value}" for an expression, or a literal like ${p}:${R}="overview"`})}}else if(!Jn.has(l)&&!ke(l)&&!Tt.has(l)&&!uo.has(l)&&!/^(data-|aria-|on)/.test(l)&&!(l in s)){let p=Rt(l,[...Jn]);p&&e.warn("W03",s,{attr:l,problem:`unknown "${l}" attribute`,didYouMean:p})}l==="attr:hidden"&&e.warn("W03",s,{attr:l,problem:"attr:hidden paints the wrong attribute",fix:'use show="expr"'});let d=Ve(s)||l==="attr:selected"&&s.tagName==="OPTION"&&!!s.closest("select[bind]");(l==="attr:value"||l==="attr:checked"||l==="attr:selected")&&d&&n("E30",s,{attr:l,problem:"attr: on a bound control collides with persist ownership",fix:"remove it; bind owns this attribute"}),l==="effect"&&Ve(s)&&/\b(value|checked)\s*=[^=]/.test(h.value)&&n("E30",s,{attr:l,expr:h.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"}),(l==="text"||l.startsWith("text:")||l==="show")&&fo(s)&&(l==="show"||n("E18",s,{attr:l,problem:"paint belongs on output elements, not form controls",fix:"move the paint to an <output> or <span>"}))}if(s.hasAttribute("state")){let h=B(s.getAttribute("state")),l=new Set;for(let d of h){d.name.includes("-")&&n("E08",s,{attr:"state",problem:`field "${d.name}" is not a valid identifier (the hyphen parses as subtraction)`,fix:`rename to ${d.name.replace(/-/g,"")}`}),l.has(d.name)&&n("E04",s,{attr:"state",problem:`field "${d.name}" is declared twice in one scope`}),l.add(d.name),Jt.has(d.attr)&&n("E05",s,{attr:"state",problem:`"${d.name}" is a reserved Sap word`}),Tt.has(d.attr)&&n("E06",s,{attr:"state",problem:`"${d.name}" is a global HTML attribute name; pick another field name`}),d.name==="open"&&s.tagName==="DIALOG"&&n("E33",s,{attr:"state",problem:"dialog open is transient",fix:"use showModal() \u2014 declare state= only on <details> or popovers"});let p=_e(s,d.attr);p&&(d.attr==="checked"||d.attr==="selected")&&n("E35",s,{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",s,{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",s,{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(Ve(s)){if(s.hasAttribute("-"),s.tagName==="INPUT"){let h=(s.getAttribute("type")||"text").toLowerCase();h==="file"&&n("E32",s,{attr:"bind",problem:"files never serialize into an HTML file",fix:"use no-save + effect instead of bind"}),h==="password"&&!s.hasAttribute("transient")&&n("E31",s,{attr:"bind",problem:"a password must never serialize into a world-readable file",fix:"add transient to the password input"})}else if(s.tagName!=="SELECT"&&s.tagName!=="TEXTAREA"){let h=s.getAttribute("contenteditable");!(h!=null&&h!=="false")&&s.children.length>0&&n("E20",s,{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(s.hasAttribute("transient")&&s.hasAttribute("persist")&&n("E34",s,{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"}),s.tagName==="DIALOG"&&s.hasAttribute("detail")&&!(s.parentElement&&s.parentElement.closest('[clay~="freeze"], [freeze], [save-freeze]'))&&e.warn("W31",s,{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'}),s.hasAttribute("item")&&!s.hasAttribute("template")&&s.parentNode&&s.parentNode.nodeType===1){let h=s.parentElement;(!h||!h.hasAttribute("items"))&&n("E10",s,{problem:"an [item] must be a direct child of an [items] list",fix:'wrap it in a container with items="name"'})}if(s.hasAttribute("items")&&k&&n("E17",s,{attr:"items",problem:"nested items inside a detail panel is a v1 mount error (nested collections ship in v1.1)"}),s.hasAttribute("items")){let h=t.querySelector(`[trigger-add="${s.getAttribute("items")}"]`);!oe(s)&&!Se(t,s.getAttribute("items"))&&ot(s).length===0&&h&&n("E17",s,{attr:"items",problem:`trigger-add targets items="${s.getAttribute("items")}" but it has no [item template] to clone`})}}),r&&(e.halted=!0,e.haltReason=e.errors[0]?e.errors[0].code:"halt",z(t,e.haltReason)),!r}var Qn="sap-styles",Zn="[item][template]{display:none!important}[hidden]{display:none!important}[sap-error]{outline:2px solid #e5484d;outline-offset:1px}",He=new WeakSet;function mo(t){if(He.has(t))return;let e=t.defaultView,r=e&&e.CSSStyleSheet;if(r&&"adoptedStyleSheets"in t)try{let n=new r;n.replaceSync(Zn),t.adoptedStyleSheets=[...t.adoptedStyleSheets,n],He.add(t);return}catch{}if(!t.getElementById(Qn)){let n=t.createElement("style");n.id=Qn,n.textContent=Zn,(t.head||t.documentElement).appendChild(n)}He.add(t)}var ho=0;function tr(){return typeof performance<"u"&&performance.now?performance.now():0}function ze(t){let e=t.id||t.getAttribute("sap")||`app-${ho++}`,r=new mt(e),n={root:t,name:e,diag:r,_state:null,_stats:null,_lastPass:null,_passes:0,_broken:!1,_mountMs:0,_mountWrites:0};if(!ge(t,r))return n.halted=!0,n;mo(t.ownerDocument);for(let s of t.querySelectorAll("textarea[data-value]"))Pt(s)||le(s);let i=tr();return Nt(n,{trigger:"mount",full:!0}),n._mountMs=tr()-i,n._mountWrites=n._stats?n._stats.writes:0,n._mountWrites>0&&!Dn()&&!W("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 bo=/^(set:|move:|sort:|trigger-add$|trigger-remove$|trigger-reset$)/;function we(t){return`${t.tagName.toLowerCase()}[sap]`}function go(t){let e={actions:0,lists:0,rows:0};return Y(t,r=>{r.hasAttribute("items")&&e.lists++,r!==t&&r.hasAttribute("item")&&!r.hasAttribute("template")&&e.rows++,[...r.attributes].some(n=>bo.test(n.name))&&e.actions++}),e}function er(t){function e(s){let g=s._stats||{},k=s.root;return{root:we(k),fields:g.fields||0,calcs:g.calcs||0,paints:g.paints||0,...go(k),warnings:s.diag.warnings.length,errors:s.diag.errors.length,mountWrites:s._mountWrites||0,ms:Math.round((s._mountMs||0)*10)/10,passes:s._passes||0,lastPass:s._lastPass||null,ok:s.diag.errors.length===0&&!s.halted}}function r(){let s=t.apps().map(e);return{ok:s.every(g=>g.ok),apps:s}}function n(s){let g=e(s);return g.ok?`sap \u2713 ${g.root} \xB7 fields ${g.fields} \xB7 calcs ${g.calcs} \xB7 paints ${g.paints} \xB7 actions ${g.actions} \xB7 lists ${g.lists} \xB7 rows ${g.rows} \xB7 warnings ${g.warnings} \xB7 mount writes ${g.mountWrites} \xB7 ${g.ms}ms`:`sap \u2717 ${g.root} \xB7 errors ${g.errors} \xB7 warnings ${g.warnings} \xB7 ${g.ms}ms`}function o(){let s=[],g=[];for(let k of t.apps())s.push(...k.diag.errors),g.push(...k.diag.warnings);return{ok:s.length===0,errors:s,warnings:g,counts:{errors:s.length,warnings:g.length}}}function i(s){let g=s===void 0?!0:!!s;for(let k of t.apps())k._debug=g;return console.log(`sap debug ${g?"on":"off"} \u2014 per-pass headers will ${g?"":"no longer "}log`),g}return{status:r,report:o,debug:i,greenLine:n}}var Kt="0.9.1";var nr={};var wo=/^(https:\/\/(?:cdn\.jsdelivr\.net\/npm|unpkg\.com)\/@panphora\/sapjs)(?=[@/]|$)/,rr=t=>new Promise(e=>setTimeout(e,t)),or=t=>t.getAttribute("plugins")?.match(/\S+/g)||[];function ir(t,e,r){let n=new Map,o=new Map,i=new Map,s=new Map,g=[],k=new Set,h={},l=!1,d,p=globalThis,R=Array.isArray(p.sapPlugins)?p.sapPlugins:p.sapPlugins==null?p.sapPlugins=[]:[],D=p.document?.currentScript?.src||"",f=wo.exec(D),y=a=>o.get(a)?.api||null,b=a=>Promise.allSettled(a.map(O));function v(){let a=new Map;for(let A of n.values())if(!o.has(A.name))for(let S of A.helpers||[])a.set(S,A.name);mn(h,a),ce()}function $(a){n.set(a.name,{...n.get(a.name),...a}),Ye(a),v()}function c(a){n.has(a.name)||$(a)}function u(a){R.includes(a)||R.push(a),$(a)}function E(a){for(let A of t.apps())A.root.isConnected&&t.schedule(A,a)}let x=Object.freeze({api:1,version:Kt,compile:G,run:et,runWith:H,planOf:X,drainPlans:At,forgetRow:kt,setBeacon:z,clearBeacon:Z,write:_t,schedule(a,A="plugin"){let S=a?.root?a:t.appFor(a);S&&t.schedule(S,A)},appFor:t.appFor,apps:t.apps,capability:W,mayWrite:I,load:O,plugin:y});function w(a){if(typeof a=="string")return O(a);let{name:A,api:S}=a,_=L=>{throw new Error(`Sap.use: plugin "${A}" ${L}`)};if((typeof A!="string"||S!==1)&&_(`needs a name and plugin API ${1}; it gives API ${S}`),l)return null;if(o.has(A))return y(A);if((a.requires||[]).some(L=>!o.has(L)))return u(a),g.includes(a)||g.push(a),null;let T=a.setup?.(x)||{},F=(L,ve)=>{for(let dt of Array.isArray(a[L])?a[L]:Object.keys(a[L]||{}))(typeof(T[L]||{})[dt]!="function"||ve(dt))&&_(`cannot add "${dt}" to ${L}: the name is taken or not valid, or setup does not supply it`)},M=L=>!te(L,A);F("helpers",L=>(Le(L)&&_(`cannot add "${L}": window.${L} exists; rename the helper`),!hn(L)||L in h)),F("boundaries",M),F("directives",M);for(let L in T.api)L in e&&_(`cannot add Sap.${L}: the name is taken`);u(a);let P={...T,name:A,order:a.order,boundary:{}};for(let L in a.boundaries)P.boundary[L]=T.boundaries[L];for(let L of a.helpers||[])h[L]=T.helpers[L];for(let L in T.formats)L in tt||(tt[L]=T.formats[L]);return he(P),T.lint&&be(T.lint),Object.assign(e,T.api),o.set(A,P),s.delete(A),Ke(A,T.directives||!0),v(),_t(()=>k.forEach(Z)),k.clear(),g.splice(0).forEach(N),E("plugin:"+A),y(A)}function N(a){try{w(a)}catch(A){console.error(A)}}function C(a){if(l||o.has(a))return null;let A=n.get(a)||{},S=V.loader?.(a,A),_=A.url||V.base&&V.base+(A.file||a)+".js";return(S!==void 0?Promise.resolve(S):new Promise((F,M)=>{if(!_)throw new Error(`no address for plugin "${a}": call Sap.use(definition)`);let P=document.createElement("script");P.src=_,P.setAttribute("clay","editor-ui"),P.onload=P.onerror=L=>{P.remove(),L.type==="load"?F():M(new Error("could not load "+_))},document.head.append(P)})).then(F=>{if(l)return;let M=F?.default||F||R.find(P=>P.name===a);if(M?.name&&w(M),!o.has(a))throw new Error(`plugin "${a}" loaded and did not register`)})}function O(a){if(o.has(a))return Promise.resolve(y(a));if(i.has(a))return i.get(a);s.delete(a);let A=Promise.all((n.get(a)?.requires||[]).map(O)).then(()=>C(a));for(let _ of V.retryDelays)A=A.catch(()=>rr(_).then(()=>C(a)));let S=A.finally(()=>i.delete(a)).then(()=>y(a),_=>{throw s.set(a,_),d||=!p.addEventListener?.("online",()=>V.retry()),E("plugin-failed:"+a),document.dispatchEvent(new CustomEvent("sap:plugin-failed",{detail:{plugin:a,error:_}})),_});return i.set(a,S),S}function j(a){let A=new Set;for(let S of a.closest?.("[sap]")?[a]:a.querySelectorAll("[sap]")){for(let _ of or(S.closest("[sap]")))A.add(_);n.size>o.size&&Y(S,_=>{let T=X(_);return T.inert?!1:(T.wants?.map(F=>A.add(F)),!!A.add(T.waits))})}return[...A].filter(S=>S&&!o.has(S))}Kn((a,A)=>{for(let S of new Set([...A.wanted.keys(),...A.waiting,...or(a.root)])){if(o.has(S))continue;let _=s.get(S);if(!_)O(S).catch(()=>{});else{let T=A.wanted.get(S)?.[0]||a.root;a.diag.error("E52",T,{problem:`the "${S}" plugin did not load: ${_.message}`,fix:"Sap.plugins.retry() tries again"}),k.add(T),_t(()=>z(T,"E52"))}}});let V={api:1,base:f?`${f[1]}@${Kt}/dist/sap-plugins/`:/^[^:]+:\//.test(D)?new URL("sap-plugins/",D).href:null,loader:null,retryDelays:[1e3,4e3],declare:c,load:O,ready(a=document,A=3e3){let S=new Set,_=()=>{let F=j(a).filter(M=>!S.has(M)&&S.add(M));return F.length&&b(F).then(_)},T=_();return T?Promise.race([T,rr(A)]):null},has:a=>o.has(a),status:()=>({installed:[...o.keys()],loading:[...i.keys()],failed:[...s.keys()]}),retry:a=>b(a?[a]:[...s.keys()])};function m(){let a=[],A=()=>(zn(),r.flushNow()),S=[...o.values()].filter(_=>_.flush);A();for(let _=0;S.length&&_<8;_++){for(let T of S){let F=T.flush();F?.then&&a.push(F)}if(!A())break}return a.length?Promise.all(a).then(m):null}e.use=w,e.plugins=V,e.flush=m;for(let a of Object.values(nr))c(a);return R.slice().forEach(N),function(){l=!0;for(let A of o.values())A.dispose?.();o.clear(),s.clear()}}function sr({createAccessor:t,installInput:e,debugExtras:r}){let n=new Map,o=[],i=Ue(Nt);function s(x){let w=x;for(;w;){if(w.nodeType===1&&w.hasAttribute&&w.hasAttribute("sap"))return n.get(w)||null;w=w.parentNode&&w.parentNode.host?w.parentNode.host:w.parentElement}return null}function g(){for(let x=o.length-1;x>=0;x--){let w=o[x];w.root.isConnected||(n.delete(w.root),o.splice(x,1))}}function k(x,w){if(x.moveBefore)try{x.moveBefore(w,null);return}catch{}x.appendChild(w)}function h(x,w){let N=w.parentElement;if(N){if(N.moveBefore)try{N.moveBefore(x,w);return}catch{}N.insertBefore(x,w)}}let l={apps:()=>o.slice(),appFor:s,isRegistered:x=>n.has(x),pruneDisconnected:g,schedule:i.schedule,runNow:(x,w)=>i.runNow(x,w),moveInto:k,placeBefore:h,remountIfPresent:()=>$()},d=t(l),p=er(l),R=r?r(l,p):{},D=!1,f=!1,y=null;function b(){D||(D=!0,e(l,d,document),y=Wn(l))}function v(){let x=W("derived");x&&typeof x.mounted=="function"&&x.mounted()}function $(x=document){if(f)return[];b(),We(l);let w=x.querySelectorAll("[sap]"),N=[];for(let C of w){if(n.has(C)||Pt(C))continue;let O=ze(C);n.set(C,O),o.push(O),N.push(O)}for(let C of N){let O=p.greenLine(C);C.diag.errors.length||C.halted?console.error(O):console.log(O)}return v(),N}function c(x){if(f)return null;if(b(),We(l),!x)return $();let w=typeof x=="string"?document.querySelector(x):x;if(!w)return null;if(n.has(w))return n.get(w);let N=ze(w);n.set(w,N),o.push(N);let C=p.greenLine(N);return N.diag.errors.length||N.halted?console.error(C):console.log(C),N}let u=d.Sap;u.version=Kt,u.refresh=function(){for(let w of o.slice())w.root.isConnected&&i.runNow(w,"refresh")},u.batch=In,u.status=p.status,u.report=p.report,u.why=R.why,u.debug=p.debug,u.doctor=R.doctor,u.greenLine=p.greenLine,u.formats=tt,u.serializeControlToAttributes=St,u.finalizeControlForSave=Pn,u.rehydrateControlFromAttributes=le,u.mount=c,u.config=function(w={}){return w.formats&&Object.assign(tt,w.formats),u},u._registry=n,u._reset=function(){n.clear(),o.length=0,Be()},u.unmount=function(){f=!0,n.clear(),o.length=0,Be(),typeof y=="function"&&y(),E()};let E=ir(l,u,i);return{Sap:u,mountAll:$,mount:c,runtime:l}}function ar(t){if(typeof document>"u")return;let e=()=>Fn(()=>t());document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e):e()}var yo=["for","form","list","headers","popovertarget","commandfor","anchor","aria-activedescendant","aria-controls","aria-describedby","aria-details","aria-errormessage","aria-flowto","aria-labelledby","aria-owns"];function Ao(t,e){let r=null;return J(t,n=>{!r&&n.getAttribute("scope")===e&&(r=n)}),r}function ur(t,e,r){let n=U(t)||e;for(;n;){for(let o of B(n.getAttribute("state")||""))if(o.name===r)return{el:n,decl:o};if(n.hasAttribute("sap"))break;n=U(n.parentElement)}return null}function vo(t){return typeof t=="number"?"num":typeof t=="boolean"?"bool":"string"}function cr(t){function e(f){let y=t.appFor(f);if(!y)return null;let b=ct(f),v=b&&b._sapEachItem&&b._sapEachItem.$el;if(v&&v.isConnected)return{ctxEl:v,appRec:y,isRow:!0};let $=Dt(f);if($)return $._sapDetailRow?{ctxEl:$._sapDetailRow,appRec:y,isRow:!0}:{ctxEl:U($.parentElement)||y.root,appRec:y,isRow:!1};let c=ne(f);if(c&&c.hasAttribute("item"))return{ctxEl:c,appRec:y,isRow:!0};let u=U(f)||y.root;return{ctxEl:u,appRec:y,isRow:u.hasAttribute("item")}}function r(f){let y=typeof f=="string"?document.querySelector(f):f;if(!y||y.nodeType!==1)return null;let b=e(y);return b?D(b.ctxEl,b.appRec,b.isRow):null}function n(f,y){let b=ct(f);if(!b)return r(f);let v=t.appFor(f),$=b._sapEachItem&&b._sapEachItem.$el;if($&&$.nodeType===1&&$.hasAttribute("item")&&yt($,y))return $.isConnected?D($,v,!0):null;let c=b.parentElement&&b.parentElement._sapDrawnEl;return!c||!c.isConnected?null:D(c,v,c.hasAttribute("item"))}function o(f,y,b){let v=lt(f,b);if(v)return q(v).read();let $=wt(f,b);if($)return ot($).map(x=>D(x,y,!0));let c=Ao(f,b);if(c)return D(c,y,!1);let u=ur(f,y.root,b);if(u)return u.decl.transient?ie(u.el,u.decl):en(u.el,u.decl);let E=f._sapScope;return E?E[b]:void 0}function i(f,y,b,v,$){v.transient?It(f,v,b):Mt(f,v,b),t.schedule($,"set:"+y)}function s(f,y){let b=new Set,v=U(f)||y;for(;v;){for(let $ of B(v.getAttribute("state")||""))b.add($.name);if(v.hasAttribute("sap"))break;v=U(v.parentElement)}return J(f,$=>{let c=$.getAttribute("bind");c&&b.add(c)}),b}function g(f,y,b,v){let $=lt(f,b);if($){if(!I($))return;q($).write(v);return}let c=f;for(;c;){for(let j of c.attributes)if(j.name==="calc:"+b){y.diag.error("E16",c,{attr:"calc:"+b,problem:`"${b}" is a computed field; computed fields are read-only`});return}if(c.hasAttribute("sap"))break;c=c.parentElement}let u=ur(f,y.root,b);if(u){if(!I(u.el,{transient:u.decl.transient}))return;i(u.el,b,v,u.decl,y);return}let E=s(f,y.root);E.delete(b);let x=b.length>=4?Rt(b,[...E]):null;if(x){y.diag.error("E12",f,{key:b,problem:`unknown state key "${b}"`,didYouMean:x});return}if(Jt.has(b)||Tt.has(b)){y.diag.error("E15",f,{key:b,problem:`cannot write undeclared field "${b}" \u2014 it is a reserved/global name and cannot become state`,fix:"pick a different field name, or declare it explicitly in a state= attribute"});return}let w=y.root;if(!I(w))return;let N=vo(v),C=w.getAttribute("state")||"",O=N==="string"?b:`${b}:${N}`;w.setAttribute("state",C?`${C} ${O}`:O),i(w,b,v,{name:b,attr:b,type:N,transient:!1},y)}function k(f){let y=f.ownerDocument,b=new Map,v=($,c)=>{let u=Ze(y),E=$.getAttribute(c);E&&c==="id"&&b.set(E,u),$.setAttribute(c,u)};f.querySelectorAll("[id]").forEach($=>v($,"id")),f.querySelectorAll("[data-id]").forEach($=>v($,"data-id")),f.querySelectorAll("[sap-error]").forEach($=>$.removeAttribute("sap-error")),f.removeAttribute("sap-error"),f.hasAttribute("data-id")?(f.removeAttribute("id"),v(f,"data-id")):v(f,"id");for(let $ of[f,...f.querySelectorAll("*")])for(let c of yo){let u=$.getAttribute(c);if(u==null)continue;let E=u.split(/\s+/).map(x=>b.get(x)||x).join(" ");E!==u&&$.setAttribute(c,E)}}function h(f,y,b){let v=Wt(y.root,f,b);if(!v)return y.diag.error("E17",f,{problem:`cannot resolve a list named "${b}" from here`}),null;if(!I(v))return null;let $=oe(v);if(!$)return y.diag.error("E17",v,{problem:`items="${b}" has no [item template] to clone`}),null;let c=v.ownerDocument.importNode($,!0);return c.removeAttribute("template"),k(c),v.appendChild(c),t.schedule(y,"trigger-add:"+b),D(c,y,!0)}function l(f,y){let b=B(f.getAttribute("state")||""),v=!0;J(f,$=>{$.hasAttribute("bind")&&!I($)&&(v=!1)});for(let $ of b)I(f,{transient:$.transient})||(v=!1);if(v){J(f,$=>{if($.hasAttribute("bind")){let c=q($),u=$.getAttribute("default");c.kind==="checkbox"||c.kind==="radio"?c.write(u!=null?u===""||u==="true"||$.value===u:$.hasAttribute("checked")):c.write(u??($.getAttribute("value")||""))}});for(let $ of b){let c=nn(f,$);$.transient?It(f,$,c):Mt(f,$,c)}t.schedule(y,"trigger-reset")}}function d(f,y){if(!f.isConnected)throw new Error("stale row handle: $remove() on a removed row");I(f)&&(f.remove(),t.schedule(y,"trigger-remove"))}function p(f,y,b){if(!f.isConnected)throw new Error("stale row handle: $move() on a removed row");let v=null;if(b&&b.nodeType===1?v=b:typeof b=="string"&&(v=Wt(y.root,f,b)),!v){y.diag.error("E17",f,{problem:`$move() cannot resolve target "${b}"`});return}!I(f)||!I(v)||(t.moveInto(v,f),t.schedule(y,"trigger-move"))}function R(f){let y=f.parentElement;return y?ot(y).indexOf(f):-1}function D(f,y,b){let v={get $el(){return f},get $key(){return ee(f,b?"row":"scope")},get $index(){return R(f)},$add(c){return h(f,y,c)},$reset(){return l(f,y),$},$remove(){d(f,y)},$move(c){p(f,y,c)},get $appRec(){return y}},$=new Proxy(v,{get(c,u){return typeof u=="symbol"||u[0]==="$"?c[u]:o(f,y,u)},set(c,u,E){return typeof u=="string"&&u[0]==="$"?(c[u]=E,!0):(g(f,y,u,E),!0)},has(c,u){return typeof u=="string"&&u[0]==="$"?u in c:o(f,y,u)!==void 0}});return $}return{Sap:r,contextElFor:e,readField:o,writeField:g,makeProxy:D,writeTargetFor:n}}var Eo=["trigger-add","trigger-remove","trigger-reset"];function xo(t){if(t.nodeType!==1)return!1;for(let e of t.attributes){let r=e.name;if(r.startsWith("set:")||r.startsWith("move:")||r.startsWith("sort:")||Eo.includes(r))return!0}return!1}function ko(t,e){let r=t,n=e.parentElement;for(;r&&r!==n;){if(r.nodeType===1&&xo(r)&&!(r.tagName==="FORM"&&r.hasAttribute("trigger-add")))return r;r=r.parentElement}return null}function lr(t,e){let{Sap:r}=e;function n(c,u){let E=null,x=ct(c),w=Dt(c);if(x)E=x._sapEachItem??null;else if(w&&w._sapDetailRow)E=w._sapDetailRow._sapScope||null;else{let O=ne(c);O&&O.hasAttribute("item")&&(E=O._sapScope||null)}return{state:(U(c)||u.root)._sapScope||u._state||{},item:E,el:c,root:u._state||{}}}function o(c,u,E){if(!c.hasAttribute("confirm")){E();return}let x=c.getAttribute("confirm"),w=x,N=G(x);if(!N.error)try{let m=et(N,n(c,u));(typeof m=="string"||typeof m=="number")&&(w=String(m))}catch{}let C=zt(),O=()=>{zt()===C&&E()},j=Mn();if(!j){window.confirm(w)&&O();return}if(c._sapGatePending)return;c._sapGatePending=!0;let V=()=>{c._sapGatePending=!1};j(w,()=>{V(),O()}).catch(V)}function i(c,u){for(let E of c.attributes){if(!E.name.startsWith("set:"))continue;let x=E.name.slice(4),w=G(E.value);if(w.error){u.diag.error("E08",c,{attr:E.name,expr:E.value,problem:String(w.error.message)});continue}let N;try{N=et(w,n(c,u))}catch(O){u.diag.error("E24",c,{attr:E.name,expr:E.value,problem:String(O.message)});continue}let C=e.writeTargetFor(c,x);C&&(C[x]=N)}}function s(c){let u=ct(c);if(!u)return c.closest("[item]");let E=u._sapEachItem&&u._sapEachItem.$el;return E&&E.nodeType===1&&E.hasAttribute("item")?E:null}function g(c,u){let E=s(c);if(!E||!I(E)||!I(E.parentElement))return;let x=ot(E.parentElement),w=x.indexOf(E);u==="up"&&w>0?t.placeBefore(E,x[w-1]):u==="down"&&w<x.length-1&&t.placeBefore(x[w+1],E)}function k(c,u,E){if(u)return Wt(E.root,c,u);let x=c;for(;x;){if(x.hasAttribute&&x.hasAttribute("items"))return x;x=x.parentElement}let w=U(c)||E.root,N=[];return J(w,C=>{C.hasAttribute("items")&&N.push(C)}),N[0]||null}function h(c,u){let E=c==null||c==="",x=u==null||u==="";if(E&&x)return 0;if(E)return 1;if(x)return-1;let w=Number(c),N=Number(u);return!Number.isNaN(w)&&!Number.isNaN(N)?w-N:String(c)<String(u)?-1:String(c)>String(u)?1:0}function l(c,u,E,x){let w=k(c,E,x);if(!w){x.diag.error("E17",c,{attr:"sort:"+u,problem:`no items list resolvable for sort:${u}`});return}if(!I(w))return;let N=ot(w),C=m=>m._sapScope?m._sapScope[u]:void 0,O=[...N].sort((m,a)=>h(C(m),C(a))),V=O.every((m,a)=>m===N[a])?[...O].reverse():O;for(let m of V)t.moveInto(w,m);t.schedule(x,"sort:"+u)}function d(c){if(!c||c.hidden)return;let u=c.querySelector("[bind]:not([type=hidden]), [contenteditable]");u&&typeof u.focus=="function"&&u.focus()}function p(c,u){o(c,u,()=>{let E=r(c);for(let x of[...c.attributes]){let w=x.name;if(w==="trigger-remove")E&&E.$remove();else if(w==="trigger-reset")E&&E.$reset();else if(w==="trigger-add"){let N=E&&E.$add(x.value);N&&d(N.$el)}else w==="move:up"?(g(c,"up"),t.schedule(u,"move:up")):w==="move:down"?(g(c,"down"),t.schedule(u,"move:down")):w.startsWith("move:to")?E&&E.$move(x.value):w.startsWith("sort:")&&l(c,w.slice(5),x.value,u)}[...c.attributes].some(x=>x.name.startsWith("set:"))&&i(c,u)})}function R(c){let u=c.target;if(!u||u.nodeType!==1)return;let E=t.appFor(u);if(!E)return;let x=ko(u,E.root);x&&p(x,E)}function D(c){let u=q(c),E=c.getAttribute("default");u.kind==="checkbox"?u.write(E===""||E==="true"):u.write(E??"")}function f(c,u,E){let x=r(c);if(!x)return;let w=x.$add(E);if(!w)return;let N=[];J(c,C=>{C.hasAttribute("bind")&&N.push(C)});for(let C of N){if(C.type==="radio"&&!C.checked)continue;let O=C.getAttribute("bind"),j=lt(w.$el,O);j?q(j).write(q(C).read()):yt(w.$el,O)&&(w[O]=q(C).read())}N.forEach(D),N.length?typeof N[0].focus=="function"&&N[0].focus():d(w.$el)}function y(c){let u=c.target;if(!u||!u.hasAttribute||!u.hasAttribute("trigger-add"))return;let E=t.appFor(u);E&&(c.preventDefault(),o(u,E,()=>f(u,E,u.getAttribute("trigger-add"))))}function b(c){let u=c.target;if(!u||u.tagName!=="DIALOG"||!u.hasAttribute("detail"))return;if(u._sapEngineClose){u._sapEngineClose=!1;return}if(u.open)return;let E=/^[\w.]+\s+by\s+state\.(\w+)\s*$/.exec(u.getAttribute("detail")||""),x=t.appFor(u);if(!E||!x)return;let w=B(u.getAttribute("state")||"").find(C=>C.name===E[1]);if(w){if(!I(u,{transient:w.transient}))return;w.transient?It(u,w,""):Mt(u,w,""),t.schedule(x,"close");return}let N=r(u.parentElement);N&&N[E[1]]!==""&&(N[E[1]]="")}function v(c,u){let E=c.hasAttribute("bind")&&re(c);if(!E&&c.hasAttribute("bind")&&ct(c)){let w=c.getAttribute("bind"),N=c._sapViewBind?e.writeTargetFor(c,w):null;return N&&(N[w]=q(c).read()),!0}let x=Dt(c);if(x&&x._sapDetailRow&&c.hasAttribute("bind")&&!E){let w=x._sapDetailRow,N=c.getAttribute("bind"),C=lt(w,N);if(C&&C!==c)return I(C)&&q(C).write(q(c).read()),!0;if(!C&&B(w.getAttribute("state")||"").some(O=>O.name===N))return e.writeField(w,u,N,q(c).read()),!0}return!1}function $(c=document){c.addEventListener("click",R),c.addEventListener("submit",y),c.addEventListener("close",b,!0)}return{install:$,routeInput:v}}function fr(t){let e=[];function r(k){let h=k.target;if(!h||h.nodeType!==1)return;let l=t.appFor(h);if(l){h.hasAttribute("persist")&&!fe(h)&&I(h)&&St(h);for(let d of e)if(d(h,l))return;t.schedule(l,k.type+" "+(h.id||h.tagName.toLowerCase()))}}function n(k){let h=k.target,l=t.appFor(h);l&&[...h.querySelectorAll("[bind]")].every(d=>I(d))&&setTimeout(()=>{h.querySelectorAll("[bind]").forEach(d=>{d.dispatchEvent(new Event("input",{bubbles:!0})),d.dispatchEvent(new Event("change",{bubbles:!0}))}),t.schedule(l,"reset")},0)}function o(k){let h=t.appFor(k.target);h&&t.schedule(h,"toggle")}function i(k){let h=k.detail||{};for(let l of[h.from,h.to,k.target]){if(!l||l.nodeType!==1)continue;let d=t.appFor(l);d&&t.schedule(d,"sorted")}}function s(k){if(k.key!=="ArrowUp"&&k.key!=="ArrowDown")return;let h=k.target;if(!h||h.nodeType!==1||h.tagName!=="INPUT"||!h.hasAttribute("bind")||!h.hasAttribute("step"))return;let l=(h.getAttribute("type")||"text").toLowerCase();if(l!=="text"&&l!=="tel"&&l!=="search"||!t.appFor(h)||!I(h))return;k.preventDefault();let p=K(h.getAttribute("step"))||1,R=k.key==="ArrowUp"?1:-1,D=K(h.value)+p*(k.shiftKey?10:1)*R,f=h.getAttribute("min"),y=h.getAttribute("max");f!==null&&f!==""&&D<K(f)&&(D=K(f)),y!==null&&y!==""&&D>K(y)&&(D=K(y)),q(h).write(String(Number(D.toFixed(2))))}function g(k=document){k.addEventListener("reset",n),k.addEventListener("toggle",o,!0),k.addEventListener("input",r),k.addEventListener("change",r),k.addEventListener("clay:sorted",i),k.addEventListener("keydown",s)}return{install:g,addRouter:k=>e.push(k)}}function dr(t){let e=t.toLowerCase();return/^x-text$|^x-html$/.test(e)?'use text="state.x" (Sap paints text only)':/^x-show$|^v-show$|^v-if$/.test(e)?'use show="expr" (toggles native hidden)':/^x-model$|^v-model$/.test(e)?'use bind="field"':/^@|^x-on:|^v-on:|^on:/.test(e)?"use native onclick + Sap(this) (no event directive)":/^:|^x-bind:class$|^v-bind:class$/.test(e)?'use class:NAME="expr" or attr:NAME="expr"':/^x-for$|^v-for$/.test(e)?'use items="name" on the container and item template on the row':/^x-data$/.test(e)?"declare state with state= / bind / items (no JS state object)":/^x-init$/.test(e)?"use a <script> or onclick + Sap(this)":/^bind:/.test(e)?'use bind="field"; one-way paint is attr:NAME="expr"':/^x-/.test(e)||/^v-/.test(e)?"this is a foreign-dialect attribute; Sap has no x-/v- attributes":null}function pr(t){let e=[],r=n=>{for(let o of n.attributes){let i=o.name;(i.startsWith("calc:")||i==="text"||i.startsWith("text:")||i==="show"||i.startsWith("attr:")||i.startsWith("class:")||i.startsWith("css:")||i==="effect"||i==="invalid"||i.startsWith("set:")||i==="detail")&&e.push({el:n,attr:i,src:o.value})}};r(t);for(let n of t.querySelectorAll("*"))r(n);return e}function mr(t){function e(o){return o?typeof o=="string"?document.querySelector(o):o.nodeType===1?o:null:null}function r(o,i){let s=e(o);if(!s)return console.warn("sap why: element not found"),null;let g=[`sap why <${s.tagName.toLowerCase()}> \u2014 ${Qt(s)}`],k=[...s.attributes].filter(l=>/^(bind|text|show|effect|invalid|detail|calc:|text:|attr:|class:|css:|set:|state|items|scope)/.test(l.name));for(let l of k)g.push(` ${l.name}="${l.value}"`);let h=s;for(;h&&!h._sapScope;)h=h.parentElement;if(h&&h._sapScope){let l=h._sapScope,d=i?[i]:Object.keys(l);g.push(" reads:");for(let p of d){let R=l[p];typeof R!="function"&&g.push(` ${p} = ${JSON.stringify(Array.isArray(R)?`[${R.length} rows]`:R)}`)}}return g.push(" serialization: textContent and value/checked attributes save with the file; reads live from properties"),console.log(g.join(`
|
|
10
|
+
`+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 i=0;i<n.length;i++)o[i]&&o[i].selected?n[i].hasAttribute("selected")||n[i].setAttribute("selected",""):n[i].removeAttribute("selected")}}function le(t){t.tagName!=="TEXTAREA"||!t.hasAttribute("data-value")||t!==t.ownerDocument.activeElement&&(t.textContent=t.getAttribute("data-value"),t.removeAttribute("data-value"))}function W(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 Dn(){let t=W("visitorDrafts");return!!(t&&typeof t.restored=="function"&&t.restored()?.restored)}var Pe=["clay:mutation-ready","hyperclay:mutation-ready"],Yr=["clay:sync-applied","hyperclay:livesync-applied"],Kr=["clay:ready","hyperclay:ready"],Xr=["clay:route"],Jr=["clay:modechange"];function Ht(t,e,r){let n=null,o=i=>{n!==null&&n!==i.type||(n=i.type,queueMicrotask(()=>{n=null}),r(i))};for(let i of e)t.addEventListener(i,o);return()=>{for(let i of e)t.removeEventListener(i,o)}}function Fn(t){let e=typeof window<"u"&&window.clay&&window.clay.ready;e&&typeof e.then=="function"?e.then(()=>t(),()=>t()):t()}function fe(t){let e=W("region");return!e||typeof e.resolveRegionPolicy!="function"||typeof e.skipForPolicy!="function"?!1:e.skipForPolicy(e.resolveRegionPolicy(t),void 0,["no-save","freeze"])}function zt(){return typeof window>"u"?null:window.clay?.modeLifecycle||null}function I(t,{transient:e=!1}={}){if(e)return!0;let r=zt();return typeof r?.canWrite!="function"||W("region")?.resolveRegionPolicy?.(t)?.persist==="none"?!0:r.canWrite()}function Mn(){let t=W("consent");return typeof t=="function"?t:null}function In(t,e){if(typeof e!="function")throw new Error("Sap.batch(label, fn): fn must be a function");let r=W("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 Wn(t){if(typeof window>"u"||typeof document>"u")return;let e=()=>{let p=!1;for(let R of t.apps())R.root.isConnected?t.runNow(R,"platform"):p=!0;p&&t.pruneDisconnected(),t.remountIfPresent()},r=W("derived"),n=r&&typeof r.register=="function"?r.register(e):null,o=typeof n=="function"?null:Ht(document,Yr,e),i=Ht(document,Xr,e),s=null,g=!1,k=()=>{let p=s;s=null,p&&(p[2](),p[3]())},h=()=>{if(g)return!1;let p=W("undo"),R=zt()?.state?.generation;if(s&&s[0]===p&&s[1]===R)return!0;if(k(),!p||typeof p.on!="function")return!1;let D=p.on("undo",e);if(typeof D!="function")return!1;let f=p.on("redo",e);return typeof f!="function"?(D(),!1):(s=[p,R,D,f],!0)};h();let l=[Pe,Kr,Jr].map(p=>Ht(document,p,h)),d=W("ready");return d&&typeof d.then=="function"&&d.then(h,()=>{}),()=>{g=!0,typeof n=="function"&&n(),o&&o(),i();for(let p of l)p();k()}}function Ut(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 Qr(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 Bn(t,e){switch(e){case"checkbox":return t.checked;case"radio":return t.checked?t.value:void 0;case"number":return Qr(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 jn(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 De(t){if(t.hasAttribute("transient")){t.removeAttribute("value"),t.removeAttribute("checked"),t.removeAttribute("data-value");return}fe(t)||St(t)}function Zr(t){t.dispatchEvent(new Event("input",{bubbles:!0})),t.dispatchEvent(new Event("change",{bubbles:!0}))}function de(t,e){return Bn(t,e)}function Vn(t,e,r){jn(t,e,r),De(t)}function q(t){let e=Ut(t);return{el:t,kind:e,read(){return Bn(t,e)},write(r,n={}){jn(t,e,r),n.noMirror||De(t),n.silent||Zr(t)},mirror(){De(t)}}}var to=[],Q=null,pe=0,Me=null,me=!1,$t=null;function qn(t){let e=null;return{kind:"hub",flush(){t.pause(),t.resume()},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 eo(){let t=null,e=null;function r(){let n=t?t.takeRecords():to;n.length&&e(Hn(n))}return{kind:"native",flush:r,subscribe(n){e=n,t=new MutationObserver(i=>n(Hn(i)));let o=document.body||document.documentElement;o&&t.observe(o,{childList:!0,subtree:!0,attributes:!0,characterData:!0})},suppress(n,o){let i=W("undo");o&&r(),i&&i.pause&&i.pause();try{return n()}finally{t&&t.takeRecords(),i&&i.resume&&i.resume()}},teardown(){t&&(t.disconnect(),t=null)}}}function Hn(t){let e=[];for(let r of t)if(r.type==="attributes"){let n=r.target;n&&n.nodeType===1&&!Gt(n)&&e.push({type:"attribute",element:n,attribute:r.attributeName})}else if(r.type==="characterData"){let n=r.target&&r.target.parentElement;n&&!Gt(n)&&e.push({type:"characterData",element:n})}else if(r.type==="childList"){let n=r.target;n.nodeType===1&&[...r.addedNodes,...r.removedNodes].some(i=>i.nodeType===3)&&!Gt(n)&&e.push({type:"characterData",element:n});let o=r.addedNodes.length>0&&n.nodeType===1&>(n);for(let i of r.addedNodes)i.nodeType!==1||Gt(i)||(o?e.push({type:"add",element:i,parent:n}):Y(i,s=>{(s===i||!Gt(s))&&e.push({type:"add",element:s,parent:n})}));for(let i of r.removedNodes)i.nodeType===1&&e.push({type:"remove",element:i,parent:n})}return e}function Gt(t){return!!(t.closest&&t.closest("[sap-ignore],[template],[cms-template]"))}function no(t,e){t.pruneDisconnected();let r=new Map,n=!1;for(let o of e){let i=o.type==="remove"?o.parent:o.element,s=i&&t.appFor(i);if(s){let g=r.get(s);g?g.push(o):r.set(s,[o])}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&&(Me=t.remountIfPresent,pe?queueMicrotask(Ie):Ie());for(let[o,i]of r)o.root.isConnected&&t.schedule(o,"mutation",i)}function Ie(){let t=Me;Me=null,t?.()}function _t(t){if(Q){let r=!pe++;try{return Q.suppress(t,r)}finally{pe--}}let e=W("undo");if(e&&e.pause&&e.resume){e.pause();try{return t()}finally{e.resume()}}return t()}function Fe(t,e){me=!0,Q=t,t.subscribe(r=>no(e,r))}function We(t){if(me||typeof window>"u"||typeof document>"u")return;let e=W("Mutation");if(e&&typeof e.onAnyChange=="function"){Fe(qn(e),t);return}typeof MutationObserver=="function"&&(Fe(eo(),t),$t=Ht(document,Pe,function(){let n=W("Mutation");n&&($t(),$t=null,Q&&Q.teardown(),me=!1,Fe(qn(n),t))}))}function Be(){if(Q)try{Q.teardown()}catch{}$t&&typeof document<"u"&&$t(),Q=null,me=!1,$t=null}function zn(){pe||(Q&&Q.flush(),Ie())}var ro=new Set(ht),Yt=Object.freeze([]),rt=[],Gn={},Yn={},je=null;function he(t){rt.includes(t)||(rt.push(t),rt.sort((e,r)=>(e.order??100)-(r.order??100)),t.boundary&&Object.assign(Gn,t.boundary),t.paintKinds&&Object.assign(Yn,t.paintKinds))}function Kn(t){je=t}function Nt(t,e={}){if(e.breaker){t.diag.error("E26",t.root,{problem:"recompute loop halted after 50 passes; recent triggers: "+(t._breakerRing||[]).join(", ")}),z(t.root,"loop");return}e.full&&(ce(),kn()),t._inPass=!0;let r=vn(t.root),n=null;try{_t(()=>{n=oo(t,e)})}finally{t._inPass=!1,En(r)}je&&n&&je(t,n),t._viewsChanged&&(t._viewsChanged=!1,t.root.dispatchEvent(new CustomEvent("sap:views-updated",{bubbles:!0})))}function oo(t,e){let r=t.root,n={},o=[],i=[],s=new Set;t.diag.errors=[];let g=e.full||t._changes===!1?null:t._changes||Yt;t._changes=null;let k=new Set,h=new Map,l=(m,a)=>m.map(A=>h.get(A)?.push(a)??h.set(A,[a])),d={root:n,state:n,item:null,ownerEl:r,projection:!1},p=null;function R(m,a,A=!1){let S=a.attr||a.name,_=A?Ln(m,S):m.getAttribute(S);return _==null&&(_=Ft(a),i.push({el:m,name:a.name,attr:S,value:$e(ut(_,a.type),a.type)})),ut(_,a.type)}function D(m,a,A,S){let _=a.decls;if(!_)return;let T=!!S.item&&!S.projection&&!S.view;for(let F of _){if(F.transient){p&&(p.pure=!1),A[F.name]=ie(m,F);continue}if(it(m,F)){A[F.name]=m.hasAttribute(F.attr);continue}A[F.name]=R(m,F,T)}}function f(m,a,A){let S=a.bind,_=A.item||A.state,T=Ut(m);p&&(T!=="leaf"||a.transient)&&(p.pure=!1),T==="radio"?(S in _||(_[S]=""),m.checked&&(_[S]=m.value)):T==="leaf"&&A.item&&!A.projection&&!A.view?_[S]=Cn(m):_[S]=de(m,T),a.transient&&(m.removeAttribute("value"),m.removeAttribute("checked"))}function y(m,a,A){let S=!1;if(a.waits&&k.add(a.waits),a.wants&&(l(a.wants,m),S=!0),p&&a.impure&&(p.pure=!1),a.paints){S=!0;for(let _ of a.paints)_.kind==="when"&&s.add(_.field),o.push({def:_,el:m,ctx:A})}for(let _ of rt)_.collect&&_.collect(N,m,a,A)!==!1&&(S=!0);p&&S&&(a.calcs&&(p.pure=!1),p.collects.push(m,a))}function b(m,a,A){Object.defineProperty(m,"$key",{value:ee(a,"row"),enumerable:!1}),Object.defineProperty(m,"$index",{value:A,enumerable:!1,configurable:!0}),Object.defineProperty(m,"$el",{value:a,enumerable:!1})}function v(m,a,A){let S=X(m);D(m,S,a,A),m._sapScope=a,!A.projection&&S.bind!=null&&f(m,S,A),y(m,S,A),S.items?E(m,a,A):$(m,a,A)}function $(m,a,A){for(let S=m.firstElementChild;S;S=S.nextElementSibling)c(S,a,A)}function c(m,a,A){let S=X(m);if(!S.inert){if(S.boundary){if(p&&(p.pure=!1),S.boundary==="scope")u(m,a,A);else if(S.boundary==="items")y(m,S,A),E(m,a,A);else if(S.waits)k.add(S.waits);else{let _=Gn[S.boundary];_?_(N,m,S,a,A):S.wants&&l(S.wants,m)}return}!A.projection&&!A.view&&S.bind!=null&&f(m,S,A),y(m,S,A);for(let _=m.firstElementChild;_;_=_.nextElementSibling)c(_,a,A)}}function u(m,a,A){let S=m.getAttribute("scope"),_={};a[S]=_;let T={root:A.root,state:_,item:null,ownerEl:m,projection:A.projection};v(m,_,T)}function E(m,a,A){p&&(p.pure=!1);let S=m.getAttribute("items"),_=[];a[S]=_,m._sapList=_;let T=!A.projection&&!A.view&&Sn(),F=0;for(let M=m.firstElementChild;M;M=M.nextElementSibling){let P=X(M);if(!P.item||P.template||P.cms)continue;let L=T?$n(M):void 0;_.push(L&&L.plan===P&&Object.isExtensible(L.obj)&&w(L,M,F,A)||x(M,P,F,A,T)),F++}}function x(m,a,A,S,_){let T={};b(T,m,A);let F={root:S.root,state:S.state,item:T,ownerEl:m,projection:S.projection};if(!_)return v(m,T,F),T;let M=p,P={plan:a,obj:T,fields:null,presence:Yt,pending:Yt,collects:[],pure:!0},L=i.length,ve=t.diag.errors.length;p=P;try{v(m,T,F)}finally{p=M}if(!P.pure||t.halted||t.diag.errors.length!==ve)return T;let dt=[];for(let pt of Object.keys(T)){let Ee=T[pt];if(Ee!==null&&typeof Ee=="object")return T;dt.push(pt,Ee)}if(a.decls)for(let pt of a.decls)it(m,pt)&&(P.presence===Yt?P.presence=[]:P.presence).push(pt.name,pt.attr);return i.length>L&&(P.pending=i.slice(L)),P.collects.length||(P.collects=Yt),P.fields=dt,_n(m,P),T}function w(m,a,A,S){let _=m.obj;try{_.$index!==A&&Object.defineProperty(_,"$index",{value:A,enumerable:!1,configurable:!0});let M=m.presence;for(let L=0;L<M.length;L+=2)_[M[L]]=a.hasAttribute(M[L+1]);let P=m.fields;for(let L=0;L<P.length;L+=2)_[P[L]]=P[L+1]}catch{return kt(a),null}a._sapScope=_;let T=m.pending;for(let M=0;M<T.length;M++)i.push(T[M]);let F=m.collects;if(F.length){let M={root:S.root,state:S.state,item:_,ownerEl:a,projection:S.projection};for(let P=0;P<F.length;P+=2)y(F[P],F[P+1],M)}return _}let N={app:t,root:r,rootObj:n,paints:o,stats:{calcs:0,lists:0},resolveDefault:R,collectEl:y,walkScope:$,changes:g,full:g===null,trigger:e.cause||e.trigger||"refresh",waiting:k,wanted:h};for(let m of rt)m.begin&&m.begin(N);let C=e.cacheReads===!1?null:Nn(r);try{v(r,n,d)}finally{e.cacheReads!==!1&&Tn(C)}if(t.halted||k.size)return N;for(let m of rt)m.afterIntake&&m.afterIntake(N);if(i.length&&s.size)for(let m of i)s.has(m.attr)&&m.el.getAttribute(m.attr)==null&&m.el.setAttribute(m.attr,m.value);for(let m of rt)m.compute&&m.compute(N);let O=0;for(let m of rt)m.reconcile&&(O+=m.reconcile(N));let j=0,V=O;for(let m of o){let a=ao(m,t);m.ctx.view?V+=a:j+=a}for(let m of rt)m.afterPaint&&m.afterPaint(N);return t._state=n,t._stats={fields:Object.keys(n).filter(m=>typeof n[m]!="function").length,calcs:N.stats.calcs,paints:o.length,lists:N.stats.lists,writes:j,viewWrites:V},t._viewsChanged=V>0,t._lastPass={trigger:e.trigger||"refresh",writes:j},t._debug&&console.log(`sap pass \xB7 trigger: ${t._lastPass.trigger} \xB7 writes ${j}/${o.length}`),N}function io(t){let e=t.kind==="text"?t.fmt||null:t.arg;return e==null?t.kind:t.kind+":"+e}function so(t,e,r,n){let o=t;for(;o&&o.nodeType===1;){if(o.hasAttribute&&o.hasAttribute(e)){let i=r.includes(o.getAttribute(e));if(n?!i:i)return!0}o=o.parentElement}return!1}function ao(t,e){let r=t.def,n=t.el,o=Yn[r.kind];if(o)return o(t,e);if(r.kind==="when")return Un(r,n,null);try{let i=H(r.entry,t.ctx.state,t.ctx.item,n,t.ctx.root),s=Un(r,n,i);return Z(n),s}catch(i){return e.diag.error(i.sapCode==="E22"?"E22":"E24",n,{attr:io(r),expr:r.entry&&r.entry.src,problem:String(i.message)}),z(n,i.sapCode||"E24"),0}}function Un(t,e,r){switch(t.kind){case"text":{let n=t.fmt!=null?fn(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=W("optionVisibility");if(n&&n._started)return e._sapWhen&&e.hidden?(e.hidden=!1,e._sapWhen=!1,1):0;e._sapWhen=!0;let o=so(e,t.field,t.values,t.match==="show-not")===(t.match==="hide");return e.hidden!==o?(e.hidden=o,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 i=0;return e[n]!==!!r&&(e[n]=!!r,i=1),!!r!==e.hasAttribute(n)&&(r?e.setAttribute(n,""):e.removeAttribute(n),i=1),i}if(ro.has(n)){let i=e.hasAttribute(n);return r&&!i?(e.setAttribute(n,""),1):!r&&i?(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 uo=new Set(ht),Xn=new Set(["calc","text","attr","class","css","set","move","sort","option","option-not","show-when","hide-when","editmode","viewmode"]),co=new Set(["show-when","hide-when","option","option-not"]),lo=/\b(?:state|item|root)\.|===|!==|&&|\|\||[()]|^\s*!/,Jn=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"]),qe=[];function be(t){qe.includes(t)||qe.push(t)}function fo(t){return t.tagName==="INPUT"||t.tagName==="SELECT"||t.tagName==="TEXTAREA"}function Ve(t){return t.hasAttribute("bind")}function po(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}if(e(n),!bt(n))for(let o=n.firstElementChild;o;o=o.nextElementSibling)r(o)}}}function ge(t,e){let r=!1,n=(s,g,k)=>{e.error(s,g,k),r=!0},o=t.ownerDocument.createTreeWalker(t,5,{acceptNode:s=>s.nodeType===3?1:bt(s)||s.hasAttribute("bind")||s.hasAttribute("sap-ignore")?2:3}),i;for(;i=o.nextNode();)if(/\{\{.*\}\}/.test(i.nodeValue||"")){n("E02",i.parentElement||t,{problem:"moustaches in text content are not a Sap feature",fix:'move the expression onto the element: text="state.x"'});break}return po(t,s=>{let g=new Set;for(let h of qe)h(s,n,l=>g.add(l));let k=s.closest&&s.closest("[detail]");for(let h of[...s.attributes]){let l=h.name;if(g.has(l))continue;if(l.includes(":")){let p=l.slice(0,l.indexOf(":"));if(!Xn.has(p)&&!ke(l)){let R=Rt(p,[...Xn]);e.warn("W03",s,{attr:l,problem:`unknown "${p}:" attribute`,didYouMean:R?`${R}:`:null})}else if(co.has(p)&&lo.test(h.value)){let R=l.slice(l.indexOf(":")+1);e.warn("W04",s,{attr:l,expr:h.value,problem:`${p}: compares the "${R}" attribute against a literal value, not a JS expression`,fix:`use show="${h.value}" for an expression, or a literal like ${p}:${R}="overview"`})}}else if(!Jn.has(l)&&!ke(l)&&!Tt.has(l)&&!uo.has(l)&&!/^(data-|aria-|on)/.test(l)&&!(l in s)){let p=Rt(l,[...Jn]);p&&e.warn("W03",s,{attr:l,problem:`unknown "${l}" attribute`,didYouMean:p})}l==="attr:hidden"&&e.warn("W03",s,{attr:l,problem:"attr:hidden paints the wrong attribute",fix:'use show="expr"'});let d=Ve(s)||l==="attr:selected"&&s.tagName==="OPTION"&&!!s.closest("select[bind]");(l==="attr:value"||l==="attr:checked"||l==="attr:selected")&&d&&n("E30",s,{attr:l,problem:"attr: on a bound control collides with persist ownership",fix:"remove it; bind owns this attribute"}),l==="effect"&&Ve(s)&&/\b(value|checked)\s*=[^=]/.test(h.value)&&n("E30",s,{attr:l,expr:h.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"}),(l==="text"||l.startsWith("text:")||l==="show")&&fo(s)&&(l==="show"||n("E18",s,{attr:l,problem:"paint belongs on output elements, not form controls",fix:"move the paint to an <output> or <span>"}))}if(s.hasAttribute("state")){let h=B(s.getAttribute("state")),l=new Set;for(let d of h){d.name.includes("-")&&n("E08",s,{attr:"state",problem:`field "${d.name}" is not a valid identifier (the hyphen parses as subtraction)`,fix:`rename to ${d.name.replace(/-/g,"")}`}),l.has(d.name)&&n("E04",s,{attr:"state",problem:`field "${d.name}" is declared twice in one scope`}),l.add(d.name),Jt.has(d.attr)&&n("E05",s,{attr:"state",problem:`"${d.name}" is a reserved Sap word`}),Tt.has(d.attr)&&n("E06",s,{attr:"state",problem:`"${d.name}" is a global HTML attribute name; pick another field name`}),d.name==="open"&&s.tagName==="DIALOG"&&n("E33",s,{attr:"state",problem:"dialog open is transient",fix:"use showModal() \u2014 declare state= only on <details> or popovers"});let p=_e(s,d.attr);p&&(d.attr==="checked"||d.attr==="selected")&&n("E35",s,{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",s,{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",s,{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(Ve(s)){if(s.hasAttribute("-"),s.tagName==="INPUT"){let h=(s.getAttribute("type")||"text").toLowerCase();h==="file"&&n("E32",s,{attr:"bind",problem:"files never serialize into an HTML file",fix:"use no-save + effect instead of bind"}),h==="password"&&!s.hasAttribute("transient")&&n("E31",s,{attr:"bind",problem:"a password must never serialize into a world-readable file",fix:"add transient to the password input"})}else if(s.tagName!=="SELECT"&&s.tagName!=="TEXTAREA"){let h=s.getAttribute("contenteditable");!(h!=null&&h!=="false")&&s.children.length>0&&n("E20",s,{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(s.hasAttribute("transient")&&s.hasAttribute("persist")&&n("E34",s,{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"}),s.tagName==="DIALOG"&&s.hasAttribute("detail")&&!(s.parentElement&&s.parentElement.closest('[clay~="freeze"], [freeze], [save-freeze]'))&&e.warn("W31",s,{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'}),s.hasAttribute("item")&&!s.hasAttribute("template")&&s.parentNode&&s.parentNode.nodeType===1){let h=s.parentElement;(!h||!h.hasAttribute("items"))&&n("E10",s,{problem:"an [item] must be a direct child of an [items] list",fix:'wrap it in a container with items="name"'})}if(s.hasAttribute("items")&&k&&n("E17",s,{attr:"items",problem:"nested items inside a detail panel is a v1 mount error (nested collections ship in v1.1)"}),s.hasAttribute("items")){let h=t.querySelector(`[trigger-add="${s.getAttribute("items")}"]`);!oe(s)&&!Se(t,s.getAttribute("items"))&&ot(s).length===0&&h&&n("E17",s,{attr:"items",problem:`trigger-add targets items="${s.getAttribute("items")}" but it has no [item template] to clone`})}}),r&&(e.halted=!0,e.haltReason=e.errors[0]?e.errors[0].code:"halt",z(t,e.haltReason)),!r}var Qn="sap-styles",Zn="[item][template]{display:none!important}[hidden]{display:none!important}[sap-error]{outline:2px solid #e5484d;outline-offset:1px}",He=new WeakSet;function mo(t){if(He.has(t))return;let e=t.defaultView,r=e&&e.CSSStyleSheet;if(r&&"adoptedStyleSheets"in t)try{let n=new r;n.replaceSync(Zn),t.adoptedStyleSheets=[...t.adoptedStyleSheets,n],He.add(t);return}catch{}if(!t.getElementById(Qn)){let n=t.createElement("style");n.id=Qn,n.textContent=Zn,(t.head||t.documentElement).appendChild(n)}He.add(t)}var ho=0;function tr(){return typeof performance<"u"&&performance.now?performance.now():0}function ze(t){let e=t.id||t.getAttribute("sap")||`app-${ho++}`,r=new mt(e),n={root:t,name:e,diag:r,_state:null,_stats:null,_lastPass:null,_passes:0,_broken:!1,_mountMs:0,_mountWrites:0};if(!ge(t,r))return n.halted=!0,n;mo(t.ownerDocument);for(let s of t.querySelectorAll("textarea[data-value]"))Pt(s)||le(s);let i=tr();return Nt(n,{trigger:"mount",full:!0}),n._mountMs=tr()-i,n._mountWrites=n._stats?n._stats.writes:0,n._mountWrites>0&&!Dn()&&!W("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 bo=/^(set:|move:|sort:|trigger-add$|trigger-remove$|trigger-reset$)/;function we(t){return`${t.tagName.toLowerCase()}[sap]`}function go(t){let e={actions:0,lists:0,rows:0};return Y(t,r=>{r.hasAttribute("items")&&e.lists++,r!==t&&r.hasAttribute("item")&&!r.hasAttribute("template")&&e.rows++,[...r.attributes].some(n=>bo.test(n.name))&&e.actions++}),e}function er(t){function e(s){let g=s._stats||{},k=s.root;return{root:we(k),fields:g.fields||0,calcs:g.calcs||0,paints:g.paints||0,...go(k),warnings:s.diag.warnings.length,errors:s.diag.errors.length,mountWrites:s._mountWrites||0,ms:Math.round((s._mountMs||0)*10)/10,passes:s._passes||0,lastPass:s._lastPass||null,ok:s.diag.errors.length===0&&!s.halted}}function r(){let s=t.apps().map(e);return{ok:s.every(g=>g.ok),apps:s}}function n(s){let g=e(s);return g.ok?`sap \u2713 ${g.root} \xB7 fields ${g.fields} \xB7 calcs ${g.calcs} \xB7 paints ${g.paints} \xB7 actions ${g.actions} \xB7 lists ${g.lists} \xB7 rows ${g.rows} \xB7 warnings ${g.warnings} \xB7 mount writes ${g.mountWrites} \xB7 ${g.ms}ms`:`sap \u2717 ${g.root} \xB7 errors ${g.errors} \xB7 warnings ${g.warnings} \xB7 ${g.ms}ms`}function o(){let s=[],g=[];for(let k of t.apps())s.push(...k.diag.errors),g.push(...k.diag.warnings);return{ok:s.length===0,errors:s,warnings:g,counts:{errors:s.length,warnings:g.length}}}function i(s){let g=s===void 0?!0:!!s;for(let k of t.apps())k._debug=g;return console.log(`sap debug ${g?"on":"off"} \u2014 per-pass headers will ${g?"":"no longer "}log`),g}return{status:r,report:o,debug:i,greenLine:n}}var Kt="0.10.0";var nr={};var wo=/^(https:\/\/(?:cdn\.jsdelivr\.net\/npm|unpkg\.com)\/@panphora\/sapjs)(?=[@/]|$)/,rr=t=>new Promise(e=>setTimeout(e,t)),or=t=>t.getAttribute("plugins")?.match(/\S+/g)||[];function ir(t,e,r){let n=new Map,o=new Map,i=new Map,s=new Map,g=[],k=new Set,h={},l=!1,d,p=globalThis,R=Array.isArray(p.sapPlugins)?p.sapPlugins:p.sapPlugins==null?p.sapPlugins=[]:[],D=p.document?.currentScript?.src||"",f=wo.exec(D),y=a=>o.get(a)?.api||null,b=a=>Promise.allSettled(a.map(O));function v(){let a=new Map;for(let A of n.values())if(!o.has(A.name))for(let S of A.helpers||[])a.set(S,A.name);mn(h,a),ce()}function $(a){n.set(a.name,{...n.get(a.name),...a}),Ye(a),v()}function c(a){n.has(a.name)||$(a)}function u(a){R.includes(a)||R.push(a),$(a)}function E(a){for(let A of t.apps())A.root.isConnected&&t.schedule(A,a)}let x=Object.freeze({api:1,version:Kt,compile:G,run:et,runWith:H,planOf:X,drainPlans:At,forgetRow:kt,setBeacon:z,clearBeacon:Z,write:_t,schedule(a,A="plugin"){let S=a?.root?a:t.appFor(a);S&&t.schedule(S,A)},appFor:t.appFor,apps:t.apps,capability:W,mayWrite:I,load:O,plugin:y});function w(a){if(typeof a=="string")return O(a);let{name:A,api:S}=a,_=L=>{throw new Error(`Sap.use: plugin "${A}" ${L}`)};if((typeof A!="string"||S!==1)&&_(`needs a name and plugin API ${1}; it gives API ${S}`),l)return null;if(o.has(A))return y(A);if((a.requires||[]).some(L=>!o.has(L)))return u(a),g.includes(a)||g.push(a),null;let T=a.setup?.(x)||{},F=(L,ve)=>{for(let dt of Array.isArray(a[L])?a[L]:Object.keys(a[L]||{}))(typeof(T[L]||{})[dt]!="function"||ve(dt))&&_(`cannot add "${dt}" to ${L}: the name is taken or not valid, or setup does not supply it`)},M=L=>!te(L,A);F("helpers",L=>(Le(L)&&_(`cannot add "${L}": window.${L} exists; rename the helper`),!hn(L)||L in h)),F("boundaries",M),F("directives",M);for(let L in T.api)L in e&&_(`cannot add Sap.${L}: the name is taken`);u(a);let P={...T,name:A,order:a.order,boundary:{}};for(let L in a.boundaries)P.boundary[L]=T.boundaries[L];for(let L of a.helpers||[])h[L]=T.helpers[L];for(let L in T.formats)L in tt||(tt[L]=T.formats[L]);return he(P),T.lint&&be(T.lint),Object.assign(e,T.api),o.set(A,P),s.delete(A),Ke(A,T.directives||!0),v(),_t(()=>k.forEach(Z)),k.clear(),g.splice(0).forEach(N),E("plugin:"+A),y(A)}function N(a){try{w(a)}catch(A){console.error(A)}}function C(a){if(l||o.has(a))return null;let A=n.get(a)||{},S=V.loader?.(a,A),_=A.url||V.base&&V.base+(A.file||a)+".js";return(S!==void 0?Promise.resolve(S):new Promise((F,M)=>{if(!_)throw new Error(`no address for plugin "${a}": call Sap.use(definition)`);let P=document.createElement("script");P.src=_,P.setAttribute("clay","editor-ui"),P.onload=P.onerror=L=>{P.remove(),L.type==="load"?F():M(new Error("could not load "+_))},document.head.append(P)})).then(F=>{if(l)return;let M=F?.default||F||R.find(P=>P.name===a);if(M?.name&&w(M),!o.has(a))throw new Error(`plugin "${a}" loaded and did not register`)})}function O(a){if(o.has(a))return Promise.resolve(y(a));if(i.has(a))return i.get(a);s.delete(a);let A=Promise.all((n.get(a)?.requires||[]).map(O)).then(()=>C(a));for(let _ of V.retryDelays)A=A.catch(()=>rr(_).then(()=>C(a)));let S=A.finally(()=>i.delete(a)).then(()=>y(a),_=>{throw s.set(a,_),d||=!p.addEventListener?.("online",()=>V.retry()),E("plugin-failed:"+a),document.dispatchEvent(new CustomEvent("sap:plugin-failed",{detail:{plugin:a,error:_}})),_});return i.set(a,S),S}function j(a){let A=new Set;for(let S of a.closest?.("[sap]")?[a]:a.querySelectorAll("[sap]")){for(let _ of or(S.closest("[sap]")))A.add(_);n.size>o.size&&Y(S,_=>{let T=X(_);return T.inert?!1:(T.wants?.map(F=>A.add(F)),!!A.add(T.waits))})}return[...A].filter(S=>S&&!o.has(S))}Kn((a,A)=>{for(let S of new Set([...A.wanted.keys(),...A.waiting,...or(a.root)])){if(o.has(S))continue;let _=s.get(S);if(!_)O(S).catch(()=>{});else{let T=A.wanted.get(S)?.[0]||a.root;a.diag.error("E52",T,{problem:`the "${S}" plugin did not load: ${_.message}`,fix:"Sap.plugins.retry() tries again"}),k.add(T),_t(()=>z(T,"E52"))}}});let V={api:1,base:f?`${f[1]}@${Kt}/dist/sap-plugins/`:/^[^:]+:\//.test(D)?new URL("sap-plugins/",D).href:null,loader:null,retryDelays:[1e3,4e3],declare:c,load:O,ready(a=document,A=3e3){let S=new Set,_=()=>{let F=j(a).filter(M=>!S.has(M)&&S.add(M));return F.length&&b(F).then(_)},T=_();return T?Promise.race([T,rr(A)]):null},has:a=>o.has(a),status:()=>({installed:[...o.keys()],loading:[...i.keys()],failed:[...s.keys()]}),retry:a=>b(a?[a]:[...s.keys()])};function m(){let a=[],A=()=>(zn(),r.flushNow()),S=[...o.values()].filter(_=>_.flush);A();for(let _=0;S.length&&_<8;_++){for(let T of S){let F=T.flush();F?.then&&a.push(F)}if(!A())break}return a.length?Promise.all(a).then(m):null}e.use=w,e.plugins=V,e.flush=m;for(let a of Object.values(nr))c(a);return R.slice().forEach(N),function(){l=!0;for(let A of o.values())A.dispose?.();o.clear(),s.clear()}}function sr({createAccessor:t,installInput:e,debugExtras:r}){let n=new Map,o=[],i=Ue(Nt);function s(x){let w=x;for(;w;){if(w.nodeType===1&&w.hasAttribute&&w.hasAttribute("sap"))return n.get(w)||null;w=w.parentNode&&w.parentNode.host?w.parentNode.host:w.parentElement}return null}function g(){for(let x=o.length-1;x>=0;x--){let w=o[x];w.root.isConnected||(n.delete(w.root),o.splice(x,1))}}function k(x,w){if(x.moveBefore)try{x.moveBefore(w,null);return}catch{}x.appendChild(w)}function h(x,w){let N=w.parentElement;if(N){if(N.moveBefore)try{N.moveBefore(x,w);return}catch{}N.insertBefore(x,w)}}let l={apps:()=>o.slice(),appFor:s,isRegistered:x=>n.has(x),pruneDisconnected:g,schedule:i.schedule,runNow:(x,w)=>i.runNow(x,w),moveInto:k,placeBefore:h,remountIfPresent:()=>$()},d=t(l),p=er(l),R=r?r(l,p):{},D=!1,f=!1,y=null;function b(){D||(D=!0,e(l,d,document),y=Wn(l))}function v(){let x=W("derived");x&&typeof x.mounted=="function"&&x.mounted()}function $(x=document){if(f)return[];b(),We(l);let w=x.querySelectorAll("[sap]"),N=[];for(let C of w){if(n.has(C)||Pt(C))continue;let O=ze(C);n.set(C,O),o.push(O),N.push(O)}for(let C of N){let O=p.greenLine(C);C.diag.errors.length||C.halted?console.error(O):console.log(O)}return v(),N}function c(x){if(f)return null;if(b(),We(l),!x)return $();let w=typeof x=="string"?document.querySelector(x):x;if(!w)return null;if(n.has(w))return n.get(w);let N=ze(w);n.set(w,N),o.push(N);let C=p.greenLine(N);return N.diag.errors.length||N.halted?console.error(C):console.log(C),N}let u=d.Sap;u.version=Kt,u.refresh=function(){for(let w of o.slice())w.root.isConnected&&i.runNow(w,"refresh")},u.batch=In,u.status=p.status,u.report=p.report,u.why=R.why,u.debug=p.debug,u.doctor=R.doctor,u.greenLine=p.greenLine,u.formats=tt,u.serializeControlToAttributes=St,u.finalizeControlForSave=Pn,u.rehydrateControlFromAttributes=le,u.mount=c,u.config=function(w={}){return w.formats&&Object.assign(tt,w.formats),u},u._registry=n,u._reset=function(){n.clear(),o.length=0,Be()},u.unmount=function(){f=!0,n.clear(),o.length=0,Be(),typeof y=="function"&&y(),E()};let E=ir(l,u,i);return{Sap:u,mountAll:$,mount:c,runtime:l}}function ar(t){if(typeof document>"u")return;let e=()=>Fn(()=>t());document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e):e()}var yo=["for","form","list","headers","popovertarget","commandfor","anchor","aria-activedescendant","aria-controls","aria-describedby","aria-details","aria-errormessage","aria-flowto","aria-labelledby","aria-owns"];function Ao(t,e){let r=null;return J(t,n=>{!r&&n.getAttribute("scope")===e&&(r=n)}),r}function ur(t,e,r){let n=U(t)||e;for(;n;){for(let o of B(n.getAttribute("state")||""))if(o.name===r)return{el:n,decl:o};if(n.hasAttribute("sap"))break;n=U(n.parentElement)}return null}function vo(t){return typeof t=="number"?"num":typeof t=="boolean"?"bool":"string"}function cr(t){function e(f){let y=t.appFor(f);if(!y)return null;let b=ct(f),v=b&&b._sapEachItem&&b._sapEachItem.$el;if(v&&v.isConnected)return{ctxEl:v,appRec:y,isRow:!0};let $=Dt(f);if($)return $._sapDetailRow?{ctxEl:$._sapDetailRow,appRec:y,isRow:!0}:{ctxEl:U($.parentElement)||y.root,appRec:y,isRow:!1};let c=ne(f);if(c&&c.hasAttribute("item"))return{ctxEl:c,appRec:y,isRow:!0};let u=U(f)||y.root;return{ctxEl:u,appRec:y,isRow:u.hasAttribute("item")}}function r(f){let y=typeof f=="string"?document.querySelector(f):f;if(!y||y.nodeType!==1)return null;let b=e(y);return b?D(b.ctxEl,b.appRec,b.isRow):null}function n(f,y){let b=ct(f);if(!b)return r(f);let v=t.appFor(f),$=b._sapEachItem&&b._sapEachItem.$el;if($&&$.nodeType===1&&$.hasAttribute("item")&&yt($,y))return $.isConnected?D($,v,!0):null;let c=b.parentElement&&b.parentElement._sapDrawnEl;return!c||!c.isConnected?null:D(c,v,c.hasAttribute("item"))}function o(f,y,b){let v=lt(f,b);if(v)return q(v).read();let $=wt(f,b);if($)return ot($).map(x=>D(x,y,!0));let c=Ao(f,b);if(c)return D(c,y,!1);let u=ur(f,y.root,b);if(u)return u.decl.transient?ie(u.el,u.decl):en(u.el,u.decl);let E=f._sapScope;return E?E[b]:void 0}function i(f,y,b,v,$){v.transient?It(f,v,b):Mt(f,v,b),t.schedule($,"set:"+y)}function s(f,y){let b=new Set,v=U(f)||y;for(;v;){for(let $ of B(v.getAttribute("state")||""))b.add($.name);if(v.hasAttribute("sap"))break;v=U(v.parentElement)}return J(f,$=>{let c=$.getAttribute("bind");c&&b.add(c)}),b}function g(f,y,b,v){let $=lt(f,b);if($){if(!I($))return;q($).write(v);return}let c=f;for(;c;){for(let j of c.attributes)if(j.name==="calc:"+b){y.diag.error("E16",c,{attr:"calc:"+b,problem:`"${b}" is a computed field; computed fields are read-only`});return}if(c.hasAttribute("sap"))break;c=c.parentElement}let u=ur(f,y.root,b);if(u){if(!I(u.el,{transient:u.decl.transient}))return;i(u.el,b,v,u.decl,y);return}let E=s(f,y.root);E.delete(b);let x=b.length>=4?Rt(b,[...E]):null;if(x){y.diag.error("E12",f,{key:b,problem:`unknown state key "${b}"`,didYouMean:x});return}if(Jt.has(b)||Tt.has(b)){y.diag.error("E15",f,{key:b,problem:`cannot write undeclared field "${b}" \u2014 it is a reserved/global name and cannot become state`,fix:"pick a different field name, or declare it explicitly in a state= attribute"});return}let w=y.root;if(!I(w))return;let N=vo(v),C=w.getAttribute("state")||"",O=N==="string"?b:`${b}:${N}`;w.setAttribute("state",C?`${C} ${O}`:O),i(w,b,v,{name:b,attr:b,type:N,transient:!1},y)}function k(f){let y=f.ownerDocument,b=new Map,v=($,c)=>{let u=Ze(y),E=$.getAttribute(c);E&&c==="id"&&b.set(E,u),$.setAttribute(c,u)};f.querySelectorAll("[id]").forEach($=>v($,"id")),f.querySelectorAll("[data-id]").forEach($=>v($,"data-id")),f.querySelectorAll("[sap-error]").forEach($=>$.removeAttribute("sap-error")),f.removeAttribute("sap-error"),f.hasAttribute("data-id")?(f.removeAttribute("id"),v(f,"data-id")):v(f,"id");for(let $ of[f,...f.querySelectorAll("*")])for(let c of yo){let u=$.getAttribute(c);if(u==null)continue;let E=u.split(/\s+/).map(x=>b.get(x)||x).join(" ");E!==u&&$.setAttribute(c,E)}}function h(f,y,b){let v=Wt(y.root,f,b);if(!v)return y.diag.error("E17",f,{problem:`cannot resolve a list named "${b}" from here`}),null;if(!I(v))return null;let $=oe(v);if(!$)return y.diag.error("E17",v,{problem:`items="${b}" has no [item template] to clone`}),null;let c=v.ownerDocument.importNode($,!0);return c.removeAttribute("template"),k(c),v.appendChild(c),t.schedule(y,"trigger-add:"+b),D(c,y,!0)}function l(f,y){let b=B(f.getAttribute("state")||""),v=!0;J(f,$=>{$.hasAttribute("bind")&&!I($)&&(v=!1)});for(let $ of b)I(f,{transient:$.transient})||(v=!1);if(v){J(f,$=>{if($.hasAttribute("bind")){let c=q($),u=$.getAttribute("default");c.kind==="checkbox"||c.kind==="radio"?c.write(u!=null?u===""||u==="true"||$.value===u:$.hasAttribute("checked")):c.write(u??($.getAttribute("value")||""))}});for(let $ of b){let c=nn(f,$);$.transient?It(f,$,c):Mt(f,$,c)}t.schedule(y,"trigger-reset")}}function d(f,y){if(!f.isConnected)throw new Error("stale row handle: $remove() on a removed row");I(f)&&(f.remove(),t.schedule(y,"trigger-remove"))}function p(f,y,b){if(!f.isConnected)throw new Error("stale row handle: $move() on a removed row");let v=null;if(b&&b.nodeType===1?v=b:typeof b=="string"&&(v=Wt(y.root,f,b)),!v){y.diag.error("E17",f,{problem:`$move() cannot resolve target "${b}"`});return}!I(f)||!I(v)||(t.moveInto(v,f),t.schedule(y,"trigger-move"))}function R(f){let y=f.parentElement;return y?ot(y).indexOf(f):-1}function D(f,y,b){let v={get $el(){return f},get $key(){return ee(f,b?"row":"scope")},get $index(){return R(f)},$add(c){return h(f,y,c)},$reset(){return l(f,y),$},$remove(){d(f,y)},$move(c){p(f,y,c)},get $appRec(){return y}},$=new Proxy(v,{get(c,u){return typeof u=="symbol"||u[0]==="$"?c[u]:o(f,y,u)},set(c,u,E){return typeof u=="string"&&u[0]==="$"?(c[u]=E,!0):(g(f,y,u,E),!0)},has(c,u){return typeof u=="string"&&u[0]==="$"?u in c:o(f,y,u)!==void 0}});return $}return{Sap:r,contextElFor:e,readField:o,writeField:g,makeProxy:D,writeTargetFor:n}}var Eo=["trigger-add","trigger-remove","trigger-reset"];function xo(t){if(t.nodeType!==1)return!1;for(let e of t.attributes){let r=e.name;if(r.startsWith("set:")||r.startsWith("move:")||r.startsWith("sort:")||Eo.includes(r))return!0}return!1}function ko(t,e){let r=t,n=e.parentElement;for(;r&&r!==n;){if(r.nodeType===1&&xo(r)&&!(r.tagName==="FORM"&&r.hasAttribute("trigger-add")))return r;r=r.parentElement}return null}function lr(t,e){let{Sap:r}=e;function n(c,u){let E=null,x=ct(c),w=Dt(c);if(x)E=x._sapEachItem??null;else if(w&&w._sapDetailRow)E=w._sapDetailRow._sapScope||null;else{let O=ne(c);O&&O.hasAttribute("item")&&(E=O._sapScope||null)}return{state:(U(c)||u.root)._sapScope||u._state||{},item:E,el:c,root:u._state||{}}}function o(c,u,E){if(!c.hasAttribute("confirm")){E();return}let x=c.getAttribute("confirm"),w=x,N=G(x);if(!N.error)try{let m=et(N,n(c,u));(typeof m=="string"||typeof m=="number")&&(w=String(m))}catch{}let C=zt(),O=()=>{zt()===C&&E()},j=Mn();if(!j){window.confirm(w)&&O();return}if(c._sapGatePending)return;c._sapGatePending=!0;let V=()=>{c._sapGatePending=!1};j(w,()=>{V(),O()}).catch(V)}function i(c,u){for(let E of c.attributes){if(!E.name.startsWith("set:"))continue;let x=E.name.slice(4),w=G(E.value);if(w.error){u.diag.error("E08",c,{attr:E.name,expr:E.value,problem:String(w.error.message)});continue}let N;try{N=et(w,n(c,u))}catch(O){u.diag.error("E24",c,{attr:E.name,expr:E.value,problem:String(O.message)});continue}let C=e.writeTargetFor(c,x);C&&(C[x]=N)}}function s(c){let u=ct(c);if(!u)return c.closest("[item]");let E=u._sapEachItem&&u._sapEachItem.$el;return E&&E.nodeType===1&&E.hasAttribute("item")?E:null}function g(c,u){let E=s(c);if(!E||!I(E)||!I(E.parentElement))return;let x=ot(E.parentElement),w=x.indexOf(E);u==="up"&&w>0?t.placeBefore(E,x[w-1]):u==="down"&&w<x.length-1&&t.placeBefore(x[w+1],E)}function k(c,u,E){if(u)return Wt(E.root,c,u);let x=c;for(;x;){if(x.hasAttribute&&x.hasAttribute("items"))return x;x=x.parentElement}let w=U(c)||E.root,N=[];return J(w,C=>{C.hasAttribute("items")&&N.push(C)}),N[0]||null}function h(c,u){let E=c==null||c==="",x=u==null||u==="";if(E&&x)return 0;if(E)return 1;if(x)return-1;let w=Number(c),N=Number(u);return!Number.isNaN(w)&&!Number.isNaN(N)?w-N:String(c)<String(u)?-1:String(c)>String(u)?1:0}function l(c,u,E,x){let w=k(c,E,x);if(!w){x.diag.error("E17",c,{attr:"sort:"+u,problem:`no items list resolvable for sort:${u}`});return}if(!I(w))return;let N=ot(w),C=m=>m._sapScope?m._sapScope[u]:void 0,O=[...N].sort((m,a)=>h(C(m),C(a))),V=O.every((m,a)=>m===N[a])?[...O].reverse():O;for(let m of V)t.moveInto(w,m);t.schedule(x,"sort:"+u)}function d(c){if(!c||c.hidden)return;let u=c.querySelector("[bind]:not([type=hidden]), [contenteditable]");u&&typeof u.focus=="function"&&u.focus()}function p(c,u){o(c,u,()=>{let E=r(c);for(let x of[...c.attributes]){let w=x.name;if(w==="trigger-remove")E&&E.$remove();else if(w==="trigger-reset")E&&E.$reset();else if(w==="trigger-add"){let N=E&&E.$add(x.value);N&&d(N.$el)}else w==="move:up"?(g(c,"up"),t.schedule(u,"move:up")):w==="move:down"?(g(c,"down"),t.schedule(u,"move:down")):w.startsWith("move:to")?E&&E.$move(x.value):w.startsWith("sort:")&&l(c,w.slice(5),x.value,u)}[...c.attributes].some(x=>x.name.startsWith("set:"))&&i(c,u)})}function R(c){let u=c.target;if(!u||u.nodeType!==1)return;let E=t.appFor(u);if(!E)return;let x=ko(u,E.root);x&&p(x,E)}function D(c){let u=q(c),E=c.getAttribute("default");u.kind==="checkbox"?u.write(E===""||E==="true"):u.write(E??"")}function f(c,u,E){let x=r(c);if(!x)return;let w=x.$add(E);if(!w)return;let N=[];J(c,C=>{C.hasAttribute("bind")&&N.push(C)});for(let C of N){if(C.type==="radio"&&!C.checked)continue;let O=C.getAttribute("bind"),j=lt(w.$el,O);j?q(j).write(q(C).read()):yt(w.$el,O)&&(w[O]=q(C).read())}N.forEach(D),N.length?typeof N[0].focus=="function"&&N[0].focus():d(w.$el)}function y(c){let u=c.target;if(!u||!u.hasAttribute||!u.hasAttribute("trigger-add"))return;let E=t.appFor(u);E&&(c.preventDefault(),o(u,E,()=>f(u,E,u.getAttribute("trigger-add"))))}function b(c){let u=c.target;if(!u||u.tagName!=="DIALOG"||!u.hasAttribute("detail"))return;if(u._sapEngineClose){u._sapEngineClose=!1;return}if(u.open)return;let E=/^[\w.]+\s+by\s+state\.(\w+)\s*$/.exec(u.getAttribute("detail")||""),x=t.appFor(u);if(!E||!x)return;let w=B(u.getAttribute("state")||"").find(C=>C.name===E[1]);if(w){if(!I(u,{transient:w.transient}))return;w.transient?It(u,w,""):Mt(u,w,""),t.schedule(x,"close");return}let N=r(u.parentElement);N&&N[E[1]]!==""&&(N[E[1]]="")}function v(c,u){let E=c.hasAttribute("bind")&&re(c);if(!E&&c.hasAttribute("bind")&&ct(c)){let w=c.getAttribute("bind"),N=c._sapViewBind?e.writeTargetFor(c,w):null;return N&&(N[w]=q(c).read()),!0}let x=Dt(c);if(x&&x._sapDetailRow&&c.hasAttribute("bind")&&!E){let w=x._sapDetailRow,N=c.getAttribute("bind"),C=lt(w,N);if(C&&C!==c)return I(C)&&q(C).write(q(c).read()),!0;if(!C&&B(w.getAttribute("state")||"").some(O=>O.name===N))return e.writeField(w,u,N,q(c).read()),!0}return!1}function $(c=document){c.addEventListener("click",R),c.addEventListener("submit",y),c.addEventListener("close",b,!0)}return{install:$,routeInput:v}}function fr(t){let e=[];function r(k){let h=k.target;if(!h||h.nodeType!==1)return;let l=t.appFor(h);if(l){h.hasAttribute("persist")&&!fe(h)&&I(h)&&St(h);for(let d of e)if(d(h,l))return;t.schedule(l,k.type+" "+(h.id||h.tagName.toLowerCase()))}}function n(k){let h=k.target,l=t.appFor(h);l&&[...h.querySelectorAll("[bind]")].every(d=>I(d))&&setTimeout(()=>{h.querySelectorAll("[bind]").forEach(d=>{d.dispatchEvent(new Event("input",{bubbles:!0})),d.dispatchEvent(new Event("change",{bubbles:!0}))}),t.schedule(l,"reset")},0)}function o(k){let h=t.appFor(k.target);h&&t.schedule(h,"toggle")}function i(k){let h=k.detail||{};for(let l of[h.from,h.to,k.target]){if(!l||l.nodeType!==1)continue;let d=t.appFor(l);d&&t.schedule(d,"sorted")}}function s(k){if(k.key!=="ArrowUp"&&k.key!=="ArrowDown")return;let h=k.target;if(!h||h.nodeType!==1||h.tagName!=="INPUT"||!h.hasAttribute("bind")||!h.hasAttribute("step"))return;let l=(h.getAttribute("type")||"text").toLowerCase();if(l!=="text"&&l!=="tel"&&l!=="search"||!t.appFor(h)||!I(h))return;k.preventDefault();let p=K(h.getAttribute("step"))||1,R=k.key==="ArrowUp"?1:-1,D=K(h.value)+p*(k.shiftKey?10:1)*R,f=h.getAttribute("min"),y=h.getAttribute("max");f!==null&&f!==""&&D<K(f)&&(D=K(f)),y!==null&&y!==""&&D>K(y)&&(D=K(y)),q(h).write(String(Number(D.toFixed(2))))}function g(k=document){k.addEventListener("reset",n),k.addEventListener("toggle",o,!0),k.addEventListener("input",r),k.addEventListener("change",r),k.addEventListener("clay:sorted",i),k.addEventListener("keydown",s)}return{install:g,addRouter:k=>e.push(k)}}function dr(t){let e=t.toLowerCase();return/^x-text$|^x-html$/.test(e)?'use text="state.x" (Sap paints text only)':/^x-show$|^v-show$|^v-if$/.test(e)?'use show="expr" (toggles native hidden)':/^x-model$|^v-model$/.test(e)?'use bind="field"':/^@|^x-on:|^v-on:|^on:/.test(e)?"use native onclick + Sap(this) (no event directive)":/^:|^x-bind:class$|^v-bind:class$/.test(e)?'use class:NAME="expr" or attr:NAME="expr"':/^x-for$|^v-for$/.test(e)?'use items="name" on the container and item template on the row':/^x-data$/.test(e)?"declare state with state= / bind / items (no JS state object)":/^x-init$/.test(e)?"use a <script> or onclick + Sap(this)":/^bind:/.test(e)?'use bind="field"; one-way paint is attr:NAME="expr"':/^x-/.test(e)||/^v-/.test(e)?"this is a foreign-dialect attribute; Sap has no x-/v- attributes":null}function pr(t){let e=[],r=n=>{for(let o of n.attributes){let i=o.name;(i.startsWith("calc:")||i==="text"||i.startsWith("text:")||i==="show"||i.startsWith("attr:")||i.startsWith("class:")||i.startsWith("css:")||i==="effect"||i==="invalid"||i.startsWith("set:")||i==="detail")&&e.push({el:n,attr:i,src:o.value})}};r(t);for(let n of t.querySelectorAll("*"))r(n);return e}function mr(t){function e(o){return o?typeof o=="string"?document.querySelector(o):o.nodeType===1?o:null:null}function r(o,i){let s=e(o);if(!s)return console.warn("sap why: element not found"),null;let g=[`sap why <${s.tagName.toLowerCase()}> \u2014 ${Qt(s)}`],k=[...s.attributes].filter(l=>/^(bind|text|show|effect|invalid|detail|calc:|text:|attr:|class:|css:|set:|state|items|scope)/.test(l.name));for(let l of k)g.push(` ${l.name}="${l.value}"`);let h=s;for(;h&&!h._sapScope;)h=h.parentElement;if(h&&h._sapScope){let l=h._sapScope,d=i?[i]:Object.keys(l);g.push(" reads:");for(let p of d){let R=l[p];typeof R!="function"&&g.push(` ${p} = ${JSON.stringify(Array.isArray(R)?`[${R.length} rows]`:R)}`)}}return g.push(" serialization: textContent and value/checked attributes save with the file; reads live from properties"),console.log(g.join(`
|
|
11
11
|
`)),null}function n(){let o=[],i=0;for(let l of t.apps()){let d=l.root,p=we(d);i++;let R=new mt(l.name);ge(d,R);for(let v of R.errors)o.push({code:v.code,severity:"error",message:`${p}: ${v.code} ${v.slug} at ${v.el}`});for(let v of R.warnings)o.push({code:v.code,severity:"warn",message:`${p}: ${v.code} ${v.slug} at ${v.el}`});i++,Nt(l,{trigger:"doctor-dryrun"});let D=l._stats?l._stats.writes:0;D>0&&o.push({code:"W30",severity:"warn",message:`${p}: dry recompute wrote ${D} cells on a quiet page; an element is stale or non-idempotent`}),i++;let f=pr(d).map(v=>v.src).join(" \0 "),y=[];for(let v of[d,...d.querySelectorAll("[state]")])for(let $ of B(v.getAttribute("state")||""))y.push($.name);for(let v of y)new RegExp(`(state|item)\\.${v}\\b`).test(f)||o.push({code:"I33",severity:"info",message:`${p}: field "${v}" is declared but read nowhere (dead state)`});i++;let b=new Map;for(let v of d.querySelectorAll("[id]"))b.set(v.id,(b.get(v.id)||0)+1);for(let[v,$]of b)$>1&&o.push({code:"W32",severity:"warn",message:`${p}: duplicate id "${v}" (${$} elements) \u2014 clone/edit collision`});i++;for(let v of pr(d))v.src.length>120&&o.push({code:"I33",severity:"info",message:`${p}: ${v.attr} expression is ${v.src.length} chars; consider a calc: field`});i++;for(let v of d.querySelectorAll("[text], [text\\:num]")){let $=v.textContent||"";/\.\d{5,}/.test($)&&o.push({code:"I33",severity:"info",message:`${p}: ${Qt(v)} paints >4 decimals; consider text:FMT`})}}let s=o.filter(l=>l.severity==="error").length,g=o.filter(l=>l.severity==="warn").length,k=o.filter(l=>l.severity==="info").length;console.log(`sap doctor \xB7 ${t.apps().map(l=>we(l.root)).join(", ")} \xB7 errors ${s} \xB7 warnings ${g} \xB7 info ${k} \xB7 ${i} checks \xB7 0ms`);for(let l of o)(l.severity==="error"?console.error:l.severity==="warn"?console.warn:console.info)(` ${l.severity==="error"?"\u2717":l.severity==="warn"?"\u26A0":"\xB7"} ${l.message}`);return o}return{why:r,doctor:n}}function So(t,e){let r=String(t).split("."),n=i=>{for(let s of r){if(i==null)return;i=Array.isArray(i)?i.flatMap(g=>g&&g[s]!=null?g[s]:[]):i[s]}return i},o=n(e.state);return o===void 0?n(e.root):o}function $o(t,e,r,n){e._sapScope=r;let o=e.getAttribute("detail")||"",i=/^([\w.]+)\s+by\s+(.+)$/.exec(o);if(!i){e.hidden=!0,e._sapDetailRow=null;return}let s=i[1],g=i[2].trim(),k=So(s,n),h;try{h=et(G(g),{state:r,item:n.item,el:e,root:n.root})}catch{h=void 0}let l=Array.isArray(k)&&h!=null?k.find(p=>p&&typeof p=="object"&&p.$el&&String(p.$key)===String(h)):null;if(e._sapDetailRow=l?l.$el:null,l&&kt(l.$el),e.tagName==="DIALOG"){let p=l?String(l.$key):null;if(p!==e._sapDetailKey&&(e._sapDetailKey=p,e._sapDismissed=!1),!l){e._sapOpenedFor=null,e.open&&typeof e.close=="function"&&(e._sapEngineClose=!0,e.close());return}e.open?e._sapOpenedFor=p:(e._sapOpenedFor===p&&(e._sapDismissed=!0),e._sapOpenedFor=null,!e._sapDismissed&&e.isConnected&&typeof e.showModal=="function"&&(e.hidden&&(e.hidden=!1),e.showModal(),e._sapOpenedFor=p))}else{if(!l){e.hidden||(e.hidden=!0);return}e.hidden&&(e.hidden=!1)}At();let d={root:n.root,state:r,item:l,ownerEl:l.$el,projection:!0};t.collectEl(e,X(e),d),t.walkScope(e,l,d)}var hr={name:"detail",order:10,begin(t){t.deferredDetails=[]},boundary:{detail(t,e,r,n,o){for(let i of B(e.getAttribute("state")||""))i.name in n||(n[i.name]=it(e,i)?e.hasAttribute(i.attr):t.resolveDefault(e,i));t.deferredDetails.push({el:e,parentObj:n,ctx:o})}},afterIntake(t){for(let e=0;e<t.deferredDetails.length;e++){let{el:r,parentObj:n,ctx:o}=t.deferredDetails[e];$o(t,r,n,o)}}};function br(t){let e=0,r=t;for(;r&&!(r.hasAttribute&&r.hasAttribute("sap"));)r=r.parentElement,e++;return e}var gr={name:"calc",order:20,begin(t){t.calcs=[]},collect(t,e,r,n){if(!r.calcs)return!1;let o=n.item||n.state;for(let i of r.calcs)t.calcs.push({owner:o,ownerEl:n.ownerEl,name:i.name,entry:i.entry,def:i,el:e,ctx:n})},compute(t){let e=t.app,r=new Map;for(let o of t.calcs){let i=r.get(o.owner);i||(i={ownerEl:o.ownerEl,list:[]},r.set(o.owner,i)),i.list.push(o)}let n=[...r.values()].sort((o,i)=>br(i.ownerEl)-br(o.ownerEl));for(let o of n){let i;try{i=bn(o.list)}catch(s){e.diag.error("E07",o.list[0].el,{problem:s.message}),i=o.list}for(let s of i)try{s.owner[s.name]=H(s.entry,s.ctx.state,s.ctx.item,s.el,s.ctx.root),Z(s.el)}catch(g){s.owner[s.name]=void 0,e.diag.error("E24",s.el,{attr:"calc:"+s.name,expr:s.entry.src,problem:String(g.message)}),z(s.el,g.sapCode||"E24")}}t.stats.calcs=t.calcs.length,t.stats.lists=r.size}};function _o(t,e,r){let n=r.nextSibling;if(e.isConnected&&t.moveBefore)try{t.moveBefore(e,n);return}catch{}t.insertBefore(e,n)}function No(t,e,r){for(let n=e.parentElement;n;n=n.parentElement)if(n._sapScope===r&&!n.hasAttribute("detail")||n.hasAttribute("sap"))return n;return t}function To(t,e,r){let n=t.app;e._sapDrawnEl=No(t.root,e,r.state);let o=null;for(let f=e.firstElementChild;f;f=f.nextElementSibling)if(f.tagName==="TEMPLATE"){o=f;break}let i=o&&o.content.children.length===1?o.content.firstElementChild:null;if(!i)return n.diag.error("E42",e,{attr:"each",problem:"each needs one <template> child with exactly one element root"}),0;let s=e.getAttribute("each"),g;try{g=et(G(s),{state:r.state,item:r.item,el:e,root:r.root})}catch(f){return n.diag.error("E24",e,{attr:"each",expr:s,problem:String(f.message)}),0}if(!Array.isArray(g))return n.diag.error("E40",e,{attr:"each",expr:s,problem:"each must evaluate to an array; the list keeps its last good rows"}),0;let k=G(e.getAttribute("key")||"item.$key"),h=[],l=new Set;for(let f of g){let y;try{y=H(k,r.state,f,e,r.root)}catch{y=void 0}let b=y==null?"":String(y);if(b===""||l.has(b))return n.diag.error("E41",e,{attr:"key",expr:k.src,problem:b===""?"an item has no key; the list keeps its last good rows":`duplicate key "${b}"; the list keeps its last good rows`}),0;l.add(b),h.push(b)}let d=e._sapEach||new Map,p=new Map,R=0,D=o;h.forEach((f,y)=>{let b=d.get(f);if(!b||b.parentElement!==e){b=e.ownerDocument.importNode(i,!0);let v=(b.getAttribute("clay")||"").split(/\s+/).filter(Boolean);v.includes("editor-ui")||b.setAttribute("clay",[...v,"editor-ui"].join(" ")),b._sapEachRow=!0,R++}b.getAttribute("data-key")!==f&&b.setAttribute("data-key",f),D.nextElementSibling!==b&&(_o(e,b,D),R++),b._sapEachItem=g[y],p.set(f,b),D=b});for(let[f,y]of d)p.get(f)!==y&&y.parentElement===e&&(y.remove(),R++);return e._sapEach=p,At(),h.forEach((f,y)=>{let b=p.get(f),v={root:r.root,state:r.state,item:g[y],ownerEl:b,projection:!1,view:!0};t.collectEl(b,X(b),v),t.walkScope(b,{},v)}),R}var wr={name:"each",order:30,begin(t){t.eachList=[]},boundary:{each(t,e,r,n,o){t.collectEl(e,r,o),t.eachList.push({el:e,ctx:o})}},reconcile(t){let e=0;for(let r=0;r<t.eachList.length;r++)e+=To(t,t.eachList[r].el,t.eachList[r].ctx);return e}};function Ro(t,e){try{H(t.def.entry,t.ctx.state,t.ctx.item,t.el,t.ctx.root),Z(t.el)}catch(r){e.diag.error("E24",t.el,{attr:"effect",expr:t.def.entry&&t.def.entry.src,problem:String(r.message)}),z(t.el,"E24")}}var yr={name:"effect",order:40,begin(t){t.effects=[]},collect(t,e,r,n){if(!r.effects)return!1;for(let o of r.effects)t.effects.push({def:o,el:e,ctx:n})},afterPaint(t){for(let e of t.effects)Ro(e,t.app)}};function Lo(t){let e="";try{let r=H(t.def.entry,t.ctx.state,t.ctx.item,t.el,t.ctx.root);e=typeof r=="string"?r:""}catch{e=""}typeof t.el.setCustomValidity=="function"&&t.el.setCustomValidity(e)}var Ar={name:"validation",order:50,begin(t){t.invalids=[]},collect(t,e,r,n){if(!r.invalids)return!1;for(let o of r.invalids)t.invalids.push({def:o,el:e,ctx:n})},afterPaint(t){for(let e of t.invalids)Lo(e)}};function vr(t,e){if(t===t.ownerDocument.activeElement)return 0;if(t.type==="radio"){let i=e!=null&&String(t.value)===String(e);return t.checked===i?0:(t.checked=i,1)}let r=Ut(t),n=de(t,r),o=e??"";return String(n)!==String(o)?(Vn(t,r,o),1):0}var Er={name:"projection",order:60,collect(t,e,r,n){if(!(r.bind!=null&&(n.view||n.projection)&&!re(e)))return!1;let o=r.bind,i=t.paints;n.view?yt(tn(n.item),o)?(e._sapViewBind="item",i.push({def:{kind:"projection",field:o,from:"item"},el:e,ctx:n})):o in n.state||o in n.root?(e._sapViewBind="drawn",i.push({def:{kind:"projection",field:o,from:"drawn"},el:e,ctx:n})):(e._sapViewBind=null,t.app.diag.error("E43",e,{attr:"bind",expr:o,problem:`bind="${o}" inside an each row matches no field of the row's record or of the scope the row is drawn in`,fix:"bind a field the record owns (bind, state= or items= on the [item]), or declare it with state= where the list is drawn"})):i.push({def:{kind:"projection",field:o,from:null},el:e,ctx:n})},paintKinds:{projection(t){let e=t.def;if(e.from==="drawn"){let r=e.field in t.ctx.state?t.ctx.state:t.ctx.root;return vr(t.el,r[e.field])}return vr(t.el,t.ctx.item?t.ctx.item[e.field]:"")}}};function xr(){for(let t of[hr,gr,wr,yr,Ar,Er])he(t)}xr();be((t,e,r)=>{for(let n of t.attributes){let o=dr(n.name);o&&(e("E01",t,{attr:n.name,expr:n.value,problem:`"${n.name}" is a foreign-dialect attribute; Sap has no ${n.name.split(/[:=]/)[0]} directive`,fix:o+" \u2014 or wrap the subtree in sap-ignore if intentional"}),r(n.name))}});var{Sap:Ae,mountAll:kr,mount:Co,runtime:Oo}=sr({createAccessor:cr,debugExtras:mr,installInput(t,e,r){let n=fr(t),o=lr(t,e);n.addRouter(o.routeInput),n.install(r),o.install(r)}}),Xt=typeof window<"u"?window.Sap:null;Xt&&Xt!==Ae&&Xt.core&&typeof Xt.unmount=="function"&&Xt.unmount();ar(kr);typeof window<"u"&&(window.Sap=Ae);var Po=Ae;return Rr(Do);})();
|
|
12
12
|
if (typeof window !== 'undefined' && Sap && Sap.default) window.Sap = Sap.default;
|
|
13
13
|
var sapDefault = Sap.default;
|
package/package.json
CHANGED
package/src/core/mode-receipt.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
// One-shot proof of the mode this tab was in, written
|
|
2
|
-
// once, at the top of is-edit-mode.js.
|
|
3
|
-
//
|
|
1
|
+
// One-shot proof of the mode this tab was in, written when the page is left and read
|
|
2
|
+
// once, at the top of is-edit-mode.js. A reload within 30 s keeps the mode, and so does
|
|
3
|
+
// Back or Forward at any age, so a page opens the way it was left in this tab. It is a
|
|
4
|
+
// hint, like the cookie: the host still authorizes every save.
|
|
4
5
|
import { docKey } from "../lib/doc-storage.js";
|
|
5
6
|
|
|
6
7
|
const key = () => docKey("mode-receipt");
|
|
@@ -18,8 +19,9 @@ export function takeReceipt() {
|
|
|
18
19
|
try { receipt = JSON.parse(raw); } catch { return null; }
|
|
19
20
|
if (receipt?.v !== 1 || receipt.path !== location.pathname) return null;
|
|
20
21
|
if (receipt.mode !== "edit" && receipt.mode !== "view") return null;
|
|
21
|
-
|
|
22
|
-
if (
|
|
22
|
+
const nav = navigationType();
|
|
23
|
+
if (nav !== "back_forward" && Date.now() - receipt.at > MAX_AGE_MS) return null;
|
|
24
|
+
if (!receipt.internal && nav !== "reload" && nav !== "back_forward") return null;
|
|
23
25
|
return receipt;
|
|
24
26
|
}
|
|
25
27
|
|
|
@@ -6,5 +6,5 @@ var SapCoreBundle=(()=>{var Ye=Object.defineProperty;var Vn=Object.getOwnPropert
|
|
|
6
6
|
${e}`:`"use strict"; return (${e});`;n={fn:ot.length?new Function(...ot,`return function(${rt}){${o}
|
|
7
7
|
}`)(...Ht):new Function(...rt,o),src:e,statement:t,deps:ar(e),error:null,waits:ge(e)}}catch(o){n={fn:null,src:e,statement:t,deps:{state:new Set,item:new Set},error:o,waits:null}}return n.waits||he.set(r,n),n}function qt(e,t){return ye(e,t.state,t.item,t.el??null,t.root)}function ye(e,t,r,n,o){if(e.error)throw e.error;return e.fn(t,r,n,o,W,M,nt,Mt,It,Dt,Ft,Bt,jt)}var we={},X=null,Kt=!0,Me=!1;function Ie(){we={}}function Jt(e){let t=Me;return X?at(X.takeRecords()):Kt&&ur(),Me=!!X&&e.getRootNode()===document,t}function Qt(e){Me=e}function Zt(){X&&at(X.takeRecords())}function ur(){if(typeof document>"u"||typeof MutationObserver!="function"){Kt=!1;return}X=new MutationObserver(at),X.observe(document,{attributes:!0,childList:!0,subtree:!0})}function at(e){for(let t of e)if(t.type==="attributes")Gt(t.target);else if(t.addedNodes.length&&!(t.target.nodeType===1&&ne(t.target)))for(let r of t.addedNodes)r.nodeType===1&&O(r,Gt)}function Gt(e){e._sapPlan&&(e._sapPlan=null)}function K(e){if(!Me)return Yt(e);let t=e._sapPlan;return t&&t.gen===we?t:e._sapPlan=Yt(e)}function H(e,t,r){let n=Ce(t,r);return n.waits&&(e.waits=n.waits),n}function Yt(e){let t={gen:we,inert:e.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,waits:null,wants:null,ext:!1,impure:!1};for(let n of e.attributes){let o=n.name,s=n.value,i=o.indexOf(":");if(i<0){switch(o){case"sap-ignore":t.inert=!0;break;case"cms-template":t.inert=!0,t.cms=!0;break;case"template":t.inert=!0,t.template=!0;break;case"item":t.item=!0;break;case"scope":t.scope=!0;break;case"items":t.items=!0;break;case"detail":t.detail=!0,t.waits=ge(s)||t.waits;break;case"each":t.each=!0,t.waits=ge(s)||ge(e.getAttribute("key"))||t.waits;break;case"bind":t.bind=s;break;case"transient":t.transient=!0;break;case"state":t.decls=$e(s);break;case"text":(t.paints||(t.paints=[])).push({kind:"text",fmt:null,entry:H(t,s)});break;case"show":(t.paints||(t.paints=[])).push({kind:"show",entry:H(t,s)});break;case"effect":(t.effects||(t.effects=[])).push({entry:H(t,s,!0)});break;case"invalid":(t.invalids||(t.invalids=[])).push({entry:H(t,s)});break;default:Xt(t,o,"",s)}continue}let g=o.slice(0,i),b=o.slice(i+1);switch(g){case"calc":(t.calcs||(t.calcs=[])).push({name:b,entry:H(t,s)});break;case"text":(t.paints||(t.paints=[])).push({kind:"text",fmt:b,entry:H(t,s)});break;case"attr":(t.paints||(t.paints=[])).push({kind:"attr",arg:b,entry:H(t,s)});break;case"class":(t.paints||(t.paints=[])).push({kind:"class",arg:b,entry:H(t,s)});break;case"css":(t.paints||(t.paints=[])).push({kind:"css",arg:b,entry:H(t,s)});break;case"show-when":case"option":(t.paints||(t.paints=[])).push({kind:"when",match:"show",field:b,values:s.split("|")});break;case"hide-when":(t.paints||(t.paints=[])).push({kind:"when",match:"hide",field:b,values:s.split("|")});break;case"option-not":(t.paints||(t.paints=[])).push({kind:"when",match:"show-not",field:b,values:s.split("|")});break;default:Xt(t,g+":",b,s)}}let r=_e(e);return t.boundary=t.scope?"scope":t.items?"items":t.detail?"detail":t.each?"each":r?r.name:null,r&&!r.installed&&(t.wants||=[]).push(r.plugin),lr(t)?cr():t}function Xt(e,t,r,n){let o=Tt(t);if(!o)return;if(!o.parse){(e.wants||=[]).push(o.plugin);return}let s=o.parse(r,n);s!==void 0&&((e[o.key]||(e[o.key]=[])).push(s),e.ext=!0,o.impure&&(e.impure=!0),s&&s.entry&&s.entry.waits&&(e.waits=s.entry.waits))}var Oe=null;function cr(){return(!Oe||Oe.gen!==we)&&(Oe=Object.freeze({gen:we,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,waits:null,wants:null,ext:!1,impure:!1})),Oe}function lr(e){return!e.inert&&!e.item&&e.boundary===null&&e.bind===null&&!e.transient&&!e.decls&&!e.calcs&&!e.paints&&!e.effects&&!e.invalids&&!e.wants&&!e.ext}var oe=new WeakMap,ie=new WeakMap,re=null,q=!1;function tn(){oe=new WeakMap,ie=new WeakMap}function en(e){for(let t of e){let r=t.target.nodeType===1?t.target:t.target.parentElement;for(let o=r;o;o=o.parentElement)ie.delete(o);if(t.type==="attributes"){oe.delete(t.target);continue}for(let o=r;o;o=o.parentElement)oe.delete(o);let n=t.addedNodes;if(!(!n||!n.length||r&&ne(r)))for(let o of n)o.nodeType===1&&O(o,fr)}}function fr(e){oe.delete(e),ie.delete(e)}function nn(){return q}function rn(e){return q?ie.get(e):void 0}function on(e,t){q&&ie.set(e,t)}function De(e){ie.delete(e)}function sn(e){let t=q;return!re&&typeof MutationObserver=="function"&&(re=new MutationObserver(en),re.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})),re&&en(re.takeRecords()),q=!!re&&e.getRootNode()===document,t}function an(e){q=e}function un(e){let t=oe.get(e);return t||oe.set(e,t={attrs:new Map,hasText:!1,text:""}),t}function cn(e,t){if(!q)return e.getAttribute(t);let r=un(e);return r.attrs.has(t)||r.attrs.set(t,e.getAttribute(t)),r.attrs.get(t)}function ln(e){if(!q)return e.textContent;let t=un(e);return t.hasText||(t.text=e.textContent,t.hasText=!0),t.text}function fn(e){return(e.getAttribute("type")||"text").toLowerCase()}function se(e){let t=e.tagName;if(t==="INPUT"){let r=fn(e);r==="checkbox"||r==="radio"?e.checked?e.setAttribute("checked",""):e.removeAttribute("checked"):e.setAttribute("value",e.value);return}if(t==="TEXTAREA"){e.setAttribute("data-value",e.value);return}if(t==="SELECT"){let r=e.options;for(let n=0;n<r.length;n++)r[n].selected?r[n].setAttribute("selected",""):r[n].removeAttribute("selected")}}function dn(e,t=e){let r=e.tagName;if(r==="INPUT"){let n=fn(e);n==="checkbox"||n==="radio"?t.checked?e.hasAttribute("checked")||e.setAttribute("checked",""):e.removeAttribute("checked"):t.value!==(e.getAttribute("value")??"")&&e.setAttribute("value",t.value);return}if(r==="TEXTAREA"){let n=t.value.startsWith(`
|
|
8
8
|
`)?`
|
|
9
|
-
`+t.value:t.value;e.textContent!==n&&(e.textContent=n),e.removeAttribute("data-value");return}if(r==="SELECT"){let n=e.options,o=t.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 Fe(e){e.tagName!=="TEXTAREA"||!e.hasAttribute("data-value")||e!==e.ownerDocument.activeElement&&(e.textContent=e.getAttribute("data-value"),e.removeAttribute("data-value"))}function $(e){if(typeof window>"u")return null;let t=window.clay,r=window.hyperclay;return e==="consent"?t?.confirm||r?.consent||null:t?.[e]||r?.[e]||null}function pn(){let e=$("visitorDrafts");return!!(e&&typeof e.restored=="function"&&e.restored()?.restored)}var ut=["clay:mutation-ready","hyperclay:mutation-ready"],dr=["clay:sync-applied","hyperclay:livesync-applied"],pr=["clay:ready","hyperclay:ready"],mr=["clay:route"],hr=["clay:modechange"];function Ae(e,t,r){let n=null,o=s=>{n!==null&&n!==s.type||(n=s.type,queueMicrotask(()=>{n=null}),r(s))};for(let s of t)e.addEventListener(s,o);return()=>{for(let s of t)e.removeEventListener(s,o)}}function mn(e){let t=typeof window<"u"&&window.clay&&window.clay.ready;t&&typeof t.then=="function"?t.then(()=>e(),()=>e()):e()}function Be(e){let t=$("region");return!t||typeof t.resolveRegionPolicy!="function"||typeof t.skipForPolicy!="function"?!1:t.skipForPolicy(t.resolveRegionPolicy(e),void 0,["no-save","freeze"])}function hn(){return typeof window>"u"?null:window.clay?.modeLifecycle||null}function ae(e,{transient:t=!1}={}){if(t)return!0;let r=hn();return typeof r?.canWrite!="function"||$("region")?.resolveRegionPolicy?.(e)?.persist==="none"?!0:r.canWrite()}function bn(e,t){if(typeof t!="function")throw new Error("Sap.batch(label, fn): fn must be a function");let r=$("undo");r&&r.flush&&r.flush();let n=t();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(e),n}function gn(e){if(typeof window>"u"||typeof document>"u")return;let t=()=>{let p=!1;for(let k of e.apps())k.root.isConnected?e.runNow(k,"platform"):p=!0;p&&e.pruneDisconnected(),e.remountIfPresent()},r=$("derived"),n=r&&typeof r.register=="function"?r.register(t):null,o=typeof n=="function"?null:Ae(document,dr,t),s=Ae(document,mr,t),i=null,g=!1,b=()=>{let p=i;i=null,p&&(p[2](),p[3]())},m=()=>{if(g)return!1;let p=$("undo"),k=hn()?.state?.generation;if(i&&i[0]===p&&i[1]===k)return!0;if(b(),!p||typeof p.on!="function")return!1;let R=p.on("undo",t);if(typeof R!="function")return!1;let L=p.on("redo",t);return typeof L!="function"?(R(),!1):(i=[p,k,R,L],!0)};m();let d=[ut,pr,hr].map(p=>Ae(document,p,m)),l=$("ready");return l&&typeof l.then=="function"&&l.then(m,()=>{}),()=>{g=!0,typeof n=="function"&&n(),o&&o(),s();for(let p of d)p();b()}}function ct(e){let t=e.tagName;if(t==="INPUT"){let r=(e.getAttribute("type")||"text").toLowerCase();return r==="checkbox"?"checkbox":r==="radio"?"radio":r==="number"||r==="range"?"number":r==="hidden"?"hidden":"text"}return t==="TEXTAREA"?"text":t==="SELECT"?e.multiple?"select-multiple":"select-one":"leaf"}function br(e){if(e.validity&&e.validity.badInput)return e.hasAttribute("value")?Number(e.getAttribute("value"))||0:e._sapLastGood??0;if(e.value==="")return 0;let t=Number(e.value);return Number.isNaN(t)?e._sapLastGood??0:(e._sapLastGood=t,t)}function wn(e,t){switch(t){case"checkbox":return e.checked;case"radio":return e.checked?e.value:void 0;case"number":return br(e);case"select-one":return e.value;case"select-multiple":return[...e.selectedOptions].map(r=>r.value);case"hidden":case"text":return e.value;case"leaf":return e.textContent;default:return e.value}}function gr(e,t,r){switch(t){case"checkbox":e.checked=!!r;break;case"radio":e.checked=String(e.value)===String(r);break;case"number":case"text":case"hidden":e.value=r==null?"":String(r);break;case"select-one":e.value=r==null?"":String(r);break;case"select-multiple":{let n=new Set((Array.isArray(r)?r:[r]).map(String));for(let o of e.options)o.selected=n.has(o.value);break}case"leaf":e.textContent=r==null?"":String(r);break;default:e.value=r==null?"":String(r)}}function yn(e){if(e.hasAttribute("transient")){e.removeAttribute("value"),e.removeAttribute("checked"),e.removeAttribute("data-value");return}Be(e)||se(e)}function yr(e){e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0}))}function An(e,t){return wn(e,t)}function xn(e){let t=ct(e);return{el:e,kind:t,read(){return wn(e,t)},write(r,n={}){gr(e,t,r),n.noMirror||yn(e),n.silent||yr(e)},mirror(){yn(e)}}}var wr=[],F=null,je=0,ft=null,We=!1,ue=null;function En(e){let t=null;return{kind:"hub",flush(){e.pause(),e.resume()},subscribe(r){let n=e.onAnyChange({debounce:0,require:"observed"},r);typeof n=="function"&&(t=n)},suppress(r){e.pause();try{return r()}finally{e.resume()}},teardown(){if(t){try{t()}catch{}t=null}}}}function Ar(){let e=null,t=null;function r(){let n=e?e.takeRecords():wr;n.length&&t(vn(n))}return{kind:"native",flush:r,subscribe(n){t=n,e=new MutationObserver(s=>n(vn(s)));let o=document.body||document.documentElement;o&&e.observe(o,{childList:!0,subtree:!0,attributes:!0,characterData:!0})},suppress(n,o){let s=$("undo");o&&r(),s&&s.pause&&s.pause();try{return n()}finally{e&&e.takeRecords(),s&&s.resume&&s.resume()}},teardown(){e&&(e.disconnect(),e=null)}}}function vn(e){let t=[];for(let r of e)if(r.type==="attributes"){let n=r.target;n&&n.nodeType===1&&!xe(n)&&t.push({type:"attribute",element:n,attribute:r.attributeName})}else if(r.type==="characterData"){let n=r.target&&r.target.parentElement;n&&!xe(n)&&t.push({type:"characterData",element:n})}else if(r.type==="childList"){let n=r.target;n.nodeType===1&&[...r.addedNodes,...r.removedNodes].some(s=>s.nodeType===3)&&!xe(n)&&t.push({type:"characterData",element:n});let o=r.addedNodes.length>0&&n.nodeType===1&&ne(n);for(let s of r.addedNodes)s.nodeType!==1||xe(s)||(o?t.push({type:"add",element:s,parent:n}):O(s,i=>{(i===s||!xe(i))&&t.push({type:"add",element:i,parent:n})}));for(let s of r.removedNodes)s.nodeType===1&&t.push({type:"remove",element:s,parent:n})}return t}function xe(e){return!!(e.closest&&e.closest("[sap-ignore],[template],[cms-template]"))}function xr(e,t){e.pruneDisconnected();let r=new Map,n=!1;for(let o of t){let s=o.type==="remove"?o.parent:o.element,i=s&&e.appFor(s);if(i){let g=r.get(i);g?g.push(o):r.set(i,[o])}o.type==="add"&&o.element&&o.element.nodeType===1&&o.element.hasAttribute&&o.element.hasAttribute("sap")&&!(e.isRegistered&&e.isRegistered(o.element))&&(n=!0)}n&&(ft=e.remountIfPresent,je?queueMicrotask(dt):dt());for(let[o,s]of r)o.root.isConnected&&e.schedule(o,"mutation",s)}function dt(){let e=ft;ft=null,e?.()}function ce(e){if(F){let r=!je++;try{return F.suppress(e,r)}finally{je--}}let t=$("undo");if(t&&t.pause&&t.resume){t.pause();try{return e()}finally{t.resume()}}return e()}function lt(e,t){We=!0,F=e,e.subscribe(r=>xr(t,r))}function pt(e){if(We||typeof window>"u"||typeof document>"u")return;let t=$("Mutation");if(t&&typeof t.onAnyChange=="function"){lt(En(t),e);return}typeof MutationObserver=="function"&&(lt(Ar(),e),ue=Ae(document,ut,function(){let n=$("Mutation");n&&(ue(),ue=null,F&&F.teardown(),We=!1,lt(En(n),e))}))}function mt(){if(F)try{F.teardown()}catch{}ue&&typeof document<"u"&&ue(),F=null,We=!1,ue=null}function kn(){je||(F&&F.flush(),dt())}var Er=new Set(ee),Ee=Object.freeze([]),z=[],Nn={},Tn={},ht=null;function He(e){z.includes(e)||(z.push(e),z.sort((t,r)=>(t.order??100)-(r.order??100)),e.boundary&&Object.assign(Nn,e.boundary),e.paintKinds&&Object.assign(Tn,e.paintKinds))}function Rn(e){ht=e}function ze(e,t={}){if(t.breaker){e.diag.error("E26",e.root,{problem:"recompute loop halted after 50 passes; recent triggers: "+(e._breakerRing||[]).join(", ")}),D(e.root,"loop");return}t.full&&(Ie(),tn()),e._inPass=!0;let r=Jt(e.root),n=null;try{ce(()=>{n=vr(e,t)})}finally{e._inPass=!1,Qt(r)}ht&&n&&ht(e,n),e._viewsChanged&&(e._viewsChanged=!1,e.root.dispatchEvent(new CustomEvent("sap:views-updated",{bubbles:!0})))}function vr(e,t){let r=e.root,n={},o=[],s=[],i=new Set;e.diag.errors=[];let g=t.full||e._changes===!1?null:e._changes||Ee;e._changes=null;let b=new Set,m=new Map,d=(u,a)=>u.map(c=>m.get(c)?.push(a)??m.set(c,[a])),l={root:n,state:n,item:null,ownerEl:r,projection:!1},p=null;function k(u,a,c=!1){let f=a.attr||a.name,h=c?cn(u,f):u.getAttribute(f);return h==null&&(h=tt(a),s.push({el:u,name:a.name,attr:f,value:Pt(Le(h,a.type),a.type)})),Le(h,a.type)}function R(u,a,c,f){let h=a.decls;if(!h)return;let y=!!f.item&&!f.projection&&!f.view;for(let E of h){if(E.transient){p&&(p.pure=!1),c[E.name]=Ct(u,E);continue}if(et(u,E)){c[E.name]=u.hasAttribute(E.attr);continue}c[E.name]=k(u,E,y)}}function L(u,a,c){let f=a.bind,h=c.item||c.state,y=ct(u);p&&(y!=="leaf"||a.transient)&&(p.pure=!1),y==="radio"?(f in h||(h[f]=""),u.checked&&(h[f]=u.value)):y==="leaf"&&c.item&&!c.projection&&!c.view?h[f]=ln(u):h[f]=An(u,y),a.transient&&(u.removeAttribute("value"),u.removeAttribute("checked"))}function _(u,a,c){let f=!1;if(a.waits&&b.add(a.waits),a.wants&&(d(a.wants,u),f=!0),p&&a.impure&&(p.pure=!1),a.paints){f=!0;for(let h of a.paints)h.kind==="when"&&i.add(h.field),o.push({def:h,el:u,ctx:c})}for(let h of z)h.collect&&h.collect(S,u,a,c)!==!1&&(f=!0);p&&f&&(a.calcs&&(p.pure=!1),p.collects.push(u,a))}function G(u,a,c){Object.defineProperty(u,"$key",{value:_t(a,"row"),enumerable:!1}),Object.defineProperty(u,"$index",{value:c,enumerable:!1,configurable:!0}),Object.defineProperty(u,"$el",{value:a,enumerable:!1})}function B(u,a,c){let f=K(u);R(u,f,a,c),u._sapScope=a,!c.projection&&f.bind!=null&&L(u,f,c),_(u,f,c),f.items?Y(u,a,c):j(u,a,c)}function j(u,a,c){for(let f=u.firstElementChild;f;f=f.nextElementSibling)U(f,a,c)}function U(u,a,c){let f=K(u);if(!f.inert){if(f.boundary){if(p&&(p.pure=!1),f.boundary==="scope")T(u,a,c);else if(f.boundary==="items")_(u,f,c),Y(u,a,c);else if(f.waits)b.add(f.waits);else{let h=Nn[f.boundary];h?h(S,u,f,a,c):f.wants&&d(f.wants,u)}return}!c.projection&&!c.view&&f.bind!=null&&L(u,f,c),_(u,f,c);for(let h=u.firstElementChild;h;h=h.nextElementSibling)U(h,a,c)}}function T(u,a,c){let f=u.getAttribute("scope"),h={};a[f]=h;let y={root:c.root,state:h,item:null,ownerEl:u,projection:c.projection};B(u,h,y)}function Y(u,a,c){p&&(p.pure=!1);let f=u.getAttribute("items"),h=[];a[f]=h,u._sapList=h;let y=!c.projection&&!c.view&&nn(),E=0;for(let N=u.firstElementChild;N;N=N.nextElementSibling){let x=K(N);if(!x.item||x.template||x.cms)continue;let w=y?rn(N):void 0;h.push(w&&w.plan===x&&Object.isExtensible(w.obj)&&A(w,N,E,c)||v(N,x,E,c,y)),E++}}function v(u,a,c,f,h){let y={};G(y,u,c);let E={root:f.root,state:f.state,item:y,ownerEl:u,projection:f.projection};if(!h)return B(u,y,E),y;let N=p,x={plan:a,obj:y,fields:null,presence:Ee,pending:Ee,collects:[],pure:!0},w=s.length,qe=e.diag.errors.length;p=x;try{B(u,y,E)}finally{p=N}if(!x.pure||e.halted||e.diag.errors.length!==qe)return y;let Q=[];for(let Z of Object.keys(y)){let Ge=y[Z];if(Ge!==null&&typeof Ge=="object")return y;Q.push(Z,Ge)}if(a.decls)for(let Z of a.decls)et(u,Z)&&(x.presence===Ee?x.presence=[]:x.presence).push(Z.name,Z.attr);return s.length>w&&(x.pending=s.slice(w)),x.collects.length||(x.collects=Ee),x.fields=Q,on(u,x),y}function A(u,a,c,f){let h=u.obj;try{h.$index!==c&&Object.defineProperty(h,"$index",{value:c,enumerable:!1,configurable:!0});let N=u.presence;for(let w=0;w<N.length;w+=2)h[N[w]]=a.hasAttribute(N[w+1]);let x=u.fields;for(let w=0;w<x.length;w+=2)h[x[w]]=x[w+1]}catch{return De(a),null}a._sapScope=h;let y=u.pending;for(let N=0;N<y.length;N++)s.push(y[N]);let E=u.collects;if(E.length){let N={root:f.root,state:f.state,item:h,ownerEl:a,projection:f.projection};for(let x=0;x<E.length;x+=2)_(E[x],E[x+1],N)}return h}let S={app:e,root:r,rootObj:n,paints:o,stats:{calcs:0,lists:0},resolveDefault:k,collectEl:_,walkScope:j,changes:g,full:g===null,trigger:t.cause||t.trigger||"refresh",waiting:b,wanted:m};for(let u of z)u.begin&&u.begin(S);let P=t.cacheReads===!1?null:sn(r);try{B(r,n,l)}finally{t.cacheReads!==!1&&an(P)}if(e.halted||b.size)return S;for(let u of z)u.afterIntake&&u.afterIntake(S);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 z)u.compute&&u.compute(S);let C=0;for(let u of z)u.reconcile&&(C+=u.reconcile(S));let J=0,I=C;for(let u of o){let a=Nr(u,e);u.ctx.view?I+=a:J+=a}for(let u of z)u.afterPaint&&u.afterPaint(S);return e._state=n,e._stats={fields:Object.keys(n).filter(u=>typeof n[u]!="function").length,calcs:S.stats.calcs,paints:o.length,lists:S.stats.lists,writes:J,viewWrites:I},e._viewsChanged=I>0,e._lastPass={trigger:t.trigger||"refresh",writes:J},e._debug&&console.log(`sap pass \xB7 trigger: ${e._lastPass.trigger} \xB7 writes ${J}/${o.length}`),S}function kr(e){let t=e.kind==="text"?e.fmt||null:e.arg;return t==null?e.kind:e.kind+":"+t}function Sr(e,t,r,n){let o=e;for(;o&&o.nodeType===1;){if(o.hasAttribute&&o.hasAttribute(t)){let s=r.includes(o.getAttribute(t));if(n?!s:s)return!0}o=o.parentElement}return!1}function Nr(e,t){let r=e.def,n=e.el,o=Tn[r.kind];if(o)return o(e,t);if(r.kind==="when")return Sn(r,n,null);try{let s=ye(r.entry,e.ctx.state,e.ctx.item,n,e.ctx.root),i=Sn(r,n,s);return fe(n),i}catch(s){return t.diag.error(s.sapCode==="E22"?"E22":"E24",n,{attr:kr(r),expr:r.entry&&r.entry.src,problem:String(s.message)}),D(n,s.sapCode||"E24"),0}}function Sn(e,t,r){switch(e.kind){case"text":{let n=e.fmt!=null?Wt(e.fmt,r):r==null?"":String(r);return t.textContent!==n?(t.textContent=n,1):0}case"show":{let n=!r;return t.hidden!==n?(t.hidden=n,1):0}case"when":{let n=$("optionVisibility");if(n&&n._started)return t._sapWhen&&t.hidden?(t.hidden=!1,t._sapWhen=!1,1):0;t._sapWhen=!0;let o=Sr(t,e.field,e.values,e.match==="show-not")===(e.match==="hide");return t.hidden!==o?(t.hidden=o,1):0}case"attr":{let n=e.arg;if((n==="checked"||n==="selected")&&typeof t[n]=="boolean"&&!t.hasAttribute("bind")&&!t.closest("select[bind]")){let s=0;return t[n]!==!!r&&(t[n]=!!r,s=1),!!r!==t.hasAttribute(n)&&(r?t.setAttribute(n,""):t.removeAttribute(n),s=1),s}if(Er.has(n)){let s=t.hasAttribute(n);return r&&!s?(t.setAttribute(n,""),1):!r&&s?(t.removeAttribute(n),1):0}let o=typeof r=="boolean"?String(r):r==null?"":String(r);return t.getAttribute(n)!==o?(t.setAttribute(n,o),1):0}case"class":{let n=!!r;return t.classList.contains(e.arg)!==n?(t.classList.toggle(e.arg,n),1):0}case"css":{let n=r==null?"":String(r);return t.style.getPropertyValue("--"+e.arg)!==n?(t.style.setProperty("--"+e.arg,n),1):0}default:return 0}}var Tr=new Set(ee),_n=new Set(["calc","text","attr","class","css","set","move","sort","option","option-not","show-when","hide-when","editmode","viewmode"]),Rr=new Set(["show-when","hide-when","option","option-not"]),_r=/\b(?:state|item|root)\.|===|!==|&&|\|\||[()]|^\s*!/,$n=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"]),gt=[];function Ue(e){gt.includes(e)||gt.push(e)}function $r(e){return e.tagName==="INPUT"||e.tagName==="SELECT"||e.tagName==="TEXTAREA"}function bt(e){return e.hasAttribute("bind")}function Lr(e,t){t(e);for(let n=e.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}if(t(n),!te(n))for(let o=n.firstElementChild;o;o=o.nextElementSibling)r(o)}}}function Ln(e,t){let r=!1,n=(i,g,b)=>{t.error(i,g,b),r=!0},o=e.ownerDocument.createTreeWalker(e,5,{acceptNode:i=>i.nodeType===3?1:te(i)||i.hasAttribute("bind")||i.hasAttribute("sap-ignore")?2:3}),s;for(;s=o.nextNode();)if(/\{\{.*\}\}/.test(s.nodeValue||"")){n("E02",s.parentElement||e,{problem:"moustaches in text content are not a Sap feature",fix:'move the expression onto the element: text="state.x"'});break}return Lr(e,i=>{let g=new Set;for(let m of gt)m(i,n,d=>g.add(d));let b=i.closest&&i.closest("[detail]");for(let m of[...i.attributes]){let d=m.name;if(g.has(d))continue;if(d.includes(":")){let p=d.slice(0,d.indexOf(":"));if(!_n.has(p)&&!Je(d)){let k=Ke(p,[..._n]);t.warn("W03",i,{attr:d,problem:`unknown "${p}:" attribute`,didYouMean:k?`${k}:`:null})}else if(Rr.has(p)&&_r.test(m.value)){let k=d.slice(d.indexOf(":")+1);t.warn("W04",i,{attr:d,expr:m.value,problem:`${p}: compares the "${k}" attribute against a literal value, not a JS expression`,fix:`use show="${m.value}" for an expression, or a literal like ${p}:${k}="overview"`})}}else if(!$n.has(d)&&!Je(d)&&!Xe.has(d)&&!Tr.has(d)&&!/^(data-|aria-|on)/.test(d)&&!(d in i)){let p=Ke(d,[...$n]);p&&t.warn("W03",i,{attr:d,problem:`unknown "${d}" attribute`,didYouMean:p})}d==="attr:hidden"&&t.warn("W03",i,{attr:d,problem:"attr:hidden paints the wrong attribute",fix:'use show="expr"'});let l=bt(i)||d==="attr:selected"&&i.tagName==="OPTION"&&!!i.closest("select[bind]");(d==="attr:value"||d==="attr:checked"||d==="attr:selected")&&l&&n("E30",i,{attr:d,problem:"attr: on a bound control collides with persist ownership",fix:"remove it; bind owns this attribute"}),d==="effect"&&bt(i)&&/\b(value|checked)\s*=[^=]/.test(m.value)&&n("E30",i,{attr:d,expr:m.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"}),(d==="text"||d.startsWith("text:")||d==="show")&&$r(i)&&(d==="show"||n("E18",i,{attr:d,problem:"paint belongs on output elements, not form controls",fix:"move the paint to an <output> or <span>"}))}if(i.hasAttribute("state")){let m=$e(i.getAttribute("state")),d=new Set;for(let l of m){l.name.includes("-")&&n("E08",i,{attr:"state",problem:`field "${l.name}" is not a valid identifier (the hyphen parses as subtraction)`,fix:`rename to ${l.name.replace(/-/g,"")}`}),d.has(l.name)&&n("E04",i,{attr:"state",problem:`field "${l.name}" is declared twice in one scope`}),d.add(l.name),Et.has(l.attr)&&n("E05",i,{attr:"state",problem:`"${l.name}" is a reserved Sap word`}),Xe.has(l.attr)&&n("E06",i,{attr:"state",problem:`"${l.name}" is a global HTML attribute name; pick another field name`}),l.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=Ze(i,l.attr);p&&(l.attr==="checked"||l.attr==="selected")&&n("E35",i,{attr:"state",problem:`"${l.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&&l.type==="num"&&n("E35",i,{attr:"state",problem:`"${l.attr}" is an HTML boolean attribute; it cannot hold a number`,fix:`declare it bare: state="${l.attr}"`}),l.transient&&(p||l.type==="presence")&&n("E35",i,{attr:"state",problem:`"${l.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(bt(i)){if(i.hasAttribute("-"),i.tagName==="INPUT"){let m=(i.getAttribute("type")||"text").toLowerCase();m==="file"&&n("E32",i,{attr:"bind",problem:"files never serialize into an HTML file",fix:"use no-save + effect instead of bind"}),m==="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 m=i.getAttribute("contenteditable");!(m!=null&&m!=="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]'))&&t.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 m=i.parentElement;(!m||!m.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")&&b&&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 m=e.querySelector(`[trigger-add="${i.getAttribute("items")}"]`);!Lt(i)&&!Qe(e,i.getAttribute("items"))&&$t(i).length===0&&m&&n("E17",i,{attr:"items",problem:`trigger-add targets items="${i.getAttribute("items")}" but it has no [item template] to clone`})}}),r&&(t.halted=!0,t.haltReason=t.errors[0]?t.errors[0].code:"halt",D(e,t.haltReason)),!r}var Pn="sap-styles",Cn="[item][template]{display:none!important}[hidden]{display:none!important}[sap-error]{outline:2px solid #e5484d;outline-offset:1px}",yt=new WeakSet;function Pr(e){if(yt.has(e))return;let t=e.defaultView,r=t&&t.CSSStyleSheet;if(r&&"adoptedStyleSheets"in e)try{let n=new r;n.replaceSync(Cn),e.adoptedStyleSheets=[...e.adoptedStyleSheets,n],yt.add(e);return}catch{}if(!e.getElementById(Pn)){let n=e.createElement("style");n.id=Pn,n.textContent=Cn,(e.head||e.documentElement).appendChild(n)}yt.add(e)}var Cr=0;function On(){return typeof performance<"u"&&performance.now?performance.now():0}function wt(e){let t=e.id||e.getAttribute("sap")||`app-${Cr++}`,r=new Ne(t),n={root:e,name:t,diag:r,_state:null,_stats:null,_lastPass:null,_passes:0,_broken:!1,_mountMs:0,_mountWrites:0};if(!Ln(e,r))return n.halted=!0,n;Pr(e.ownerDocument);for(let i of e.querySelectorAll("textarea[data-value]"))me(i)||Fe(i);let s=On();return ze(n,{trigger:"mount",full:!0}),n._mountMs=On()-s,n._mountWrites=n._stats?n._stats.writes:0,n._mountWrites>0&&!pn()&&!$("derived")&&r.warn("W30",e,{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 Or=/^(set:|move:|sort:|trigger-add$|trigger-remove$|trigger-reset$)/;function Mr(e){return`${e.tagName.toLowerCase()}[sap]`}function Ir(e){let t={actions:0,lists:0,rows:0};return O(e,r=>{r.hasAttribute("items")&&t.lists++,r!==e&&r.hasAttribute("item")&&!r.hasAttribute("template")&&t.rows++,[...r.attributes].some(n=>Or.test(n.name))&&t.actions++}),t}function Mn(e){function t(i){let g=i._stats||{},b=i.root;return{root:Mr(b),fields:g.fields||0,calcs:g.calcs||0,paints:g.paints||0,...Ir(b),warnings:i.diag.warnings.length,errors:i.diag.errors.length,mountWrites:i._mountWrites||0,ms:Math.round((i._mountMs||0)*10)/10,passes:i._passes||0,lastPass:i._lastPass||null,ok:i.diag.errors.length===0&&!i.halted}}function r(){let i=e.apps().map(t);return{ok:i.every(g=>g.ok),apps:i}}function n(i){let g=t(i);return g.ok?`sap \u2713 ${g.root} \xB7 fields ${g.fields} \xB7 calcs ${g.calcs} \xB7 paints ${g.paints} \xB7 actions ${g.actions} \xB7 lists ${g.lists} \xB7 rows ${g.rows} \xB7 warnings ${g.warnings} \xB7 mount writes ${g.mountWrites} \xB7 ${g.ms}ms`:`sap \u2717 ${g.root} \xB7 errors ${g.errors} \xB7 warnings ${g.warnings} \xB7 ${g.ms}ms`}function o(){let i=[],g=[];for(let b of e.apps())i.push(...b.diag.errors),g.push(...b.diag.warnings);return{ok:i.length===0,errors:i,warnings:g,counts:{errors:i.length,warnings:g.length}}}function s(i){let g=i===void 0?!0:!!i;for(let b of e.apps())b._debug=g;return console.log(`sap debug ${g?"on":"off"} \u2014 per-pass headers will ${g?"":"no longer "}log`),g}return{status:r,report:o,debug:s,greenLine:n}}var ve="0.9.1";var In={};var Dr=/^(https:\/\/(?:cdn\.jsdelivr\.net\/npm|unpkg\.com)\/@panphora\/sapjs)(?=[@/]|$)/,Dn=e=>new Promise(t=>setTimeout(t,e)),Fn=e=>e.getAttribute("plugins")?.match(/\S+/g)||[];function Bn(e,t,r){let n=new Map,o=new Map,s=new Map,i=new Map,g=[],b=new Set,m={},d=!1,l,p=globalThis,k=Array.isArray(p.sapPlugins)?p.sapPlugins:p.sapPlugins==null?p.sapPlugins=[]:[],R=p.document?.currentScript?.src||"",L=Dr.exec(R),_=a=>o.get(a)?.api||null,G=a=>Promise.allSettled(a.map(C));function B(){let a=new Map;for(let c of n.values())if(!o.has(c.name))for(let f of c.helpers||[])a.set(f,c.name);Ut(m,a),Ie()}function j(a){n.set(a.name,{...n.get(a.name),...a}),kt(a),B()}function U(a){n.has(a.name)||j(a)}function T(a){k.includes(a)||k.push(a),j(a)}function Y(a){for(let c of e.apps())c.root.isConnected&&e.schedule(c,a)}let v=Object.freeze({api:1,version:ve,compile:Ce,run:qt,runWith:ye,planOf:K,drainPlans:Zt,forgetRow:De,setBeacon:D,clearBeacon:fe,write:ce,schedule(a,c="plugin"){let f=a?.root?a:e.appFor(a);f&&e.schedule(f,c)},appFor:e.appFor,apps:e.apps,capability:$,mayWrite:ae,load:C,plugin:_});function A(a){if(typeof a=="string")return C(a);let{name:c,api:f}=a,h=w=>{throw new Error(`Sap.use: plugin "${c}" ${w}`)};if((typeof c!="string"||f!==1)&&h(`needs a name and plugin API ${1}; it gives API ${f}`),d)return null;if(o.has(c))return _(c);if((a.requires||[]).some(w=>!o.has(w)))return T(a),g.includes(a)||g.push(a),null;let y=a.setup?.(v)||{},E=(w,qe)=>{for(let Q of Array.isArray(a[w])?a[w]:Object.keys(a[w]||{}))(typeof(y[w]||{})[Q]!="function"||qe(Q))&&h(`cannot add "${Q}" to ${w}: the name is taken or not valid, or setup does not supply it`)},N=w=>!Re(w,c);E("helpers",w=>(it(w)&&h(`cannot add "${w}": window.${w} exists; rename the helper`),!Vt(w)||w in m)),E("boundaries",N),E("directives",N);for(let w in y.api)w in t&&h(`cannot add Sap.${w}: the name is taken`);T(a);let x={...y,name:c,order:a.order,boundary:{}};for(let w in a.boundaries)x.boundary[w]=y.boundaries[w];for(let w of a.helpers||[])m[w]=y.helpers[w];for(let w in y.formats)w in W||(W[w]=y.formats[w]);return He(x),y.lint&&Ue(y.lint),Object.assign(t,y.api),o.set(c,x),i.delete(c),St(c,y.directives||!0),B(),ce(()=>b.forEach(fe)),b.clear(),g.splice(0).forEach(S),Y("plugin:"+c),_(c)}function S(a){try{A(a)}catch(c){console.error(c)}}function P(a){if(d||o.has(a))return null;let c=n.get(a)||{},f=I.loader?.(a,c),h=c.url||I.base&&I.base+(c.file||a)+".js";return(f!==void 0?Promise.resolve(f):new Promise((E,N)=>{if(!h)throw new Error(`no address for plugin "${a}": call Sap.use(definition)`);let x=document.createElement("script");x.src=h,x.setAttribute("clay","editor-ui"),x.onload=x.onerror=w=>{x.remove(),w.type==="load"?E():N(new Error("could not load "+h))},document.head.append(x)})).then(E=>{if(d)return;let N=E?.default||E||k.find(x=>x.name===a);if(N?.name&&A(N),!o.has(a))throw new Error(`plugin "${a}" loaded and did not register`)})}function C(a){if(o.has(a))return Promise.resolve(_(a));if(s.has(a))return s.get(a);i.delete(a);let c=Promise.all((n.get(a)?.requires||[]).map(C)).then(()=>P(a));for(let h of I.retryDelays)c=c.catch(()=>Dn(h).then(()=>P(a)));let f=c.finally(()=>s.delete(a)).then(()=>_(a),h=>{throw i.set(a,h),l||=!p.addEventListener?.("online",()=>I.retry()),Y("plugin-failed:"+a),document.dispatchEvent(new CustomEvent("sap:plugin-failed",{detail:{plugin:a,error:h}})),h});return s.set(a,f),f}function J(a){let c=new Set;for(let f of a.closest?.("[sap]")?[a]:a.querySelectorAll("[sap]")){for(let h of Fn(f.closest("[sap]")))c.add(h);n.size>o.size&&O(f,h=>{let y=K(h);return y.inert?!1:(y.wants?.map(E=>c.add(E)),!!c.add(y.waits))})}return[...c].filter(f=>f&&!o.has(f))}Rn((a,c)=>{for(let f of new Set([...c.wanted.keys(),...c.waiting,...Fn(a.root)])){if(o.has(f))continue;let h=i.get(f);if(!h)C(f).catch(()=>{});else{let y=c.wanted.get(f)?.[0]||a.root;a.diag.error("E52",y,{problem:`the "${f}" plugin did not load: ${h.message}`,fix:"Sap.plugins.retry() tries again"}),b.add(y),ce(()=>D(y,"E52"))}}});let I={api:1,base:L?`${L[1]}@${ve}/dist/sap-plugins/`:/^[^:]+:\//.test(R)?new URL("sap-plugins/",R).href:null,loader:null,retryDelays:[1e3,4e3],declare:U,load:C,ready(a=document,c=3e3){let f=new Set,h=()=>{let E=J(a).filter(N=>!f.has(N)&&f.add(N));return E.length&&G(E).then(h)},y=h();return y?Promise.race([y,Dn(c)]):null},has:a=>o.has(a),status:()=>({installed:[...o.keys()],loading:[...s.keys()],failed:[...i.keys()]}),retry:a=>G(a?[a]:[...i.keys()])};function u(){let a=[],c=()=>(kn(),r.flushNow()),f=[...o.values()].filter(h=>h.flush);c();for(let h=0;f.length&&h<8;h++){for(let y of f){let E=y.flush();E?.then&&a.push(E)}if(!c())break}return a.length?Promise.all(a).then(u):null}t.use=A,t.plugins=I,t.flush=u;for(let a of Object.values(In))U(a);return k.slice().forEach(S),function(){d=!0;for(let c of o.values())c.dispose?.();o.clear(),i.clear()}}function jn({createAccessor:e,installInput:t,debugExtras:r}){let n=new Map,o=[],s=xt(ze);function i(v){let A=v;for(;A;){if(A.nodeType===1&&A.hasAttribute&&A.hasAttribute("sap"))return n.get(A)||null;A=A.parentNode&&A.parentNode.host?A.parentNode.host:A.parentElement}return null}function g(){for(let v=o.length-1;v>=0;v--){let A=o[v];A.root.isConnected||(n.delete(A.root),o.splice(v,1))}}function b(v,A){if(v.moveBefore)try{v.moveBefore(A,null);return}catch{}v.appendChild(A)}function m(v,A){let S=A.parentElement;if(S){if(S.moveBefore)try{S.moveBefore(v,A);return}catch{}S.insertBefore(v,A)}}let d={apps:()=>o.slice(),appFor:i,isRegistered:v=>n.has(v),pruneDisconnected:g,schedule:s.schedule,runNow:(v,A)=>s.runNow(v,A),moveInto:b,placeBefore:m,remountIfPresent:()=>j()},l=e(d),p=Mn(d),k=r?r(d,p):{},R=!1,L=!1,_=null;function G(){R||(R=!0,t(d,l,document),_=gn(d))}function B(){let v=$("derived");v&&typeof v.mounted=="function"&&v.mounted()}function j(v=document){if(L)return[];G(),pt(d);let A=v.querySelectorAll("[sap]"),S=[];for(let P of A){if(n.has(P)||me(P))continue;let C=wt(P);n.set(P,C),o.push(C),S.push(C)}for(let P of S){let C=p.greenLine(P);P.diag.errors.length||P.halted?console.error(C):console.log(C)}return B(),S}function U(v){if(L)return null;if(G(),pt(d),!v)return j();let A=typeof v=="string"?document.querySelector(v):v;if(!A)return null;if(n.has(A))return n.get(A);let S=wt(A);n.set(A,S),o.push(S);let P=p.greenLine(S);return S.diag.errors.length||S.halted?console.error(P):console.log(P),S}let T=l.Sap;T.version=ve,T.refresh=function(){for(let A of o.slice())A.root.isConnected&&s.runNow(A,"refresh")},T.batch=bn,T.status=p.status,T.report=p.report,T.why=k.why,T.debug=p.debug,T.doctor=k.doctor,T.greenLine=p.greenLine,T.formats=W,T.serializeControlToAttributes=se,T.finalizeControlForSave=dn,T.rehydrateControlFromAttributes=Fe,T.mount=U,T.config=function(A={}){return A.formats&&Object.assign(W,A.formats),T},T._registry=n,T._reset=function(){n.clear(),o.length=0,mt()},T.unmount=function(){L=!0,n.clear(),o.length=0,mt(),typeof _=="function"&&_(),Y()};let Y=Bn(d,T,s);return{Sap:T,mountAll:j,mount:U,runtime:d}}function Wn(e){if(typeof document>"u")return;let t=()=>mn(()=>e());document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t):t()}function Hn(e){let t=[];function r(b){let m=b.target;if(!m||m.nodeType!==1)return;let d=e.appFor(m);if(d){m.hasAttribute("persist")&&!Be(m)&&ae(m)&&se(m);for(let l of t)if(l(m,d))return;e.schedule(d,b.type+" "+(m.id||m.tagName.toLowerCase()))}}function n(b){let m=b.target,d=e.appFor(m);d&&[...m.querySelectorAll("[bind]")].every(l=>ae(l))&&setTimeout(()=>{m.querySelectorAll("[bind]").forEach(l=>{l.dispatchEvent(new Event("input",{bubbles:!0})),l.dispatchEvent(new Event("change",{bubbles:!0}))}),e.schedule(d,"reset")},0)}function o(b){let m=e.appFor(b.target);m&&e.schedule(m,"toggle")}function s(b){let m=b.detail||{};for(let d of[m.from,m.to,b.target]){if(!d||d.nodeType!==1)continue;let l=e.appFor(d);l&&e.schedule(l,"sorted")}}function i(b){if(b.key!=="ArrowUp"&&b.key!=="ArrowDown")return;let m=b.target;if(!m||m.nodeType!==1||m.tagName!=="INPUT"||!m.hasAttribute("bind")||!m.hasAttribute("step"))return;let d=(m.getAttribute("type")||"text").toLowerCase();if(d!=="text"&&d!=="tel"&&d!=="search"||!e.appFor(m)||!ae(m))return;b.preventDefault();let p=M(m.getAttribute("step"))||1,k=b.key==="ArrowUp"?1:-1,R=M(m.value)+p*(b.shiftKey?10:1)*k,L=m.getAttribute("min"),_=m.getAttribute("max");L!==null&&L!==""&&R<M(L)&&(R=M(L)),_!==null&&_!==""&&R>M(_)&&(R=M(_)),xn(m).write(String(Number(R.toFixed(2))))}function g(b=document){b.addEventListener("reset",n),b.addEventListener("toggle",o,!0),b.addEventListener("input",r),b.addEventListener("change",r),b.addEventListener("clay:sorted",s),b.addEventListener("keydown",i)}return{install:g,addRouter:b=>t.push(b)}}var ke="https://clayjs.com/v1/sap.js",Fr=/^(calc|set|move|sort):/,Br=new Set(["each","detail","effect","invalid","confirm","trigger-add","trigger-remove","trigger-reset"]);function At(e){return Fr.test(e)||Br.has(e)}Ue((e,t)=>{for(let r of e.attributes)At(r.name)&&t("E50",e,{attr:r.name,expr:r.value,problem:`${r.name} is full sapjs; the sapjs core only paints declared state`,fix:`load ${ke}; the markup stays as it is`})});function le(e,t,r){e.app.diag.error("E50",t,{attr:r,problem:`${r} is full sapjs; the sapjs core only paints declared state`,fix:`load ${ke}; the markup stays as it is`}),D(t,"E50"),e.app.halted=!0}He({name:"core-only",collect(e,t,r){r.calcs&&le(e,t,"calc:"+r.calcs[0].name),r.effects&&le(e,t,"effect"),r.invalids&&le(e,t,"invalid");for(let n of t.attributes)At(n.name)&&(n.name.startsWith("calc:")&&r.calcs||n.name==="effect"&&r.effects||n.name==="invalid"&&r.invalids||le(e,t,n.name));return!1},boundary:{each(e,t){le(e,t,"each")},detail(e,t){le(e,t,"detail")}}});function jr(){return{Sap:function(){throw new Error(`Sap(el) is full sapjs; load ${ke}`)}}}var zn=e=>()=>(console.warn(`Sap.${e} is full sapjs; load ${ke}`),null),{Sap:Se,mountAll:Un,mount:Wr,runtime:Hr}=jn({createAccessor:jr,debugExtras:()=>({why:zn("why"),doctor:zn("doctor")}),installInput(e,t,r){Hn(e).install(r)}});Se.core=!0;var zr=typeof window<"u"&&window.Sap&&!window.Sap.core;zr?Se.unmount():Wn(Un);typeof window<"u"&&!window.Sap&&(window.Sap=Se);var Ur=Se;return Kn(Vr);})();
|
|
9
|
+
`+t.value:t.value;e.textContent!==n&&(e.textContent=n),e.removeAttribute("data-value");return}if(r==="SELECT"){let n=e.options,o=t.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 Fe(e){e.tagName!=="TEXTAREA"||!e.hasAttribute("data-value")||e!==e.ownerDocument.activeElement&&(e.textContent=e.getAttribute("data-value"),e.removeAttribute("data-value"))}function $(e){if(typeof window>"u")return null;let t=window.clay,r=window.hyperclay;return e==="consent"?t?.confirm||r?.consent||null:t?.[e]||r?.[e]||null}function pn(){let e=$("visitorDrafts");return!!(e&&typeof e.restored=="function"&&e.restored()?.restored)}var ut=["clay:mutation-ready","hyperclay:mutation-ready"],dr=["clay:sync-applied","hyperclay:livesync-applied"],pr=["clay:ready","hyperclay:ready"],mr=["clay:route"],hr=["clay:modechange"];function Ae(e,t,r){let n=null,o=s=>{n!==null&&n!==s.type||(n=s.type,queueMicrotask(()=>{n=null}),r(s))};for(let s of t)e.addEventListener(s,o);return()=>{for(let s of t)e.removeEventListener(s,o)}}function mn(e){let t=typeof window<"u"&&window.clay&&window.clay.ready;t&&typeof t.then=="function"?t.then(()=>e(),()=>e()):e()}function Be(e){let t=$("region");return!t||typeof t.resolveRegionPolicy!="function"||typeof t.skipForPolicy!="function"?!1:t.skipForPolicy(t.resolveRegionPolicy(e),void 0,["no-save","freeze"])}function hn(){return typeof window>"u"?null:window.clay?.modeLifecycle||null}function ae(e,{transient:t=!1}={}){if(t)return!0;let r=hn();return typeof r?.canWrite!="function"||$("region")?.resolveRegionPolicy?.(e)?.persist==="none"?!0:r.canWrite()}function bn(e,t){if(typeof t!="function")throw new Error("Sap.batch(label, fn): fn must be a function");let r=$("undo");r&&r.flush&&r.flush();let n=t();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(e),n}function gn(e){if(typeof window>"u"||typeof document>"u")return;let t=()=>{let p=!1;for(let k of e.apps())k.root.isConnected?e.runNow(k,"platform"):p=!0;p&&e.pruneDisconnected(),e.remountIfPresent()},r=$("derived"),n=r&&typeof r.register=="function"?r.register(t):null,o=typeof n=="function"?null:Ae(document,dr,t),s=Ae(document,mr,t),i=null,g=!1,b=()=>{let p=i;i=null,p&&(p[2](),p[3]())},m=()=>{if(g)return!1;let p=$("undo"),k=hn()?.state?.generation;if(i&&i[0]===p&&i[1]===k)return!0;if(b(),!p||typeof p.on!="function")return!1;let R=p.on("undo",t);if(typeof R!="function")return!1;let L=p.on("redo",t);return typeof L!="function"?(R(),!1):(i=[p,k,R,L],!0)};m();let d=[ut,pr,hr].map(p=>Ae(document,p,m)),l=$("ready");return l&&typeof l.then=="function"&&l.then(m,()=>{}),()=>{g=!0,typeof n=="function"&&n(),o&&o(),s();for(let p of d)p();b()}}function ct(e){let t=e.tagName;if(t==="INPUT"){let r=(e.getAttribute("type")||"text").toLowerCase();return r==="checkbox"?"checkbox":r==="radio"?"radio":r==="number"||r==="range"?"number":r==="hidden"?"hidden":"text"}return t==="TEXTAREA"?"text":t==="SELECT"?e.multiple?"select-multiple":"select-one":"leaf"}function br(e){if(e.validity&&e.validity.badInput)return e.hasAttribute("value")?Number(e.getAttribute("value"))||0:e._sapLastGood??0;if(e.value==="")return 0;let t=Number(e.value);return Number.isNaN(t)?e._sapLastGood??0:(e._sapLastGood=t,t)}function wn(e,t){switch(t){case"checkbox":return e.checked;case"radio":return e.checked?e.value:void 0;case"number":return br(e);case"select-one":return e.value;case"select-multiple":return[...e.selectedOptions].map(r=>r.value);case"hidden":case"text":return e.value;case"leaf":return e.textContent;default:return e.value}}function gr(e,t,r){switch(t){case"checkbox":e.checked=!!r;break;case"radio":e.checked=String(e.value)===String(r);break;case"number":case"text":case"hidden":e.value=r==null?"":String(r);break;case"select-one":e.value=r==null?"":String(r);break;case"select-multiple":{let n=new Set((Array.isArray(r)?r:[r]).map(String));for(let o of e.options)o.selected=n.has(o.value);break}case"leaf":e.textContent=r==null?"":String(r);break;default:e.value=r==null?"":String(r)}}function yn(e){if(e.hasAttribute("transient")){e.removeAttribute("value"),e.removeAttribute("checked"),e.removeAttribute("data-value");return}Be(e)||se(e)}function yr(e){e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0}))}function An(e,t){return wn(e,t)}function xn(e){let t=ct(e);return{el:e,kind:t,read(){return wn(e,t)},write(r,n={}){gr(e,t,r),n.noMirror||yn(e),n.silent||yr(e)},mirror(){yn(e)}}}var wr=[],F=null,je=0,ft=null,We=!1,ue=null;function En(e){let t=null;return{kind:"hub",flush(){e.pause(),e.resume()},subscribe(r){let n=e.onAnyChange({debounce:0,require:"observed"},r);typeof n=="function"&&(t=n)},suppress(r){e.pause();try{return r()}finally{e.resume()}},teardown(){if(t){try{t()}catch{}t=null}}}}function Ar(){let e=null,t=null;function r(){let n=e?e.takeRecords():wr;n.length&&t(vn(n))}return{kind:"native",flush:r,subscribe(n){t=n,e=new MutationObserver(s=>n(vn(s)));let o=document.body||document.documentElement;o&&e.observe(o,{childList:!0,subtree:!0,attributes:!0,characterData:!0})},suppress(n,o){let s=$("undo");o&&r(),s&&s.pause&&s.pause();try{return n()}finally{e&&e.takeRecords(),s&&s.resume&&s.resume()}},teardown(){e&&(e.disconnect(),e=null)}}}function vn(e){let t=[];for(let r of e)if(r.type==="attributes"){let n=r.target;n&&n.nodeType===1&&!xe(n)&&t.push({type:"attribute",element:n,attribute:r.attributeName})}else if(r.type==="characterData"){let n=r.target&&r.target.parentElement;n&&!xe(n)&&t.push({type:"characterData",element:n})}else if(r.type==="childList"){let n=r.target;n.nodeType===1&&[...r.addedNodes,...r.removedNodes].some(s=>s.nodeType===3)&&!xe(n)&&t.push({type:"characterData",element:n});let o=r.addedNodes.length>0&&n.nodeType===1&&ne(n);for(let s of r.addedNodes)s.nodeType!==1||xe(s)||(o?t.push({type:"add",element:s,parent:n}):O(s,i=>{(i===s||!xe(i))&&t.push({type:"add",element:i,parent:n})}));for(let s of r.removedNodes)s.nodeType===1&&t.push({type:"remove",element:s,parent:n})}return t}function xe(e){return!!(e.closest&&e.closest("[sap-ignore],[template],[cms-template]"))}function xr(e,t){e.pruneDisconnected();let r=new Map,n=!1;for(let o of t){let s=o.type==="remove"?o.parent:o.element,i=s&&e.appFor(s);if(i){let g=r.get(i);g?g.push(o):r.set(i,[o])}o.type==="add"&&o.element&&o.element.nodeType===1&&o.element.hasAttribute&&o.element.hasAttribute("sap")&&!(e.isRegistered&&e.isRegistered(o.element))&&(n=!0)}n&&(ft=e.remountIfPresent,je?queueMicrotask(dt):dt());for(let[o,s]of r)o.root.isConnected&&e.schedule(o,"mutation",s)}function dt(){let e=ft;ft=null,e?.()}function ce(e){if(F){let r=!je++;try{return F.suppress(e,r)}finally{je--}}let t=$("undo");if(t&&t.pause&&t.resume){t.pause();try{return e()}finally{t.resume()}}return e()}function lt(e,t){We=!0,F=e,e.subscribe(r=>xr(t,r))}function pt(e){if(We||typeof window>"u"||typeof document>"u")return;let t=$("Mutation");if(t&&typeof t.onAnyChange=="function"){lt(En(t),e);return}typeof MutationObserver=="function"&&(lt(Ar(),e),ue=Ae(document,ut,function(){let n=$("Mutation");n&&(ue(),ue=null,F&&F.teardown(),We=!1,lt(En(n),e))}))}function mt(){if(F)try{F.teardown()}catch{}ue&&typeof document<"u"&&ue(),F=null,We=!1,ue=null}function kn(){je||(F&&F.flush(),dt())}var Er=new Set(ee),Ee=Object.freeze([]),z=[],Nn={},Tn={},ht=null;function He(e){z.includes(e)||(z.push(e),z.sort((t,r)=>(t.order??100)-(r.order??100)),e.boundary&&Object.assign(Nn,e.boundary),e.paintKinds&&Object.assign(Tn,e.paintKinds))}function Rn(e){ht=e}function ze(e,t={}){if(t.breaker){e.diag.error("E26",e.root,{problem:"recompute loop halted after 50 passes; recent triggers: "+(e._breakerRing||[]).join(", ")}),D(e.root,"loop");return}t.full&&(Ie(),tn()),e._inPass=!0;let r=Jt(e.root),n=null;try{ce(()=>{n=vr(e,t)})}finally{e._inPass=!1,Qt(r)}ht&&n&&ht(e,n),e._viewsChanged&&(e._viewsChanged=!1,e.root.dispatchEvent(new CustomEvent("sap:views-updated",{bubbles:!0})))}function vr(e,t){let r=e.root,n={},o=[],s=[],i=new Set;e.diag.errors=[];let g=t.full||e._changes===!1?null:e._changes||Ee;e._changes=null;let b=new Set,m=new Map,d=(u,a)=>u.map(c=>m.get(c)?.push(a)??m.set(c,[a])),l={root:n,state:n,item:null,ownerEl:r,projection:!1},p=null;function k(u,a,c=!1){let f=a.attr||a.name,h=c?cn(u,f):u.getAttribute(f);return h==null&&(h=tt(a),s.push({el:u,name:a.name,attr:f,value:Pt(Le(h,a.type),a.type)})),Le(h,a.type)}function R(u,a,c,f){let h=a.decls;if(!h)return;let y=!!f.item&&!f.projection&&!f.view;for(let E of h){if(E.transient){p&&(p.pure=!1),c[E.name]=Ct(u,E);continue}if(et(u,E)){c[E.name]=u.hasAttribute(E.attr);continue}c[E.name]=k(u,E,y)}}function L(u,a,c){let f=a.bind,h=c.item||c.state,y=ct(u);p&&(y!=="leaf"||a.transient)&&(p.pure=!1),y==="radio"?(f in h||(h[f]=""),u.checked&&(h[f]=u.value)):y==="leaf"&&c.item&&!c.projection&&!c.view?h[f]=ln(u):h[f]=An(u,y),a.transient&&(u.removeAttribute("value"),u.removeAttribute("checked"))}function _(u,a,c){let f=!1;if(a.waits&&b.add(a.waits),a.wants&&(d(a.wants,u),f=!0),p&&a.impure&&(p.pure=!1),a.paints){f=!0;for(let h of a.paints)h.kind==="when"&&i.add(h.field),o.push({def:h,el:u,ctx:c})}for(let h of z)h.collect&&h.collect(S,u,a,c)!==!1&&(f=!0);p&&f&&(a.calcs&&(p.pure=!1),p.collects.push(u,a))}function G(u,a,c){Object.defineProperty(u,"$key",{value:_t(a,"row"),enumerable:!1}),Object.defineProperty(u,"$index",{value:c,enumerable:!1,configurable:!0}),Object.defineProperty(u,"$el",{value:a,enumerable:!1})}function B(u,a,c){let f=K(u);R(u,f,a,c),u._sapScope=a,!c.projection&&f.bind!=null&&L(u,f,c),_(u,f,c),f.items?Y(u,a,c):j(u,a,c)}function j(u,a,c){for(let f=u.firstElementChild;f;f=f.nextElementSibling)U(f,a,c)}function U(u,a,c){let f=K(u);if(!f.inert){if(f.boundary){if(p&&(p.pure=!1),f.boundary==="scope")T(u,a,c);else if(f.boundary==="items")_(u,f,c),Y(u,a,c);else if(f.waits)b.add(f.waits);else{let h=Nn[f.boundary];h?h(S,u,f,a,c):f.wants&&d(f.wants,u)}return}!c.projection&&!c.view&&f.bind!=null&&L(u,f,c),_(u,f,c);for(let h=u.firstElementChild;h;h=h.nextElementSibling)U(h,a,c)}}function T(u,a,c){let f=u.getAttribute("scope"),h={};a[f]=h;let y={root:c.root,state:h,item:null,ownerEl:u,projection:c.projection};B(u,h,y)}function Y(u,a,c){p&&(p.pure=!1);let f=u.getAttribute("items"),h=[];a[f]=h,u._sapList=h;let y=!c.projection&&!c.view&&nn(),E=0;for(let N=u.firstElementChild;N;N=N.nextElementSibling){let x=K(N);if(!x.item||x.template||x.cms)continue;let w=y?rn(N):void 0;h.push(w&&w.plan===x&&Object.isExtensible(w.obj)&&A(w,N,E,c)||v(N,x,E,c,y)),E++}}function v(u,a,c,f,h){let y={};G(y,u,c);let E={root:f.root,state:f.state,item:y,ownerEl:u,projection:f.projection};if(!h)return B(u,y,E),y;let N=p,x={plan:a,obj:y,fields:null,presence:Ee,pending:Ee,collects:[],pure:!0},w=s.length,qe=e.diag.errors.length;p=x;try{B(u,y,E)}finally{p=N}if(!x.pure||e.halted||e.diag.errors.length!==qe)return y;let Q=[];for(let Z of Object.keys(y)){let Ge=y[Z];if(Ge!==null&&typeof Ge=="object")return y;Q.push(Z,Ge)}if(a.decls)for(let Z of a.decls)et(u,Z)&&(x.presence===Ee?x.presence=[]:x.presence).push(Z.name,Z.attr);return s.length>w&&(x.pending=s.slice(w)),x.collects.length||(x.collects=Ee),x.fields=Q,on(u,x),y}function A(u,a,c,f){let h=u.obj;try{h.$index!==c&&Object.defineProperty(h,"$index",{value:c,enumerable:!1,configurable:!0});let N=u.presence;for(let w=0;w<N.length;w+=2)h[N[w]]=a.hasAttribute(N[w+1]);let x=u.fields;for(let w=0;w<x.length;w+=2)h[x[w]]=x[w+1]}catch{return De(a),null}a._sapScope=h;let y=u.pending;for(let N=0;N<y.length;N++)s.push(y[N]);let E=u.collects;if(E.length){let N={root:f.root,state:f.state,item:h,ownerEl:a,projection:f.projection};for(let x=0;x<E.length;x+=2)_(E[x],E[x+1],N)}return h}let S={app:e,root:r,rootObj:n,paints:o,stats:{calcs:0,lists:0},resolveDefault:k,collectEl:_,walkScope:j,changes:g,full:g===null,trigger:t.cause||t.trigger||"refresh",waiting:b,wanted:m};for(let u of z)u.begin&&u.begin(S);let P=t.cacheReads===!1?null:sn(r);try{B(r,n,l)}finally{t.cacheReads!==!1&&an(P)}if(e.halted||b.size)return S;for(let u of z)u.afterIntake&&u.afterIntake(S);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 z)u.compute&&u.compute(S);let C=0;for(let u of z)u.reconcile&&(C+=u.reconcile(S));let J=0,I=C;for(let u of o){let a=Nr(u,e);u.ctx.view?I+=a:J+=a}for(let u of z)u.afterPaint&&u.afterPaint(S);return e._state=n,e._stats={fields:Object.keys(n).filter(u=>typeof n[u]!="function").length,calcs:S.stats.calcs,paints:o.length,lists:S.stats.lists,writes:J,viewWrites:I},e._viewsChanged=I>0,e._lastPass={trigger:t.trigger||"refresh",writes:J},e._debug&&console.log(`sap pass \xB7 trigger: ${e._lastPass.trigger} \xB7 writes ${J}/${o.length}`),S}function kr(e){let t=e.kind==="text"?e.fmt||null:e.arg;return t==null?e.kind:e.kind+":"+t}function Sr(e,t,r,n){let o=e;for(;o&&o.nodeType===1;){if(o.hasAttribute&&o.hasAttribute(t)){let s=r.includes(o.getAttribute(t));if(n?!s:s)return!0}o=o.parentElement}return!1}function Nr(e,t){let r=e.def,n=e.el,o=Tn[r.kind];if(o)return o(e,t);if(r.kind==="when")return Sn(r,n,null);try{let s=ye(r.entry,e.ctx.state,e.ctx.item,n,e.ctx.root),i=Sn(r,n,s);return fe(n),i}catch(s){return t.diag.error(s.sapCode==="E22"?"E22":"E24",n,{attr:kr(r),expr:r.entry&&r.entry.src,problem:String(s.message)}),D(n,s.sapCode||"E24"),0}}function Sn(e,t,r){switch(e.kind){case"text":{let n=e.fmt!=null?Wt(e.fmt,r):r==null?"":String(r);return t.textContent!==n?(t.textContent=n,1):0}case"show":{let n=!r;return t.hidden!==n?(t.hidden=n,1):0}case"when":{let n=$("optionVisibility");if(n&&n._started)return t._sapWhen&&t.hidden?(t.hidden=!1,t._sapWhen=!1,1):0;t._sapWhen=!0;let o=Sr(t,e.field,e.values,e.match==="show-not")===(e.match==="hide");return t.hidden!==o?(t.hidden=o,1):0}case"attr":{let n=e.arg;if((n==="checked"||n==="selected")&&typeof t[n]=="boolean"&&!t.hasAttribute("bind")&&!t.closest("select[bind]")){let s=0;return t[n]!==!!r&&(t[n]=!!r,s=1),!!r!==t.hasAttribute(n)&&(r?t.setAttribute(n,""):t.removeAttribute(n),s=1),s}if(Er.has(n)){let s=t.hasAttribute(n);return r&&!s?(t.setAttribute(n,""),1):!r&&s?(t.removeAttribute(n),1):0}let o=typeof r=="boolean"?String(r):r==null?"":String(r);return t.getAttribute(n)!==o?(t.setAttribute(n,o),1):0}case"class":{let n=!!r;return t.classList.contains(e.arg)!==n?(t.classList.toggle(e.arg,n),1):0}case"css":{let n=r==null?"":String(r);return t.style.getPropertyValue("--"+e.arg)!==n?(t.style.setProperty("--"+e.arg,n),1):0}default:return 0}}var Tr=new Set(ee),_n=new Set(["calc","text","attr","class","css","set","move","sort","option","option-not","show-when","hide-when","editmode","viewmode"]),Rr=new Set(["show-when","hide-when","option","option-not"]),_r=/\b(?:state|item|root)\.|===|!==|&&|\|\||[()]|^\s*!/,$n=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"]),gt=[];function Ue(e){gt.includes(e)||gt.push(e)}function $r(e){return e.tagName==="INPUT"||e.tagName==="SELECT"||e.tagName==="TEXTAREA"}function bt(e){return e.hasAttribute("bind")}function Lr(e,t){t(e);for(let n=e.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}if(t(n),!te(n))for(let o=n.firstElementChild;o;o=o.nextElementSibling)r(o)}}}function Ln(e,t){let r=!1,n=(i,g,b)=>{t.error(i,g,b),r=!0},o=e.ownerDocument.createTreeWalker(e,5,{acceptNode:i=>i.nodeType===3?1:te(i)||i.hasAttribute("bind")||i.hasAttribute("sap-ignore")?2:3}),s;for(;s=o.nextNode();)if(/\{\{.*\}\}/.test(s.nodeValue||"")){n("E02",s.parentElement||e,{problem:"moustaches in text content are not a Sap feature",fix:'move the expression onto the element: text="state.x"'});break}return Lr(e,i=>{let g=new Set;for(let m of gt)m(i,n,d=>g.add(d));let b=i.closest&&i.closest("[detail]");for(let m of[...i.attributes]){let d=m.name;if(g.has(d))continue;if(d.includes(":")){let p=d.slice(0,d.indexOf(":"));if(!_n.has(p)&&!Je(d)){let k=Ke(p,[..._n]);t.warn("W03",i,{attr:d,problem:`unknown "${p}:" attribute`,didYouMean:k?`${k}:`:null})}else if(Rr.has(p)&&_r.test(m.value)){let k=d.slice(d.indexOf(":")+1);t.warn("W04",i,{attr:d,expr:m.value,problem:`${p}: compares the "${k}" attribute against a literal value, not a JS expression`,fix:`use show="${m.value}" for an expression, or a literal like ${p}:${k}="overview"`})}}else if(!$n.has(d)&&!Je(d)&&!Xe.has(d)&&!Tr.has(d)&&!/^(data-|aria-|on)/.test(d)&&!(d in i)){let p=Ke(d,[...$n]);p&&t.warn("W03",i,{attr:d,problem:`unknown "${d}" attribute`,didYouMean:p})}d==="attr:hidden"&&t.warn("W03",i,{attr:d,problem:"attr:hidden paints the wrong attribute",fix:'use show="expr"'});let l=bt(i)||d==="attr:selected"&&i.tagName==="OPTION"&&!!i.closest("select[bind]");(d==="attr:value"||d==="attr:checked"||d==="attr:selected")&&l&&n("E30",i,{attr:d,problem:"attr: on a bound control collides with persist ownership",fix:"remove it; bind owns this attribute"}),d==="effect"&&bt(i)&&/\b(value|checked)\s*=[^=]/.test(m.value)&&n("E30",i,{attr:d,expr:m.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"}),(d==="text"||d.startsWith("text:")||d==="show")&&$r(i)&&(d==="show"||n("E18",i,{attr:d,problem:"paint belongs on output elements, not form controls",fix:"move the paint to an <output> or <span>"}))}if(i.hasAttribute("state")){let m=$e(i.getAttribute("state")),d=new Set;for(let l of m){l.name.includes("-")&&n("E08",i,{attr:"state",problem:`field "${l.name}" is not a valid identifier (the hyphen parses as subtraction)`,fix:`rename to ${l.name.replace(/-/g,"")}`}),d.has(l.name)&&n("E04",i,{attr:"state",problem:`field "${l.name}" is declared twice in one scope`}),d.add(l.name),Et.has(l.attr)&&n("E05",i,{attr:"state",problem:`"${l.name}" is a reserved Sap word`}),Xe.has(l.attr)&&n("E06",i,{attr:"state",problem:`"${l.name}" is a global HTML attribute name; pick another field name`}),l.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=Ze(i,l.attr);p&&(l.attr==="checked"||l.attr==="selected")&&n("E35",i,{attr:"state",problem:`"${l.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&&l.type==="num"&&n("E35",i,{attr:"state",problem:`"${l.attr}" is an HTML boolean attribute; it cannot hold a number`,fix:`declare it bare: state="${l.attr}"`}),l.transient&&(p||l.type==="presence")&&n("E35",i,{attr:"state",problem:`"${l.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(bt(i)){if(i.hasAttribute("-"),i.tagName==="INPUT"){let m=(i.getAttribute("type")||"text").toLowerCase();m==="file"&&n("E32",i,{attr:"bind",problem:"files never serialize into an HTML file",fix:"use no-save + effect instead of bind"}),m==="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 m=i.getAttribute("contenteditable");!(m!=null&&m!=="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]'))&&t.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 m=i.parentElement;(!m||!m.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")&&b&&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 m=e.querySelector(`[trigger-add="${i.getAttribute("items")}"]`);!Lt(i)&&!Qe(e,i.getAttribute("items"))&&$t(i).length===0&&m&&n("E17",i,{attr:"items",problem:`trigger-add targets items="${i.getAttribute("items")}" but it has no [item template] to clone`})}}),r&&(t.halted=!0,t.haltReason=t.errors[0]?t.errors[0].code:"halt",D(e,t.haltReason)),!r}var Pn="sap-styles",Cn="[item][template]{display:none!important}[hidden]{display:none!important}[sap-error]{outline:2px solid #e5484d;outline-offset:1px}",yt=new WeakSet;function Pr(e){if(yt.has(e))return;let t=e.defaultView,r=t&&t.CSSStyleSheet;if(r&&"adoptedStyleSheets"in e)try{let n=new r;n.replaceSync(Cn),e.adoptedStyleSheets=[...e.adoptedStyleSheets,n],yt.add(e);return}catch{}if(!e.getElementById(Pn)){let n=e.createElement("style");n.id=Pn,n.textContent=Cn,(e.head||e.documentElement).appendChild(n)}yt.add(e)}var Cr=0;function On(){return typeof performance<"u"&&performance.now?performance.now():0}function wt(e){let t=e.id||e.getAttribute("sap")||`app-${Cr++}`,r=new Ne(t),n={root:e,name:t,diag:r,_state:null,_stats:null,_lastPass:null,_passes:0,_broken:!1,_mountMs:0,_mountWrites:0};if(!Ln(e,r))return n.halted=!0,n;Pr(e.ownerDocument);for(let i of e.querySelectorAll("textarea[data-value]"))me(i)||Fe(i);let s=On();return ze(n,{trigger:"mount",full:!0}),n._mountMs=On()-s,n._mountWrites=n._stats?n._stats.writes:0,n._mountWrites>0&&!pn()&&!$("derived")&&r.warn("W30",e,{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 Or=/^(set:|move:|sort:|trigger-add$|trigger-remove$|trigger-reset$)/;function Mr(e){return`${e.tagName.toLowerCase()}[sap]`}function Ir(e){let t={actions:0,lists:0,rows:0};return O(e,r=>{r.hasAttribute("items")&&t.lists++,r!==e&&r.hasAttribute("item")&&!r.hasAttribute("template")&&t.rows++,[...r.attributes].some(n=>Or.test(n.name))&&t.actions++}),t}function Mn(e){function t(i){let g=i._stats||{},b=i.root;return{root:Mr(b),fields:g.fields||0,calcs:g.calcs||0,paints:g.paints||0,...Ir(b),warnings:i.diag.warnings.length,errors:i.diag.errors.length,mountWrites:i._mountWrites||0,ms:Math.round((i._mountMs||0)*10)/10,passes:i._passes||0,lastPass:i._lastPass||null,ok:i.diag.errors.length===0&&!i.halted}}function r(){let i=e.apps().map(t);return{ok:i.every(g=>g.ok),apps:i}}function n(i){let g=t(i);return g.ok?`sap \u2713 ${g.root} \xB7 fields ${g.fields} \xB7 calcs ${g.calcs} \xB7 paints ${g.paints} \xB7 actions ${g.actions} \xB7 lists ${g.lists} \xB7 rows ${g.rows} \xB7 warnings ${g.warnings} \xB7 mount writes ${g.mountWrites} \xB7 ${g.ms}ms`:`sap \u2717 ${g.root} \xB7 errors ${g.errors} \xB7 warnings ${g.warnings} \xB7 ${g.ms}ms`}function o(){let i=[],g=[];for(let b of e.apps())i.push(...b.diag.errors),g.push(...b.diag.warnings);return{ok:i.length===0,errors:i,warnings:g,counts:{errors:i.length,warnings:g.length}}}function s(i){let g=i===void 0?!0:!!i;for(let b of e.apps())b._debug=g;return console.log(`sap debug ${g?"on":"off"} \u2014 per-pass headers will ${g?"":"no longer "}log`),g}return{status:r,report:o,debug:s,greenLine:n}}var ve="0.10.0";var In={};var Dr=/^(https:\/\/(?:cdn\.jsdelivr\.net\/npm|unpkg\.com)\/@panphora\/sapjs)(?=[@/]|$)/,Dn=e=>new Promise(t=>setTimeout(t,e)),Fn=e=>e.getAttribute("plugins")?.match(/\S+/g)||[];function Bn(e,t,r){let n=new Map,o=new Map,s=new Map,i=new Map,g=[],b=new Set,m={},d=!1,l,p=globalThis,k=Array.isArray(p.sapPlugins)?p.sapPlugins:p.sapPlugins==null?p.sapPlugins=[]:[],R=p.document?.currentScript?.src||"",L=Dr.exec(R),_=a=>o.get(a)?.api||null,G=a=>Promise.allSettled(a.map(C));function B(){let a=new Map;for(let c of n.values())if(!o.has(c.name))for(let f of c.helpers||[])a.set(f,c.name);Ut(m,a),Ie()}function j(a){n.set(a.name,{...n.get(a.name),...a}),kt(a),B()}function U(a){n.has(a.name)||j(a)}function T(a){k.includes(a)||k.push(a),j(a)}function Y(a){for(let c of e.apps())c.root.isConnected&&e.schedule(c,a)}let v=Object.freeze({api:1,version:ve,compile:Ce,run:qt,runWith:ye,planOf:K,drainPlans:Zt,forgetRow:De,setBeacon:D,clearBeacon:fe,write:ce,schedule(a,c="plugin"){let f=a?.root?a:e.appFor(a);f&&e.schedule(f,c)},appFor:e.appFor,apps:e.apps,capability:$,mayWrite:ae,load:C,plugin:_});function A(a){if(typeof a=="string")return C(a);let{name:c,api:f}=a,h=w=>{throw new Error(`Sap.use: plugin "${c}" ${w}`)};if((typeof c!="string"||f!==1)&&h(`needs a name and plugin API ${1}; it gives API ${f}`),d)return null;if(o.has(c))return _(c);if((a.requires||[]).some(w=>!o.has(w)))return T(a),g.includes(a)||g.push(a),null;let y=a.setup?.(v)||{},E=(w,qe)=>{for(let Q of Array.isArray(a[w])?a[w]:Object.keys(a[w]||{}))(typeof(y[w]||{})[Q]!="function"||qe(Q))&&h(`cannot add "${Q}" to ${w}: the name is taken or not valid, or setup does not supply it`)},N=w=>!Re(w,c);E("helpers",w=>(it(w)&&h(`cannot add "${w}": window.${w} exists; rename the helper`),!Vt(w)||w in m)),E("boundaries",N),E("directives",N);for(let w in y.api)w in t&&h(`cannot add Sap.${w}: the name is taken`);T(a);let x={...y,name:c,order:a.order,boundary:{}};for(let w in a.boundaries)x.boundary[w]=y.boundaries[w];for(let w of a.helpers||[])m[w]=y.helpers[w];for(let w in y.formats)w in W||(W[w]=y.formats[w]);return He(x),y.lint&&Ue(y.lint),Object.assign(t,y.api),o.set(c,x),i.delete(c),St(c,y.directives||!0),B(),ce(()=>b.forEach(fe)),b.clear(),g.splice(0).forEach(S),Y("plugin:"+c),_(c)}function S(a){try{A(a)}catch(c){console.error(c)}}function P(a){if(d||o.has(a))return null;let c=n.get(a)||{},f=I.loader?.(a,c),h=c.url||I.base&&I.base+(c.file||a)+".js";return(f!==void 0?Promise.resolve(f):new Promise((E,N)=>{if(!h)throw new Error(`no address for plugin "${a}": call Sap.use(definition)`);let x=document.createElement("script");x.src=h,x.setAttribute("clay","editor-ui"),x.onload=x.onerror=w=>{x.remove(),w.type==="load"?E():N(new Error("could not load "+h))},document.head.append(x)})).then(E=>{if(d)return;let N=E?.default||E||k.find(x=>x.name===a);if(N?.name&&A(N),!o.has(a))throw new Error(`plugin "${a}" loaded and did not register`)})}function C(a){if(o.has(a))return Promise.resolve(_(a));if(s.has(a))return s.get(a);i.delete(a);let c=Promise.all((n.get(a)?.requires||[]).map(C)).then(()=>P(a));for(let h of I.retryDelays)c=c.catch(()=>Dn(h).then(()=>P(a)));let f=c.finally(()=>s.delete(a)).then(()=>_(a),h=>{throw i.set(a,h),l||=!p.addEventListener?.("online",()=>I.retry()),Y("plugin-failed:"+a),document.dispatchEvent(new CustomEvent("sap:plugin-failed",{detail:{plugin:a,error:h}})),h});return s.set(a,f),f}function J(a){let c=new Set;for(let f of a.closest?.("[sap]")?[a]:a.querySelectorAll("[sap]")){for(let h of Fn(f.closest("[sap]")))c.add(h);n.size>o.size&&O(f,h=>{let y=K(h);return y.inert?!1:(y.wants?.map(E=>c.add(E)),!!c.add(y.waits))})}return[...c].filter(f=>f&&!o.has(f))}Rn((a,c)=>{for(let f of new Set([...c.wanted.keys(),...c.waiting,...Fn(a.root)])){if(o.has(f))continue;let h=i.get(f);if(!h)C(f).catch(()=>{});else{let y=c.wanted.get(f)?.[0]||a.root;a.diag.error("E52",y,{problem:`the "${f}" plugin did not load: ${h.message}`,fix:"Sap.plugins.retry() tries again"}),b.add(y),ce(()=>D(y,"E52"))}}});let I={api:1,base:L?`${L[1]}@${ve}/dist/sap-plugins/`:/^[^:]+:\//.test(R)?new URL("sap-plugins/",R).href:null,loader:null,retryDelays:[1e3,4e3],declare:U,load:C,ready(a=document,c=3e3){let f=new Set,h=()=>{let E=J(a).filter(N=>!f.has(N)&&f.add(N));return E.length&&G(E).then(h)},y=h();return y?Promise.race([y,Dn(c)]):null},has:a=>o.has(a),status:()=>({installed:[...o.keys()],loading:[...s.keys()],failed:[...i.keys()]}),retry:a=>G(a?[a]:[...i.keys()])};function u(){let a=[],c=()=>(kn(),r.flushNow()),f=[...o.values()].filter(h=>h.flush);c();for(let h=0;f.length&&h<8;h++){for(let y of f){let E=y.flush();E?.then&&a.push(E)}if(!c())break}return a.length?Promise.all(a).then(u):null}t.use=A,t.plugins=I,t.flush=u;for(let a of Object.values(In))U(a);return k.slice().forEach(S),function(){d=!0;for(let c of o.values())c.dispose?.();o.clear(),i.clear()}}function jn({createAccessor:e,installInput:t,debugExtras:r}){let n=new Map,o=[],s=xt(ze);function i(v){let A=v;for(;A;){if(A.nodeType===1&&A.hasAttribute&&A.hasAttribute("sap"))return n.get(A)||null;A=A.parentNode&&A.parentNode.host?A.parentNode.host:A.parentElement}return null}function g(){for(let v=o.length-1;v>=0;v--){let A=o[v];A.root.isConnected||(n.delete(A.root),o.splice(v,1))}}function b(v,A){if(v.moveBefore)try{v.moveBefore(A,null);return}catch{}v.appendChild(A)}function m(v,A){let S=A.parentElement;if(S){if(S.moveBefore)try{S.moveBefore(v,A);return}catch{}S.insertBefore(v,A)}}let d={apps:()=>o.slice(),appFor:i,isRegistered:v=>n.has(v),pruneDisconnected:g,schedule:s.schedule,runNow:(v,A)=>s.runNow(v,A),moveInto:b,placeBefore:m,remountIfPresent:()=>j()},l=e(d),p=Mn(d),k=r?r(d,p):{},R=!1,L=!1,_=null;function G(){R||(R=!0,t(d,l,document),_=gn(d))}function B(){let v=$("derived");v&&typeof v.mounted=="function"&&v.mounted()}function j(v=document){if(L)return[];G(),pt(d);let A=v.querySelectorAll("[sap]"),S=[];for(let P of A){if(n.has(P)||me(P))continue;let C=wt(P);n.set(P,C),o.push(C),S.push(C)}for(let P of S){let C=p.greenLine(P);P.diag.errors.length||P.halted?console.error(C):console.log(C)}return B(),S}function U(v){if(L)return null;if(G(),pt(d),!v)return j();let A=typeof v=="string"?document.querySelector(v):v;if(!A)return null;if(n.has(A))return n.get(A);let S=wt(A);n.set(A,S),o.push(S);let P=p.greenLine(S);return S.diag.errors.length||S.halted?console.error(P):console.log(P),S}let T=l.Sap;T.version=ve,T.refresh=function(){for(let A of o.slice())A.root.isConnected&&s.runNow(A,"refresh")},T.batch=bn,T.status=p.status,T.report=p.report,T.why=k.why,T.debug=p.debug,T.doctor=k.doctor,T.greenLine=p.greenLine,T.formats=W,T.serializeControlToAttributes=se,T.finalizeControlForSave=dn,T.rehydrateControlFromAttributes=Fe,T.mount=U,T.config=function(A={}){return A.formats&&Object.assign(W,A.formats),T},T._registry=n,T._reset=function(){n.clear(),o.length=0,mt()},T.unmount=function(){L=!0,n.clear(),o.length=0,mt(),typeof _=="function"&&_(),Y()};let Y=Bn(d,T,s);return{Sap:T,mountAll:j,mount:U,runtime:d}}function Wn(e){if(typeof document>"u")return;let t=()=>mn(()=>e());document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t):t()}function Hn(e){let t=[];function r(b){let m=b.target;if(!m||m.nodeType!==1)return;let d=e.appFor(m);if(d){m.hasAttribute("persist")&&!Be(m)&&ae(m)&&se(m);for(let l of t)if(l(m,d))return;e.schedule(d,b.type+" "+(m.id||m.tagName.toLowerCase()))}}function n(b){let m=b.target,d=e.appFor(m);d&&[...m.querySelectorAll("[bind]")].every(l=>ae(l))&&setTimeout(()=>{m.querySelectorAll("[bind]").forEach(l=>{l.dispatchEvent(new Event("input",{bubbles:!0})),l.dispatchEvent(new Event("change",{bubbles:!0}))}),e.schedule(d,"reset")},0)}function o(b){let m=e.appFor(b.target);m&&e.schedule(m,"toggle")}function s(b){let m=b.detail||{};for(let d of[m.from,m.to,b.target]){if(!d||d.nodeType!==1)continue;let l=e.appFor(d);l&&e.schedule(l,"sorted")}}function i(b){if(b.key!=="ArrowUp"&&b.key!=="ArrowDown")return;let m=b.target;if(!m||m.nodeType!==1||m.tagName!=="INPUT"||!m.hasAttribute("bind")||!m.hasAttribute("step"))return;let d=(m.getAttribute("type")||"text").toLowerCase();if(d!=="text"&&d!=="tel"&&d!=="search"||!e.appFor(m)||!ae(m))return;b.preventDefault();let p=M(m.getAttribute("step"))||1,k=b.key==="ArrowUp"?1:-1,R=M(m.value)+p*(b.shiftKey?10:1)*k,L=m.getAttribute("min"),_=m.getAttribute("max");L!==null&&L!==""&&R<M(L)&&(R=M(L)),_!==null&&_!==""&&R>M(_)&&(R=M(_)),xn(m).write(String(Number(R.toFixed(2))))}function g(b=document){b.addEventListener("reset",n),b.addEventListener("toggle",o,!0),b.addEventListener("input",r),b.addEventListener("change",r),b.addEventListener("clay:sorted",s),b.addEventListener("keydown",i)}return{install:g,addRouter:b=>t.push(b)}}var ke="https://clayjs.com/v1/sap.js",Fr=/^(calc|set|move|sort):/,Br=new Set(["each","detail","effect","invalid","confirm","trigger-add","trigger-remove","trigger-reset"]);function At(e){return Fr.test(e)||Br.has(e)}Ue((e,t)=>{for(let r of e.attributes)At(r.name)&&t("E50",e,{attr:r.name,expr:r.value,problem:`${r.name} is full sapjs; the sapjs core only paints declared state`,fix:`load ${ke}; the markup stays as it is`})});function le(e,t,r){e.app.diag.error("E50",t,{attr:r,problem:`${r} is full sapjs; the sapjs core only paints declared state`,fix:`load ${ke}; the markup stays as it is`}),D(t,"E50"),e.app.halted=!0}He({name:"core-only",collect(e,t,r){r.calcs&&le(e,t,"calc:"+r.calcs[0].name),r.effects&&le(e,t,"effect"),r.invalids&&le(e,t,"invalid");for(let n of t.attributes)At(n.name)&&(n.name.startsWith("calc:")&&r.calcs||n.name==="effect"&&r.effects||n.name==="invalid"&&r.invalids||le(e,t,n.name));return!1},boundary:{each(e,t){le(e,t,"each")},detail(e,t){le(e,t,"detail")}}});function jr(){return{Sap:function(){throw new Error(`Sap(el) is full sapjs; load ${ke}`)}}}var zn=e=>()=>(console.warn(`Sap.${e} is full sapjs; load ${ke}`),null),{Sap:Se,mountAll:Un,mount:Wr,runtime:Hr}=jn({createAccessor:jr,debugExtras:()=>({why:zn("why"),doctor:zn("doctor")}),installInput(e,t,r){Hn(e).install(r)}});Se.core=!0;var zr=typeof window<"u"&&window.Sap&&!window.Sap.core;zr?Se.unmount():Wn(Un);typeof window<"u"&&!window.Sap&&(window.Sap=Se);var Ur=Se;return Kn(Vr);})();
|
|
10
10
|
export default SapCoreBundle.default;
|
package/dist/m/c-C7SUMNMI.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as k,d as l,e as i}from"./c-BPF2NSPV.js";import{a as M}from"./c-P7KNDG34.js";import{a as S}from"./c-CYWLPPUS.js";import{e as b}from"./c-U4TWEIKZ.js";var A=Object.fromEntries(new URLSearchParams(window.location.search)),n=A;var w=()=>S("mode-receipt"),R=3e4;function T(){try{return performance.getEntriesByType("navigation")[0]?.type??null}catch{return null}}function P(){let e=null;try{e=sessionStorage.getItem(w()),sessionStorage.removeItem(w())}catch{return null}if(!e)return null;let t;try{t=JSON.parse(e)}catch{return null}return t?.v!==1||t.path!==location.pathname||t.mode!=="edit"&&t.mode!=="view"||Date.now()-t.at>R||!t.internal&&T()!=="reload"?null:t}function J({mode:e,canEdit:t,internal:s}){try{sessionStorage.setItem(w(),JSON.stringify({v:1,path:location.pathname,mode:e,canEdit:t,at:Date.now(),internal:s}))}catch{}}var o=null;typeof window<"u"&&(window.clayEditMode!=null?o=!!window.clayEditMode:window.__hyperclayEditMode!=null&&(o=!!window.__hyperclayEditMode));var r=typeof document<"u"&&document.documentElement.hasAttribute("viewonly"),B=typeof document<"u"&&b(),p=!!M.get("isAdminOfCurrentResource"),g=n.editmode==="document",y=B&&n.editmode!=="false"&&!((n.editmode==="true"||g)&&p)&&!r&&!i()&&o==null&&!l(),u=typeof window<"u"?P():null,x=typeof document<"u"&&document.documentElement.getAttribute("opens-in")==="edit",D=g?!r&&!i()&&o!==!1:n.editmode?n.editmode==="true"||!r&&!i()&&(o??(l()||p)):r||i()?!1:o??(l()||p),V=u?.canEdit===!0&&o!==!1&&!i()&&!(r&&n.editmode!=="true"),h=D||V,q=y||i()||o===!1||n.editmode==="false"||r&&n.editmode!=="true",m=h,I=null;function z(e){I=typeof e=="boolean"?e:null;let t=e===!1?!1:e===!0?h||!q:h;t!==m&&(m=t,typeof document<"u"&&document.dispatchEvent(new Event("clay:capabilitychange")))}function Q(){return I}var F=u?u.mode==="edit"||x&&!u.internal:n.editmode&&!g?n.editmode==="true":o===!0||x,d=y?!0:m&&F,O=y?"draft":d?"edit":"view",Y=p,c={phase:"idle",destination:y?"draft":"host",generation:0,reason:null};function Z(e){e.mode!==void 0&&(O=e.mode),e.isEditMode!==void 0&&(d=e.isEditMode,typeof window<"u"&&(window.__hyperclayEditMode=d)),e.canEdit!==void 0&&(m=e.canEdit);for(let t in c)e[t]!==void 0&&(c[t]=e[t])}var U=()=>({mode:O,...c});function ee(){return d&&U().phase==="idle"}var a=typeof window>"u"||!window.clay?[]:(window.clay.modeParticipants||Object.defineProperty(window.clay,"modeParticipants",{value:[],writable:!0,configurable:!0}),window.clay.modeParticipants),f=new Set,_=()=>{},te=e=>_=e,ne=()=>a.slice(),E=e=>{throw new TypeError(`clay.modeLifecycle: ${e}`)},W=()=>{(c.phase!=="idle"||d)&&E("the page is not idle in view")},C=()=>{c.phase==="blocked"&&!d||W()};function oe(){return f.clear(),a.splice(0)}function ie(e){let t=e&&e.id;(typeof t!="string"||!t||typeof e.prepare!="function")&&E("a participant needs an id and a prepare()"),f.has(t)&&E(`duplicate participant id "${t}"`),C(),f.add(t),a.push(e);let s=!0;return()=>{if(!s)return;C(),s=!1,f.delete(t);let v=a.indexOf(e);v!==-1&&a.splice(v,1),_(t)}}var re=k;export{J as a,y as b,m as c,z as d,Q as e,d as f,O as g,Y as h,Z as i,U as j,ee as k,te as l,ne as m,oe as n,ie as o,re as p};
|