Current Path : /var/www/www-root/data/www/info.monolith-realty.ru/bitrix/js/mobileapp/ |
Current File : /var/www/www-root/data/www/info.monolith-realty.ru/bitrix/js/mobileapp/platform.min.js |
(function(){const e={};const t=[];const n={};const o=".";class i{#e={};addModule(e,t){this.#e[e]=t}getModuleExports(e){return this.#e[e]?.exports}}if(typeof globalThis.nativeModules==="undefined"){Object.defineProperty(globalThis,"nativeModules",{enumerable:false,writable:false,configurable:true,value:new i})}function s(e){const t=e.factory;const n=function(t){let n=t;if(t.charAt(0)==="."){n=e.id.slice(0,e.id.lastIndexOf(o))+o+t.slice(2)}return r(n)};e.exports={};delete e.factory;t(n,e.exports,e);return e.exports}let r=function(o){if(o.startsWith("native/")){if(typeof nativeRequire!=="function"){return{}}const e=o.replace("native/","");let t=globalThis.nativeModules.getModuleExports(e);if(typeof t==="undefined"&&t!==null){t=nativeRequire(e);globalThis.nativeModules.addModule(e,{exports:t})}return t}if(!e[o]){throw new Error(`extension ${o} not found`)}else if(o in n){const e=`${t.slice(n[o]).join(" -> ")} -> ${o}`;throw new Error(`Cycle in require graph: ${e}`)}if(e[o].factory){try{n[o]=t.length;t.push(o);return s(e[o])}finally{delete n[o];t.pop()}}return e[o].exports};const l=()=>{const t=Object.keys(e);const n=t.length;const o=t.filter((t=>typeof e[t].factory==="undefined"));const i=o.length;const s=t.filter((e=>!o.includes(e)));const r=t=>Object.keys(e).filter((e=>e.startsWith(t)));return{defined:t,definedCount:n,used:o,usedCount:i,emptyUsage:s,findUsage:r}};const a=function(t,n){e[t]={id:t,factory:n}};a.remove=function(t){delete e[t]};a.moduleMap=e;const u={};this.jnExtensionData={set(e,t){u[e]=t},get(e){if(typeof u[e]!=="undefined"){return u[e]}return{}}};const c=this.jnexport=(...e)=>{e.forEach((e=>{if(Array.isArray(e)){if(e.length===2){this[e[1]]=e[0]}}else{this[e.name]=e}}))};const f={};let d=null;const p={};const h=(e,t=false)=>{if(d==null){d={};this.loadedExtensions.forEach((e=>{f[e]=true}))}return new Promise(((n,o)=>{if(Application.getApiVersion()<45){o({error:"API_VERSION is lower then 45"});return}if(f[e]&&t===false){n();return}if(!p[e]){p[e]=[]}p[e].push({fail:e=>{o(e)},success:()=>{n()}});if(d[e]){return}d[e]=true;const i={headers:{"Content-Type":"application/json"},data:Object.keys(f)};dynamicLoad(`/mobileapp/jn/${e}/?type=extension`,i).then((t=>{delete d[e];f[e]=true;if(p[e]){p[e].forEach((e=>e.success.call()))}})).catch((t=>{delete d[e];if(p[e]){p[e].forEach((e=>e.fail.call(null,t)))}}))}))};const y=e=>new Promise(((t,n)=>{if(typeof e!=="string"){n(new Error(`Expected argument 'ext' with value ${e} to be a string`))}BX.ajax({url:`/mobileapp/jn/${e}/?type=extension&onlyTextOfExt=true`,method:"POST",dataType:"html",onsuccess:t,onfailure:n})}));this.jn={moduleUsage:l,define:a,require:r,export:c,import:h,getExtensionCodeText:y}})(); //# sourceMappingURL=platform.map.js