@odoo/owl 3.0.0-alpha.20 → 3.0.0-alpha.22
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/README.md +100 -110
- package/dist/compile_templates.mjs +84 -80
- package/dist/owl-devtools.zip +0 -0
- package/dist/owl.cjs.js +1612 -1473
- package/dist/owl.es.js +1612 -1473
- package/dist/owl.iife.js +1612 -1473
- package/dist/owl.iife.min.js +1 -1
- package/dist/types/compiler/code_generator.d.ts +1 -2
- package/dist/types/compiler/inline_expressions.d.ts +7 -24
- package/dist/types/compiler/parser.d.ts +3 -8
- package/dist/types/owl.d.ts +33 -27
- package/dist/types/runtime/blockdom/attributes.d.ts +2 -0
- package/dist/types/runtime/component_node.d.ts +2 -0
- package/dist/types/runtime/plugin_manager.d.ts +2 -0
- package/dist/types/runtime/reactivity/computations.d.ts +1 -0
- package/dist/types/runtime/rendering/scheduler.d.ts +1 -1
- package/dist/types/runtime/rendering/template_helpers.d.ts +2 -2
- package/dist/types/runtime/types.d.ts +3 -0
- package/dist/types/version.d.ts +1 -1
- package/package.json +25 -2
- package/dist/compiler.js +0 -2371
- package/dist/owl.cjs.runtime.js +0 -4070
- package/dist/owl.es.runtime.js +0 -4026
- package/dist/owl.iife.runtime.js +0 -4074
- package/dist/owl.iife.runtime.min.js +0 -1
- package/dist/types/common/types.d.ts +0 -1
- package/dist/types/runtime/cancellableContext.d.ts +0 -15
- package/dist/types/runtime/cancellablePromise.d.ts +0 -15
- package/dist/types/runtime/error_handling.d.ts +0 -13
- package/dist/types/runtime/executionContext.d.ts +0 -0
- package/dist/types/runtime/fibers.d.ts +0 -37
- package/dist/types/runtime/listOperation.d.ts +0 -1
- package/dist/types/runtime/model.d.ts +0 -48
- package/dist/types/runtime/plugins.d.ts +0 -36
- package/dist/types/runtime/portal.d.ts +0 -12
- package/dist/types/runtime/reactivity/async_computed.d.ts +0 -1
- package/dist/types/runtime/reactivity/derived.d.ts +0 -7
- package/dist/types/runtime/reactivity/reactivity.d.ts +0 -46
- package/dist/types/runtime/reactivity/signals.d.ts +0 -30
- package/dist/types/runtime/reactivity/state.d.ts +0 -48
- package/dist/types/runtime/reactivity.d.ts +0 -57
- package/dist/types/runtime/relationalModel/discussModel.d.ts +0 -19
- package/dist/types/runtime/relationalModel/discussModelTypes.d.ts +0 -22
- package/dist/types/runtime/relationalModel/field.d.ts +0 -20
- package/dist/types/runtime/relationalModel/model.d.ts +0 -59
- package/dist/types/runtime/relationalModel/modelData.d.ts +0 -18
- package/dist/types/runtime/relationalModel/modelRegistry.d.ts +0 -3
- package/dist/types/runtime/relationalModel/modelUtils.d.ts +0 -4
- package/dist/types/runtime/relationalModel/store.d.ts +0 -16
- package/dist/types/runtime/relationalModel/types.d.ts +0 -83
- package/dist/types/runtime/relationalModel/util.d.ts +0 -1
- package/dist/types/runtime/relationalModel/web/WebDataPoint.d.ts +0 -25
- package/dist/types/runtime/relationalModel/web/WebRecord.d.ts +0 -131
- package/dist/types/runtime/relationalModel/web/WebStaticList.d.ts +0 -63
- package/dist/types/runtime/relationalModel/web/webModel.d.ts +0 -5
- package/dist/types/runtime/relationalModel/web/webModelTypes.d.ts +0 -139
- package/dist/types/runtime/scheduler.d.ts +0 -21
- package/dist/types/runtime/signals.d.ts +0 -19
- package/dist/types/runtime/suspense.d.ts +0 -5
- package/dist/types/runtime/task.d.ts +0 -12
- package/dist/types/runtime/template_helpers.d.ts +0 -58
- package/dist/types/utils/registry.d.ts +0 -15
|
@@ -1 +0,0 @@
|
|
|
1
|
-
!function(t){"use strict";class e extends Error{}class n{constructor(t){this.__owl__=t}setup(){}render(t=!1){this.__owl__.render(!0===t)}}function o(t){let e=!1;return async(...n)=>{e||(e=!0,await Promise.resolve(),e=!1,t(...n))}}n.template="";class r extends EventTarget{trigger(t,e){this.dispatchEvent(new CustomEvent(t,{detail:e}))}}class i extends String{}function s(t){return t instanceof i?t:void 0===t?l(""):"number"==typeof t?l(String(t)):([["&","&"],["<","<"],[">",">"],["'","'"],['"',"""],["`","`"]].forEach(e=>{t=String(t).replace(new RegExp(e[0],"g"),e[1])}),l(t))}function l(t,...e){if(!Array.isArray(t))return new i(t);const n=t;let o="",r=0;for(;r<e.length;++r)o+=n[r]+s(e[r]);return o+=n[r],new i(o)}var c;let a,h;function u(t){h&&(h.sources.add(t),t.observers.add(h))}function d(t){!function(t){if(a)return t();a=[];try{return t()}finally{}}(()=>{for(const e of t.observers)e.state===c.EXECUTED&&(e.isDerived?b(e):a.push(e)),e.state=c.STALE}),f()}!function(t){t[t.EXECUTED=0]="EXECUTED",t[t.STALE=1]="STALE",t[t.PENDING=2]="PENDING"}(c||(c={}));const f=o(function(){if(!a)return;for(const t of a)y(t);a=void 0});function p(){return h}function m(t){h=t}function g(t,e){const n=h;let o;h=t;try{o=e()}finally{h=n}return o}function y(t){var e;const n=t.state;if(n===c.EXECUTED)return;if(n===c.PENDING&&(function(t){for(const e of t.sources)"compute"in e&&y(e)}(t),t.state!==c.STALE))return void(t.state=c.EXECUTED);v(t);const o=h;h=t,t.value=null===(e=t.compute)||void 0===e?void 0:e.call(t),t.state=c.EXECUTED,h=o}function v(t){const e=t.sources;for(const n of e){n.observers.delete(t)}e.clear()}function b(t){for(const e of t.observers)e.state||(e.state=c.PENDING,e.isDerived?b(e):a.push(e))}const w=new WeakMap,x=new WeakMap;function N(t,n){try{t.destroy()}catch(t){}return Object.assign(new e("[Owl] Unhandled error. Destroying the root component"),{cause:n})}function E(t,e){if(!t)return!1;const n=t.fiber;n&&w.set(n,e);const o=x.get(t);if(o){let n=!1;const r=()=>N(t.app,e);for(let t=o.length-1;t>=0;t--)try{o[t](e,r),n=!0;break}catch(t){e=t}if(n)return!0}return E(t.parent,e)}function _(t){let{error:e}=t;const n="node"in t?t.node:t.fiber.node,o="fiber"in t?t.fiber:n.fiber;if(o){let t=o;do{t.node.fiber=t,t=t.parent}while(t);w.set(o.root,e)}if(!E(n,e))throw N(n.app,e)}function D(t){t=t.slice();const e=[];let n;for(;(n=t[0])&&"string"==typeof n;)e.push(t.shift());return{modifiers:e,data:t}}const O={shouldNormalizeDom:!0,mainEventHandler:(t,e,n)=>("function"==typeof t?t(e):Array.isArray(t)&&(t=D(t).data)[0](t[1],e),!1)},T=document.createTextNode("");class k{constructor(t,e){this.key=t,this.child=e}mount(t,e){this.parentEl=t,this.child.mount(t,e)}moveBeforeDOMNode(t,e){this.child.moveBeforeDOMNode(t,e)}moveBeforeVNode(t,e){this.moveBeforeDOMNode(t&&t.firstNode()||e)}patch(t,e){if(this===t)return;let n=this.child,o=t.child;if(this.key===t.key)n.patch(o,e);else{const r=n.firstNode();r.parentElement.insertBefore(T,r),e&&n.beforeRemove(),n.remove(),o.mount(this.parentEl,T),this.child=o,this.key=t.key}}beforeRemove(){this.child.beforeRemove()}remove(){this.child.remove()}firstNode(){return this.child.firstNode()}toString(){return this.child.toString()}}function S(t,e){return new k(t,e)}const{setAttribute:R,removeAttribute:C}=Element.prototype,M=DOMTokenList.prototype,I=M.add,P=M.remove,B=Array.isArray,{split:j,trim:A}=String.prototype,L=/\s+/;function V(t,e){switch(e){case!1:case void 0:C.call(this,t);break;case!0:R.call(this,t,"");break;default:R.call(this,t,e)}}function $(t){return function(e){V.call(this,t,e)}}function F(t){if(B(t))"class"===t[0]?H.call(this,t[1]):V.call(this,t[0],t[1]);else for(let e in t)"class"===e?H.call(this,t[e]):V.call(this,e,t[e])}function W(t,e){if(B(t)){const n=t[0],o=t[1];if(n===e[0]){if(o===e[1])return;"class"===n?X.call(this,o,e[1]):V.call(this,n,o)}else C.call(this,e[0]),V.call(this,n,o)}else{for(let n in e)n in t||("class"===n?X.call(this,"",e[n]):C.call(this,n));for(let n in t){const o=t[n];o!==e[n]&&("class"===n?X.call(this,o,e[n]):V.call(this,n,o))}}}function U(t){const e={};switch(typeof t){case"string":const n=A.call(t);if(!n)return{};let o=j.call(n,L);for(let t=0,n=o.length;t<n;t++)e[o[t]]=!0;return e;case"object":for(let n in t){const o=t[n];if(o){if(n=A.call(n),!n)continue;const t=j.call(n,L);for(let n of t)e[n]=o}}return e;case"undefined":return{};case"number":return{[t]:!0};default:return{[t]:!0}}}function H(t){t=""===t?{}:U(t);const e=this.classList;for(let n in t)I.call(e,n)}function X(t,e){e=""===e?{}:U(e),t=""===t?{}:U(t);const n=this.classList;for(let o in e)o in t||P.call(n,o);for(let o in t)o in e||I.call(n,o)}function q(t){const e=t.split(".")[0],n=t.includes(".capture");return t.includes(".synthetic")?function(t,e=!1){let n=`__event__synthetic_${t}`;e&&(n=`${n}_capture`);!function(t,e,n=!1){if(G[e])return;document.addEventListener(t,t=>function(t,e){let n=e.target;for(;null!==n;){const o=n[t];if(o)for(const t of Object.values(o)){if(O.mainEventHandler(t,e,n))return}n=n.parentNode}}(e,t),{capture:n}),G[e]=!0}(t,n,e);const o=K++;function r(t){const e=this[n]||{};e[o]=t,this[n]=e}function i(){delete this[n]}return{setup:r,update:r,remove:i}}(e,n):function(t,e=!1){let n=`__event__${t}_${z++}`;e&&(n=`${n}_capture`);function o(t){const e=t.currentTarget;if(!e||!function(t){if(!t)return!1;if(t.ownerDocument.contains(t))return!0;const e=t.getRootNode();return e instanceof ShadowRoot&&t.ownerDocument.contains(e.host)}(e))return;const o=e[n];o&&O.mainEventHandler(o,t,e)}function r(r){this[n]=r,this.addEventListener(t,o,{capture:e})}function i(){delete this[n],this.removeEventListener(t,o,{capture:e})}function s(t){this[n]=t}return{setup:r,update:s,remove:i}}(e,n)}let z=1;let K=1;const G={};const J=Node.prototype,Z=J.insertBefore,Q=(Y=J,tt="textContent",Object.getOwnPropertyDescriptor(Y,tt)).set;var Y,tt;const et=J.removeChild;class nt{constructor(t){this.children=t}mount(t,e){const n=this.children,o=n.length,r=new Array(o);for(let i=0;i<o;i++){let o=n[i];if(o)o.mount(t,e);else{const n=document.createTextNode("");r[i]=n,Z.call(t,n,e)}}this.anchors=r,this.parentEl=t}moveBeforeDOMNode(t,e=this.parentEl){this.parentEl=e;const n=this.children,o=this.anchors;for(let r=0,i=n.length;r<i;r++){let i=n[r];if(i)i.moveBeforeDOMNode(t,e);else{const n=o[r];Z.call(e,n,t)}}}moveBeforeVNode(t,e){if(t){const n=t.children[0];e=(n?n.firstNode():t.anchors[0])||null}const n=this.children,o=this.parentEl,r=this.anchors;for(let t=0,i=n.length;t<i;t++){let i=n[t];if(i)i.moveBeforeVNode(null,e);else{const n=r[t];Z.call(o,n,e)}}}patch(t,e){if(this===t)return;const n=this.children,o=t.children,r=this.anchors,i=this.parentEl;for(let t=0,s=n.length;t<s;t++){const s=n[t],l=o[t];if(s)if(l)s.patch(l,e);else{const o=s.firstNode(),l=document.createTextNode("");r[t]=l,Z.call(i,l,o),e&&s.beforeRemove(),s.remove(),n[t]=void 0}else if(l){n[t]=l;const e=r[t];l.mount(i,e),et.call(i,e)}}}beforeRemove(){const t=this.children;for(let e=0,n=t.length;e<n;e++){const n=t[e];n&&n.beforeRemove()}}remove(){const t=this.parentEl;if(this.isOnlyChild)Q.call(t,"");else{const e=this.children,n=this.anchors;for(let o=0,r=e.length;o<r;o++){const r=e[o];r?r.remove():et.call(t,n[o])}}}firstNode(){const t=this.children[0];return t?t.firstNode():this.anchors[0]}toString(){return this.children.map(t=>t?t.toString():"").join("")}}function ot(t){return new nt(t)}const rt=Node.prototype,it=CharacterData.prototype,st=rt.insertBefore,lt=((t,e)=>Object.getOwnPropertyDescriptor(t,e))(it,"data").set,ct=rt.removeChild;class at{constructor(t){this.text=t}mountNode(t,e,n){this.parentEl=e,st.call(e,t,n),this.el=t}moveBeforeDOMNode(t,e=this.parentEl){this.parentEl=e,st.call(e,this.el,t)}moveBeforeVNode(t,e){st.call(this.parentEl,this.el,t?t.el:e)}beforeRemove(){}remove(){ct.call(this.parentEl,this.el)}firstNode(){return this.el}toString(){return this.text}}class ht extends at{mount(t,e){this.mountNode(document.createTextNode(pt(this.text)),t,e)}patch(t){const e=t.text;this.text!==e&&(lt.call(this.el,pt(e)),this.text=e)}}class ut extends at{mount(t,e){this.mountNode(document.createComment(pt(this.text)),t,e)}patch(){}}function dt(t){return new ht(t)}function ft(t){return new ut(t)}function pt(t){switch(typeof t){case"string":return t;case"number":return String(t);case"boolean":return t?"true":"false";default:return t||""}}const mt=(t,e)=>Object.getOwnPropertyDescriptor(t,e),gt=Node.prototype,yt=Element.prototype,vt=mt(CharacterData.prototype,"data").set,bt=mt(gt,"firstChild").get,wt=mt(gt,"nextSibling").get,xt=()=>{};function Nt(t){return function(e){this[t]=0===e?0:e?e.valueOf():""}}const Et={};function _t(t){if(t in Et)return Et[t];const e=(new DOMParser).parseFromString(`<t>${t}</t>`,"text/xml").firstChild.firstChild;O.shouldNormalizeDom&&Dt(e);const n=Ot(e),o=St(n),r=function(t,e){let n=function(t,e){const{refN:n,collectors:o,children:r,locations:i,cbRefs:s}=e,l=o.length;i.sort((t,e)=>t.idx-e.idx);const c=i.length,a=r.length,h=r,u=n>0,d=gt.cloneNode,f=gt.insertBefore,p=yt.remove;class m{constructor(t){this.data=t}beforeRemove(){}remove(){p.call(this.el)}firstNode(){return this.el}moveBeforeDOMNode(t,e=this.parentEl){this.parentEl=e,f.call(e,this.el,t)}moveBeforeVNode(t,e){f.call(this.parentEl,this.el,t?t.el:e)}toString(){const t=document.createElement("div");return this.mount(t,null),t.innerHTML}mount(e,n){const o=d.call(t,!0);f.call(e,o,n),this.el=o,this.parentEl=e}patch(t,e){}}u&&(m.prototype.mount=function(e,r){const u=d.call(t,!0),p=new Array(n);this.refs=p,p[0]=u;for(let t=0;t<l;t++){const e=o[t];p[e.idx]=e.getVal.call(p[e.prevIdx])}if(c){const t=this.data;for(let e=0;e<c;e++){const n=i[e];n.setData.call(p[n.refIdx],t[e])}}if(f.call(e,u,r),a){const t=this.children;for(let e=0;e<a;e++){const n=t[e];if(n){const t=h[e],o=t.afterRefIdx?p[t.afterRefIdx]:null;n.isOnlyChild=t.isOnlyChild,n.mount(p[t.parentRefIdx],o)}}}if(this.el=u,this.parentEl=e,s.length){const t=this.data,e=this.refs;for(let n of s){const{idx:o,refIdx:r}=i[n];(0,t[o])(e[r],null)}}},m.prototype.patch=function(t,e){if(this===t)return;const n=this.refs;if(c){const e=this.data,o=t.data;for(let t=0;t<c;t++){const r=e[t],s=o[t];if(r!==s){const e=i[t];e.updateData.call(n[e.refIdx],s,r)}}this.data=o}if(a){let o=this.children;const r=t.children;for(let t=0;t<a;t++){const i=o[t],s=r[t];if(i)s?i.patch(s,e):(e&&i.beforeRemove(),i.remove(),o[t]=void 0);else if(s){const e=h[t],r=e.afterRefIdx?n[e.afterRefIdx]:null;s.mount(n[e.parentRefIdx],r),o[t]=s}}}},m.prototype.remove=function(){if(s.length){const t=this.data,e=this.refs;for(let n of s){const{idx:o,refIdx:r}=i[n];(0,t[o])(null,e[r])}}p.call(this.el)});return m}(t,e);if(e.children.length)return n=class extends n{constructor(t,e){super(t),this.children=e}},n.prototype.beforeRemove=nt.prototype.beforeRemove,(t,e=[])=>new n(t,e);return t=>new n(t)}(n.el,o);return Et[t]=r,r}function Dt(t){if(t.nodeType!==Node.TEXT_NODE||/\S/.test(t.textContent)){if(t.nodeType!==Node.ELEMENT_NODE||"pre"!==t.tagName)for(let e=t.childNodes.length-1;e>=0;--e)Dt(t.childNodes.item(e))}else t.remove()}function Ot(t,n=null,o=null){switch(t.nodeType){case Node.ELEMENT_NODE:{let e=o&&o.currentNS;const r=t.tagName;let i;const s=[];if(r.startsWith("block-text-")){const t=parseInt(r.slice(11),10);s.push({type:"text",idx:t}),i=document.createTextNode("")}if(r.startsWith("block-child-")){o.isRef||Tt(o);const t=parseInt(r.slice(12),10);s.push({type:"child",idx:t}),i=document.createTextNode("")}if(e||(e=t.namespaceURI),i||(i=e?document.createElementNS(e,r):document.createElement(r)),i instanceof Element){if(!o){document.createElement("template").content.appendChild(i)}const e=t.attributes;for(let t=0;t<e.length;t++){const n=e[t].name,o=e[t].value;if(n.startsWith("block-handler-")){const t=parseInt(n.slice(14),10);s.push({type:"handler",idx:t,event:o})}else if(n.startsWith("block-attribute-")){const t=parseInt(n.slice(16),10);s.push({type:"attribute",idx:t,name:o,tag:r})}else if(n.startsWith("block-property-")){const t=parseInt(n.slice(15),10);s.push({type:"property",idx:t,name:o,tag:r})}else"block-attributes"===n?s.push({type:"attributes",idx:parseInt(o,10)}):"block-ref"===n?s.push({type:"ref",idx:parseInt(o,10)}):i.setAttribute(e[t].name,o)}}const l={parent:n,firstChild:null,nextSibling:null,el:i,info:s,refN:0,currentNS:e};if(t.firstChild){const e=t.childNodes[0];if(1===t.childNodes.length&&e.nodeType===Node.ELEMENT_NODE&&e.tagName.startsWith("block-child-")){const t=e.tagName,n=parseInt(t.slice(12),10);s.push({idx:n,type:"child",isOnlyChild:!0})}else{l.firstChild=Ot(t.firstChild,l,l),i.appendChild(l.firstChild.el);let e=t.firstChild,n=l.firstChild;for(;e=e.nextSibling;)n.nextSibling=Ot(e,n,l),i.appendChild(n.nextSibling.el),n=n.nextSibling}}return l.info.length&&Tt(l),l}case Node.TEXT_NODE:case Node.COMMENT_NODE:return{parent:n,firstChild:null,nextSibling:null,el:t.nodeType===Node.TEXT_NODE?document.createTextNode(t.textContent):document.createComment(t.textContent),info:[],refN:0,currentNS:null}}throw new e("boom")}function Tt(t){t.isRef=!0;do{t.refN++}while(t=t.parent)}function kt(t){let e=t.parent;for(;e&&e.nextSibling===t;)t=e,e=e.parent;return e}function St(t,e,n){if(!e){e={collectors:[],locations:[],children:new Array(t.info.filter(t=>"child"===t.type).length),cbRefs:[],refN:t.refN},n=0}if(t.refN){const o=n,r=t.isRef,i=t.firstChild?t.firstChild.refN:0,s=t.nextSibling?t.nextSibling.refN:0;if(r){for(let e of t.info)e.refIdx=o;t.refIdx=o,function(t,e){for(let n of e.info)switch(n.type){case"text":t.locations.push({idx:n.idx,refIdx:n.refIdx,setData:Rt,updateData:Rt});break;case"child":n.isOnlyChild?t.children[n.idx]={parentRefIdx:n.refIdx,isOnlyChild:!0}:t.children[n.idx]={parentRefIdx:kt(e).refIdx,afterRefIdx:n.refIdx};break;case"property":{const e=n.refIdx,o=Nt(n.name);t.locations.push({idx:n.idx,refIdx:e,setData:o,updateData:o});break}case"attribute":{const e=n.refIdx;let o,r;"class"===n.name?(r=H,o=X):(r=$(n.name),o=r),t.locations.push({idx:n.idx,refIdx:e,setData:r,updateData:o});break}case"attributes":t.locations.push({idx:n.idx,refIdx:n.refIdx,setData:F,updateData:W});break;case"handler":{const{setup:e,update:o}=q(n.event);t.locations.push({idx:n.idx,refIdx:n.refIdx,setData:e,updateData:o});break}case"ref":t.locations.push({idx:n.idx,refIdx:n.refIdx,setData:xt,updateData:xt}),t.cbRefs.push(n.idx)}}(e,t),n++}if(s){const r=n+i;e.collectors.push({idx:r,prevIdx:o,getVal:wt}),St(t.nextSibling,e,r)}i&&(e.collectors.push({idx:n,prevIdx:o,getVal:bt}),St(t.firstChild,e,n))}return e}function Rt(t){vt.call(this,pt(t))}const Ct=Node.prototype,Mt=Ct.insertBefore,It=Ct.appendChild,Pt=Ct.removeChild,Bt=((t,e)=>Object.getOwnPropertyDescriptor(t,e))(Ct,"textContent").set;class jt{constructor(t){this.children=t}mount(t,e){const n=this.children,o=document.createTextNode("");this.anchor=o,Mt.call(t,o,e);const r=n.length;if(r){const e=n[0].mount;for(let i=0;i<r;i++)e.call(n[i],t,o)}this.parentEl=t}moveBeforeDOMNode(t,e=this.parentEl){this.parentEl=e;const n=this.children;for(let o=0,r=n.length;o<r;o++)n[o].moveBeforeDOMNode(t,e);e.insertBefore(this.anchor,t)}moveBeforeVNode(t,e){if(t){const n=t.children[0];e=(n?n.firstNode():t.anchor)||null}const n=this.children;for(let t=0,o=n.length;t<o;t++)n[t].moveBeforeVNode(null,e);this.parentEl.insertBefore(this.anchor,e)}patch(t,e){if(this===t)return;const n=this.children,o=t.children;if(0===o.length&&0===n.length)return;this.children=o;const r=o[0]||n[0],{mount:i,patch:s,remove:l,beforeRemove:c,moveBeforeVNode:a,firstNode:h}=r,u=this.anchor,d=this.isOnlyChild,f=this.parentEl;if(0===o.length&&d){if(e)for(let t=0,e=n.length;t<e;t++)c.call(n[t]);return Bt.call(f,""),void It.call(f,u)}let p,m=0,g=0,y=n[0],v=o[0],b=n.length-1,w=o.length-1,x=n[b],N=o[w];for(;m<=b&&g<=w;){if(null===y){y=n[++m];continue}if(null===x){x=n[--b];continue}let t=y.key,r=v.key;if(t===r){s.call(y,v,e),o[g]=y,y=n[++m],v=o[++g];continue}let l=x.key,c=N.key;if(l===c){s.call(x,N,e),o[w]=x,x=n[--b],N=o[--w];continue}if(t===c){s.call(y,N,e),o[w]=y;const t=o[w+1];a.call(y,t,u),y=n[++m],N=o[--w];continue}if(l===r){s.call(x,v,e),o[g]=x;const t=n[m];a.call(x,t,u),x=n[--b],v=o[++g];continue}p=p||Lt(n,m,b);let d=p[r];if(void 0===d)i.call(v,f,h.call(y)||null);else{const t=n[d];a.call(t,y,null),s.call(t,v,e),o[g]=t,n[d]=null}v=o[++g]}if(m<=b||g<=w)if(m>b){const t=o[w+1],e=t?h.call(t)||null:u;for(let t=g;t<=w;t++)i.call(o[t],f,e)}else for(let t=m;t<=b;t++){let o=n[t];o&&(e&&c.call(o),l.call(o))}}beforeRemove(){const t=this.children,e=t.length;if(e){const n=t[0].beforeRemove;for(let o=0;o<e;o++)n.call(t[o])}}remove(){const{parentEl:t,anchor:e}=this;if(this.isOnlyChild)Bt.call(t,"");else{const n=this.children,o=n.length;if(o){const t=n[0].remove;for(let e=0;e<o;e++)t.call(n[e])}Pt.call(t,e)}}firstNode(){const t=this.children[0];return t?t.firstNode():void 0}toString(){return this.children.map(t=>t.toString()).join("")}}function At(t){return new jt(t)}function Lt(t,e,n){let o={};for(let r=e;r<=n;r++)o[t[r].key]=r;return o}const Vt=Node.prototype,$t=Vt.insertBefore,Ft=Vt.removeChild;class Wt{constructor(t){this.content=[],this.html=t}mount(t,e){this.parentEl=t;const n=document.createElement("template");n.innerHTML=this.html,this.content=[...n.content.childNodes];for(let n of this.content)$t.call(t,n,e);if(!this.content.length){const n=document.createTextNode("");this.content.push(n),$t.call(t,n,e)}}moveBeforeDOMNode(t,e=this.parentEl){this.parentEl=e;for(let n of this.content)$t.call(e,n,t)}moveBeforeVNode(t,e){const n=t?t.content[0]:e;this.moveBeforeDOMNode(n)}patch(t){if(this===t)return;const e=t.html;if(this.html!==e){const n=this.parentEl,o=this.content[0],r=document.createElement("template");r.innerHTML=e;const i=[...r.content.childNodes];for(let t of i)$t.call(n,t,o);if(!i.length){const t=document.createTextNode("");i.push(t),$t.call(n,t,o)}this.remove(),this.content=i,this.html=t.html}}beforeRemove(){}remove(){const t=this.parentEl;for(let e of this.content)Ft.call(t,e)}firstNode(){return this.content[0]}toString(){return this.html}}function Ut(t){return new Wt(t)}function Ht(t,e,n=null){t.mount(e,n)}function Xt(t){let e=t.fiber;if(e){let t=e.root;return t.locked=!0,t.setCounter(t.counter+1-zt(e.children)),t.locked=!1,e.children=[],e.childrenMap={},e.bdom=null,w.has(e)&&(w.delete(e),w.delete(t),e.appliedToDom=!1,e instanceof Gt&&(e.mounted=e instanceof Jt?[e]:[])),e}const n=new Gt(t,null);return t.willPatch.length&&n.willPatch.push(n),t.patched.length&&n.patched.push(n),n}function qt(){throw new e("Attempted to render cancelled fiber")}function zt(t){let e=0;for(let n of t){let t=n.node;n.render=qt,0===t.status&&t.cancel(),t.fiber=null,n.bdom?t.forceNextRender=!0:e++,e+=zt(n.children)}return e}class Kt{constructor(t,e){if(this.bdom=null,this.children=[],this.appliedToDom=!1,this.childrenMap={},this.node=t,this.parent=e,e){const t=e.root;t.setCounter(t.counter+1),this.root=t,e.children.push(this)}else this.root=this}render(){let t=this.root.node,e=t.app.scheduler,n=t.parent;for(;n;){if(n.fiber){let o=n.fiber.root;if(0!==o.counter||!(t.parentKey in n.fiber.childrenMap))return void e.delayedRenders.push(this);n=o.node}t=n,n=n.parent}this._render()}_render(){const t=this.node,e=this.root;e&&(g(t.signalComputation,()=>{try{this.bdom=!0,this.bdom=t.renderFn()}catch(e){t.app.handleError({node:t,error:e})}}),e.setCounter(e.counter-1))}}class Gt extends Kt{constructor(){super(...arguments),this.counter=1,this.willPatch=[],this.patched=[],this.mounted=[],this.locked=!1}complete(){const t=this.node;let e;this.locked=!0;let n=this.mounted;try{for(e of this.willPatch){let t=e.node;if(t.fiber===e){const e=t.component;for(let n of t.willPatch)n.call(e)}}for(e=void 0,t._patch(),this.locked=!1;e=n.pop();)if(e.appliedToDom)for(let t of e.node.mounted)t();let o=this.patched;for(;e=o.pop();)if(e.appliedToDom)for(let t of e.node.patched)t()}catch(o){for(let t of n)t.node.willUnmount=[];this.locked=!1,t.app.handleError({fiber:e||this,error:o})}}setCounter(t){this.counter=t,0===t&&this.node.app.scheduler.flush()}}class Jt extends Gt{constructor(t,e,n={}){super(t,null),this.target=e,this.position=n.position||"last-child"}complete(){let t=this;try{const e=this.node;if(e.children=this.childrenMap,e.app.constructor.validateTarget(this.target),e.bdom)e.updateDom();else if(e.bdom=this.bdom,"last-child"===this.position||0===this.target.childNodes.length)Ht(e.bdom,this.target);else{const t=this.target.childNodes[0];Ht(e.bdom,this.target,t)}e.fiber=null,e.status=1,this.appliedToDom=!0;let n=this.mounted;for(;t=n.pop();)if(t.appliedToDom)for(let e of t.node.mounted)e()}catch(e){this.node.app.handleError({fiber:t,error:e})}}}let Zt=null;function Qt(){if(!Zt)throw new e("No active component (a hook function should only be called in 'setup')");return Zt}class Yt{constructor(t,e,n,o,r){this.fiber=null,this.bdom=null,this.status=0,this.forceNextRender=!1,this.children=Object.create(null),this.willStart=[],this.willUnmount=[],this.mounted=[],this.willPatch=[],this.patched=[],this.willDestroy=[],this.name=t.name,Zt=this,this.app=n,this.parent=o,this.parentKey=r,this.pluginManager=o?o.pluginManager:n.pluginManager,this.signalComputation={value:void 0,compute:()=>this.render(!1),sources:new Set,state:c.EXECUTED},this.props=Object.assign({},e);const i=p();m(void 0),this.component=new t(this);const s={this:this.component,__owl__:this};this.renderFn=n.getTemplate(t.template).bind(this.component,s,this),this.component.setup(),m(i),Zt=null}mountComponent(t,e){const n=new Jt(this,t,e);this.app.scheduler.addFiber(n),this.initiateRender(n)}async initiateRender(t){this.fiber=t,this.mounted.length&&t.root.mounted.push(t);const e=this.component;try{let t;g(void 0,()=>{t=this.willStart.map(t=>t.call(e))}),await Promise.all(t)}catch(t){return void this.app.handleError({node:this,error:t})}0===this.status&&this.fiber===t&&t.render()}async render(t){if(this.status>=2)return;let e=this.fiber;if(e&&(e.root.locked||!0===e.bdom)&&(await Promise.resolve(),e=this.fiber),e&&!e.bdom&&!w.has(e)||!e&&!this.bdom)return;const n=Xt(this);this.fiber=n,this.app.scheduler.addFiber(n),await Promise.resolve(),this.status>=2||this.fiber!==n||!e&&n.parent||n.render()}cancel(){this._cancel(),delete this.parent.children[this.parentKey],this.app.scheduler.scheduleDestroy(this)}_cancel(){this.status=2;const t=this.children;for(let e in t)t[e]._cancel()}destroy(){let t=1===this.status;this._destroy(),t&&this.bdom.remove()}_destroy(){const t=this.component;if(1===this.status)for(let e of this.willUnmount)e.call(t);for(let t of Object.values(this.children))t._destroy();if(this.willDestroy.length)try{for(let e of this.willDestroy)e.call(t)}catch(t){this.app.handleError({error:t,node:this})}this.status=3}updateDom(){if(this.fiber)if(this.bdom===this.fiber.bdom)for(let t in this.children){this.children[t].updateDom()}else this.bdom.patch(this.fiber.bdom,!1),this.fiber.appliedToDom=!0,this.fiber=null}firstNode(){const t=this.bdom;return t?t.firstNode():void 0}mount(t,e){const n=this.fiber.bdom;this.bdom=n,n.mount(t,e),this.status=1,this.fiber.appliedToDom=!0,this.children=this.fiber.childrenMap,this.fiber=null}moveBeforeDOMNode(t,e){this.bdom.moveBeforeDOMNode(t,e)}moveBeforeVNode(t,e){this.bdom.moveBeforeVNode(t?t.bdom:null,e)}patch(){this.fiber&&this.fiber.parent&&this._patch()}_patch(){let t=!1;for(let e in this.children){t=!0;break}const e=this.fiber;this.children=e.childrenMap,this.bdom.patch(e.bdom,t),e.appliedToDom=!0,this.fiber=null}beforeRemove(){this._destroy()}remove(){this.bdom.remove()}}function te(t,n){const o=ee(t,n);if(o.length){const t=JSON.stringify(o,(t,e)=>"function"==typeof e?e.name:e,2);throw new e(`Value does not match the type\n${t}`)}}function ee(t,e){return e(t)}const ne=function(t){return"string"!=typeof t?[{type:"type",expected:String,received:t}]:[]};function oe(...t){return function(e){if("object"!=typeof e)return[{type:"type",expected:Object,received:e}];const n=Object.keys(e),o=t.filter(t=>!!t.endsWith("?")||!n.includes(t));return o.length?[{type:"missing keys",value:e,missingKeys:o}]:[]}}function re(t){return function(e){if("object"!=typeof e)return[{type:"type",expected:Object,received:e}];if(t){const n=[],o=[];for(let r in t){const i=ee(e[r],t[r]);r in e?o.push(...i):n.push(r)}return n.length&&o.push({type:"missing keys",value:e,missingKeys:n}),o}return[]}}var ie={__proto__:null,any:function(){return[]},boolean:function(t){return"boolean"!=typeof t?[{type:"type",expected:Boolean,received:t}]:[]},number:function(t){return"number"!=typeof t?[{type:"type",expected:Number,received:t}]:[]},string:ne,array:function(t){return function(e){return Array.isArray(e)?t?e.flatMap(e=>ee(e,t)):[]:[{type:"type",expected:Array,received:e}]}},func:function(t,e){return function(t){return"function"!=typeof t?[{type:"type",expected:Function,received:t}]:[]}},instanceOf:function(t){return function(e){return e instanceof t?[]:[{type:"type",expected:t,received:e}]}},keys:oe,literal:function(t){return function(e){return e!==t?[{type:"exact value",expected:t,received:e}]:[]}},object:re,optional:function(t){return function(e){return void 0===e?[]:ee(e,t)}},record:function(t){return function(e){if("object"!=typeof e)return[{type:"type",expected:Object,received:e}];const n=[];for(let o in e)n.push(...ee(e[o],t));return n}},tuple:function(...t){return function(e){return Array.isArray(e)?e.length!==t.length?[{type:"length",expected:t.length,received:e.length}]:t.flatMap((t,n)=>ee(e[n],t)):[{type:"type",expected:Array,received:e}]}},constructor:function(t){return function(e){return"function"==typeof e&&(e===t||e.prototype instanceof t)?[]:[{type:"type"}]}},union:function(...t){return function(e){return t.filter(t=>ee(e,t).length).length?[{type:"union"}]:[]}},signal:function(t){return function(t){return"function"!=typeof t?[{type:"type",expected:Function,received:t}]:"function"!=typeof t.set?[{type:"type",expected:Function,received:t.set}]:[]}},reactiveValue:function(t){return function(t){return"function"!=typeof t?[{type:"type",expected:Function,received:t}]:[]}}};let se={};class le{constructor(t){var e;this.children=[],this.onDestroyCb=[],this.status=0,this.parent=t||null,null===(e=this.parent)||void 0===e||e.children.push(this),this.plugins=this.parent?Object.create(this.parent.plugins):{}}destroy(){for(let t of this.children)t.destroy();const t=this.onDestroyCb;for(;t.length;)t.pop()();this.status=3}getPluginById(t){return this.plugins[t]||null}getPlugin(t){return this.getPluginById(t.id)}startPlugins(t,n={}){const o=le.current;le.current=this;const r=[];for(const i of t){if(!i.id)throw le.current=o,new e(`Plugin "${i.name}" has no id`);if(this.plugins.hasOwnProperty(i.id)){const t=this.getPluginById(i.id).constructor;if(t!==i)throw le.current=o,new e(`Trying to start a plugin with the same id as an other plugin (id: '${i.id}', existing plugin: '${t.name}', starting plugin: '${i.name}')`);continue}se=n[i.id]||{};const t=new i;this.plugins[i.id]=t,r.push(t)}se={};for(let t of r)t.setup();return le.current=o,le.current||(this.status=1),r}}function ce(t){const n=le.current||Qt().pluginManager;let o=n.getPluginById(t.id);if(!o){if(n!==le.current)throw new e(`Unknown plugin "${t.id}"`);n.startPlugins([t]),o=n.getPluginById(t.id)}return o}le.current=null,ce.props=function(t,e={}){function n(t){return void 0===se[t]?e[t]:se[t]}const o=Object.create(null);function r(t){for(const e of t)Reflect.defineProperty(o,e,{enumerable:!0,get:n.bind(null,e)})}if(t){const e=t&&!Array.isArray(t);r((e?Object.keys(t):t).map(t=>t.endsWith("?")?t.slice(0,-1):t));if(Qt().app.dev){const n=e?re(t):oe(...t);te(se,n)}}else r(Object.keys(se));return se};const ae=Symbol("Key changes"),he=Object.prototype.toString,ue=Object.prototype.hasOwnProperty,de=["Object","Array","Set","Map","WeakMap"],fe=["Set","Map","WeakMap"];function pe(t){return he.call(be(t)).slice(8,-1)}function me(t){return"object"==typeof t&&de.includes(pe(t))}function ge(t,e){return!e&&me(t)?Oe(t):t}const ye=new WeakSet;function ve(t){return ye.add(t),t}function be(t){return Ee.has(t)?Ee.get(t):t}const we=new WeakMap;function xe(t,e,n){u(null!=n?n:function(t,e){let n=we.get(t);n||(n=new Map,we.set(t,n));let o=n.get(e);return o||(o={value:void 0,observers:new Set},n.set(e,o)),o}(t,e))}function Ne(t,e,n){if(!n){const o=we.get(t);if(!o)return;if(!o.has(e))return;n=o.get(e)}d(n)}const Ee=new WeakMap,_e=new WeakMap;function De(t,n){if(!me(t))throw new e("Cannot make the given value reactive");if(ye.has(t))return t;if(Ee.has(t))return t;const o=_e.get(t);if(o)return o;const r=pe(t),i=fe.includes(r)?function(t,e,n){const o=Ie[e](t,n);return Object.assign(Te(n),{get:(t,e)=>ue.call(o,e)?o[e]:(xe(t,e,n),ge(t[e],n))})}(t,r,n):Te(n),s=new Proxy(t,i);return _e.set(t,s),Ee.set(s,t),s}function Oe(t){return De(t,null)}function Te(t){return{get(e,n,o){const r=Object.getOwnPropertyDescriptor(e,n);return!r||r.writable||r.configurable?(xe(e,n,t),ge(Reflect.get(e,n,o),t)):Reflect.get(e,n,o)},set(e,n,o,r){const i=ue.call(e,n),s=Reflect.get(e,n,r),l=Reflect.set(e,n,be(o),r);return!i&&ue.call(e,n)&&Ne(e,ae,t),(s!==Reflect.get(e,n,r)||"length"===n&&Array.isArray(e))&&Ne(e,n,t),l},deleteProperty(e,n){const o=Reflect.deleteProperty(e,n);return Ne(e,ae,t),Ne(e,n,t),o},ownKeys:e=>(xe(e,ae,t),Reflect.ownKeys(e)),has:(e,n)=>(xe(e,ae,t),Reflect.has(e,n))}}function ke(t,e,n){return o=>(o=be(o),xe(e,o,n),ge(e[t](o),n))}function Se(t,e,n){return function*(){xe(e,ae,n);const o=e.keys();for(const r of e[t]()){const t=o.next().value;xe(e,t,n),yield ge(r,n)}}}function Re(t,e){return function(n,o){xe(t,ae,e),t.forEach(function(r,i,s){xe(t,i,e),n.call(o,ge(r,e),ge(i,e),ge(s,e))},o)}}function Ce(t,e,n,o){return(r,i)=>{r=be(r);const s=n.has(r),l=n[e](r),c=n[t](r,i);return s!==n.has(r)&&Ne(n,ae,o),l!==n[e](r)&&Ne(n,r,o),c}}function Me(t,e){return()=>{const n=[...t.keys()];t.clear(),Ne(t,ae,e);for(const o of n)Ne(t,o,e)}}const Ie={Set:(t,e)=>({has:ke("has",t,e),add:Ce("add","has",t,e),delete:Ce("delete","has",t,e),keys:Se("keys",t,e),values:Se("values",t,e),entries:Se("entries",t,e),[Symbol.iterator]:Se(Symbol.iterator,t,e),forEach:Re(t,e),clear:Me(t,e),get size(){return xe(t,ae,e),t.size}}),Map:(t,e)=>({has:ke("has",t,e),get:ke("get",t,e),set:Ce("set","get",t,e),delete:Ce("delete","has",t,e),keys:Se("keys",t,e),values:Se("values",t,e),entries:Se("entries",t,e),[Symbol.iterator]:Se(Symbol.iterator,t,e),forEach:Re(t,e),clear:Me(t,e),get size(){return xe(t,ae,e),t.size}}),WeakMap:(t,e)=>({has:ke("has",t,e),get:ke("get",t,e),set:Ce("set","get",t,e),delete:Ce("delete","has",t,e)})};class Pe{constructor(){this.tasks=new Set,this.frame=0,this.delayedRenders=[],this.cancelledNodes=new Set,this.processing=!1,this.requestAnimationFrame=Pe.requestAnimationFrame}addFiber(t){this.tasks.add(t.root)}scheduleDestroy(t){this.cancelledNodes.add(t),0===this.frame&&(this.frame=this.requestAnimationFrame(()=>this.processTasks()))}flush(){if(this.delayedRenders.length){let t=this.delayedRenders;this.delayedRenders=[];for(let e of t)e.root&&3!==e.node.status&&e.node.fiber===e&&e.render()}0===this.frame&&(this.frame=this.requestAnimationFrame(()=>this.processTasks()))}processTasks(){if(!this.processing){this.processing=!0,this.frame=0;for(let t of this.cancelledNodes)t._destroy();this.cancelledNodes.clear();for(let t of this.tasks)this.processFiber(t);for(let t of this.tasks)3===t.node.status&&this.tasks.delete(t);this.processing=!1}}processFiber(t){if(t.root!==t)return void this.tasks.delete(t);const e=w.has(t);e&&0!==t.counter?this.tasks.delete(t):3!==t.node.status?0===t.counter&&(e||t.complete(),t.appliedToDom&&this.tasks.delete(t)):this.tasks.delete(t)}}function Be(t,e,n){const o=e.bind(t.component);if(t.app.dev){const t=e.name?` <${e.name}>`:"";Reflect.defineProperty(o,"name",{value:n+t})}return o}function je(t){const e=Qt();e.mounted.push(Be(e,t,"onMounted"))}function Ae(t){const e=Qt();e.willUnmount.unshift(Be(e,t,"onWillUnmount"))}function Le(t){const e=le.current;if(e)e.onDestroyCb.push(t);else{const e=Qt();e.willDestroy.unshift(Be(e,t,"onWillDestroy"))}}function Ve(t,e={}){const n=Qt(),o=Object.create(null);function r(t){for(const r of t)o[r]=void 0===n.props?e[r]:n.props[r]}if(t){const e=t&&!Array.isArray(t);if(r((e?Object.keys(t):t).map(t=>t.endsWith("?")?t.slice(0,-1):t)),n.app.dev){const o=e?re(t):oe(...t);te(n.props,o)}}else r(Object.keys(n.props));return o}Pe.requestAnimationFrame=window.requestAnimationFrame.bind(window);const $e=dt("").constructor;class Fe extends $e{constructor(t,e){super(""),this.target=null,this.selector=t,this.content=e}mount(t,e){super.mount(t,e),this.target=document.querySelector(this.selector),this.target?this.content.mount(this.target,null):this.content.mount(t,e)}beforeRemove(){this.content.beforeRemove()}remove(){this.content&&(super.remove(),this.content.remove(),this.content=null)}patch(t){super.patch(t),this.content?this.content.patch(t.content,!0):(this.content=t.content,this.content.mount(this.target,null))}}class We extends n{constructor(){super(...arguments),this.props=Ve({target:ne})}setup(){const t=this.__owl__;je(()=>{const n=t.bdom;if(!n.target){const o=document.querySelector(t.props.target);if(!o)throw new e("invalid portal target");n.content.moveBeforeDOMNode(o.firstChild,o)}}),Ae(()=>{t.bdom.remove()})}}We.template="__portal__";const Ue=Object.create;function He(t){const e=Ue(t);for(let n in t)e[n]=t[n];return e}const Xe=Symbol("isBoundary");class qe{constructor(t,e,n,o,r){this.fn=t,this.ctx=He(e),this.component=n,this.node=o,this.key=r}evaluate(){return this.fn.call(this.component,this.ctx,this.node,this.key)}toString(){return this.evaluate().toString()}}const ze={withDefault:function(t,e){return null==t||!1===t?e:t},zero:Symbol("zero"),isBoundary:Xe,callSlot:function(t,e,n,o,r,i,s){n=n+"__slot_"+o;const l=t.__owl__.props.slots||{},{__render:c,__ctx:a,__scope:h}=l[o]||{},u=Ue(a||{});h&&(u[h]=i);const d=c?c(u,e,n):null;if(s){let i,l;return d?i=r?S(o,d):d:l=s(t,e,n),ot([i,l])}return d||dt("")},capture:He,withKey:function(t,e){return t.key=e,t},prepareList:function(t){let n,o;if(Array.isArray(t))n=t,o=t;else if(t instanceof Map)n=[...t.keys()],o=[...t.values()];else if(Symbol.iterator in Object(t))n=[...t],o=n;else{if(!t||"object"!=typeof t)throw new e(`Invalid loop expression: "${t}" is not iterable`);o=Object.values(t),n=Object.keys(t)}const r=o.length;return[n,o,r,new Array(r)]},setContextValue:function(t,e,n){const o=t;for(;!t.hasOwnProperty(e)&&!t.hasOwnProperty(Xe);){const e=t.__proto__;if(!e){t=o;break}t=e}t[e]=n},shallowEqual:function(t,e){for(let n=0,o=t.length;n<o;n++)if(t[n]!==e[n])return!1;return!0},toNumber:function(t){const e=parseFloat(t);return isNaN(e)?t:e},LazyValue:qe,safeOutput:function(t,e){if(null==t)return e?S("default",e):S("undefined",dt(""));let n,o;return t instanceof i?(n="string_safe",o=Ut(t)):t instanceof qe?(n="lazy_value",o=t.evaluate()):(n="string_unsafe",o=dt(t)),S(n,o)},createCatcher:function(t){const e=Object.keys(t).length;class n{constructor(t,e){this.handlerFns=[],this.afterNode=null,this.child=t,this.handlerData=e}mount(e,n){this.parentEl=e,this.child.mount(e,n),this.afterNode=document.createTextNode(""),e.insertBefore(this.afterNode,n),this.wrapHandlerData();for(let n in t){const o=t[n],r=q(n);this.handlerFns[o]=r,r.setup.call(e,this.handlerData[o])}}wrapHandlerData(){for(let t=0;t<e;t++){let e=this.handlerData[t],n=e.length-2,o=e[n];const r=this;e[n]=function(t){const e=t.target;let n=r.child.firstNode();const i=r.afterNode;for(;n&&n!==i;){if(n.contains(e))return o.call(this,t);n=n.nextSibling}}}}moveBeforeDOMNode(t,e=this.parentEl){this.parentEl=e,this.child.moveBeforeDOMNode(t,e),e.insertBefore(this.afterNode,t)}moveBeforeVNode(t,e){t&&(e=t.firstNode()||e),this.child.moveBeforeVNode(t?t.child:null,e),this.parentEl.insertBefore(this.afterNode,e)}patch(t,n){if(this!==t){this.handlerData=t.handlerData,this.wrapHandlerData();for(let t=0;t<e;t++)this.handlerFns[t].update.call(this.parentEl,this.handlerData[t]);this.child.patch(t.child,n)}}beforeRemove(){this.child.beforeRemove()}remove(){for(let t=0;t<e;t++)this.handlerFns[t].remove.call(this.parentEl);this.child.remove(),this.afterNode.remove()}firstNode(){return this.child.firstNode()}toString(){return this.child.toString()}}return function(t,e){return new n(t,e)}},markRaw:ve,OwlError:e,createRef:function(t){if(!t)throw new e("Ref is undefined or null");let n,o;if(t.add&&t.remove)n=t.add.bind(t),o=t.remove.bind(t);else{if(!t.set)throw new e("Ref should implement either a 'set' function or 'add' and 'remove' functions");n=t.set.bind(t),o=()=>t.set(null)}return(t,e)=>{e&&o(e),t&&n(t)}},modelExpr:function(t){if(!t.set||"function"!=typeof t)throw new e("Invalid t-model expression: expression should evaluate to a function with a 'set' method defined on it");return t}};const Ke={text:dt,createBlock:_t,list:At,multi:ot,html:Ut,toggler:S,comment:ft};class Ge{static registerTemplate(t,e){Je[t]=e}constructor(t={}){if(this.rawTemplates=Object.create(Je),this.templates={},this.Portal=We,this.dev=t.dev||!1,this.translateFn=t.translateFn,this.translatableAttributes=t.translatableAttributes,t.templates)if(t.templates instanceof Document||"string"==typeof t.templates)this.addTemplates(t.templates);else for(const e in t.templates)this.addTemplate(e,t.templates[e]);this.getRawTemplate=t.getTemplate,this.customDirectives=t.customDirectives||{},this.runtimeUtils={...ze,__globals__:t.globalValues||{}},this.hasGlobalValues=Boolean(t.globalValues&&Object.keys(t.globalValues).length)}addTemplate(t,n){if(t in this.rawTemplates){if(!this.dev)return;const o=this.rawTemplates[t];if(("string"==typeof o?o:o instanceof Element?o.outerHTML:o.toString())===("string"==typeof n?n:n.outerHTML))return;throw new e(`Template ${t} already defined with different content`)}this.rawTemplates[t]=n}addTemplates(t){if(t){t=t instanceof Document?t:function(t){const n=(new DOMParser).parseFromString(t,"text/xml");if(n.getElementsByTagName("parsererror").length){let o="Invalid XML in template.";const r=n.getElementsByTagName("parsererror")[0].textContent;if(r){o+="\nThe parser has produced the following error message:\n"+r;const e=/\d+/g,n=e.exec(r);if(n){const i=Number(n[0]),s=t.split("\n")[i-1],l=e.exec(r);if(s&&l){const t=Number(l[0])-1;s[t]&&(o+=`\nThe error might be located at xml line ${i} column ${t}\n${s}\n${"-".repeat(t-1)}^`)}}}throw new e(o)}return n}(t);for(const e of t.querySelectorAll("[t-name]")){const t=e.getAttribute("t-name");this.addTemplate(t,e)}}}getTemplate(t){var n;if(!(t in this.templates)){const o=(null===(n=this.getRawTemplate)||void 0===n?void 0:n.call(this,t))||this.rawTemplates[t];if(void 0===o){let n="";try{n=` (for component "${Qt().component.constructor.name}")`}catch{}throw new e(`Missing template: "${t}"${n}`)}const r="function"==typeof o&&!(o instanceof Element)?o:this._compileTemplate(t,o),i=this.templates;this.templates[t]=function(e,n){return i[t].call(this,e,n)};const s=r(this,Ke,this.runtimeUtils);this.templates[t]=s}return this.templates[t]}_compileTemplate(t,n){throw new e("Unable to compile a template. Please use owl full build instead")}callTemplate(t,e,n,o,r){return S(e,this.getTemplate(e).call(t,n,o,r+e))}}const Je={};function Ze(...t){const e="__template__"+Ze.nextId++,n=String.raw(...t);return Je[e]=n,e}Ze.nextId=1,Ge.registerTemplate("__portal__",function(t,e,n){let{callSlot:o}=n;return function(t,e,n=""){return new Fe(t.this.props.target,o(t,e,n,"default",!1,null))}});let Qe=!1;const Ye=new Set;window.__OWL_DEVTOOLS__||(window.__OWL_DEVTOOLS__={apps:Ye,Fiber:Kt,RootFiber:Gt,toRaw:be,proxy:Oe});class tn extends Ge{constructor(t={}){super(t),this.scheduler=new Pe,this.roots=new Set,this.name=t.name||"",Ye.add(this),this.pluginManager=t.pluginManager||new le(null),t.plugins&&this.pluginManager.startPlugins(t.plugins),t.test&&(this.dev=!0),!this.dev||t.test||Qe||(console.info("Owl is running in 'dev' mode."),Qe=!0)}createRoot(t,e={}){const n=e.props||{};let o,r;const i=new Promise((t,e)=>{o=t,r=e}),s=function(){let t=Zt;return()=>{Zt=t}}();let l,c=null;try{l=this.makeNode(t,n)}catch(t){c=t,r(t)}finally{s()}const a={node:l,promise:i,mount:(t,e)=>(c||(tn.validateTarget(t),this.mountNode(l,t,o,r,e)),i),destroy:()=>{this.roots.delete(a),l.destroy(),this.scheduler.processTasks()}};return this.roots.add(a),a}makeNode(t,e){return new Yt(t,e,this,null,null)}mountNode(t,e,n,o,r){let i=x.get(t);i||(i=[],x.set(t,i)),i.unshift((t,e)=>{const n=e();o(n)}),t.mounted.push(()=>{n(t.component),i.shift()}),t.mountComponent(e,r)}destroy(){for(let t of this.roots)t.destroy();this.scheduler.processTasks(),Ye.delete(this)}createComponent(t,o){const r=!o,i=Yt.prototype.initiateRender;return(s,l,c,a,h)=>{let u=c.children,d=u[l];r&&d&&d.component.constructor!==h&&(d=void 0);const f=c.fiber;if(!d){if(o){const o=a.constructor.components;if(!o)throw new e(`Cannot find the definition of component "${t}", missing static components key in parent`);if(!(h=o[t]))throw new e(`Cannot find the definition of component "${t}"`);if(!(h.prototype instanceof n))throw new e(`"${t}" is not a Component. It must inherit from the Component class`)}d=new Yt(h,s,this,c,l),u[l]=d,i.call(d,new Kt(d,f))}return f.childrenMap[l]=d,d}}handleError(...t){return _(...t)}}tn.validateTarget=function(t){const n=t&&t.ownerDocument;if(n){if(!n.defaultView)throw new e("Cannot mount a component: the target document is not attached to a window (defaultView is missing)");if(t instanceof n.defaultView.HTMLElement||t instanceof ShadowRoot){if(!function(t,e){let n=t;const o=e.defaultView.ShadowRoot;for(;n;){if(n===e)return!0;if(n.parentNode)n=n.parentNode;else{if(!(n instanceof o&&n.host))return!1;n=n.host}}return!1}(t,n))throw new e("Cannot mount a component on a detached dom node");return}}throw new e("Cannot mount component: the target is not a valid DOM element")},tn.apps=Ye,tn.version="3.0.0-alpha";function en(t,e){let n;return()=>(null!=n||(n={state:c.STALE,sources:new Set,compute:()=>(d(n),t()),isDerived:!0,value:void 0,observers:new Set,name:null==e?void 0:e.name}),y(n),u(n),n.value)}const nn=Symbol("Signal");function on(t,e,n){const o={value:t,observers:new Set,name:null==n?void 0:n.name};let r=e(o);const i=()=>(u(o),r);return i[nn]=o,i.set=t=>{Object.is(o.value,t)||(o.value=t,r=e(o),d(o))},i}function rn(t,e){return on(t,t=>t.value,e)}rn.invalidate=function(t){if(!(nn in t))throw new e(`Value is not a signal (${t})`);d(t[nn])},rn.Array=function(t,e){return on(t,t=>De(t.value,t),e)},rn.Object=function(t,e){return on(t,t=>De(t.value,t),e)},rn.Map=function(t,e){return on(t,t=>De(t.value,t),e)},rn.Set=function(t,e){return on(t,t=>De(t.value,t),e)};function sn(t,e){var n,o,r;const i={state:c.STALE,value:void 0,compute:()=>(m(void 0),ln(i),m(i),t()),sources:new Set,childrenEffect:[],name:null==e?void 0:e.name};return null===(r=null===(o=null===(n=p())||void 0===n?void 0:n.childrenEffect)||void 0===o?void 0:o.push)||void 0===r||r.call(o,i),y(i),()=>{const t=p();m(void 0),ln(i),m(t)}}function ln(t){v(t),function(t){const e=t.value;e&&"function"==typeof e&&(e(),t.value=void 0)}(t);for(const e of t.childrenEffect)e.state=c.EXECUTED,v(e),ln(e);t.childrenEffect.length=0}O.shouldNormalizeDom=!1,O.mainEventHandler=(t,n,o)=>{const{data:r,modifiers:i}=D(t);t=r;let s=!1;if(i.length){let t=!1;const e=n.target===o;for(const o of i)switch(o){case"self":if(t=!0,e)continue;return s;case"prevent":(t&&e||!t)&&n.preventDefault();continue;case"stop":(t&&e||!t)&&n.stopPropagation(),s=!0;continue}}if(Object.hasOwnProperty.call(t,0)){const o=t[0];if("function"!=typeof o)throw new e(`Invalid handler (expected a function, received: '${o}')`);let r=t[1]?t[1].__owl__:null;r&&1!==r.status||o.call(r?r.component:null,n)}return s};const cn={config:O,mount:Ht,patch:function(t,e,n=!1){t.patch(e,n)},remove:function(t,e=!1){e&&t.beforeRemove(),t.remove()},list:At,multi:ot,text:dt,toggler:S,createBlock:_t,html:Ut,comment:ft},an={version:tn.version};t.App=tn,t.Component=n,t.EventBus=r,t.OwlError=e,t.Plugin=class{static get id(){var t;return null!==(t=this._shadowId)&&void 0!==t?t:this.name}static set id(t){this._shadowId=t}setup(){}},t.PluginManager=le,t.Registry=class{constructor(t={}){this._map=rn.Object(Object.create(null)),this.entries=en(()=>Object.entries(this._map()).sort((t,e)=>t[1][0]-e[1][0]).map(([t,e])=>[t,e[1]])),this.items=en(()=>this.entries().map(t=>t[1])),this._name=t.name||"registry",this._validation=t.validation}addById(t,n=50){if(!t.id)throw new e(`Item should have an id key (registry '${this._name}')`);return this.add(t.id,t,n)}add(t,e,n=50){return this._validation&&te(e,this._validation),this._map()[t]=[n,e],this}get(t,e){const n=t in this._map();if(!n&&arguments.length<2)throw new Error(`KeyNotFoundError: Cannot find key "${t}" (registry '${this._name}')`);return n?this._map()[t][1]:e}remove(t){delete this._map()[t]}has(t){return t in this._map()}},t.Resource=class{constructor(t={}){this._items=rn.Array([]),this.items=en(()=>this._items().sort((t,e)=>t[0]-e[0]).map(t=>t[1])),this._validation=t.validation}add(t,e=50){return this._validation&&te(t,this._validation),this._items().push([e,t]),this}remove(t){const e=this._items().filter(([e,n])=>n!==t);return this._items.set(e),this}has(t){return this._items().some(([e,n])=>n===t)}},t.__info__=an,t.assertType=te,t.batched=o,t.blockDom=cn,t.computed=en,t.effect=sn,t.htmlEscape=s,t.markRaw=ve,t.markup=l,t.mount=async function(t,e,n={}){return new tn(n).createRoot(t,n).mount(e,n)},t.onError=function(t){const e=Qt();let n=x.get(e);n||(n=[],x.set(e,n)),n.push(t.bind(e.component))},t.onMounted=je,t.onPatched=function(t){const e=Qt();e.patched.push(Be(e,t,"onPatched"))},t.onWillDestroy=Le,t.onWillPatch=function(t){const e=Qt();e.willPatch.unshift(Be(e,t,"onWillPatch"))},t.onWillStart=function(t){const e=Qt();e.willStart.push(Be(e,t,"onWillStart"))},t.onWillUnmount=Ae,t.plugin=ce,t.props=Ve,t.providePlugins=function(t,e){const n=Qt(),o=new le(n.pluginManager);return n.pluginManager=o,Le(()=>o.destroy()),o.startPlugins(t,e)},t.proxy=Oe,t.signal=rn,t.status=function(){const t=le.current,e=t||Qt();return()=>{switch(e.status){case 0:return"new";case 2:return"cancelled";case 1:return t?"started":"mounted";case 3:return"destroyed"}}},t.toRaw=be,t.types=ie,t.untrack=function(t){return g(void 0,t)},t.useComponent=function(){return Zt.component},t.useEffect=function(t){Le(sn(t))},t.useListener=function(t,e,n,o){t.addEventListener(e,n,o),Le(()=>t.removeEventListener(e,n,o))},t.useResource=function(t,e){for(let n of e)t.add(n);Le(()=>{for(let n of e)t.remove(n)})},t.validateType=ee,t.whenReady=function(t){return new Promise(function(t){"loading"!==document.readyState?t(!0):document.addEventListener("DOMContentLoaded",t,!1)}).then(t||function(){})},t.xml=Ze,Object.defineProperty(t,"__esModule",{value:!0}),an.date="2026-01-14T19:21:38.789Z",an.hash="2278017",an.url="https://github.com/odoo/owl"}(this.owl=this.owl||{});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare type customDirectives = Record<string, (node: Element, value: string, modifier: string[]) => void>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export declare type TaskContext = {
|
|
2
|
-
isCancelled: boolean;
|
|
3
|
-
cancel: () => void;
|
|
4
|
-
meta: Record<string, any>;
|
|
5
|
-
};
|
|
6
|
-
export declare const taskContextStack: TaskContext[];
|
|
7
|
-
export declare function getTaskContext(): TaskContext;
|
|
8
|
-
export declare function makeTaskContext(): TaskContext;
|
|
9
|
-
export declare function useTaskContext(ctx?: TaskContext): {
|
|
10
|
-
ctx: TaskContext;
|
|
11
|
-
cleanup: () => void;
|
|
12
|
-
};
|
|
13
|
-
export declare function pushTaskContext(context: TaskContext): void;
|
|
14
|
-
export declare function popTaskContext(): void;
|
|
15
|
-
export declare function taskEffect(fn: Function): TaskContext;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export declare type PromiseExecContext = {
|
|
2
|
-
cancelled: boolean;
|
|
3
|
-
};
|
|
4
|
-
export declare type CancellablePromise<T = any> = Promise<T> & {
|
|
5
|
-
execContext?: PromiseExecContext;
|
|
6
|
-
};
|
|
7
|
-
export declare const setCancellableContext: (ctx: PromiseExecContext | undefined) => PromiseExecContext | undefined;
|
|
8
|
-
export declare const resetCancellableContext: (ctx: PromiseExecContext | undefined) => void;
|
|
9
|
-
export declare const _exec: (execContext: PromiseExecContext | undefined, cb: Function, args: any[]) => any;
|
|
10
|
-
export declare function patchPromise(): void;
|
|
11
|
-
export declare function restorePromise(): void;
|
|
12
|
-
export declare function getCancellableTask(cb: Function): {
|
|
13
|
-
cancel: () => boolean;
|
|
14
|
-
readonly isCancel: boolean;
|
|
15
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { ComponentNode } from "./component_node";
|
|
2
|
-
import type { Fiber } from "./fibers";
|
|
3
|
-
export declare const fibersInError: WeakMap<Fiber, any>;
|
|
4
|
-
export declare const nodeErrorHandlers: WeakMap<ComponentNode, ((error: any) => void)[]>;
|
|
5
|
-
declare type ErrorParams = {
|
|
6
|
-
error: any;
|
|
7
|
-
} & ({
|
|
8
|
-
node: ComponentNode;
|
|
9
|
-
} | {
|
|
10
|
-
fiber: Fiber;
|
|
11
|
-
});
|
|
12
|
-
export declare function handleError(params: ErrorParams): void;
|
|
13
|
-
export {};
|
|
File without changes
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { BDom } from "./blockdom";
|
|
2
|
-
import type { ComponentNode } from "./component_node";
|
|
3
|
-
export declare function makeChildFiber(node: ComponentNode, parent: Fiber): Fiber;
|
|
4
|
-
export declare function makeRootFiber(node: ComponentNode): Fiber;
|
|
5
|
-
export declare class Fiber {
|
|
6
|
-
node: ComponentNode;
|
|
7
|
-
bdom: BDom | null;
|
|
8
|
-
root: RootFiber | null;
|
|
9
|
-
parent: Fiber | null;
|
|
10
|
-
children: Fiber[];
|
|
11
|
-
appliedToDom: boolean;
|
|
12
|
-
deep: boolean;
|
|
13
|
-
childrenMap: ComponentNode["children"];
|
|
14
|
-
constructor(node: ComponentNode, parent: Fiber | null);
|
|
15
|
-
render(): void;
|
|
16
|
-
_render(): void;
|
|
17
|
-
}
|
|
18
|
-
export declare class RootFiber extends Fiber {
|
|
19
|
-
counter: number;
|
|
20
|
-
willPatch: Fiber[];
|
|
21
|
-
patched: Fiber[];
|
|
22
|
-
mounted: Fiber[];
|
|
23
|
-
locked: boolean;
|
|
24
|
-
complete(): void;
|
|
25
|
-
setCounter(newValue: number): void;
|
|
26
|
-
}
|
|
27
|
-
declare type Position = "first-child" | "last-child";
|
|
28
|
-
export interface MountOptions {
|
|
29
|
-
position?: Position;
|
|
30
|
-
}
|
|
31
|
-
export declare class MountFiber extends RootFiber {
|
|
32
|
-
target: HTMLElement;
|
|
33
|
-
position: Position;
|
|
34
|
-
constructor(node: ComponentNode, target: HTMLElement, options?: MountOptions);
|
|
35
|
-
complete(): void;
|
|
36
|
-
}
|
|
37
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function reactiveMap<A, B>(arr: A[], fn: (a: A, index: number) => B): any;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { Signal } from "./reactivity/signal";
|
|
2
|
-
type MClass<TFields extends Record<string, FieldDef>> = (new (...args: any[]) => Model<TFields>) & StaticModel<TFields>;
|
|
3
|
-
type CharField = {
|
|
4
|
-
type: "char";
|
|
5
|
-
};
|
|
6
|
-
type NumberField = {
|
|
7
|
-
type: "number";
|
|
8
|
-
};
|
|
9
|
-
type Many2OneField<C extends MClass<any>> = {
|
|
10
|
-
type: "many2one";
|
|
11
|
-
comodel: () => C;
|
|
12
|
-
};
|
|
13
|
-
type FieldDef = CharField | NumberField | Many2OneField<MClass<any>>;
|
|
14
|
-
type FieldValue<F extends FieldDef> = F extends CharField ? Signal<string> : F extends NumberField ? Signal<number> : F extends Many2OneField<infer C> ? Signal<InstanceType<C>> : never;
|
|
15
|
-
type FieldsToData<F extends Record<string, FieldDef>> = {
|
|
16
|
-
[K in keyof F]: FieldValue<F[K]>;
|
|
17
|
-
};
|
|
18
|
-
type FieldDescription = {
|
|
19
|
-
type: "char";
|
|
20
|
-
} | {
|
|
21
|
-
type: "number";
|
|
22
|
-
} | {
|
|
23
|
-
type: "many2one";
|
|
24
|
-
comodel: () => MClass<any>;
|
|
25
|
-
};
|
|
26
|
-
export type Fields = Record<string, FieldDescription>;
|
|
27
|
-
interface StaticModel<F extends Record<string, FieldDef>> {
|
|
28
|
-
fields: F;
|
|
29
|
-
id: string;
|
|
30
|
-
}
|
|
31
|
-
type R<F extends Record<string, FieldDef>, C extends MClass<F>> = InstanceType<C>;
|
|
32
|
-
export declare class Model<F extends Record<string, FieldDef> = any> {
|
|
33
|
-
#private;
|
|
34
|
-
static fields: Fields;
|
|
35
|
-
readonly id: string;
|
|
36
|
-
data: FieldsToData<F>;
|
|
37
|
-
constructor(store: Store, id: string, data?: any);
|
|
38
|
-
toObject(): Object;
|
|
39
|
-
}
|
|
40
|
-
export declare class Store {
|
|
41
|
-
#private;
|
|
42
|
-
static fromObject(obj: any, models: MClass<any>[]): Store;
|
|
43
|
-
uuid(): string;
|
|
44
|
-
create<F extends Record<string, FieldDef>, C extends MClass<F>>(M: C, initialState?: any): R<F, C>;
|
|
45
|
-
toObject(): Object;
|
|
46
|
-
getAll<F extends Record<string, FieldDef>, C extends MClass<F>>(M: C): R<F, C>[];
|
|
47
|
-
}
|
|
48
|
-
export {};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { Props, WithDefaults } from "./props";
|
|
2
|
-
import { STATUS } from "./status";
|
|
3
|
-
import { GetOptionalEntries } from "./types";
|
|
4
|
-
export interface PluginConstructor {
|
|
5
|
-
new (): Plugin;
|
|
6
|
-
id: string;
|
|
7
|
-
}
|
|
8
|
-
export declare class Plugin {
|
|
9
|
-
private static _shadowId;
|
|
10
|
-
static get id(): string;
|
|
11
|
-
static set id(shadowId: string);
|
|
12
|
-
setup(): void;
|
|
13
|
-
}
|
|
14
|
-
interface PluginManagerOptions {
|
|
15
|
-
parent?: PluginManager | null;
|
|
16
|
-
plugins?: PluginConstructor[];
|
|
17
|
-
pluginProps?: any;
|
|
18
|
-
}
|
|
19
|
-
export declare class PluginManager {
|
|
20
|
-
static current: PluginManager | null;
|
|
21
|
-
private children;
|
|
22
|
-
private parent;
|
|
23
|
-
private plugins;
|
|
24
|
-
private onDestroyCb;
|
|
25
|
-
status: STATUS;
|
|
26
|
-
constructor(options?: PluginManagerOptions);
|
|
27
|
-
destroy(): void;
|
|
28
|
-
getPluginById<T extends Plugin>(id: string): T | null;
|
|
29
|
-
getPlugin<T extends PluginConstructor>(pluginType: T): InstanceType<T> | null;
|
|
30
|
-
startPlugins(pluginTypes: PluginConstructor[], pluginProps?: any): Plugin[];
|
|
31
|
-
}
|
|
32
|
-
export declare function plugin<T extends PluginConstructor>(pluginType: T): InstanceType<T>;
|
|
33
|
-
export declare namespace plugin {
|
|
34
|
-
var props: <P extends Record<string, any> = any, D extends GetOptionalEntries<P> = any>(type?: P, defaults?: D) => Props<WithDefaults<P, D>>;
|
|
35
|
-
}
|
|
36
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Component } from "./component";
|
|
2
|
-
/**
|
|
3
|
-
* kind of similar to <t t-slot="default"/>, but it wraps it around a VPortal
|
|
4
|
-
*/
|
|
5
|
-
export declare function portalTemplate(app: any, bdom: any, helpers: any): (ctx: any, node: any, key?: string) => any;
|
|
6
|
-
export declare class Portal extends Component {
|
|
7
|
-
static template: string;
|
|
8
|
-
props: import("./props").Props<{
|
|
9
|
-
target: string;
|
|
10
|
-
}>;
|
|
11
|
-
setup(): void;
|
|
12
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function asyncComputed<T>(fn: () => Promise<T>): () => Promise<T>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Opts, Derived } from "./computations";
|
|
2
|
-
import { ReactiveValue } from "./signal";
|
|
3
|
-
export declare function derived<T>(fn: () => T, opts?: Opts): ReactiveValue<T>;
|
|
4
|
-
export declare function setSignalHooks(hooks: {
|
|
5
|
-
onDerived: (derived: Derived<any, any>) => void;
|
|
6
|
-
}): void;
|
|
7
|
-
export declare function resetSignalHooks(): void;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
type Target = object;
|
|
2
|
-
type Reactive<T extends Target> = T;
|
|
3
|
-
/**
|
|
4
|
-
* Mark an object or array so that it is ignored by the reactivity system
|
|
5
|
-
*
|
|
6
|
-
* @param value the value to mark
|
|
7
|
-
* @returns the object itself
|
|
8
|
-
*/
|
|
9
|
-
export declare function markRaw<T extends Target>(value: T): T;
|
|
10
|
-
/**
|
|
11
|
-
* Given a proxy objet, return the raw (non proxy) underlying object
|
|
12
|
-
*
|
|
13
|
-
* @param value a proxy value
|
|
14
|
-
* @returns the underlying value
|
|
15
|
-
*/
|
|
16
|
-
export declare function toRaw<T extends Target, U extends Reactive<T>>(value: U | T): T;
|
|
17
|
-
export declare const targets: WeakMap<object, object>;
|
|
18
|
-
/**
|
|
19
|
-
* Creates a reactive proxy for an object. Reading data on the proxy object
|
|
20
|
-
* subscribes to changes to the data. Writing data on the object will cause the
|
|
21
|
-
* notify callback to be called if there are suscriptions to that data. Nested
|
|
22
|
-
* objects and arrays are automatically made reactive as well.
|
|
23
|
-
*
|
|
24
|
-
* Whenever you are notified of a change, all subscriptions are cleared, and if
|
|
25
|
-
* you would like to be notified of any further changes, you should go read
|
|
26
|
-
* the underlying data again. We assume that if you don't go read it again after
|
|
27
|
-
* being notified, it means that you are no longer interested in that data.
|
|
28
|
-
*
|
|
29
|
-
* Subscriptions:
|
|
30
|
-
* + Reading a property on an object will subscribe you to changes in the value
|
|
31
|
-
* of that property.
|
|
32
|
-
* + Accessing an object's keys (eg with Object.keys or with `for..in`) will
|
|
33
|
-
* subscribe you to the creation/deletion of keys. Checking the presence of a
|
|
34
|
-
* key on the object with 'in' has the same effect.
|
|
35
|
-
* - getOwnPropertyDescriptor does not currently subscribe you to the property.
|
|
36
|
-
* This is a choice that was made because changing a key's value will trigger
|
|
37
|
-
* this trap and we do not want to subscribe by writes. This also means that
|
|
38
|
-
* Object.hasOwnProperty doesn't subscribe as it goes through this trap.
|
|
39
|
-
*
|
|
40
|
-
* @param target the object for which to create a proxy proxy
|
|
41
|
-
* @param callback the function to call when an observed property of the
|
|
42
|
-
* proxy has changed
|
|
43
|
-
* @returns a proxy that tracks changes to it
|
|
44
|
-
*/
|
|
45
|
-
export declare function proxy<T extends Target>(target: T): T;
|
|
46
|
-
export {};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Atom, Computation, Derived, Opts } from "../../common/types";
|
|
2
|
-
type SignalFunction<T> = () => T;
|
|
3
|
-
export interface Signal<T> extends SignalFunction<T> {
|
|
4
|
-
/**
|
|
5
|
-
* Update the value of the signal with a new value. If the new value is different
|
|
6
|
-
* from the previous values, all computations that depends on this signal will
|
|
7
|
-
* be invalidated, and effects will rerun.
|
|
8
|
-
*/
|
|
9
|
-
set(value: T): void;
|
|
10
|
-
/**
|
|
11
|
-
* Call the updater function (if given) to update the signal value.
|
|
12
|
-
* If the updater value is not given, then all computations that depends on
|
|
13
|
-
* this signal will be invalidated and effects will rerun.
|
|
14
|
-
*/
|
|
15
|
-
update(updater?: (value: T) => T): void;
|
|
16
|
-
}
|
|
17
|
-
export declare function signal<T>(value: T, opts?: Opts): Signal<T>;
|
|
18
|
-
export declare function effect<T>(fn: () => T, opts?: Opts): () => void;
|
|
19
|
-
export declare function derived<T>(fn: () => T, opts?: Opts): () => T;
|
|
20
|
-
export declare function onReadAtom(atom: Atom): void;
|
|
21
|
-
export declare function onWriteAtom(atom: Atom): void;
|
|
22
|
-
export declare function withoutReactivity<T extends (...args: any[]) => any>(fn: T): ReturnType<T>;
|
|
23
|
-
export declare function getCurrentComputation(): Computation<any> | undefined;
|
|
24
|
-
export declare function setComputation(computation: Computation | undefined): void;
|
|
25
|
-
export declare function runWithComputation<T>(computation: Computation, fn: () => T): T;
|
|
26
|
-
export declare function setSignalHooks(hooks: {
|
|
27
|
-
onDerived: (derived: Derived<any, any>) => void;
|
|
28
|
-
}): void;
|
|
29
|
-
export declare function resetSignalHooks(): void;
|
|
30
|
-
export {};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { Atom } from "./computations";
|
|
2
|
-
type Target = object;
|
|
3
|
-
type Reactive<T extends Target> = T;
|
|
4
|
-
/**
|
|
5
|
-
* Mark an object or array so that it is ignored by the reactivity system
|
|
6
|
-
*
|
|
7
|
-
* @param value the value to mark
|
|
8
|
-
* @returns the object itself
|
|
9
|
-
*/
|
|
10
|
-
export declare function markRaw<T extends Target>(value: T): T;
|
|
11
|
-
/**
|
|
12
|
-
* Given a proxy objet, return the raw (non proxy) underlying object
|
|
13
|
-
*
|
|
14
|
-
* @param value a proxy value
|
|
15
|
-
* @returns the underlying value
|
|
16
|
-
*/
|
|
17
|
-
export declare function toRaw<T extends Target, U extends Reactive<T>>(value: U | T): T;
|
|
18
|
-
export declare const targets: WeakMap<object, object>;
|
|
19
|
-
export declare function proxifyTarget<T extends Target>(target: T, atom: Atom | null): T;
|
|
20
|
-
/**
|
|
21
|
-
* Creates a reactive proxy for an object. Reading data on the proxy object
|
|
22
|
-
* subscribes to changes to the data. Writing data on the object will cause the
|
|
23
|
-
* notify callback to be called if there are suscriptions to that data. Nested
|
|
24
|
-
* objects and arrays are automatically made reactive as well.
|
|
25
|
-
*
|
|
26
|
-
* Whenever you are notified of a change, all subscriptions are cleared, and if
|
|
27
|
-
* you would like to be notified of any further changes, you should go read
|
|
28
|
-
* the underlying data again. We assume that if you don't go read it again after
|
|
29
|
-
* being notified, it means that you are no longer interested in that data.
|
|
30
|
-
*
|
|
31
|
-
* Subscriptions:
|
|
32
|
-
* + Reading a property on an object will subscribe you to changes in the value
|
|
33
|
-
* of that property.
|
|
34
|
-
* + Accessing an object's keys (eg with Object.keys or with `for..in`) will
|
|
35
|
-
* subscribe you to the creation/deletion of keys. Checking the presence of a
|
|
36
|
-
* key on the object with 'in' has the same effect.
|
|
37
|
-
* - getOwnPropertyDescriptor does not currently subscribe you to the property.
|
|
38
|
-
* This is a choice that was made because changing a key's value will trigger
|
|
39
|
-
* this trap and we do not want to subscribe by writes. This also means that
|
|
40
|
-
* Object.hasOwnProperty doesn't subscribe as it goes through this trap.
|
|
41
|
-
*
|
|
42
|
-
* @param target the object for which to create a proxy proxy
|
|
43
|
-
* @param callback the function to call when an observed property of the
|
|
44
|
-
* proxy has changed
|
|
45
|
-
* @returns a proxy that tracks changes to it
|
|
46
|
-
*/
|
|
47
|
-
export declare function state<T extends Target>(target: T): T;
|
|
48
|
-
export {};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import type { Callback } from "./utils";
|
|
2
|
-
declare type Target = object;
|
|
3
|
-
declare type Reactive<T extends Target> = T;
|
|
4
|
-
/**
|
|
5
|
-
* Mark an object or array so that it is ignored by the reactivity system
|
|
6
|
-
*
|
|
7
|
-
* @param value the value to mark
|
|
8
|
-
* @returns the object itself
|
|
9
|
-
*/
|
|
10
|
-
export declare function markRaw<T extends Target>(value: T): T;
|
|
11
|
-
/**
|
|
12
|
-
* Given a reactive objet, return the raw (non reactive) underlying object
|
|
13
|
-
*
|
|
14
|
-
* @param value a reactive value
|
|
15
|
-
* @returns the underlying value
|
|
16
|
-
*/
|
|
17
|
-
export declare function toRaw<T extends Target, U extends Reactive<T>>(value: U | T): T;
|
|
18
|
-
/**
|
|
19
|
-
* Clears all subscriptions of the Reactives associated with a given callback.
|
|
20
|
-
*
|
|
21
|
-
* @param callback the callback for which the reactives need to be cleared
|
|
22
|
-
*/
|
|
23
|
-
export declare function clearReactivesForCallback(callback: Callback): void;
|
|
24
|
-
export declare function getSubscriptions(callback: Callback): {
|
|
25
|
-
target: object;
|
|
26
|
-
keys: (string | number | symbol)[];
|
|
27
|
-
}[];
|
|
28
|
-
export declare const targets: WeakMap<object, object>;
|
|
29
|
-
/**
|
|
30
|
-
* Creates a reactive proxy for an object. Reading data on the reactive object
|
|
31
|
-
* subscribes to changes to the data. Writing data on the object will cause the
|
|
32
|
-
* notify callback to be called if there are suscriptions to that data. Nested
|
|
33
|
-
* objects and arrays are automatically made reactive as well.
|
|
34
|
-
*
|
|
35
|
-
* Whenever you are notified of a change, all subscriptions are cleared, and if
|
|
36
|
-
* you would like to be notified of any further changes, you should go read
|
|
37
|
-
* the underlying data again. We assume that if you don't go read it again after
|
|
38
|
-
* being notified, it means that you are no longer interested in that data.
|
|
39
|
-
*
|
|
40
|
-
* Subscriptions:
|
|
41
|
-
* + Reading a property on an object will subscribe you to changes in the value
|
|
42
|
-
* of that property.
|
|
43
|
-
* + Accessing an object's keys (eg with Object.keys or with `for..in`) will
|
|
44
|
-
* subscribe you to the creation/deletion of keys. Checking the presence of a
|
|
45
|
-
* key on the object with 'in' has the same effect.
|
|
46
|
-
* - getOwnPropertyDescriptor does not currently subscribe you to the property.
|
|
47
|
-
* This is a choice that was made because changing a key's value will trigger
|
|
48
|
-
* this trap and we do not want to subscribe by writes. This also means that
|
|
49
|
-
* Object.hasOwnProperty doesn't subscribe as it goes through this trap.
|
|
50
|
-
*
|
|
51
|
-
* @param target the object for which to create a reactive proxy
|
|
52
|
-
* @param callback the function to call when an observed property of the
|
|
53
|
-
* reactive has changed
|
|
54
|
-
* @returns a proxy that tracks changes to it
|
|
55
|
-
*/
|
|
56
|
-
export declare function reactive<T extends Target>(target: T, callback?: Callback): T;
|
|
57
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { AttrParams, DateParams, DatetimeParams, HtmlParams, ManyParams, RelationParams } from "./discussModelTypes";
|
|
2
|
-
import { Model } from "./model";
|
|
3
|
-
import { FieldDefinition } from "./types";
|
|
4
|
-
export declare class DiscussRecord {
|
|
5
|
-
static Model: typeof Model;
|
|
6
|
-
static fields: Record<string, FieldDefinition>;
|
|
7
|
-
static register(): void;
|
|
8
|
-
static insert(data: Partial<any>): any;
|
|
9
|
-
record: Model;
|
|
10
|
-
constructor();
|
|
11
|
-
}
|
|
12
|
-
export declare const fields: {
|
|
13
|
-
One: (modelName: string, params?: RelationParams) => import("./types").FieldDefinitionMany2One;
|
|
14
|
-
Many: (modelName: string, params?: ManyParams) => FieldDefinition;
|
|
15
|
-
Attr: (defaultValue: string, params?: AttrParams) => import("./types").FieldDefinitionAny;
|
|
16
|
-
Html: (defaultValue: string, params?: HtmlParams) => import("./types").FieldDefinitionAny;
|
|
17
|
-
Date: (params?: DateParams) => import("./types").FieldDefinitionAny;
|
|
18
|
-
Datetime: (params?: DatetimeParams) => import("./types").FieldDefinitionAny;
|
|
19
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { DiscussRecord } from "./discussModel";
|
|
2
|
-
export declare type FieldCommonParams = {
|
|
3
|
-
compute?: (record: DiscussRecord) => any;
|
|
4
|
-
eager?: boolean;
|
|
5
|
-
onUpdate?: (record: DiscussRecord) => void;
|
|
6
|
-
};
|
|
7
|
-
export declare type RelationParams = FieldCommonParams & {
|
|
8
|
-
inverse?: string;
|
|
9
|
-
onAdd?: (record: DiscussRecord) => void;
|
|
10
|
-
onDelete?: (record: DiscussRecord) => void;
|
|
11
|
-
};
|
|
12
|
-
export declare type ManyParams = RelationParams & {
|
|
13
|
-
sort?: (a: DiscussRecord, b: DiscussRecord) => number;
|
|
14
|
-
};
|
|
15
|
-
export declare type AttrParams = FieldCommonParams & {
|
|
16
|
-
sort?: (a: DiscussRecord, b: DiscussRecord) => number;
|
|
17
|
-
type?: string;
|
|
18
|
-
};
|
|
19
|
-
export declare type HtmlParams = FieldCommonParams;
|
|
20
|
-
export declare type DateParams = FieldCommonParams;
|
|
21
|
-
export declare type DatetimeParams = FieldCommonParams;
|
|
22
|
-
export declare type DManyFn<T extends DiscussRecord> = () => T[];
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { FieldDefinition, FieldDefinitionAny, FieldDefinitionChar, FieldDefinitionDate, FieldDefinitionDatetime, FieldDefinitionHtml, FieldDefinitionMany2One, FieldDefinitionMany2OneReference, FieldDefinitionNumber, FieldDefinitionOne2Many, FieldDefinitionProperties, FieldDefinitionReference, FieldDefinitionSelection, FieldDefinitionText, FieldTypes, ModelId } from "./types";
|
|
2
|
-
export declare const fieldAny: () => FieldDefinitionAny;
|
|
3
|
-
export declare const fieldNumber: () => FieldDefinitionNumber;
|
|
4
|
-
export declare const fieldChar: () => FieldDefinitionChar;
|
|
5
|
-
export declare const fieldText: () => FieldDefinitionText;
|
|
6
|
-
export declare const fieldHtml: () => FieldDefinitionHtml;
|
|
7
|
-
export declare const fieldDate: () => FieldDefinitionDate;
|
|
8
|
-
export declare const fieldDatetime: () => FieldDefinitionDatetime;
|
|
9
|
-
export declare const fieldSelection: (selection: any) => FieldDefinitionSelection;
|
|
10
|
-
export declare const fieldReference: () => FieldDefinitionReference;
|
|
11
|
-
export declare const fieldProperties: () => FieldDefinitionProperties;
|
|
12
|
-
export declare const fieldOne2Many: (modelId: ModelId, { relatedField }?: {
|
|
13
|
-
relatedField?: string | undefined;
|
|
14
|
-
}) => FieldDefinitionOne2Many;
|
|
15
|
-
export declare const fieldMany2One: (modelId: ModelId) => FieldDefinitionMany2One;
|
|
16
|
-
export declare const fieldMany2Many: (modelId: ModelId, opts?: {
|
|
17
|
-
relationTableName?: string;
|
|
18
|
-
}) => FieldDefinition;
|
|
19
|
-
export declare const fieldMany2OneReference: () => FieldDefinitionMany2OneReference;
|
|
20
|
-
export declare const field: (type: FieldTypes, opts?: any) => FieldDefinition;
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { MakeGetSet } from "../../common/types";
|
|
2
|
-
import { ModelId, InstanceId, FieldDefinition, RecordItem, RelationChanges, DraftContext } from "./types";
|
|
3
|
-
export declare class Model {
|
|
4
|
-
static id: ModelId;
|
|
5
|
-
static fields: Record<string, FieldDefinition>;
|
|
6
|
-
static relatedFields: Record<string, string>;
|
|
7
|
-
static recordsItems: Record<InstanceId, RecordItem>;
|
|
8
|
-
static create<T extends typeof Model>(this: T, data: Partial<InstanceType<T>>): InstanceType<T>;
|
|
9
|
-
static get<T extends typeof Model>(this: T, id: InstanceId, context?: DraftContext): InstanceType<T>;
|
|
10
|
-
static getAll<T extends typeof Model>(this: T): InstanceType<T>[];
|
|
11
|
-
static register<T extends typeof Model>(this: T): T;
|
|
12
|
-
static getRecordItem(id: InstanceId, defaultData?: Record<string, any>): RecordItem;
|
|
13
|
-
static getGlobalInstance<T extends typeof Model>(this: T, id: InstanceId): InstanceType<T>;
|
|
14
|
-
static getContextInstance<T extends typeof Model>(this: T, id: InstanceId, draftContext?: DraftContext): InstanceType<T>;
|
|
15
|
-
id?: InstanceId;
|
|
16
|
-
data: RecordItem["data"];
|
|
17
|
-
reactiveData: RecordItem["reactiveData"];
|
|
18
|
-
changes: RelationChanges;
|
|
19
|
-
reactiveChanges: RelationChanges;
|
|
20
|
-
parentRecord?: Model;
|
|
21
|
-
childRecords: Model[];
|
|
22
|
-
draftContext?: DraftContext;
|
|
23
|
-
constructor(idOrParentRecord?: InstanceId | Model, params?: {
|
|
24
|
-
createData?: Record<string, any>;
|
|
25
|
-
draftContext?: DraftContext;
|
|
26
|
-
});
|
|
27
|
-
delete(): void;
|
|
28
|
-
isNew(): boolean;
|
|
29
|
-
hasChanges(): boolean;
|
|
30
|
-
makeDraft(): this;
|
|
31
|
-
saveDraft(): void;
|
|
32
|
-
_saveDraft(parentDraftContext: DraftContext): void;
|
|
33
|
-
withContext(fn: () => void): void;
|
|
34
|
-
_setDraftItem(id: InstanceId): void;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Define a lazy property on an object that computes its getter and setter on first access.
|
|
38
|
-
* Allowing to delay some computation until the property is actually used.
|
|
39
|
-
*
|
|
40
|
-
* @param object The object on which to define the property.
|
|
41
|
-
* @param property The name of the property to define.
|
|
42
|
-
* @param makeGetSet A function that returns a tuple containing the getter and optional setter.
|
|
43
|
-
* @example
|
|
44
|
-
* defineLazyProperty(MyClass.prototype, "myProperty", function() {
|
|
45
|
-
* // Some computing that will only run once, on first access.
|
|
46
|
-
* return [
|
|
47
|
-
* () => this._myProperty,
|
|
48
|
-
* (value) => { this._myProperty = value; }
|
|
49
|
-
* ];
|
|
50
|
-
* });
|
|
51
|
-
*/
|
|
52
|
-
export declare function defineLazyProperty<T, V>(object: object, property: string, makeGetSet: MakeGetSet<T, V>): void;
|
|
53
|
-
export declare function combineLists(listA: InstanceId[], deleteList: InstanceId[], addList: InstanceId[]): InstanceId[];
|
|
54
|
-
export declare function ensureContext(context: DraftContext, record: Model): Model | undefined;
|
|
55
|
-
export declare function withDraftContext<T>(context: DraftContext, fn: () => T): T;
|
|
56
|
-
export declare function saveDraftContext(context: DraftContext): void;
|
|
57
|
-
export declare function makeDraftContext(parent?: DraftContext): DraftContext;
|
|
58
|
-
export declare function formatId(number: number): string;
|
|
59
|
-
export declare function resetIdCounter(): void;
|