You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
11 KiB
2 lines
11 KiB
"use strict";var W=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var U=W(L=>{"use strict";Object.defineProperty(L,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(L,{getDataOnPath:function(){return se},parseMultiDataPaths:function(){return ce}});var N=/^\s/,k=function(e,t){throw Error('Parsing data path "'+e+'" failed at char "'+e[t]+'" (index '+t+")")},ae=function(e,t){for(var r=t.index;t.index<t.length;){var n=e[t.index];if(/^[0-9]/.test(n)){t.index++;continue}break}return r===t.index&&k(e,t.index),parseInt(e.slice(r,t.index),10)},$=function(e,t){var r=t.index,n=e[r];if(/^[_a-zA-Z$]/.test(n))for(t.index++;t.index<t.length;){var a=e[t.index];if(/^[_a-zA-Z0-9$]/.test(a)){t.index++;continue}break}else k(e,t.index);return e.slice(r,t.index)},H=function(e,t){for(var r=[$(e,t)],n={deepCmp:!1};t.index<t.length;){var a=e[t.index];if(a==="[")t.index++,r.push(""+ae(e,t)),e[t.index]!=="]"&&k(e,t.index),t.index++;else if(a==="."){if(t.index++,e[t.index]==="*"){if(t.index++,e[t.index]==="*"){t.index++,n.deepCmp=!0;break}k(e,t.index)}r.push($(e,t))}else break}return{path:r,options:n}},ie=function(e,t){for(;N.test(e[t.index]);)t.index++;for(var r=[H(e,t)],n=!1;t.index<t.length;){var a=e[t.index];N.test(a)?t.index++:a===","?(n=!0,t.index++):n?(n=!1,r.push(H(e,t))):k(e,t.index)}return r},ue=function(e,t){t.index<t.length&&k(e,t.index)},ce=function(e){var t={length:e.length,index:0},r=ie(e,t);return ue(e,t),r},se=function(e,t){var r=e;return t.forEach(function(n){var a;r=(r===void 0?"undefined":(a=r)&&typeof Symbol<"u"&&a.constructor===Symbol?"symbol":typeof a)!="object"||r===null?void 0:r[n]}),r}});var Z=W((Pe,z)=>{z.exports=function(){let t=null,r;function n(i){return i?typeof i=="object"||typeof i=="function":!1}function a(i){if(i!==null&&!n(i))throw new TypeError("Object prototype may only be an Object or null: "+i)}let o=Object,u=!!o.create||!({__proto__:null}instanceof o),c=o.create||(u?function(s){return a(s),{__proto__:s}}:function(s){if(a(s),s===null)throw new SyntaxError("Native Object.create is required to create objects with null prototype");var l=function(){};return l.prototype=s,new l}),d=function(){return null},g=o.getPrototypeOf||([].__proto__===Array.prototype?function(s){let l=s.__proto__;return n(l)?l:null}:d);return r=function(i,s){if((this&&this instanceof r?this.constructor:void 0)===void 0)throw new TypeError("Constructor Proxy requires 'new'");if(!n(i)||!n(s))throw new TypeError("Cannot create proxy with a non-object as target or handler");let h=function(){};t=function(){i=null,h=function(f){throw new TypeError(`Cannot perform '${f}' on a proxy that has been revoked`)}},setTimeout(function(){t=null},0);let b=s;s={get:null,set:null,apply:null,construct:null};for(let f in b){if(!(f in s))throw new TypeError(`Proxy polyfill does not support trap '${f}'`);s[f]=b[f]}typeof b=="function"&&(s.apply=b.apply.bind(b));let v=g(i),p,_=!1,w=!1;typeof i=="function"?(p=function(){let m=this&&this.constructor===p,y=Array.prototype.slice.call(arguments);if(h(m?"construct":"apply"),m&&s.construct)return s.construct.call(this,i,y);if(!m&&s.apply)return s.apply(i,this,y);if(m){y.unshift(i);let j=i.bind.apply(i,y);return new j}return i.apply(this,y)},_=!0):i instanceof Array?(p=[],w=!0):p=u||v!==null?c(v):{};let O=s.get?function(f){return h("get"),s.get(this,f,p)}:function(f){return h("get"),this[f]},x=s.set?function(f,m){h("set");let y=s.set(this,f,m,p)}:function(f,m){h("set"),this[f]=m},q=o.getOwnPropertyNames(i),A={};q.forEach(function(f){if((_||w)&&f in p)return;let y={enumerable:!!o.getOwnPropertyDescriptor(i,f).enumerable,get:O.bind(i,f),set:x.bind(i,f)};o.defineProperty(p,f,y),A[f]=!0});let P=!0;if(_||w){let f=o.setPrototypeOf||([].__proto__===Array.prototype?function(y,j){return a(j),y.__proto__=j,y}:d);v&&f(p,v)||(P=!1)}if(s.get||!P)for(let f in i)A[f]||o.defineProperty(p,f,{get:O.bind(i,f)});return o.seal(i),o.seal(p),p},r.revocable=function(i,s){return{proxy:new r(i,s),revoke:t}},r}});var G=W(R=>{"use strict";function D(e){return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}Object.defineProperty(R,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(R,{create:function(){return de},unwrap:function(){return function e(t){if(t!==null&&(t===void 0?"undefined":D(t))==="object"&&D(t.__rawObject__)!=="object"){if(Array.isArray(t))return t.map(function(n){return e(n)});var r={};return Object.keys(t).forEach(function(n){r[n]=e(t[n])}),r}return(t===void 0?"undefined":D(t))!=="object"||t===null||D(t.__rawObject__)!=="object"?t:t.__rawObject__}}});var T,fe=(0,((T=Z())&&T.__esModule?T:{default:T}).default)(),K=function(e,t,r){if((e===void 0?"undefined":D(e))!=="object"||e===null)return e;var n={get:function(a,o){if(o==="__rawObject__")return a;var u=r.concat(o),c=a[o];return t.push({kind:"value",path:u,value:c}),K(c,t,u)},ownKeys:function(a){var o=r.slice(),u=Object.keys(a).sort();return t.push({kind:"keys",path:o,keys:u}),u}};try{return new Proxy(e,n)}catch{return new fe(e,n)}};function de(e,t){return K(e,t,[])}});var ne=W(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(V,{behavior:function(){return ve},computed:function(){return ye},watch:function(){return be}});var M,J,pe=Y(require("rfdc")),le=Y(require("fast-deep-equal")),E=te(U()),F=te(G());function Y(e){return e&&e.__esModule?e:{default:e}}function ee(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,r=new WeakMap;return(ee=function(n){return n?r:t})(e)}function te(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var r=ee(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var u=a?Object.getOwnPropertyDescriptor(e,o):null;u&&(u.get||u.set)?Object.defineProperty(n,o,u):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}var Q=(0,pe.default)({proto:!0});(M=J||(J={}))[M.CREATED=0]="CREATED",M[M.ATTACHED=1]="ATTACHED";var he=0;function X(e,t){return e===t||e!=e&&t!=t}var S=function(){"use strict";function e(){this.observersItems=[],this.computedWatchDefId=he++,this.computedList=[],this.watchList=[];var r=this.computedWatchDefId,n=this.computedList,a=this.watchList;this.observersItems.push({fields:"_computedWatchInit",observer:function(){var o=this,u=this.data._computedWatchInit;if(u===0){var c={computedUpdaters:[],computedRelatedPathValues:Array(n.length),watchCurVal:Array(a.length),_triggerFromComputedAttached:Object.create(null)};this._computedWatchInfo||(this._computedWatchInfo={}),this._computedWatchInfo[r]=c,a.forEach(function(g,i){var s=g.map(function(l){var h=l.path,b=l.options,v=E.getDataOnPath(o.data,h);return b.deepCmp?Q(v):v});c.watchCurVal[i]=s})}else if(u===1){var d=this._computedWatchInfo[r];n.forEach(function(g,i){var s,l=g[0],h=g[1],b=[],v=h(F.create(o.data,b));o.setData(((s={})[l]=F.unwrap(v),s)),d._triggerFromComputedAttached[l]=!0,d.computedRelatedPathValues[i]=b,d.computedUpdaters.push(function(){for(var p,_=d.computedRelatedPathValues[i],w=!1,O=0;O<_.length;O++){var x=_[O];if(x.kind==="keys"){var q=x.path,A=x.keys,P=Object.keys(E.getDataOnPath(o.data,q)).sort();if(P.length!==A.length){w=!0;break}for(var f=0;f<P.length;f+=1)if(P[f]!==A[f]){w=!0;break}}else{var m=x.path;if(!X(x.value,E.getDataOnPath(o.data,m))){w=!0;break}}}if(!w)return!1;var y=[],j=h(F.create(o.data,y));return o.setData(((p={})[l]=F.unwrap(j),p)),d.computedRelatedPathValues[i]=y,!0})})}}})}var t=e.prototype;return t.addComputed=function(r,n){if(this.computedList.push([r,n]),this.computedList.length===1){var a=this.computedWatchDefId;this.observersItems.push({fields:"**",observer:function(){var o,u=this;if(this._computedWatchInfo){var c=this._computedWatchInfo[a];if(c)do try{o=c.computedUpdaters.some(function(d){return d.call(u)})}catch(d){console.error(d.stack);break}while(o)}}})}},t.addWatch=function(r,n){var a=E.parseMultiDataPaths(r),o=this.watchList.length;this.watchList.push(a);var u=this.computedWatchDefId;this.observersItems.push({fields:r,observer:function(){var c=this;if(this._computedWatchInfo){var d=this._computedWatchInfo[u];if(d){if(Object.keys(d._triggerFromComputedAttached).length){var g={};for(var i in a.forEach(function(p){return g[p.path[0]]=!0}),d._triggerFromComputedAttached)if(d._triggerFromComputedAttached[i]&&g[i]&&d._triggerFromComputedAttached[i]){d._triggerFromComputedAttached[i]=!1;return}}var s=d.watchCurVal[o],l=a.map(function(p){var _=p.path,w=p.options;return{val:E.getDataOnPath(c.data,_),options:w}}),h=l.map(function(p){var _=p.val;return p.options.deepCmp?Q(_):_});d.watchCurVal[o]=h;for(var b=!1,v=0;v<h.length;v++)if(a[v].options.deepCmp?!(0,le.default)(s[v],h[v]):!X(s[v],h[v])){b=!0;break}b&&n.apply(this,l.map(function(p){return p.val}))}}}})},e}(),ve=Behavior({lifetimes:{attached:function(){this.setData({_computedWatchInit:1})},created:function(){this.setData({_computedWatchInit:0})}},definitionFilter:function(e){var t,r,n=e.computed,a=e.watch,o=new S;n&&Object.keys(n).forEach(function(c){var d=n[c];o.addComputed(c,d)}),a&&Object.keys(a).forEach(function(c){var d=a[c];o.addWatch(c,d)});var u=o.observersItems;((t=e.observers)&&typeof Symbol<"u"&&t.constructor===Symbol?"symbol":typeof t)!="object"&&(e.observers={}),Array.isArray(e.observers)?(r=e.observers).push.apply(r,[].concat(u)):u.forEach(function(c){var d=e.observers[c.fields];d?e.observers[c.fields]=function(){c.observer.call(this),d.call(this)}:e.observers[c.fields]=c.observer})}}),re=function(e){if(!e._computedWatchInit){e._computedWatchInit=!0;var t=e.lifetime,r=e.setData;t("attached",function(){r({_computedWatchInit:1})}),t("created",function(){r({_computedWatchInit:0})})}};function ye(e,t,r,n,a){re(e);var o=new S;return Object.keys(t).forEach(function(u){var c=t[u];o.addComputed(u,c)}),r&&Object.keys(r).forEach(function(u){var c=r[u];o.addComputed(u,c)}),n&&Object.keys(n).forEach(function(u){var c=n[u];o.addComputed(u,c)}),a&&Object.keys(a).forEach(function(u){var c=a[u];o.addComputed(u,c)}),o.observersItems.forEach(function(u){var c=u.fields,d=u.observer;e.observer(c,d)}),e.data}var be=function(e,t,r){re(e);var n=new S;n.addWatch(t,r),n.observersItems.forEach(function(a){var o=a.fields,u=a.observer;e.observer(o,u)})}});Object.defineProperty(exports,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(exports,{BehaviorWithComputed:function(){return _e},ComponentWithComputed:function(){return me},DataTracerMode:function(){return B},behavior:function(){return I.behavior},computed:function(){return I.computed},getCurrentDataTracerMode:function(){return we},setCurrentDataTracerMode:function(){return ge},watch:function(){return I.watch}});var C,B,I=ne();function me(e){return Array.isArray(e.behaviors)||(e.behaviors=[]),e.behaviors.unshift(I.behavior),Component(e)}function _e(e){return Array.isArray(e.behaviors)||(e.behaviors=[]),e.behaviors.unshift(I.behavior),Behavior(e)}(C=B||(B={}))[C.Auto=0]="Auto",C[C.Proxy=1]="Proxy",C[C.DefineProperty=2]="DefineProperty";var oe=0,we=function(){return oe},ge=function(e){oe=e};
|