ezh 0.1.0
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 +4 -0
- package/lib/RbTree.js +675 -0
- package/lib/bundle.min.js +1 -0
- package/lib/debugCheck.d.ts +2 -0
- package/lib/debugCheck.js +69 -0
- package/lib/elements.js +1313 -0
- package/lib/index.d.ts +527 -0
- package/lib/index.js +4 -0
- package/lib/router.js +111 -0
- package/lib/state.js +354 -0
- package/package.json +54 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";class e{a4(){return!this.k}G(e){for(;e.parent?.e;){let t=e.parent,i=t.parent;if(t===i.c){const n=i.d;n?.e?(t.e=!1,n.e=!1,i.e=!0,e=i):(e===t.d&&(e=t,this.y(e),t=e.parent,i=t.parent),t.e=!1,i.e=!0,this.z(i))}else{const n=i.c;!0===n?.e?(t.e=!1,n.e=!1,i.e=!0,e=i):(e===t.c&&(e=t,this.z(e),t=e.parent,i=t.parent),t.e=!1,i.e=!0,this.y(i))}}this.k.e=!1}v(e){const{c:t,d:i,parent:n}=e;if(!t)return n?(n.c===e?n.c=i:n.d=i,i?(i.parent=n,void(i.e=!1)):void(e.e||this.H(n))):(this.k=i,void(i&&(i.parent=void 0,i.e=!1)));if(!i)return n?n.c===e?n.c=t:n.d=t:this.k=t,t.parent=n,void(t.e=!1);let r,s,a=i;if(a.c){do{a=a.c}while(a.c);s=a.d,r=a.parent,r.c===a?r.c=s:r.d=s,s&&(s.parent=r),a.d=i,i.parent=a}else r=a,s=a.d;n?n.c===e?n.c=a:n.d=a:this.k=a,a.parent=n,a.c=t,t.parent=a;const o=a.e;a.e=e.e,s?s.e=!1:o||this.H(r)}H(e){let t,i;for(;;){if(t===e.c){if(i=e.d,i.e){this.y(e),i.e=!1,e.e=!0,i=e.d;continue}if(i.d?.e)return this.y(e),i.e=e.e,e.e=!1,void(i.d.e=!1);if(i.c?.e){i.c.e=!1,this.z(i),i.e=!0,i=e.d;continue}}else{if(i=e.c,i.e){this.z(e),i.e=!1,e.e=!0,i=e.c;continue}if(i.c?.e)return this.z(e),i.e=e.e,e.e=!1,void(i.c.e=!1);if(i.d?.e){i.d.e=!1,this.y(i),i.e=!0,i=e.c;continue}}if(e.e)return e.e=!1,void(i.e=!0);if(i.e=!0,t=e,!t.parent)return;e=t.parent}}y(e){const t=e.d;e.d=t?.c,t?.c&&(t.c.parent=e),t.parent=e.parent,e.parent?e===e.parent.c?e.parent.c=t:e.parent.d=t:this.k=t,t.c=e,e.parent=t}z(e){const t=e.c;e.c=t?.d,t?.d&&(t.d.parent=e),t.parent=e.parent,e.parent?e===e.parent.d?e.parent.d=t:e.parent.c=t:this.k=t,t.d=e,e.parent=t}k}class t extends e{search(e){return this.I(e)?.value}delete(e){const t=this.I(e);if(t)return this.v(t),t.value}C(e,t,i){let n=this.k;if(n){let r;for(;e!==n.key;){if(e<n.key){if(n.c){n=n.c;continue}r={key:e,value:t,e:!0,parent:n,c:void 0,d:void 0},n.c=r}else{if(n.d){n=n.d;continue}r={key:e,value:t,e:!0,parent:n,c:void 0,d:void 0},n.d=r}return void this.G(r)}const s=n.value;return i&&(n.value=t),s}this.k={key:e,value:t,e:!1,parent:void 0,c:void 0,d:void 0}}a5(e,t){let i=0,n=this.k;if(n){const r=[];if(void 0!==t)for(;;){if(t<n.key){if(n.c){r.push(n),n=n.c;continue}}else if(t>n.key){if(n.d){n=n.d;continue}return i}break}else for(;n.c;)r.push(n),n=n.c;let s;for(;;){const t=e(n.key,n.value);if(i++,2&t&&(s??(s=[])).push(n),1&t){i=-i;break}if(n.d)for(n=n.d;n.c;)r.push(n),n=n.c;else if(n=r.pop(),!n)break}if(s){let e=s.length;for(;e>0;)this.v(s[--e])}}return i}O(e,t){let i=0,n=this.k;if(n){const r=[];if(void 0!==t)for(;;){if(t>n.key){if(n.d){r.push(n),n=n.d;continue}}else if(t<n.key){if(n.c){n=n.c;continue}return i}break}else for(;n.d;)r.push(n),n=n.d;let s;for(;;){const t=e(n.key,n.value);if(i++,2&t&&(s??(s=[])).push(n),1&t){i=-i;break}if(n.c)for(n=n.c;n.d;)r.push(n),n=n.d;else if(n=r.pop(),!n)break}if(s){let e=s.length;for(;e>0;)this.v(s[--e])}}return i}I(e){let t=this.k;if(t)for(;e!==t.key;){if(e<t.key){if(t.c){t=t.c;continue}}else if(t.d){t=t.d;continue}return}return t}}const i={ariaAtomic:"aria-atomic",ariaAutoComplete:"aria-autocomplete",ariaBrailleLabel:"aria-braillelabel",ariaBrailleRoleDescription:"aria-brailleroledescription",ariaBusy:"aria-busy",ariaChecked:"aria-checked",ariaColCount:"aria-colcount",ariaColIndex:"aria-colindex",ariaColIndexText:"aria-colindextext",ariaColSpan:"aria-colspan",ariaCurrent:"aria-current",ariaDescription:"aria-description",ariaDisabled:"aria-disabled",ariaExpanded:"aria-expanded",ariaHasPopup:"aria-haspopup",ariaHidden:"aria-hidden",ariaInvalid:"aria-invalid",ariaKeyShortcuts:"aria-keyshortcuts",ariaLabel:"aria-label",ariaLevel:"aria-level",ariaLive:"aria-live",ariaModal:"aria-modal",ariaMultiLine:"aria-multiline",ariaMultiSelectable:"aria-multiselectable",ariaOrientation:"aria-orientation",ariaPlaceholder:"aria-placeholder",ariaPosInSet:"aria-posinset",ariaPressed:"aria-pressed",ariaReadOnly:"aria-readonly",ariaRequired:"aria-required",ariaRoleDescription:"aria-roledescription",ariaRowCount:"aria-rowcount",ariaRowIndex:"aria-rowindex",ariaRowIndexText:"aria-rowindextext",ariaRowSpan:"aria-rowspan",ariaSelected:"aria-selected",ariaSetSize:"aria-setsize",ariaSort:"aria-sort",ariaValueMax:"aria-valuemax",ariaValueMin:"aria-valuemin",ariaValueNow:"aria-valuenow",ariaValueText:"aria-valuetext",alignmentBaseline:"alignment-baseline",annotationXml:"annotation-xml",baselineShift:"baseline-shift",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",pointerEvents:"pointer-events",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strokeDasharray:"stroke-dasharray",strokeDashoffset:"stroke-dashoffset",strokeLinecap:"stroke-linecap",strokeLinejoin:"stroke-linejoin",strokeMiterlimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",style:"style",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",unicodeBidi:"unicode-bidi",vectorEffect:"vector-effect",wordSpacing:"word-spacing",writingMode:"writing-mode"},n={},r=[];Object.freeze(n),Object.freeze(r);const s=()=>!1,a=[],o=new Set,l=new t,h=new t,c=[],d=[],f={id:"",index:0,firstElement:null,attachTo:s,move:s,detachFrom:s,update:s,refresh:s,release:s,version:0,parentCom:{},markChanged:s,watchMountChange:s};let u="";const p=new t,m=new Map;let v=f,g=(e,t)=>document.createElement(e);const b={svg:(e,t)=>(t.a9(),document.createElementNS("http://www.w3.org/2000/svg",e)),math:(e,t)=>(t.a9(),document.createElementNS("http://www.w3.org/1998/Math/MathML",e)),foreignObject:(e,t)=>"foreignObject"!==e?document.createElement(e):(t.a9(),document.createElementNS("http://www.w3.org/2000/svg",e))},k=(e,t)=>{const i=["",t];for(;e.constructor!==M;)i.push(e.id),e=e.parent;return i.reverse().join(",")},w=()=>{do{p.a5(((e,t)=>{const{newChildren:i,parent:n}=t;return i&&(n&&C(n)?(t.refresh(i),n.currentBefore=void 0):t.constructor===$&&l.C(e,t)),2}))}while(!p.a4());for(const{parent:e,element:t}of a)if(t.detachFrom(n),t.parent!==e&&!h.a4()&&C(e)){const i=!t.parent,n=k(e,t.id);h.a5(((e,t)=>e.startsWith(n)?(t._(t.D,i),2):1),n)}a.length=0},y=(e,t=[],i=0)=>{let n=e[i];for(;;){if(n&&void 0!==n.id)t.push(n);else if(null!=n)switch(typeof n){case"object":y(n,t);break;case"function":n=n();continue;case"boolean":case"number":case"bigint":n=""+n;default:t.push(new S("",n))}if(!(++i<e.length))break;n=e[i]}return t},x=(e,t,i)=>{let n;const r=e.length;let s=t,a=0;for(;a<r;){const t=e[a];if(t!==s[a]){if(a===s.length)return s;const e=s[a];if(!e||void 0===e.id){s=y(s,s.slice(0,a),a);continue}if(n!==s)break}n||t.parent===i||(n=e),a++}return a===s.length?n:s===t?y(s,e.slice(0,a),a):s},C=e=>{let t=e;do{if(t.constructor===M)return!0;t=t.parent}while(t);return!1},E=(e,t,i,n)=>{let r,s,a;if(t!==e&&e.length){const o=[];let l;for(s=t.length,r=1e7;--s>=0;)if(a=t[s],a.parent===i){const e=s-a.index;e===r?(l.H++,a.index=s):(l={from:a.index,to:s,H:1},r=e,a.index=-o.push(l))}else 1e7!==r&&(r=1e7);const h=[];for(s=e.length-1;s>=0;)a=e[s],a.index<0?(l=o[-a.index-1],h.push(l),s-=l.H):(a.detachFrom(i),s--);let c,d,f=0;for(s=t.length-1;s>=0;)if(a=t[s],a.parent!==i)a.index=s--,a.attachTo(i);else{if(l=o[-a.index-1],d=l.H,c=h[f],a.index=s,!n){if(c===l){f++,s-=l.H,i.currentBefore=void 0;continue}if(c.from>l.from){r=f;do{d-=c.H,c=h[++r]}while(c.from>l.from&&d>0);if(d>0){s-=l.H,i.currentBefore=void 0,f=r;continue}}}r=s-l.H;do{a.move()}while(--s>r&&(a=t[s]))}}else for(s=t.length-1;s>=0;s--)a=t[s],a.index=s,i!==a.parent&&a.attachTo(i);i.currentBefore=void 0};class S{constructor(e,t){this.id=e,this.parent=void 0,this.index=0,this.n=0,this.ag=t}id;parent;index;firstElement;attachTo(e){this.firstElement||(this.firstElement=document.createTextNode(this.ag));const{parent:t,firstElement:i,index:n}=this;this.id&&(this.n++||o.delete(this),t&&(i.remove(),a.push({parent:t,element:this}))),this.parent=e;let r=e.currentBefore;void 0===r&&(r=e.findNextSiblingElement(n)),e.element.insertBefore(i,r),e.currentBefore=i}move(){const{parent:e,index:t,firstElement:i}=this;let n=e.currentBefore;void 0===n&&(n=e.findNextSiblingElement(t)),e.element.insertBefore(i,n),e.currentBefore=i}detachFrom(e){this.parent===e?(this.firstElement.remove(),this.parent=void 0,this.id&&a.push({parent:e,element:this})):this.id&&! --this.n&&this.release()}update(e){return this.ag!==e&&(this.ag=e,this.firstElement&&(this.firstElement.nodeValue=e)),!1}refresh(){}release(e){e&&this.parent===e&&(this.firstElement.remove(),this.parent=void 0),this.id&&--this.n<=0&&m.delete(this.id)}n;ag}class B{constructor(e,t,i){this.id=e,this.parent=void 0,this.index=0,this.n=0,this.newChildren=this.d=i?y(t):t||r,this.currentBefore=void 0}id;parent;index;newChildren;currentBefore;get element(){return this.parent.element}get firstElement(){const{d:e}=this;for(let t=0;t<e.length;t++){const i=e[t].firstElement;if(i)return i}return null}attachTo(e){const{parent:t,d:i,newChildren:n}=this;if(this.n++||o.delete(this),t){a.push({parent:t,element:this});for(let e=i.length-1;e>=0;e--)i[e].detachFrom(this)}this.parent=e;const r=n||i;for(let e=r.length-1;e>=0;e--){const t=r[e];t.index=e,t.attachTo(this)}e.currentBefore=this.currentBefore,this.currentBefore=void 0,this.d=r,this.newChildren=void 0}move(){const{d:e,newChildren:t}=this;if(t)E(e,t,this,!0),this.d=t,this.newChildren=void 0;else{for(let t=e.length-1;t>=0;t--)e[t].move();this.currentBefore=void 0}}detachFrom(e){if(this.parent===e){const{d:t}=this;for(const e of t)e.detachFrom(this);this.parent=void 0,a.push({parent:e,element:this})}else--this.n||this.release()}update(e,t){if(t){const e=x(this.d,t,this);if(e)return this.newChildren=e,!0}return!1}refresh(e){E(this.d,e,this),this.d=e,this.newChildren=void 0}release(e){if(e&&this.parent===e){const{d:e}=this;for(const t of e)t.detachFrom(this);this.parent=void 0}--this.n<=0&&m.delete(this.id)}findNextSiblingElement(e){const t=this.newChildren||this.d;let i,n=e+1,r=t[n];for(;r;){if(i=r.firstElement,i)return i;r=t[++n]}return i=this.parent.currentBefore,void 0!==i?i:this.parent.findNextSiblingElement(this.index)}n;d}class j{constructor(e,t,i,s,a,o){if(this.id=e,this.parent=void 0,this.index=0,this.n=0,this.firstElement=this.element=g(t,this),this.newChildren=this.d=o?y(s):s||r,this.currentBefore=void 0,i){if(this.p=n,this.u=-1,"select"===t){const e=this.element,t=i,n=t.value;if(n){t.value=void 0;const i=this.refresh;this.refresh=r=>{if(E(this.d,r,this),this.d=r,this.newChildren=void 0,Array.isArray(n)){const t=n,[i,r,s]=t;e.value=s;const a=t[3]=e=>i[r]=e.target.value;e.addEventListener("change",a)}else e.value=n;t.value=n,this.refresh=i}}}this.update(i),this.u=a??0}else this.p=i,this.u=0}id;element;parent;newChildren;index;currentBefore;firstElement;attachTo(e){const{parent:t,element:i,newChildren:n,index:r}=this;this.n++||o.delete(this),t&&(i.remove(),a.push({parent:t,element:this})),this.parent=e,n&&this.refresh(n);let s=e.currentBefore;void 0===s&&(s=e.findNextSiblingElement(r)),e.element.insertBefore(i,s),e.currentBefore=i}move(){const{parent:e,newChildren:t,index:i,element:n}=this;t&&this.refresh(t);let r=e.currentBefore;void 0===r&&(r=e.findNextSiblingElement(i)),e.element.insertBefore(n,r),e.currentBefore=n}detachFrom(e){this.parent===e?(this.element.remove(),this.parent=void 0,a.push({parent:e,element:this})):--this.n||this.release()}update(e,t){const{element:r,p:s,u:a}=this;if(s&&a){this.p=e;let t=a;for(const a in e){const o=e[a],l=s[a];if(o!==l)if(null!=o)switch(typeof o){case"string":{const e=i[a];e?r.setAttribute(e,o):r[a]=o;break}case"number":case"boolean":case"function":r[a]=o;break;default:if(Array.isArray(o)){const[e,t,i]=o;if(l){const[n,s,h,c]=l;if(h!==i&&r[a]!==i&&(r[a]=i),n===e&&s===t)o[3]=c;else{const i=o[3]=i=>e[t]=i.target[a];r.removeEventListener("change",c),r.addEventListener("change",i)}}else{r[a]=i;const n=o[3]=i=>e[t]=i.target[a];r.addEventListener("change",n)}break}if("style"===a){if(!l){const t=r.style,i={};let n=0;for(const e in o){const r=o[e];i[e]=r,n++,t[e]=r}e[a]=i,i.k=n;break}const t=r.style,i={};let n=0,s=l.k;for(const e in o){const r=o[e];i[e]=r,e in l&&s--,n++,r!==l[a]&&(t[e]=r)}if(e[a]=i,i.k=n,s)for(const e in l)if(!(e in o)&&(t[e]=null,! --s))break;break}r[a]=o}else switch(typeof l){case"string":{const e=i[a];e?this.element.removeAttribute(e):this.element[a]=o;break}case"object":l?Array.isArray(l)?r.removeEventListener("change",l[3]):l===n&&(r[a]=o):r[a]=o;break;default:r[a]=o}if(! --t)break}}if(t){const e=x(this.d,t,this);if(e)return this.newChildren=e,!0}return!1}refresh(e){E(this.d,e,this),this.d=e,this.newChildren=void 0}release(e){if(e&&this.parent===e&&(this.element.remove(),this.parent=void 0),--this.n<=0){const{d:e}=this;for(const t of e)t.release(this);m.delete(this.id)}}findNextSiblingElement(e){const t=this.newChildren||this.d;let i,n=e+1,r=t[n];for(;r;){if(i=r.firstElement,i)return i;r=t[++n]}return null}a9(){this.update=this.aP}aP(e,t){const{element:n,p:r,u:s}=this;if(r&&s){this.p=e;let t=s;for(const s in e){const a=e[s],o=r[s];if(a!==o)if(null!=a)switch(typeof a){case"string":n.setAttribute(i[s]??s,a);break;case"number":case"boolean":n.setAttribute(i[s]??s,""+a);break;case"function":n[s]=a;break;default:if("style"===s){if(!o){const t=n.style,i={};let r=0;for(const e in a){const n=a[e];i[e]=n,r++,t[e]=n}e[s]=i,i.k=r;break}const t=n.style,i={};let r=0,l=o.k;for(const e in a){const n=a[e];i[e]=n,e in o&&l--,r++,n!==o[s]&&(t[e]=n)}if(e[s]=i,i.k=r,l)for(const e in o)if(!(e in a)&&(t[e]=null,! --l))break;break}n[s]=a}else switch(typeof o){case"string":case"number":case"boolean":n.removeAttribute(i[s]??s);break;default:n[s]=a}if(! --t)break}}if(t){const e=x(this.d,t,this);if(e)return this.newChildren=e,!0}return!1}n;p;d;u}class ${constructor(e,t,i,n,s,a,o){this.id=e,this.parentCom=t,this.parent=void 0,this.index=0,this.version=0,this.n=0,this.aC=i,this.p=n,this.newChildren=this.d=o?y(s):s||r,this.u=a??0}id;parentCom;parent;newChildren;index;version;get firstElement(){return this.j?.firstElement||null}attachTo(e){const{parent:t,newChildren:i,j:n}=this;this.parent=e,i?this.refresh(i):n&&(n.index=this.index,n.attachTo(e)),this.n++||o.delete(this),t&&a.push({parent:t,element:this})}move(){const{newChildren:e,j:t}=this;e?this.refresh(e):t&&(t.index=this.index,t.move())}detachFrom(e){this.parent===e?(this.j?.detachFrom(e),this.parent=void 0,a.push({parent:e,element:this})):--this.n||this.release()}update(e,t){const{p:i,d:n,u:r}=this;if(this.p=e,t){const e=x(n,t,this.parent);if(e)return this.newChildren=e,!0}if(!this.newChildren&&r){let t=r;for(const r in i){if(i[r]!==e[r])return this.newChildren=n,!0;if(! --t)break}}return!1}refresh(e){const{id:t,parent:i,j:r,index:s}=this,a=v;v=this;let o=this.aC(this.p||n,e);if(o!==r)switch(typeof o){case"boolean":case"number":case"bigint":o=""+o;case"string":o=new S("",o),this.j=o,o.index=s,o.attachTo(i),r?.detachFrom(i);break;default:o?(this.j=o,o.index=s,o.attachTo(i),r?.detachFrom(i),l.a4()||l.a5(((e,i)=>e.startsWith(t)?i.parent&&C(i.parent)?(p.C(e,i),2):0:1),t)):(this.j=void 0,r?.detachFrom(i))}else r&&(r.parent!==i?(r.index=s,r.attachTo(i)):r.index!==s&&(r.index=s,r.move()));this.d=e,this.newChildren=void 0,v=a}release(e){e&&this.parent===e&&(this.j?.detachFrom(e),this.parent=void 0),--this.n<=0&&(this.newChildren&&l.delete(this.id),m.delete(this.id))}markChanged(){return!this.newChildren&&(this.newChildren=this.d,!0)}watchMountChange(e,t,i){const n=k(this.parent,this.id);h.C(n+e,{_:t,D:i},!0)}n;aC;p;d;u;j}class M{constructor(e,t){this.id=e,this.element=t,this.currentBefore=void 0}id;element;parent;currentBefore;findNextSiblingElement(e){return null}render(e){this.ah||(this.ah=new $(this.id,f,e,null,r),m.set(this.id,this.ah),this.ah.attachTo(this))}ah}let A=(e,t)=>{const i=e[t];if(i){for(const[e,t]of i){const i=m.get(e);i?.version===t&&i.markChanged()&&(p.a4()&&queueMicrotask(w),p.C(e,i))}i.clear()}};const F=()=>{u=d.pop()};var N,T;(T=N||(N={})).render=(e,t)=>{const i=(c.length||"")+"|",n=new M(i,e);c.push(n),n.render(t)},T.$=(e,t,i,n,r,s)=>{const a=`${v.id}${e}${u}`;let o=m.get(a);return o?((i||n)&&o.update(i,n)&&p.C(a,o),o):(o=new j(a,t,i,n,r,s),m.set(a,o),o)},T.$c=(e,t,i,n,r,s)=>{const a=`${v.id}${e}${u}`;let o=m.get(a);return o?((i||n)&&o.update(i,n)&&p.C(a,o),o):(o=new $(a,v,t,i,n,r,s),m.set(a,o),o)},T.$f=(e,t,i)=>{const n=`${v.id}${e}${u}`;let r=m.get(n);return r?(t&&r.update(null,t)&&p.C(n,r),r):(r=new B(n,t,i),m.set(n,r),r)},T.$k=e=>(d.push(u),u=`${u||"{"}${e}}`,F),T.$n=e=>{const t=g;return g=b[e],()=>{g=t}},T.$s=(e,t)=>(e(),t),T.$t=(e,t,i)=>{const n=`${v.id}${e}${u}`;let r=m.get(n);return r?(i&&r.update(t),r):(r=new S(n,t),m.set(r.id,r),r)};const z=Symbol(),H=Array.prototype,L=(e,t)=>{if(v.id){let i=e[t];i||(i=new Map,e[t]=i),i.set(v.id,v.version)}};let R=(e,t)=>{R=A,R(e,t)},I=!1;const O=new WeakMap,P=e=>function(...t){const i=this.length;let n,r,s;switch(e){case H.push:n=i,r=n+t.length,s=i;break;case H.unshift:n=0,r=t.length,s=i;break;case H.fill:n=t[1],void 0===n||n<=-i?n=0:n<0&&(n=i+n),r=t[2],void 0===r||r>i?r=i:r<=-i?r=0:r<0&&(r=i+r),s=r;break;case H.sort:case H.reverse:n=r=0,s=i;break;case H.pop:n=r=i-1,s=i;break;case H.shift:n=r=0,s=i;break;default:n=t[0],n<0&&(n=i+n),r=t.length>2?t.length-2:0,s=t[1],void 0===s&&(s=i-n),s=s>0?s!==r?i:n+r:r?i:n,r+=n}const a=e.bind(this)(...t),o=this[z];let l;for(let e=n;e<r;e++){switch(l=this[e],typeof l){case"object":if(l){for(;e<r;)l=this[e],l&&!l[z]&&(this[e]=q(l)),e++;break}case"undefined":continue}break}return i!==this.length&&R(o,"length"),R(o,Symbol.iterator),a},D={push:P(H.push),unshift:P(H.unshift),fill:P(H.fill),sort:P(H.sort),reverse:P(H.reverse),pop:P(H.pop),shift:P(H.shift),splice:P(H.splice)},V={get(e,t){if(t!==z){let i=e[t];if(i&&i===H[t]){const n=D[t];if(n)return n.bind(e);i=i.bind(e)}return L(e[z],"length"!==t?Symbol.iterator:t),i}return e},set(e,t,i){if(t!==z){if(e[t]===i)return!0;const n=e[z];return i&&"object"==typeof i&&(i=q(i)),e[t]=i,"length"===t&&R(n,t),R(n,Symbol.iterator),!0}return((e,t)=>{const i=t.length,n=e.length;let r;for(let n=0;n<i;n++){let s=t[n];if(s&&"object"==typeof s){do{s=t[n],r=e[n],s?r?r!==s&&(r[z]=s):e[n]=q(s):e[n]=s}while(++n<i);break}if(null!=s){do{e[n]=t[n]}while(++n<i);break}e[n]=s}const s=e[z];n!==i&&(n>i&&(e.length=i),R(s,"length")),R(s,Symbol.iterator)})(e,i),!0},has:(e,t)=>(L(e[z],isNaN(parseInt(t))?t:Symbol.iterator),t in e),deleteProperty:(e,t)=>(isNaN(parseInt(t))||(t=Symbol.iterator),void 0!==e[t]&&R(e[z],t),delete e[t])},W={get(e,t){if(t!==z){const i=e[t];return"id"!==t&&L(e[z],t),i}return e},set(e,t,i,n){if(t!==z){if(e[t]===i)return!0;const n=e[z];return i&&"object"==typeof i&&(i=q(i)),e[t]=i,R(n,t),!0}return((e,t,i)=>{const n={...e};let r;for(const s in i){delete n[s];const a=i[s];a&&"object"==typeof a&&(r=e[s],r)?r[z]=a:e[s]!==a&&(t[s]=a)}for(const e in n)delete t[e]})(e,n,i),!0},has:(e,t)=>(L(e[z],t),t in e),deleteProperty:(e,t)=>(void 0!==e[t]&&R(e[z],t),delete e[t])},q=e=>{let t;if(Array.isArray(e)){t=[];const i=e.length;for(let n=0;n<i;n++){let r=e[n];if(r&&"object"==typeof r){do{t[n]=(r=e[n])&&q(r)}while(++n<i);break}if(null!=r){do{t[n]=e[n]}while(++n<i);break}t[n]=r}e=new Proxy(t,V)}else{t={};for(const i in e){const n=e[i];t[i]=n&&"object"==typeof n?q(n):n}e=new Proxy(t,W)}return t[z]={},e},G=(e,t)=>{t?e.w=!0:e.com.watchMountChange("s",G,e)};let _=0;const K=(e=>{const t=v;if(t.id){let i=O.get(t);if(i){const n=i.e;return i.w?(I=!0,"function"==typeof e&&(e=e()),n[z]=e,I=!1,i.w=!1,t.watchMountChange("s",G,i)):"function"==typeof e&&(I=!0,(e=e(n))!==n&&(n[z]=e),I=!1),n}"function"==typeof e&&(e=e());const n=q(e);return i={com:t,e:n,w:!1},O.set(t,i),n}return"function"==typeof e&&(e=e()),q(e)})({c:0});window.addEventListener("popstate",(()=>{K.c=++_}))})();
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { q, N, o, refreshComReaders, aD } from './elements';
|
|
2
|
+
import { t, y } from './state';
|
|
3
|
+
const d = (text, k) => {
|
|
4
|
+
const f = new Error(text);
|
|
5
|
+
const stack = f.stack;
|
|
6
|
+
if (stack) {
|
|
7
|
+
const i = stack.indexOf('\n');
|
|
8
|
+
let c = i;
|
|
9
|
+
for (let b = 0; b < k; b++) {
|
|
10
|
+
c = stack.indexOf('\n', c + 1);
|
|
11
|
+
}
|
|
12
|
+
f.stack = stack.substring(0, i) + stack.substring(c);
|
|
13
|
+
}
|
|
14
|
+
return f;
|
|
15
|
+
};
|
|
16
|
+
const j = (target, l) => {
|
|
17
|
+
const { get, set } = target;
|
|
18
|
+
target.get = function (key) {
|
|
19
|
+
const h = get.bind(this)(key);
|
|
20
|
+
if (h) {
|
|
21
|
+
if (q.id && !t) {
|
|
22
|
+
if (h.e < N) {
|
|
23
|
+
h.e = N;
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
l();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return h.data;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
target.set = function (key, a) {
|
|
33
|
+
const p = {
|
|
34
|
+
e: N,
|
|
35
|
+
data: a,
|
|
36
|
+
};
|
|
37
|
+
return set.bind(this)(key, p);
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
const m = refreshComReaders;
|
|
41
|
+
let g = false;
|
|
42
|
+
const n = (readerRecord, key) => {
|
|
43
|
+
if (q.id) {
|
|
44
|
+
if (!t) {
|
|
45
|
+
throw d('Models should not be modified while rendering', 3);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
g = true;
|
|
49
|
+
m(readerRecord, key);
|
|
50
|
+
g = false;
|
|
51
|
+
};
|
|
52
|
+
const r = () => {
|
|
53
|
+
aD(n);
|
|
54
|
+
j(o, () => {
|
|
55
|
+
throw d('This element already exists, "key" prop is required when it is in a loop', 5);
|
|
56
|
+
});
|
|
57
|
+
j(y, () => {
|
|
58
|
+
throw d('The "useState" function can only be called once in the com function', 4);
|
|
59
|
+
});
|
|
60
|
+
const s = o.get;
|
|
61
|
+
o.get = function (key) {
|
|
62
|
+
if (!g && !q.id) {
|
|
63
|
+
throw d('All the elements must be in a closure that passed to h.render()', 3);
|
|
64
|
+
}
|
|
65
|
+
return s.bind(this)(key);
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
r();
|
|
69
|
+
//# sourceMappingURL=debugCheck.js.map
|