var wService="wssisthemisonline/fbrequest";function getProducts(){return new Promise(function(t,o){try{var e="action=getProductos&usr=#{USER}&source=web-products".replace(/#\{USER\}/g,cfg_username);httpPostAsync("getProducts",wService,e,!1).then(function(e){t(e)}).catch(function(e){cursorWaiting(!1),t({})})}catch(e){console_log("webService_py","getProducts",e),o(e)}})}function getChildren_Materias(r){return new Promise(function(t,o){try{var e="action=getMaterias&parent=#{IDPARENT}&idMatPaqEc=#{ALLOWPAQECON}".replace(/#\{IDPARENT\}/g,r).replace(/#\{ALLOWPAQECON\}/g,path_bds_allow_paqEco);httpPostAsync("getMaterias",wService,e,!1).then(function(e){e=JSON.parse(e);t(e.data)}).catch(function(e){cursorWaiting(!1),t({})})}catch(e){console_log("webService_py","getChildren_Materias",e),o(e)}})}function getFiltroMaterias(r){return new Promise(function(t,o){try{var e="action=getFiltroMaterias&filtrar_titulo_ley=#{FILTRAR_TEXTO}&bundle=#{BUNDLE}".replace(/#\{FILTRAR_TEXTO\}/g,r).replace(/#\{BUNDLE\}/g,bundle_cte.join(".")+".");httpPostAsync("getFiltroMaterias",wService,e,!1).then(function(e){e=JSON.parse(e);t(e.data)}).catch(function(e){cursorWaiting(!1),t({})})}catch(e){console_log("webService_py","getChildren_Materias",e),o(e)}})}function getNoticias(r,c){return new Promise(function(t,o){try{var e="action=getNoticias&db=#{DB}&nodeLevel=#{NODELEVEL}".replace(/#\{DB\}/g,r).replace(/#\{NODELEVEL\}/g,c);httpPostAsync("getNoticias",wService,e,!1).then(function(e){e=JSON.parse(e);t(e.data)}).catch(function(e){cursorWaiting(!1),t("")})}catch(e){console_log("webService_py","getNoticias",e),o(e)}})}function getSysDate(){return new Promise(function(t,o){try{httpPostAsync("getSysDate",wService,"action=getSysDate",!1).then(function(e){e=JSON.parse(e);t(e.data)}).catch(function(e){cursorWaiting(!1),t("")})}catch(e){console_log("webService_py","getSysDate",e),o(e)}})}function getMsgsError(){return new Promise(function(t,o){try{httpPostAsync("getMsgsError",wService,"action=getMsgsError",!1).then(function(e){e=JSON.parse(e);t(e.data)}).catch(function(e){cursorWaiting(!1),t("")})}catch(e){console_log("webService_py","getMsgsError",e),o(e)}})}function getChildren_Leyes(r,c,n){return new Promise(function(t,o){try{"#"==c&&(c="");var e="action=getChildren_Leyes&db=#{DB}&newParent=#{NEWPARENT}".replace(/#\{IDPARENT\}/g,c||"").replace(/#\{DB\}/g,r||"").replace(/#\{NEWPARENT\}/g,n||"");httpPostAsync("getLeyes",wService,e,!1).then(function(e){e=JSON.parse(e);t(e)}).catch(function(e){""!=e&&"data"in e&&"no_existeBD_yearExists"==e.data&&"year"in e&&0=num_leyes?webSocketProcessInParts.close():searchCorrelationDBs(s)}},webSocketProcessInParts.onerror=function(e){console_log("webService_py","wsPython-onerror","started: "+(webSocketProcess_iniciado?"1":"0")),webSocketProcess_iniciado&&webSocketProcessInParts.close(),webSocket_onProcess=!1,webSocketProcess_iniciado=!1,webSocketCancelar=!1,o()}}catch(e){console_log("webService_py","wsPython",e),webSocketProcess_iniciado&&webSocketProcessInParts.close(),webSocket_onProcess=!1,webSocketProcess_iniciado=!1,webSocketCancelar=!1,o()}})}function startSearchCorrelations(e){try{webSocketProcessInParts.send("startSearchCorrelations|"+e[0].obra+"|"+e[0].ley+"|"+e[0].anio+"|"+e[0].articulo+"|"+e[0].tipo+"|"+e[0].source)}catch(e){console_log("webService_py","startSearchCorrelations",e)}}function searchCorrelationDBs(e){try{webSocketProcessInParts.send("searchCorrelations|"+e)}catch(e){console_log("webService_py","searchCorrelationDBs",e)}}function procesar_texto_html(e,t){try{var r=e,c=["\\%","\\!","\\#","\\$","\\&","\\'","\\(","\\)","\\*","\\+","\\,","\\/","\\:","\\;","\\=","\\?","\\@","\\[","\\]"];let o=["%25","%21","%23","%24","%26","%27","%28","%29","%2A","%2B","%2C","%2F","%3A","%3B","%3D","%3F","%40","%5B","%5D"];t==SOURCE_PROCESS_TXT_TOWS?(r=(r=(r=(r=(r=(r=(r=(r=(r=(r=(r=r.replaceAll(/[\u2200-\u22FF]/g,function(e){return"&#x"+e.charCodeAt().toString(16).toUpperCase()+";"})).replaceAll(/[\u0370-\u03FF]/g,function(e){return"&#x"+e.charCodeAt().toString(16).toUpperCase()+";"})).replace(/&/g,"&")).replace(/\u2014/g,"—")).replace(/\u201C/g,"“")).replace(/\u201d/g,"”")).replace(/\u2019/g,"’")).replace(/\u2013/g,"–")).replace(/\u200b/g,"")).replace(/\u2026/g,"…")).replace(/\u2018/g,"‘"),c.forEach((e,t)=>{e=new RegExp(e,"g");r=r.replace(e,o[t])})):t==SOURCE_PROCESS_TXT_FROMWS&&(r=(r=(r=(r=(r=(r=r.replace(/—/g,String.fromCharCode(parseInt("2014",16)))).replace(/“/g,String.fromCharCode(parseInt("201C",16)))).replace(/”/g,String.fromCharCode(parseInt("201d",16)))).replace(/’/g,String.fromCharCode(parseInt("2019",16)))).replace(/–/g,String.fromCharCode(parseInt("2013",16)))).replace(/‘/g,String.fromCharCode(parseInt("2018",16))))}catch(e){console_log("webService_py","procesar_texto_html",e)}finally{return r}}function wsSearchTextoCorr(d,h,n,a,_){return new Promise(function(t,o){try{var e=cfg_serv_byStep.replace(/(^\w+:|^)\/\//,"");let i=0,s=0;let l="",u="",p=null,g=0,S="";var r=("/"==e[e.length-1]?e.substring(0,e.length-1):e)+"/"+cfg_searchTextCorr_ws+"?action=searchCorrelationsText&year_search="+n+"&opcBuscar="+a+"&txt="+_,c=("1"==cfg_use_wssCorr?"wss://":"ws://")+r;webSocketProcess_iniciado&&(webSocketProcessInParts.close(),webSocketProcess_iniciado=!1),"texto_toSearch"in searchTextCorr_wbScktConfig&&0=num_leyes?webSocketProcessInParts.close():searchCorrelationTextDBs(i)}},webSocketProcessInParts.onerror=function(e){console_log("webService_py","wsSearchTextoCorr-onerror","started: "+(webSocketProcess_iniciado?"1":"0")),webSocketProcess_iniciado&&webSocketProcessInParts.close(),webSocket_onProcess=!1,webSocketProcess_iniciado=!1,webSocketCancelar=!1,o()}}catch(e){console_log("webService_py","wsSearchTextoCorr",e),webSocketProcess_iniciado&&webSocketProcessInParts.close(),webSocket_onProcess=!1,webSocketProcess_iniciado=!1,webSocketCancelar=!1,o()}})}function startSearchCorrelationsText(){try{webSocketProcessInParts.send("startSearchCorrelationsText")}catch(e){console_log("webService_py","startSearchCorrelationsText",e)}}function searchCorrelationTextDBs(e){try{webSocketProcessInParts.send("searchCorrelationsText|"+e)}catch(e){console_log("webService_py","searchCorrelationTextDBs",e)}}