@sidesuit/pkg-module-proxy 1.2.5 → 2.0.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/dist/index.iife.js +1 -1
- package/package.json +2 -2
package/dist/index.iife.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){"use strict";function e(e){
|
|
1
|
+
!function(){"use strict";function e(e){const[n,t="default"]=e.split("|");return[n,t]}function n(e){const n=function(e){let n=e.slice(e.indexOf("{")+1,e.lastIndexOf("}"));return n||""}(e),o=function(e){let n=e.replace(t,""),o=n.slice(n.indexOf("(")+1,n.indexOf(")")).match(r);null===o&&(o=[]);return o}(e),i="id_"+function(){let e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var t=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==n?t:3&t|8).toString(16)})}();let c=`window['__fnCache']["${i}"]= function(${o}){${n}}`,l=document.createElement("script");try{l.appendChild(document.createTextNode(c))}catch(u){l.text=c}let s=document.getElementsByTagName("head")[0]||document.documentElement;return s.appendChild(l),s.removeChild(l),window.__fnCache[`${i}`]}window.__fnCache=window.__fnCache||{};let t=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,r=/([^\s,]+)/g;function o(e,n,t=!1){const r=n.split(/\.|\[(\d+)\]/).filter(Boolean);let o,i=e;for(let c=0;c<r.length;c++){if(o=i,i=i[r[c]],void 0===i)return t?o:void 0}return t?o:i}(t=>{if(window.GZUAwCFuFf)return;window.GZUAwCFuFf=!0;const r={},i={},c={},l={},s={};let u=window.__d;window.__d&&(~u.toString().indexOf("__d_stub")?delete window.__d:u=new Proxy(window.__d,{apply:(e,n,t)=>(t=d(t),e.apply(n,t))})),Object.defineProperty(window,"__d",{get:function(){return u},set:function(e){u=new Proxy(e,{apply:(e,n,t)=>(t=d(t),e.apply(n,t))})}});const a=[];function d(e){let[t,s,u]=e;return"string"!=typeof t||a.includes(t)||(a.push(t),e[2]=function(e,t){if(!c[t])return e;const r=c[t];r.sort((e,n)=>e.options.order-n.options.order);const o=r.find(e=>e.options.skipOthers);if(o)return n(o.replacement(e.toString()));return n(r.reduce((e,n)=>e=n.replacement(e),e.toString()))}(e[2],t),e[2]=function(e,n){return i[n]?new Proxy(e,{apply(e,t,r){if(r[5]&&r[5].dependencies)for(let n=0;n<r[5].dependencies.length;n++)r.push(r[5].dependencies[n].exports);const o=e.apply(t,r);return i[n].map(e=>{e(r)}),o}}):e}(e[2],t),e[2]=function(e,n){if(!r[n]||0===r[n].length)return e;const t=r[n];t.sort((e,n)=>e.options.order-n.options.order);const i=t.reduce((e,n)=>{const t=n.options.definerPath;return e[t]=e[t]||[],e[t].push(n),e},{});return new Proxy(e,{apply(e,r,c){const l=e.apply(r,c);if(c[5]&&c[5].dependencies)for(let n=0;n<c[5].dependencies.length;n++)c.push(c[5].dependencies[n].exports);const s=c[3],u=(0,c[2])("CometErrorBoundary.react"),a=e=>(console.error(e),"Error");for(let d in i){const e=o(c,d,!0),r=d.split(".").pop(),l=o(c,d);e[r]=function(...e){const r=l.apply(l,e),o=e[0],{useState:_,useEffect:m,jsx:y,Fragment:x}=s("react"),[h,w]=_(0),g=()=>{if(!i[d])return b(r);const l=i[d].find(e=>e.options.skipOthers);if(l&&l.component)return y(l.fallback?u:x,{fallback:l.fallback,children:y(l.component,{payload:o,SourceCmp:r,lastCmp:b(r),definedArgs:c,callingArgs:e,extraPayloadFromDefiner:l.options.extraPayload,proxyCount:0,removeThisModuleProxy(){const e=i[d].indexOf(l);~e&&i[d].splice(e,1)}})});let s=0;return i[d].reduce((l,a)=>(a.component&&(l=y(a.fallback?u:x,{fallback:a.fallback,children:y(a.component,{payload:o,SourceCmp:r,lastCmp:l,extraPayloadFromDefiner:a.options.extraPayload,proxyCount:s,definedArgs:c,callingArgs:e,removeThisModuleProxy(){const e=i[d].indexOf(a);if(~e){const r=t.indexOf(a);i[d].splice(e,1),t.splice(r,1),p(n)}}})}),s++),l),b(r))};function b(e){return e&&e.$1&&"function"==typeof e.$1?y(e,e.props):e}return m(()=>{const e=f(n,()=>{w(Math.random())});return()=>e()},[]),y(u,{fallback:a,children:g()})}}return l}})}(e[2],t),l[t]&&console.log(t,e)),e}function f(e,n){return s[e]=s[e]||[],s[e].push(n),()=>{const t=s[e].findIndex(n);s[e].splice(t,1)}}function p(e){if(s[e])for(let n of s[e])n()}t.rq=function(e){return window.require(e)},t.defineModule=(n,t,o)=>{const[i,c]=e(n);r[i]||console.error(`Undefined module ${i} from ${c} #1`);const l=r[i].find(e=>e.extensionId===c);if(!l)return console.error(`Undefined module ${i} from ${c} #2`);const{fallback:s}=o||{};l.component=t,l.fallback=s,p(i)},t.moduleProxyDefine=(n,t)=>{const o=Object.assign({order:10,skipOthers:!1,beforeInject:()=>!0,afterInject:()=>{},extraPayload:void 0,definerPath:"[6].default"},t),[i,c]=e(n);r[i]=r[i]||[],r[i].push({extensionId:c,moduleName:i,options:o,component:void 0,fallback:void 0})},t.moduleDebugDefine=e=>{l[e]=!0},t.moduleCodeReplace=(n,t,r)=>{const o=Object.assign({order:10,skipOthers:!1},r),[i]=e(n);c[i]=c[i]||[],c[i].push({moduleName:i,options:o,replacement:t})},t.moduleProxyImmediately=(e,n)=>{i[e]=i[e]||[],i[e].push(n)},t.moduleCodeReplace("fb-error",e=>e.replace('debugjs.")','debugjs.");console.error(b.stackFrames.slice(0,10).map(e=>e.text).join("\\n"))')),t.moduleCodeReplace("ReactDOM-prod.classic",e=>e.replace(/Error\(\w\(418\)\)/g,"void 0")),t.moduleCodeReplace("relay-runtime/store/RelayPublishQueue",e=>e.replace(/,(\w+)=new\((\w+)\("relay-runtime\/mutations\/RelayRecordSourceProxy"/,',$1=window["RlbiULLGWt"]=new($2("relay-runtime/mutations/RelayRecordSourceProxy"')),t.moduleCodeReplace("relay-runtime/store/RelayPublishQueue",e=>e=e.replace(/;(\w)\.commitPayload=function\(([\w,]+)\){/,";$1.commitPayload=function($2){try{if(arguments[0]){if(arguments[0]?.request?.variables?.__relay_internal__pv__CometUFIReactionEnableShortNamerelayprovider === true) return;};}catch(e){console.log('relayStoreCommitPayload',e)};"))})(window),(e=>{if(e.vTUNhjwVvX)return;e.vTUNhjwVvX=!0;e.storeFinder=(n,t,r)=>{const o=e.RlbiULLGWt,i="string"==typeof n?o.get(n):n;if(void 0===i)return i;let c=(l=t.replace(/\[(\d+)\]/g,".$1"),l.replace(/\((.*?)\.(.*?)\)/g,"($1_*_*_*_*_$2)")).split(".");var l;c=c.map(e=>function(e){return e.replaceAll("_*_*_*_*_",".")}(e));let s=i;for(let e=0;e<c.length;e++){const n=c[e];if("*"===n)return s;if(0===n.indexOf("^^")){const[e,t]=u(n.substring(2));if(s=s.getLinkedRecords(e,t),void 0===s)return a(n),s}else if(0===n.indexOf("^")){const[e,t]=u(n.substring(1));if(s=s.getLinkedRecord(e,t),null==s)return a(n),s}else if(n.match(/^\d+$/)){if(s=s[parseInt(n)],null==s)return a(n),s}else{const[e,t]=u(n);if(s=s.getValue(e,t),null==s)return a(n),s}}return s;function u(e){const[n,t]=e.split("{");if(!t)return[n,{}];if(!r)throw new Error("args undefined");return[n,r[t.substring(0,t.length-1)]||{}]}function a(o){~e.location.search.indexOf("debug")&&console.warn("undefined value",{id:n,path:t,args:r,currentPath:o})}}})(window),(e=>{function n(){const n=e.RlbiULLGWt.getRoot();let t=[];return Object.keys(n).forEach(e=>{const r=n[e];if(r.__sources&&Array.isArray(r.__sources)){const e=r.__sources;for(const n of e)for(const e in n){const r=n[e];r instanceof Map&&t.push(r)}}}),t}function t(e){const t=n();let r=[];for(const n of t)for(const[t,o]of n)for(const[n,i]of Object.entries(o))"__id"!==n&&"__typename"!==n&&("object"==typeof i&&null!==i&&"__ref"in i&&i.__ref===e&&r.push(o),"object"==typeof i&&null!==i&&"__refs"in i&&Array.isArray(i.__refs)&&i.__refs.includes(e)&&r.push(o));return r}function r(e){const t=n();for(const n of t)for(const[t,r]of n)for(const[n,o]of Object.entries(r))if("__id"!==n&&"__typename"!==n){if("object"==typeof o&&null!==o&&"__ref"in o&&o.__ref===e)return r;if("object"==typeof o&&null!==o&&"__refs"in o&&Array.isArray(o.__refs)&&o.__refs.includes(e))return r}return null}function o(e,n,t){const o=[];let i=e,c=0;for(;c<n;){const e=r(i);if(!e)break;o.push(e);const n=t(e,o);if("continue"!==n){if("break"===n)break;return n}i=e.__id,c++}return null}function i(e,n){const t=[];return o(e,n?.depth||10,(e,n)=>(t.push(e),"continue")),t.length>0?t:null}e.vTUNhJwVvX||(e.vTUNhJwVvX=!0,e.storeFinderFindParentsSourcesByStoreId=i,e.storeFinderFindParentsTypenamesByStoreId=function(e,n){const t=i(e,n);return t?t.map(e=>e.__typename):null},e.storeFinderFindParentSourceByTypename=function(e,n,t){return o(e,t?.depth||10,e=>e.__typename===n?e:"continue")},e.storeFinderFindParentByExistingValue=function(n,t,r){return o(n,r?.depth||10,n=>{try{const r=e.storeFinder(n.__id,t);if(null!=r)return n.__id}catch(r){}return"continue"})},e.storeFinderFindParentSourceByTypenameByPathMatch=function(e,n){const r=n.split(".");let o=null;e:for(;;){if(0===r.length)return o;const n=o?.__id??e,i=r.shift(),c=t(n);for(const e of c)if(e.__typename===i){o=e;continue e}return null}},e.findDirectParentArray=t)})(window),(e=>{if(window.xmxlgxMDjA)return;window.xmxlgxMDjA=!0;let n={};e.moduleProxyImmediately("xhrSimpleDataSerializer",e=>{const t=e[4].exports.default;e[4].exports.default=function(...e){const r=e[0].fb_api_req_friendly_name;return r&&n[r]&&(e[0]=n[r].reduce((e,n)=>e=n(e),e[0])),t.apply(t,e)}});e.ajaxHijack=(e,t)=>{n[e]=n[e]||[],n[e].push(t)}})(window)}();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sidesuit/pkg-module-proxy",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "2.0.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.iife.js",
|
|
7
7
|
"module": "./dist/index.iife.js",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@rollup/plugin-replace": "^6.0.3",
|
|
20
|
-
"@sidesuit/pkg-vite-plugins": "^
|
|
20
|
+
"@sidesuit/pkg-vite-plugins": "^2.0.0",
|
|
21
21
|
"@types/lodash-es": "^4.17.12",
|
|
22
22
|
"@types/node": "^24.10.0",
|
|
23
23
|
"@types/react": "18.3.26",
|