@fctc/edu-logic-lib 1.2.0 → 1.2.1
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/chunk-3VUHHO7T.mjs +1 -0
- package/dist/chunk-4HCNCH3K.mjs +1 -0
- package/dist/chunk-4WC7TEQB.mjs +2 -0
- package/dist/chunk-6QAALOXO.mjs +6 -0
- package/dist/chunk-AT7T7PUJ.mjs +1 -0
- package/dist/chunk-CDLT5L7M.mjs +1 -0
- package/dist/chunk-GHOANIO5.mjs +1 -0
- package/dist/chunk-QKRSQCY2.mjs +1 -0
- package/dist/chunk-TWFPZEDT.mjs +1 -0
- package/dist/chunk-UBGANIIB.mjs +1 -0
- package/dist/chunk-WAXGOBY2.mjs +0 -1
- package/dist/chunk-ZC4WZW6I.mjs +1 -0
- package/dist/config.mjs +1 -2
- package/dist/constants.mjs +1 -2
- package/dist/environment.mjs +1 -4
- package/dist/hooks.mjs +1 -9
- package/dist/index.mjs +1 -12
- package/dist/models.mjs +1 -9
- package/dist/provider.mjs +1 -8
- package/dist/services.mjs +1 -7
- package/dist/store.mjs +1 -1
- package/dist/types.mjs +1 -1
- package/dist/utils.mjs +1 -1
- package/package.json +79 -90
- package/dist/base-model-type-DvO53Lwi.d.ts +0 -7
- package/dist/chunk-227GQM56.mjs +0 -295
- package/dist/chunk-3B6NWGPJ.js +0 -303
- package/dist/chunk-3GSWPBI3.js +0 -122
- package/dist/chunk-56VJGYA5.js +0 -66
- package/dist/chunk-5CWLH3IT.js +0 -635
- package/dist/chunk-A3OMRS6W.mjs +0 -62
- package/dist/chunk-GGNOJ77I.js +0 -2
- package/dist/chunk-HDWNBT3C.mjs +0 -120
- package/dist/chunk-IGSNXETE.mjs +0 -85
- package/dist/chunk-IXDDYGKE.js +0 -61
- package/dist/chunk-KYUV2PH4.mjs +0 -585
- package/dist/chunk-MLJQPO4Q.mjs +0 -57
- package/dist/chunk-MXBJCI62.mjs +0 -2344
- package/dist/chunk-ODQQQ7WA.js +0 -94
- package/dist/chunk-QLUONJPQ.mjs +0 -519
- package/dist/chunk-QMO7DJNI.mjs +0 -1059
- package/dist/chunk-QYYFZUNV.mjs +0 -90
- package/dist/chunk-RZBHZYXG.js +0 -582
- package/dist/chunk-TT2ZKGNO.mjs +0 -29
- package/dist/chunk-UHYQ7IVO.js +0 -32
- package/dist/chunk-UY632SGY.js +0 -2362
- package/dist/chunk-UYN3VSHW.js +0 -95
- package/dist/chunk-ZAYNNN2Q.js +0 -1068
- package/dist/config.d.ts +0 -15
- package/dist/config.js +0 -11
- package/dist/constants.d.ts +0 -120
- package/dist/constants.js +0 -55
- package/dist/context-type-D5XefoL-.d.ts +0 -8
- package/dist/environment.d.ts +0 -54
- package/dist/environment.js +0 -25
- package/dist/hooks.d.ts +0 -218
- package/dist/hooks.js +0 -194
- package/dist/index-C_nK1Mii.d.ts +0 -19
- package/dist/index.d.ts +0 -23
- package/dist/index.js +0 -629
- package/dist/models.d.ts +0 -35
- package/dist/models.js +0 -26
- package/dist/provider.d.ts +0 -16
- package/dist/provider.js +0 -25
- package/dist/services.d.ts +0 -160
- package/dist/services.js +0 -44
- package/dist/store.d.ts +0 -505
- package/dist/store.js +0 -254
- package/dist/types.d.ts +0 -12
- package/dist/types.js +0 -4
- package/dist/use-get-selection-DFh6sc49.d.ts +0 -26
- package/dist/utils.d.ts +0 -52
- package/dist/utils.js +0 -66
- package/dist/view-type-BTzRpkT7.d.ts +0 -106
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var A=(E=>(E.PROFILE="userinfo",E.CURRENT_COMPANY="current_company",E.LIST_COMPANY="list_company",E.COMPANY_INFO="company_info",E.MENU="menus",E.GET_VIEW_BY_ACTION="get_view_by_action",E.ACTION_DETAIL="action_detail",E.GET_DATA_SELECTION="get_data_select",E.WEB_SAVE="web_save",E.WEB_READ="web_read",E.GET_PROVIDER="get_provider",E))(A||{});var T=(e=>(e.WEB_SEARCH_READ="web_search_read",e.WEB_READ_GROUP="web_read_group",e.WEB_READ="web_read",e.WEB_SAVE="web_save",e.UNLINK="unlink",e.ONCHANGE="onchange",e.GET_ONCHANGE_FIELDS="get_fields_onchange",e.GET_FIELD_VIEW="get_fields_view_v2",e))(T||{});var O=(_=>(_.AUTH_TOKEN_PATH="/authentication/oauth2/token",_.GENTOKEN_SOCIAL="/token/generate",_.CALL_PATH="/call",_.COMPANY_PATH="/company",_.PROFILE_PATH="/userinfo",_.RESET_PASSWORD_PATH="/reset_password",_.CHANGE_PASSWORD_PATH="/change_password",_.UPDATE_PASSWORD_PATH="/change_password_parent",_.LOAD_ACTION="/load_action",_.REPORT_PATH="/report",_.RUN_ACTION_PATH="/run_action",_.UPLOAD_FILE_PATH="/upload/file",_.GET_MESSAGE="/chatter/thread/messages",_.SENT_MESSAGE="/chatter/message/post",_.UPLOAD_IMAGE="/mail/attachment/upload",_.DELETE_MESSAGE="/chatter/message/update_content",_.IMAGE_PATH="/web/image",_.LOAD_MESSAGE="/load_message_failures",_.TOKEN="/check_token",_.CREATE_UPDATE_PATH="/create_update",_.TWOFA_METHOD_PATH="/id/api/v2/call",_.SIGNIN_SSO="/signin-sso/oauth",_))(O||{});export{A as a,T as b,O as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a as a$1}from'./chunk-CDLT5L7M.mjs';import {c,g}from'./chunk-QKRSQCY2.mjs';var t=class extends a$1{constructor(r){super(r);}async getCurrentCompany(){return await c.getCurrentCompany()}async getUserCompany(r){return await c.getInfoCompany(r)}},s=t;var a=class extends a$1{constructor(r){super(r);}async getProfile(){return await g.getProfile()}},m=a;export{s as a,m as b};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {useDispatch,useSelector}from'react-redux';import {createSlice,configureStore}from'@reduxjs/toolkit';var j={baseUrl:"",requests:null,companies:[],user:{},envFile:null,defaultCompany:{id:null,logo:"",secondary_color:"",primary_color:""},context:{uid:null,allowed_company_ids:[],lang:"vi_VN",tz:"Asia/Saigon"}},y=createSlice({name:"env",initialState:j,reducers:{setEnv:(e,t)=>{Object.assign(e,t.payload);},setUid:(e,t)=>{e.context.uid=t.payload;},setAllowCompanies:(e,t)=>{e.context.allowed_company_ids=t.payload;},setCompanies:(e,t)=>{e.companies=t.payload;},setDefaultCompany:(e,t)=>{e.defaultCompany=t.payload;},setLang:(e,t)=>{e.context.lang=t.payload;},setUser:(e,t)=>{e.user=t.payload;},setEnvFile:(e,t)=>{e.envFile=t.payload;}}}),{setEnv:V,setUid:C,setLang:$,setAllowCompanies:U,setCompanies:B,setDefaultCompany:K,setUser:H,setEnvFile:G}=y.actions,W=e=>e.env,P=y.reducer;var z={dataParse:null,idFile:null,isFileLoaded:false,loadingImport:false,selectedFile:null,errorData:null},m=createSlice({name:"excel",initialState:z,reducers:{setDataParse:(e,t)=>{e.dataParse=t.payload;},setIdFile:(e,t)=>{e.idFile=t.payload;},setIsFileLoaded:(e,t)=>{e.isFileLoaded=t.payload;},setLoadingImport:(e,t)=>{e.loadingImport=t.payload;},setSelectedFile:(e,t)=>{e.selectedFile=t.payload;},setErrorData:(e,t)=>{e.errorData=t.payload;}}}),{setDataParse:q,setIdFile:J,setIsFileLoaded:Q,setLoadingImport:X,setSelectedFile:Z,setErrorData:ee}=m.actions,te=e=>e.excel,A=m.reducer;var re={viewDataStore:{},isShowingModalDetail:false,isShowModalTranslate:false,formSubmitComponent:{},fieldTranslation:null,listSubject:{},dataUser:{}},h=createSlice({name:"form",initialState:re,reducers:{setViewDataStore:(e,t)=>{e.viewDataStore=t.payload;},setIsShowingModalDetail:(e,t)=>{e.isShowingModalDetail=t.payload;},setIsShowModalTranslate:(e,t)=>{e.isShowModalTranslate=t.payload;},setFormSubmitComponent:(e,t)=>{e.formSubmitComponent[t.payload.key]=t.payload.component;},setFieldTranslate:(e,t)=>{e.fieldTranslation=t.payload;},setListSubject:(e,t)=>{e.listSubject=t.payload;},setDataUser:(e,t)=>{e.dataUser=t.payload;}}}),{setViewDataStore:ae,setIsShowingModalDetail:ne,setIsShowModalTranslate:se,setFormSubmitComponent:ie,setFieldTranslate:ce,setListSubject:le,setDataUser:de}=h.actions,pe=e=>e.form,T=h.reducer;var fe={pageLimit:10,fields:{},order:"",selectedRowKeys:[],indexRowTableModal:-2,footerGroupTable:{},page:0,domainTable:[]},S=createSlice({name:"list",initialState:fe,reducers:{setPageLimit:(e,t)=>{e.pageLimit=t.payload;},setFields:(e,t)=>{e.fields=t.payload;},setOrder:(e,t)=>{e.order=t.payload;},setSelectedRowKeys:(e,t)=>{e.selectedRowKeys=t.payload;},setIndexRowTableModal:(e,t)=>{e.indexRowTableModal=t.payload;},setPage:(e,t)=>{e.page=t.payload;},setDomainTable:(e,t)=>{e.domainTable=t.payload;}}}),{setPageLimit:ye,setFields:me,setOrder:he,setSelectedRowKeys:Se,setIndexRowTableModal:be,setPage:ge,setDomainTable:we}=S.actions,xe=e=>e.list,R=S.reducer;var ve={menuList:[]},b=createSlice({name:"navbar",initialState:ve,reducers:{setMenuList:(e,t)=>{e.menuList=t.payload;}}}),{setMenuList:De}=b.actions,Ne=e=>e.navbar,M=b.reducer;var Ae={profile:{}},g=createSlice({name:"profile",initialState:Ae,reducers:{setProfile:(e,t)=>{e.profile=t.payload;}}}),{setProfile:Te}=g.actions,Re=e=>e.profile,I=g.reducer;var Ie={groupByDomain:null,tableHead:[],searchString:"",hoveredIndexSearchList:null,selectedTags:[],firstDomain:null,searchMap:{},typeFieldsSearch:"",modelSearch:"",filterBy:[],groupBy:[]},w=createSlice({name:"search",initialState:Ie,reducers:{setGroupByDomain:(e,t)=>{e.groupByDomain=t.payload;},setTableHead:(e,t)=>{e.tableHead=t.payload;},setSearchString:(e,t)=>{e.searchString=t.payload;},setHoveredIndexSearchList:(e,t)=>{e.hoveredIndexSearchList=t.payload;},setSelectedTags:(e,t)=>{e.selectedTags=t.payload;},setFirstDomain:(e,t)=>{e.firstDomain=t.payload;},setTypeFieldsSearch:(e,t)=>{e.typeFieldsSearch=t.payload;},setModelSearch:(e,t)=>{e.modelSearch=t.payload;},setFilterBy:(e,t)=>{e.filterBy=t.payload;},setGroupBy:(e,t)=>{e.groupBy=t.payload;},setSearchMap:(e,t)=>{e.searchMap=t.payload;},updateSearchMap:(e,t)=>{e.searchMap[t.payload.key]||(e.searchMap[t.payload.key]=[]),e.searchMap[t.payload.key].push(t.payload.value);},removeKeyFromSearchMap:(e,t)=>{let{key:o,item:n}=t.payload,s=e.searchMap[o];if(s)if(n){let i=s.filter(a=>a.name!==n.name);i.length>0?e.searchMap[o]=i:delete e.searchMap[o];}else delete e.searchMap[o];},clearSearchMap:e=>{e.searchMap={};}}}),{setGroupByDomain:Fe,setSelectedTags:Oe,setSearchString:_e,setHoveredIndexSearchList:Le,setFirstDomain:ke,setTableHead:je,setFilterBy:Ve,setTypeFieldsSearch:Ce,setModelSearch:$e,setSearchMap:Ue,updateSearchMap:Be,removeKeyFromSearchMap:Ke,setGroupBy:He,clearSearchMap:Ge}=w.actions,We=e=>e.search,Ye=e=>e.search.searchMap,F=w.reducer;function E(e){return `Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var x=()=>Math.random().toString(36).substring(7).split("").join("."),ze={INIT:`@@redux/INIT${x()}`,REPLACE:`@@redux/REPLACE${x()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${x()}`},d=ze;function qe(e){if(typeof e!="object"||e===null)return false;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function Je(e){if(e===void 0)return "undefined";if(e===null)return "null";let t=typeof e;switch(t){case "boolean":case "string":case "number":case "symbol":case "function":return t}if(Array.isArray(e))return "array";if(Ze(e))return "date";if(Xe(e))return "error";let o=Qe(e);switch(o){case "Symbol":case "Promise":case "WeakMap":case "WeakSet":case "Map":case "Set":return o}return Object.prototype.toString.call(e).slice(8,-1).toLowerCase().replace(/\s/g,"")}function Qe(e){return typeof e.constructor=="function"?e.constructor.name:null}function Xe(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function Ze(e){return e instanceof Date?true:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function et(e){let t=typeof e;return process.env.NODE_ENV!=="production"&&(t=Je(e)),t}function O(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function tt(e,t,o,n){let s=Object.keys(t),i=o&&o.type===d.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(s.length===0)return "Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!qe(e))return `The ${i} has unexpected type of "${et(e)}". Expected argument to be an object with the following keys: "${s.join('", "')}"`;let a=Object.keys(e).filter(r=>!t.hasOwnProperty(r)&&!n[r]);if(a.forEach(r=>{n[r]=true;}),!(o&&o.type===d.REPLACE)&&a.length>0)return `Unexpected ${a.length>1?"keys":"key"} "${a.join('", "')}" found in ${i}. Expected to find one of the known reducer keys instead: "${s.join('", "')}". Unexpected keys will be ignored.`}function ot(e){Object.keys(e).forEach(t=>{let o=e[t];if(typeof o(void 0,{type:d.INIT})>"u")throw new Error(process.env.NODE_ENV==="production"?E(12):`The slice reducer for key "${t}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(typeof o(void 0,{type:d.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?E(13):`The slice reducer for key "${t}" returned undefined when probed with a random type. Don't try to handle '${d.INIT}' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`)});}function _(e){let t=Object.keys(e),o={};for(let a=0;a<t.length;a++){let r=t[a];process.env.NODE_ENV!=="production"&&typeof e[r]>"u"&&O(`No reducer provided for key "${r}"`),typeof e[r]=="function"&&(o[r]=e[r]);}let n=Object.keys(o),s;process.env.NODE_ENV!=="production"&&(s={});let i;try{ot(o);}catch(a){i=a;}return function(r={},p){if(i)throw i;if(process.env.NODE_ENV!=="production"){let c=tt(r,o,p,s);c&&O(c);}let l=false,v={};for(let c=0;c<n.length;c++){let u=n[c],L=o[u],D=r[u],f=L(D,p);if(typeof f>"u"){let N=p&&p.type;throw new Error(process.env.NODE_ENV==="production"?E(14):`When called with an action of type ${N?`"${String(N)}"`:"(unknown type)"}, the slice reducer for key "${u}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`)}v[u]=f,l=l||f!==D;}return l=l||n.length!==Object.keys(r).length,l?v:r}}var at=_({env:P,navbar:M,list:R,search:F,form:T,excel:A,profile:I}),nt=configureStore({reducer:at,middleware:e=>e({serializableCheck:false})});var ct=useDispatch,lt=useSelector;
|
|
2
|
+
export{Be as $,pe as A,S as B,ye as C,me as D,he as E,Se as F,be as G,ge as H,we as I,xe as J,b as K,De as L,Ne as M,g as N,Te as O,Re as P,w as Q,Fe as R,Oe as S,_e as T,Le as U,ke as V,je as W,Ve as X,Ce as Y,$e as Z,Ue as _,y as a,Ke as aa,V as b,He as ba,C as c,Ge as ca,$ as d,We as da,U as e,Ye as ea,B as f,nt as fa,K as g,ct as ga,H as h,lt as ha,G as i,W as j,m as k,q as l,J as m,Q as n,X as o,Z as p,ee as q,te as r,h as s,ae as t,ne as u,se as v,ie as w,ce as x,le as y,de as z};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
var C=class extends Error{},Ee={"\\":"\\",'"':'"',"'":"'",a:"\x07",b:"\b",f:"\f",n:`
|
|
2
|
+
`,r:"\r",t:" ",v:"\v"};function Me(t,e){let n=[],r;for(let u=0;u<t.length;++u){if(t[u]!=="\\"){n.push(t[u]);continue}let s=t[u+1];if(s in Ee){n.push(Ee[s]),++u;continue}switch(s){case `
|
|
3
|
+
`:++u;continue;case "N":if(!e)break;throw new C("SyntaxError: \\N{} escape not implemented");case "u":if(!e)break;let a=t.slice(u+2,u+6);if(!/[0-9a-f]{4}/i.test(a))throw new C(["SyntaxError: (unicode error) 'unicodeescape' codec"," can't decode bytes in position ",u,"-",u+4,": truncated \\uXXXX escape"].join(""));r=parseInt(a,16),n.push(String.fromCharCode(r)),u+=5;continue;case "U":if(!e)break;throw new C("SyntaxError: \\U escape not implemented");case "x":let o=t.slice(u+2,u+4);if(!/[0-9a-f]{2}/i.test(o))throw e?new C(["SyntaxError: (unicode error) 'unicodeescape'"," codec can't decode bytes in position ",u,"-",u+2,": truncated \\xXX escape"].join("")):new C("ValueError: invalid \\x escape");r=parseInt(o,16),n.push(String.fromCharCode(r)),u+=3;continue;default:if(!/[0-8]/.test(s))break;let i=/[0-8]{1,3}/g;i.lastIndex=u+1;let c=i.exec(t);if(!c)break;let l=c[0];r=parseInt(l,8),n.push(String.fromCharCode(r)),u+=l.length;continue}n.push("\\");}return n.join("")}var Ye=new Set(["None","False","True"]),z=["in","not","not in","is","is not","<","<=",">",">=","<>","!=","=="],ee=["or","and","|","^","&","<<",">>","+","-","*","/","//","%","~","**","."],ze=["-"],Ke=new Set(["(",")","[","]","{","}",":",",","if","else","lambda","=",...z,...ee,...ze]);function N(...t){return "("+t.join("|")+")"}var ge="[a-zA-Z_]\\w*",Ae="[ \\f\\t]*",Ve="\\d+(L|l)?",Ze=Ve,_="[eE][+-]?\\d+",He=N(`\\d+\\.\\d*(${_})?`,`\\.\\d+(${_})?`),qe=N(He,`\\d+${_}`),be=N(qe,Ze),Ge=N("\\*\\*=?",">>=?","<<=?","<>","!=","//=?","[+\\-*/%&|^=<>]=?","~"),Je="[\\[\\]\\(\\)\\{\\}]",We="[:;.,`@]",Xe=N(Ge,Je,We),Te=N("([uU])?'([^\\n'\\\\]*(?:\\\\.[^\\n'\\\\]*)*)'",'([uU])?"([^\\n"\\\\]*(?:\\\\.[^\\n"\\\\]*)*)"'),Qe=Ae+N(be,Xe,Te,ge),_e=new RegExp("^"+be+"$"),he=new RegExp("^"+Te+"$"),et=new RegExp("^"+ge+"$"),tt=new RegExp("^"+Ae);function De(t){let e=[],n=t.length,r=0,u=0,s=new RegExp(Qe,"g");for(;s.lastIndex<n;){let a=s.exec(t);if(!a){if(/^\s+$/.test(t.slice(u)))break;throw new C("Failed to tokenize <<"+t+">> at index "+(u||0)+"; parsed so far: "+e)}if(a.index>u&&t.slice(u,a.index).trim())throw new C("Invalid expression");r=a.index,u=s.lastIndex;let o=t.slice(r,u).replace(tt,"");if(_e.test(o))e.push({type:0,value:parseFloat(o)});else if(he.test(o)){let i=he.exec(o);if(!i)throw new C("Invalid string match");e.push({type:1,value:Me(i[3]!==void 0?i[3]:i[5],!!(i[2]||i[4]))});}else if(Ke.has(o))o==="in"&&e.length>0&&e[e.length-1].value==="not"?(o="not in",e.pop()):o==="not"&&e.length>0&&e[e.length-1].value==="is"&&(o="is not",e.pop()),e.push({type:2,value:o});else if(Ye.has(o))e.push({type:4,value:o});else if(et.test(o))e.push({type:3,value:o});else throw new C("Invalid expression")}return e}var d=class extends Error{},we=new Set(z),nt=new Set([...ee,...z]);function K(t){switch(t){case "=":return 10;case "if":return 20;case "in":case "not in":case "is":case "is not":case "<":case "<=":case ">":case ">=":case "<>":case "==":case "!=":return 60;case "or":return 30;case "and":return 40;case "not":return 50;case "|":return 70;case "^":return 80;case "&":return 90;case "<<":case ">>":return 100;case "+":case "-":return 110;case "*":case "/":case "//":case "%":return 120;case "**":return 140;case ".":case "(":case "[":return 150;default:return 0}}function te(t){return t.type===2?K(t.value):0}function g(t,e){return t.type===2&&t.value===e}function rt(t,e){switch(t.type){case 0:return {type:0,value:t.value};case 1:return {type:1,value:t.value};case 4:return t.value==="None"?{type:3}:{type:2,value:t.value==="True"};case 3:return {type:5,value:t.value};case 2:switch(t.value){case "-":case "+":case "~":return {type:6,op:t.value,right:T(e,130)};case "not":return {type:6,op:t.value,right:T(e,50)};case "(":let n=[],r=false;for(;e[0]&&!g(e[0],")");)if(n.push(T(e,0)),e[0]){if(e[0]&&g(e[0],","))r=true,e.shift();else if(!g(e[0],")"))throw new d("parsing error")}else throw new d("parsing error");if(!e[0]||!g(e[0],")"))throw new d("parsing error");return e.shift(),r=r||n.length===0,r?{type:10,value:n}:n[0];case "[":let u=[];for(;e[0]&&!g(e[0],"]");)if(u.push(T(e,0)),e[0]){if(g(e[0],","))e.shift();else if(!g(e[0],"]"))throw new d("parsing error")}if(!e[0]||!g(e[0],"]"))throw new d("parsing error");return e.shift(),{type:4,value:u};case "{":let s={};for(;e[0]&&!g(e[0],"}");){let a=T(e,0);if(a.type!==1&&a.type!==0||!e[0]||!g(e[0],":"))throw new d("parsing error");e.shift();let o=T(e,0);s[a.value]=o,g(e[0],",")&&e.shift();}if(!e.shift())throw new d("parsing error");return {type:11,value:s};default:throw new d("Token cannot be parsed")}default:throw new d("Token cannot be parsed")}}function ut(t,e,n){switch(e.type){case 2:if(nt.has(e.value)){let r=T(n,te(e));if(e.value==="and"||e.value==="or")return {type:14,op:e.value,left:t,right:r};if(e.value==="."){if(r.type===5)return {type:15,obj:t,key:r.value};throw new d("invalid obj lookup")}let u={type:7,op:e.value,left:t,right:r};for(;we.has(e.value)&&n[0]&&n[0].type===2&&we.has(n[0].value);){let s=n.shift();u={type:14,op:"and",left:u,right:{type:7,op:s.value,left:r,right:T(n,te(s))}},r=u.right;}return u}switch(e.value){case "(":let r=[],u={};for(;n[0]&&!g(n[0],")");){let i=T(n,0);i.type===9?u[i.name.value]=i.value:r.push(i),n[0]&&g(n[0],",")&&n.shift();}if(!n[0]||!g(n[0],")"))throw new d("parsing error");return n.shift(),{type:8,fn:t,args:r,kwargs:u};case "=":if(t.type===5)return {type:9,name:t,value:T(n,10)};break;case "[":let s=T(n);if(!n[0]||!g(n[0],"]"))throw new d("parsing error");return n.shift(),{type:12,target:t,key:s};case "if":let a=T(n);if(!n[0]||!g(n[0],"else"))throw new d("parsing error");n.shift();let o=T(n);return {type:13,condition:a,ifTrue:t,ifFalse:o};}}throw new d("Token cannot be parsed")}function T(t,e=0){let n=t.shift();if(!n)throw new d("Unexpected end of input");let r=rt(n,t);for(;t[0]&&te(t[0])>e;)r=ut(r,t.shift(),t);return r}function Se(t){if(t.length)return T(t,0);throw new d("Missing token")}function P(t,e){let n=t[t.length-1],r=typeof n=="object"?t.slice(0,-1):t,u=typeof n=="object"?n:{};for(let[s,a]of r.entries())u[e[s]]=a;return u}var ue=class extends Error{},$=class extends Error{},R=class extends Error{};function w(t){return String(t).padStart(2,"0")}function ae(t){return String(t).padStart(4,"0")}function S(t,e,n){let r=t%e;return (r>0&&e<0||r<0&&e>0)&&(r+=e),n(Math.floor(t/e),r)}function oe(t,e="AssertionError"){if(!t)throw new ue(e)}var V=[null,31,28,31,30,31,30,31,31,30,31,30,31],ie=[null];for(let t=0,e=1;e<V.length;++e)ie.push(t),t+=V[e];function se(t,e){return e===2&&Z(t)?29:V[e]}function Z(t){return t%4===0&&(t%100!==0||t%400===0)}function H(t){let e=t-1;return e*365+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400)}function ot(t,e){let n=e>2&&Z(t);return ie[e]+(n?1:0)}function Fe(t,e,n){let r=se(t,e);if(!(1<=n&&n<=r))throw new $(`day must be in 1..${r}`);return H(t)+ot(t,e)+n}var st=H(401),at=H(101),it=H(5);function ct(t){--t;let e=0,n=0,r=0,u=0,s=0;S(t,st,(l,A)=>{e=l,S(A,at,(F,x)=>{n=F,S(x,it,(U,f)=>{r=U,S(f,365,(m,b)=>{u=m,s=b;});});});}),t=s;let a=e*400+1+n*100+r*4+u;if(u===4||n===100)return oe(s===0),{year:a-1,month:12,day:31};let o=u===3&&(r!==24||n===3);oe(o===Z(a));let i=t+50>>5,c=ie[i]+(i>2&&o?1:0);return c>t&&(--i,c-=V[i]+(i===2&&o?1:0)),t-=c,{year:a,month:i,day:t+1}}function ce(t,e,n,r,u,s,a){r=r||0,u=u||0,s=s||0,a=a||0,(a<0||a>999999)&&S(a,1e6,(i,c)=>{a=c,s+=i;}),(s<0||s>59)&&S(s,60,(i,c)=>{s=c,u+=i;}),(u<0||u>59)&&S(u,60,(i,c)=>{u=c,r+=i;}),(r<0||r>23)&&S(r,24,(i,c)=>{r=c,n+=i;}),(e<1||e>12)&&S(e-1,12,(i,c)=>{e=c+1,t+=i;});let o=se(t,e);if(n<1||n>o)if(n===0)--e,e>0?n=se(t,e):(--t,e=12,n=31);else if(n===o+1)++e,n=1,e>12&&(e=1,++t);else {let i=ct(Fe(t,e,1)+(n-1));t=i.year,e=i.month,n=i.day;}return {year:t,month:e,day:n,hour:r,minute:u,second:s,microsecond:a}}var E=class t{constructor(e,n,r){this.year=e;this.month=n;this.day=r;}static today(){return this.convertDate(new Date)}static convertDate(e){let n=e.getFullYear(),r=e.getMonth()+1,u=e.getDate();return new t(n,r,u)}static create(...e){let{year:n,month:r,day:u}=P(e,["year","month","day"]);return new t(n,r,u)}add(e){let n=ce(this.year,this.month,this.day+e.days,0,0,0);return new t(n.year,n.month,n.day)}isEqual(e){return e instanceof t?this.year===e.year&&this.month===e.month&&this.day===e.day:false}strftime(e){return e.replace(/%([A-Za-z])/g,(n,r)=>{switch(r){case "Y":return ae(this.year);case "m":return w(this.month);case "d":return w(this.day);default:throw new $(`No known conversion for ${n}`)}})}substract(e){if(e instanceof h)return this.add(e.negate());if(e instanceof t)return h.create(this.toordinal()-e.toordinal());throw new R}toJSON(){return this.strftime("%Y-%m-%d")}toordinal(){return Fe(this.year,this.month,this.day)}},p=class t{constructor(e,n,r,u,s,a,o){this.year=e;this.month=n;this.day=r;this.hour=u;this.minute=s;this.second=a;this.microsecond=o;}static now(){return this.convertDate(new Date)}static convertDate(e){let n=e.getFullYear(),r=e.getMonth()+1,u=e.getDate(),s=e.getHours(),a=e.getMinutes(),o=e.getSeconds();return new t(n,r,u,s,a,o,0)}static create(...e){let n=P(e,["year","month","day","hour","minute","second","microsecond"]),r=n.year,u=n.month,s=n.day,a=n.hour||0,o=n.minute||0,i=n.second||0,c=n.microsecond/1e3||0;return new t(r,u,s,a,o,i,c)}static combine(...e){let{date:n,time:r}=P(e,["date","time"]);return t.create(n.year,n.month,n.day,r.hour,r.minute,r.second)}add(e){let n=ce(this.year,this.month,this.day+e.days,this.hour,this.minute,this.second+e.seconds,this.microsecond+e.microseconds);return new t(n.year,n.month,n.day,n.hour,n.minute,n.second,n.microsecond)}isEqual(e){return e instanceof t?this.year===e.year&&this.month===e.month&&this.day===e.day&&this.hour===e.hour&&this.minute===e.minute&&this.second===e.second&&this.microsecond===e.microsecond:false}strftime(e){return e.replace(/%([A-Za-z])/g,(n,r)=>{switch(r){case "Y":return ae(this.year);case "m":return w(this.month);case "d":return w(this.day);case "H":return w(this.hour);case "M":return w(this.minute);case "S":return w(this.second);default:throw new $(`No known conversion for ${n}`)}})}substract(e){return this.add(e.negate())}toJSON(){return this.strftime("%Y-%m-%d %H:%M:%S")}to_utc(){let e=new Date(this.year,this.month-1,this.day,this.hour,this.minute,this.second),n=h.create({minutes:e.getTimezoneOffset()});return this.add(n)}},j=class t extends E{constructor(n,r,u){let s=new Date,a=s.getFullYear(),o=s.getMonth()+1,i=s.getDate();super(a,o,i);this.hour=n;this.minute=r;this.second=u;this.hour=n,this.minute=r,this.second=u;}static create(...n){let r=P(n,["hour","minute","second"]),u=r.hour||0,s=r.minute||0,a=r.second||0;return new t(u,s,a)}strftime(n){return n.replace(/%([A-Za-z])/g,(r,u)=>{switch(u){case "Y":return ae(this.year);case "m":return w(this.month);case "d":return w(this.day);case "H":return w(this.hour);case "M":return w(this.minute);case "S":return w(this.second);default:throw new $(`No known conversion for ${r}`)}})}toJSON(){return this.strftime("%H:%M:%S")}},ne=[31,59,90,120,151,181,212,243,273,304,334,366],lt=["hour","minute","second"],ft=["year","month","day",...lt],yt="years months weeks days hours minutes seconds microseconds leapdays".split(" "),pt="year month day hour minute second microsecond weekday nlyearday yearday".split(" "),mt=["dt1","dt2"],v=class t{static create(...e){let n=P(e,mt);if("dt1"in n)throw new Error("relativedelta(dt1, dt2) is not supported for now");for(let u of ft)if(u in n){let s=n[u];oe(s>=0,`${u} ${s} is out of range`);}for(let u of yt)n[u]=n[u]||0;for(let u of pt)n[u]=u in n?n[u]:null;n.days+=7*n.weeks;let r=0;if(n.nlyearday?r=n.nlyearday:n.yearday&&(r=n.yearday,r>59&&(n.leapDays=-1)),r){for(let u=0;u<ne.length;u++)if(r<=ne[u]){n.month=u+1,u===0?n.day=r:n.day=r-ne[u-1];break}}return new t(n)}static add(e,n){if(!(e instanceof E||e instanceof p))throw new R;let r=ce((n.year||e.year)+n.years,(n.month||e.month)+n.months,n.day||e.day,n.hour||(e instanceof p?e.hour:0),n.minute||(e instanceof p?e.minute:0),n.second||(e instanceof p?e.second:0),n.microseconds||(e instanceof p?e.microsecond:0)),u=new p(r.year,r.month,r.day,r.hour,r.minute,r.second,r.microsecond),s=0;n.leapDays&&u.month>2&&Z(u.year)&&(s=n.leapDays);let a=u.add(h.create({days:n.days+s,hours:n.hours,minutes:n.minutes,seconds:n.seconds,microseconds:n.microseconds})),i=!!!(a.hour||a.minute||a.second||a.microsecond)&&e instanceof E?new E(a.year,a.month,a.day):a;if(n.weekday!==null){let c=n.weekday+1,A=(7-new Date(i.year,i.month-1,i.day).getDay()+c)%7;return i.add(new h(A,0,0))}return i}static substract(e,n){return t.add(e,n.negate())}constructor(e={},n=1){this.years=n*e.years,this.months=n*e.months,this.days=n*e.days,this.hours=n*e.hours,this.minutes=n*e.minutes,this.seconds=n*e.seconds,this.microseconds=n*e.microseconds,this.leapDays=e.leapDays,this.year=e.year,this.month=e.month,this.day=e.day,this.hour=e.hour,this.minute=e.minute,this.second=e.second,this.microsecond=e.microsecond,this.weekday=e.weekday;}years;months;days;hours;minutes;seconds;microseconds;leapDays;year;month;day;hour;minute;second;microsecond;weekday;negate(){return new t(this,-1)}isEqual(){throw new R}},dt="weeks days hours minutes seconds milliseconds microseconds".split(" ");function re(t){let e=t%1;return [e<0?e+1:e,Math.floor(t)]}var h=class t{constructor(e,n,r){this.days=e;this.seconds=n;this.microseconds=r;}static create(...e){let n=P(e,["days","seconds","microseconds"]);for(let f of dt)n[f]=n[f]||0;let r=0,u=0,s=0,a=n.days+n.weeks*7,o=n.seconds+60*n.minutes+3600*n.hours,i=n.microseconds+1e3*n.milliseconds,[c,l]=re(a);r=l;let A=0;if(c){let[f,m]=re(c*24*3600);u=m,A=f;}let[F,x]=re(o);o=x;let U=F+A;return S(o,24*3600,(f,m)=>{r+=f,u+=m;}),i+=U*1e6,S(i,1e6,(f,m)=>{S(f,24*3600,(b,Le)=>{r+=b,u+=Le,s+=Math.round(m);});}),new t(r,u,s)}add(e){return t.create({days:this.days+e.days,seconds:this.seconds+e.seconds,microseconds:this.microseconds+e.microseconds})}divide(e){let n=(this.days*24*3600+this.seconds)*1e6+this.microseconds;return t.create({microseconds:Math.floor(n/e)})}isEqual(e){return e instanceof t?this.days===e.days&&this.seconds===e.seconds&&this.microseconds===e.microseconds:false}isTrue(){return this.days!==0||this.seconds!==0||this.microseconds!==0}multiply(e){return t.create({days:e*this.days,seconds:e*this.seconds,microseconds:e*this.microseconds})}negate(){return t.create({days:-this.days,seconds:-this.seconds,microseconds:-this.microseconds})}substract(e){return t.create({days:this.days-e.days,seconds:this.seconds-e.seconds,microseconds:this.microseconds-e.microseconds})}total_seconds(){return this.days*86400+this.seconds+this.microseconds/1e6}};var O=class extends Error{constructor(e){super(e),this.name="EvaluationError";}};function le(t,e){if(t===null)throw new O("value not iterable");if(typeof t=="object"&&!Array.isArray(t)&&!(t instanceof Set)&&(t=Object.keys(t)),typeof t?.[Symbol.iterator]!="function")throw new O("value not iterable");return e(t)}var D={bool(t){switch(typeof t){case "number":return t!==0;case "string":return t!=="";case "boolean":return t;case "object":return t==null?false:"isTrue"in t&&typeof t.isTrue=="function"?t.isTrue():t instanceof Array?!!t.length:t instanceof Set?!!t.size:Object.keys(t).length!==0;default:return true}},set(t){if(arguments.length>2)throw new O(`set expected at most 1 argument, got (${arguments.length-1})`);return le(t,e=>new Set(e))},time:{strftime(t){return p.now().strftime(t)}},context_today(){return E.today()},get current_date(){return this.today},get today(){return E.today().strftime("%Y-%m-%d")},get now(){return p.now().strftime("%Y-%m-%d %H:%M:%S")},datetime:{time:j,timedelta:h,datetime:p,date:E},relativedelta:v,true:true,false:false};function q(t){switch(typeof t){case "string":return {type:1,value:t};case "number":return {type:0,value:t};case "boolean":return {type:2,value:t};case "object":if(Array.isArray(t))return {type:4,value:t.map(q)};if(t===null)return {type:3};if(t instanceof Date)return {type:1,value:String(p.convertDate(t))};if(t instanceof E||t instanceof p)return {type:1,value:t};{let e={};for(let n in t)e[n]=q(t[n]);return {type:11,value:e}}default:throw new Error("Invalid type")}}function y(t,e=0){switch(t.type){case 3:return "None";case 1:return JSON.stringify(t.value);case 0:return String(t.value);case 2:return t.value?"True":"False";case 4:return `[${t.value.map(y).join(", ")}]`;case 6:return t.op==="not"?`not ${y(t.right,50)}`:`${t.op}${y(t.right,130)}`;case 7:let n=K(t.op),r=`${y(t.left,n)} ${t.op} ${y(t.right,n)}`;return n<e?`(${r})`:r;case 11:let u=[];for(let x in t.value)u.push(`"${x}": ${y(t.value[x])}`);return `{${u.join(", ")}}`;case 10:return `(${t.value.map(y).join(", ")})`;case 5:return t.value;case 12:return `${y(t.target)}[${y(t.key)}]`;case 13:let{ifTrue:s,condition:a,ifFalse:o}=t;return `${y(s)} if ${y(a)} else ${y(o)}`;case 14:let i=K(t.op),c=`${y(t.left,i)} ${t.op} ${y(t.right,i)}`;return i<e?`(${c})`:c;case 15:return `${y(t.obj,150)}.${t.key}`;case 8:let l=t.args.map(y),A=[];for(let x in t.kwargs)A.push(`${x} = ${y(t.kwargs[x])}`);let F=l.concat(A).join(", ");return `${y(t.fn)}(${F})`;default:throw new Error("invalid expression: "+JSON.stringify(t))}}var fe=Object.create(null);function ye(t){return new Proxy(t,{getPrototypeOf(){return fe}})}var W=D.bool;function Et(t,e){let n=B(t.right,e);switch(t.op){case "-":return n instanceof Object&&"negate"in n?n.negate():-n;case "+":return n;case "not":return !W(n);default:throw new O(`Unknown unary operator: ${t.op}`)}}function xe(t){switch(typeof t){case "object":return t===null?1:Array.isArray(t)?5:3;case "number":return 2;case "string":return 4;default:throw new O(`Unknown type: ${typeof t}`)}}function G(t,e){if(typeof t=="number"&&typeof e=="number")return t<e;typeof t=="boolean"&&(t=t?1:0),typeof e=="boolean"&&(e=e?1:0);let n=xe(t),r=xe(e);return n===r?t<e:n<r}function J(t,e){return typeof t!=typeof e?typeof t=="boolean"&&typeof e=="number"?e===(t?1:0):typeof t=="number"&&typeof e=="boolean"?t===(e?1:0):false:t instanceof Object&&"isEqual"in t?t.isEqual(e):t===e}function Ce(t,e){return Array.isArray(e)||typeof e=="string"&&typeof t=="string"?e.includes(t):typeof e=="object"?t in e:false}function ht(t,e){let n=B(t.left,e),r=B(t.right,e);switch(t.op){case "+":{let u=n instanceof v,s=r instanceof v;if(u||s){let i=u?r:n,c=u?n:r;return v.add(i,c)}let a=n instanceof h,o=r instanceof h;if(a&&o)return n.add(r);if(a){if(r instanceof E||r instanceof p)return r.add(n);throw new R}if(o){if(n instanceof E||n instanceof p)return n.add(r);throw new R}return n instanceof Array&&r instanceof Array?[...n,...r]:n+r}case "-":{if(r instanceof v)return v.substract(n,r);if(r instanceof h){if(n instanceof h)return n.substract(r);if(n instanceof E||n instanceof p)return n.substract(r);throw new R}return n instanceof E?n.substract(r):n-r}case "*":{let u=n instanceof h,s=r instanceof h;if(u||s){let a=u?r:n;return (u?n:r).multiply(a)}return n*r}case "/":return n/r;case "%":return n%r;case "//":return n instanceof h?n.divide(r):Math.floor(n/r);case "**":return n**r;case "==":return J(n,r);case "<>":case "!=":return !J(n,r);case "<":return G(n,r);case ">":return G(r,n);case ">=":return J(n,r)||G(r,n);case "<=":return J(n,r)||G(n,r);case "in":return Ce(n,r);case "not in":return !Ce(n,r);default:throw new O(`Unknown binary operator: ${t.op}`)}}var me={get(...t){let{key:e,defValue:n}=P(t,["key","defValue"]),r=this;return e in r?r[e]:n!==void 0?n:null}},ke={lower(){return this.toLowerCase()},upper(){return this.toUpperCase()}};function pe(t,e,n,...r){if(r.length===1)return new Set(n);if(r.length>2)throw new O(`${t}: py_js supports at most 1 argument, got (${r.length-1})`);return le(r[0],e)}var Ie={intersection(...t){return pe("intersection",e=>{let n=new Set;for(let r of e)this.has(r)&&n.add(r);return n},this,...t)},difference(...t){return pe("difference",e=>{e=new Set(e);let n=new Set;for(let r of this)e.has(r)||n.add(r);return n},this,...t)},union(...t){return pe("union",e=>new Set([...this,...e]),this,...t)}};function ve(t){return Object.getOwnPropertyNames(t.prototype).map(e=>t.prototype[e])}var Oe=new Set([D.time.strftime,D.set,D.bool,D.context_today,D.datetime.datetime.now,D.datetime.datetime.combine,D.datetime.date.today,...ve(D.relativedelta),...Object.values(D.datetime).flatMap(t=>ve(t)),...Object.values(Ie),...Object.values(me),...Object.values(ke)]),Be=Symbol("unbound function");function B(t,e={}){let n=new Set,r,u=Object.create(e);u?.context||Object.defineProperty(u,"context",{get(){return r||(r=ye(e)),r}});function s(o){switch(o?.type){case 0:case 1:return o.value;case 5:return o.value in u?typeof u[o.value]=="object"&&u[o.value]?.id&&o?.value!=="parent"?u[o.value]?.id:u[o.value]??false:o.value in D?D[o.value]:false;case 3:return null;case 2:return o.value;case 6:return Et(o,u);case 7:return ht(o,u);case 14:let i=a(o.left);return o.op==="and"?W(i)?a(o.right):i:W(i)?i:a(o.right);case 4:case 10:return o.value.map(a);case 11:let c={};for(let b in o.value)c[b]=a(o.value[b]);return n.add(c),c;case 8:let l=a(o.fn),A=o.args.map(a),F={};for(let b in o.kwargs)F[b]=a(o?.kwargs[b]);return l===E||l===p||l===j||l===v||l===h?l.create(...A,F):l(...A,F);case 12:let x=a(o.target),U=a(o.key);return x[U];case 13:return W(a(o.condition))?a(o.ifTrue):a(o.ifFalse);case 15:let f=a(o.obj),m;if(n.has(f)||Object.isPrototypeOf.call(fe,f)?m=me[o.key]:typeof f=="string"?m=ke[o.key]:f instanceof Set?m=Ie[o.key]:o.key==="get"&&typeof f=="object"?(m=me[o.key],f=ye(f)):typeof f=="number"?m=f:Array.isArray(f[o.key])?m=f[o.key]?.map(b=>b?.id??b):m=f[o.key]?.id??f[o.key]??false,typeof m=="function"){let b=m.bind(f);return b[Be]=m,b}return m;default:throw new O(`AST of type ${o.type} cannot be evaluated`)}}function a(o){let i=s(o);if(typeof i=="function"&&!Oe.has(i)&&!Oe.has(i[Be]))throw new Error("Invalid Function Call");return i}return a(t)}function L(t){let e=De(t);return Se(e)}function X(t,e={}){let n;try{n=L(t);}catch(r){throw new EvalError(`Can not parse python expression: (${t})
|
|
4
|
+
Error: ${r.message}`)}try{return B(n,e)}catch(r){throw new EvalError(`Can not evaluate python expression: (${t})
|
|
5
|
+
Error: ${r.message}`)}}function Pe(t,e={}){return !t||t==="False"||t==="0"?false:t==="True"||t==="1"?true:X(`bool(${t})`,e)}function Re(t,e={}){let n=L(t),r={};for(let u in n.value){let s=n.value[u];try{r[u]=B(s,e);}catch{}}return r}function Ne(t,e,n=(r,u)=>r===u){if(!t||!e||typeof t!="object"||typeof e!="object")return t===e;let r=Object.keys(t);return r.length===Object.keys(e).length&&r.every(u=>n(t[u],e[u]))}var $e=Ne;function M(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var k=class extends Error{},I=class t{ast={type:-1,value:null};static TRUE;static FALSE;static combine(e,n){if(e.length===0)return new t([]);let r=e[0]instanceof t?e[0]:new t(e[0]);if(e.length===1)return r;let u=t.combine(e.slice(1),n),s=new t([]),a=r.ast.value,o=u.ast.value,i=n==="AND"?"&":"|",c={type:4,value:a.concat(o)};return s.ast=je(c,i),s}static and(e){return t.combine(e,"AND")}static or(e){return t.combine(e,"OR")}static not(e){let n=new t(e);return n.ast.value.unshift({type:1,value:"!"}),n}static removeDomainLeaves(e,n){function r(a,o,i,c){let l=a[o];if(l.type===10)return n.includes(l.value[0].value)?i==="&"?c.ast.value.push(...t.TRUE.ast.value):i==="|"&&c.ast.value.push(...t.FALSE.ast.value):c.ast.value.push(l),1;if(l.type===1){if(l.value==="|"&&a[o+1].type===10&&a[o+2].type===10&&n.includes(a[o+1].value[0].value)&&n.includes(a[o+2].value[0].value))return c.ast.value.push(...t.TRUE.ast.value),3;if(c.ast.value.push(l),l.value==="!")return 1+r(a,o+1,"&",c);let A=r(a,o+1,l.value,c),F=r(a,o+1+A,l.value,c);return 1+A+F}return 0}let u=new t(e);if(u.ast.value.length===0)return u;let s=new t([]);return r(u.ast.value,0,"&",s),s}constructor(e=[]){if(e instanceof t)return new t(e.toString());{let n;try{n=typeof e=="string"?L(e):Dt(e);}catch(r){throw new k(`Invalid domain representation: ${e}`,{cause:r})}this.ast=je(n);}}contains(e){let n=B(this.ast,e);return St(e,n)}toString(){return y(this.ast)}toList(e){return B(this.ast,e)}toJson(){try{let e=this.toList({});return new t(e).toString()===this.toString()?e:this.toString()}catch{return this.toString()}}};var gt=[1,"=",1],At=[0,"=",1],bt=new I([gt]),Tt=new I([At]);I.TRUE=bt;I.FALSE=Tt;function Dt(t){return {type:4,value:t.map(n=>{switch(n){case "!":case "&":case "|":return {type:1,value:n};default:return {type:10,value:n.map(q)}}})}}function je(t,e="&"){if(t.type!==4)if(t.type===10){let u=t.value;if(u.findIndex(s=>s.type===10)===-1||!u.every(s=>s.type===10||s.type===1))throw new k("Invalid domain AST")}else throw new k("Invalid domain AST");if(t.value.length===0)return t;let n=1;for(let u of t.value)switch(u.type){case 1:if(u.value==="&"||u.value==="|")n++;else if(u.value!=="!")throw new k("Invalid domain AST");break;case 4:case 10:if(u.value.length===3){n--;break}throw new k("Invalid domain AST");default:throw new k("Invalid domain AST")}let r=t.value.slice();for(;n<0;)n++,r.unshift({type:1,value:e});if(n>0)throw new k(`invalid domain ${y(t)} (missing ${n} segment(s))`);return {type:4,value:r}}function Q(t,e){if(typeof e=="boolean")return e;let[n,r,u]=e;if(typeof n=="string"){let i=n.split(".");if(i.length>=2)return Q(t[i[0]],[i.slice(1).join("."),r,u])}let s,a;["like","not like","ilike","not ilike"].includes(r)&&(s=new RegExp(`(.*)${M(u).replaceAll("%","(.*)")}(.*)`,"g"),a=new RegExp(`(.*)${M(u).replaceAll("%","(.*)")}(.*)`,"gi"));let o=typeof n=="number"?n:t[n];switch(r){case "=?":if([false,null].includes(u))return true;case "=":case "==":return Array.isArray(o)&&Array.isArray(u)?$e(o,u):o===u;case "!=":case "<>":return !Q(t,[n,"==",u]);case "<":return o<u;case "<=":return o<=u;case ">":return o>u;case ">=":return o>=u;case "in":{let i=Array.isArray(u)?u:[u];return (Array.isArray(o)?o:[o]).some(l=>i.includes(l))}case "not in":{let i=Array.isArray(u)?u:[u];return !(Array.isArray(o)?o:[o]).some(l=>i.includes(l))}case "like":return o===false?false:!!o.match(s);case "not like":return o===false?false:!o.match(s);case "=like":return o===false?false:new RegExp(M(u).replace(/%/g,".*")).test(o);case "ilike":return o===false?false:!!o.match(a);case "not ilike":return o===false?false:!o.match(a);case "=ilike":return o===false?false:new RegExp(M(u).replace(/%/g,".*"),"i").test(o)}throw new k("could not match domain")}function wt(t){let e=Q.bind(null,t);return {"!":n=>!e(n),"&":(n,r)=>e(n)&&e(r),"|":(n,r)=>e(n)||e(r)}}function St(t,e){if(e.length===0)return true;let n=wt(t),r=Array.from(e).reverse(),u=[];for(let s of r){let a=typeof s=="string"&&n[s];if(a){let o=u.splice(-a.length);u.push(a(...o));}else u.push(s);}return Q(t,u.pop())}var Y=(t,e)=>{try{if(e===void 0||e==="0"||e==="False"||e===!1)return !1;if(e==="1"||e==="True"||e===!0)return !0;try{if(t&&e)return new I(e).contains(t)}catch{return t&&e?Pe(e,t):!1}return !1}catch{return false}},de=(t,e)=>{if(Array.isArray(e)){if(e?.length>0)return e&&e.some(n=>Y(t,n))}else return Y(t,e);return false};var Ft=(t,e={})=>{try{return Re(t,e)}catch{return null}},xt=(t,e)=>{try{return e&&Object.keys(e)?.forEach(r=>{Array.isArray(e[r])&&e[r]?.every(s=>typeof s=="object"&&s!==null&&s?.id!==void 0)&&(e[r]=e[r]?.map(s=>s?.id));}),X(t,e)}catch{try{return new I(t).toList(e)}catch{return []}}},Ct=t=>t?t.split(",").map(e=>{let[n,r]=e.trim().split(/\s+/),u=r?.toUpperCase()==="DESC"?"DESC":"ASC";return `${n} ${u}`}).join(", "):null,vt={checkDomain:Y,matchDomains:de,Domain:I},Ot=t=>Object.keys(t).map(e=>encodeURIComponent(e)+"="+encodeURIComponent(t[e].toString())).join("&"),Bt=(t,e)=>{let n=t+e/2,r=0;for(let l=0;l<n.length;l++)r=n.charCodeAt(l)+((r<<5)-r);let u=r>>16&255,s=r>>8&255,a=r&255,o=120+u%61,i=120+s%61,c=120+a%61;return `#${o.toString(16).padStart(2,"0")}${i.toString(16).padStart(2,"0")}${c.toString(16).padStart(2,"0")}`},kt=t=>{let e=[];function n(r){for(let u of r)u&&(u?.type_co==="field"&&de(t,u?.on_change)&&e.push(u.name),u?.fields&&Array.isArray(u?.fields)&&n(u?.fields));}return n(t),e},It=({viewType:t,aid:e,model:n,id:r,actionPath:u})=>{let s=`/${t}/${u}?aid=${e}&model=${n}`;return r&&(s+=`&id=${r}`),s},Pt=t=>{let e={};for(let n in t)t[n]!==void 0&&(e[n]=t[n]);return e},Rt=(t,e)=>t?.views?.form?.tabs?.filter(r=>r?Y(e,r.invisible)?false:r:null)||[],Nt=t=>{try{return /^data:([a-zA-Z]+\/[a-zA-Z0-9-.+]+)?;base64,/.test(t)?!0:/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{3}=|[A-Za-z0-9+\/]{2}==)?$/.test(t)}catch{return false}},Ue=t=>{if(!/^data:image\/(png|jpeg|jpg|gif|webp);base64,/.test(t))return false;try{let n=t.split(",")[1];return !!n&&atob(n).length>0}catch{return false}},$t=t=>/\.(jpg|jpeg|png|gif|bmp|webp|svg|tiff|ico)$/i.test(t)||Ue(t),jt=t=>{if(t<1024)return `${t} B`;let e=Math.floor(Math.log(t)/Math.log(1024)),n=["B","KB","MB","GB","TB"];return `${(t/Math.pow(1024,e)).toFixed(2)} ${n[e]}`},Ut=(t=window.location.href)=>{let e=t?.split(".");return e.length>2?e[0].replace("https://","").replace("http://",""):null};
|
|
6
|
+
export{Y as a,de as b,Ft as c,xt as d,Ct as e,vt as f,Ot as g,Bt as h,kt as i,It as j,Pt as k,Rt as l,Nt as m,Ue as n,$t as o,jt as p,Ut as q};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {b,c as c$1,d,e,f,g,h,fa}from'./chunk-4WC7TEQB.mjs';import {c,a,b as b$1}from'./chunk-GHOANIO5.mjs';var n=class{envStore;baseUrl;requests;context;defaultCompany;config;companies;user;db;localStorageUtils;sessionStorageUtils;constructor(t,e,o){this.envStore=t,this.localStorageUtils=e,this.sessionStorageUtils=o,this.setup();}setup(){let t=this.envStore.getState().env;this.baseUrl=t?.baseUrl,this.requests=t?.requests,this.context=t?.context,this.defaultCompany=t?.defaultCompany,this.config=t?.config,this.companies=t?.companies||[],this.user=t?.user,this.db=t?.db;}setupEnv(t){let e=this.envStore.dispatch,o={...t,localStorageUtils:this.localStorageUtils,sessionStorageUtils:this.sessionStorageUtils},U=c.init(o);e(b({...o,requests:U})),this.setup();}setUid(t){let e=this.envStore.dispatch;e(c$1(t)),this.setup();}setLang(t){let e=this.envStore.dispatch;e(d(t)),this.setup();}setAllowCompanies(t){let e$1=this.envStore.dispatch;e$1(e(t)),this.setup();}setCompanies(t){let e=this.envStore.dispatch;e(f(t)),this.setup();}setDefaultCompany(t){let e=this.envStore.dispatch;e(g(t)),this.setup();}setUserInfo(t){let e=this.envStore.dispatch;e(h(t)),this.setup();}},s=null;function m({localStorageUtils:a,sessionStorageUtils:t}){return s=new n(fa,a,t),s}function y(){return s||(s=new n(fa,a(),b$1())),s}export{n as a,s as b,m as c,y as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {f}from'./chunk-ZC4WZW6I.mjs';var r=class{name;view;actContext;fields;constructor(i){this.name=i.name,this.view=i.view,this.actContext=i.actContext,this.fields=i.fields;}getSpecificationByFields({fields:i=[],specification:c={},modelsData:n,model:s,modelRoot:p}){if(Array.isArray(i)){let t={...c};return i.forEach(e=>{if(!e?.type_co||e?.name&&e?.type_co==="field"){if(n?.[s]?.[e?.name])if(n?.[s]?.[e?.name]?.type==="one2many"||n?.[s]?.[e?.name]?.type==="many2many"){let o=n?.[s]?.[e?.name]?.relation,a=n?.[o];a?(t[e?.name]={fields:{}},p&&p===o?t[e?.name].fields={id:{}}:t[e?.name].fields=this.getSpecificationByFields({fields:Object.values(a),specification:{},modelsData:n,model:o,modelRoot:s})):t[e?.name]={fields:{id:{},display_name:{}}};}else n?.[s]?.[e?.name]?.type==="many2one"?t[e?.name]={fields:{id:{},display_name:{},...f[e?.widget]?{image_256:{}}:{},...e?.name==="currency_id"&&i?.find(o=>o?.widget==="monetary")?{symbol:{}}:{},...e?.widget==="many2many_binary"?{mimetype:{}}:{}}}:t[e?.name]={};}else if(e?.type_co==="group"||e?.type_co==="div"||e?.type_co==="span"){let o=this.getSpecificationByFields({fields:e?.fields,specification:t,modelsData:n,model:s});t={...t,...o};}else if(e?.type_co==="tree"||e?.type_co==="list"){let o=n?.[s]?.[e?.name]?.relation,a=this.getSpecificationByFields({fields:e?.fields,specification:{},modelsData:n,model:o,modelRoot:s});t={...t,[e?.name]:{fields:{...t?.[e?.name]?.fields,...a}}};}}),t}else console.warn("fields is not array");}getTreeProps(){return this.view?.views?.list||{}}getTreeFields(){return this.view?.views?.list?.fields||[]}getSpecification(){let i={},c=this.view?.models||{};return this.getSpecificationByFields({fields:this.fields,specification:i,modelsData:c,model:this.name,modelRoot:""})}},d=r;export{d as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import h from'axios';var I=()=>({setToken:async d=>{localStorage.setItem("accessToken",d);},setRefreshToken:async d=>{localStorage.setItem("refreshToken",d);},getAccessToken:async()=>localStorage.getItem("accessToken"),getRefreshToken:async()=>localStorage.getItem("refreshToken"),clearToken:async()=>{localStorage.removeItem("accessToken"),localStorage.removeItem("refreshToken");}});var E=()=>({getBrowserSession:async()=>sessionStorage.getItem("browserSession")});var y="MAINTENANCE_ACTIVE",N="MAINTENANCE_AT",S="MAINTENANCE_LAST_PATH",U=false;function L(){if(typeof window>"u")return;let{pathname:o,search:n}=window.location,g=o+(n||"");o!=="/maintenance"&&!window.localStorage.getItem(S)&&window.localStorage.setItem(S,g),window.localStorage.setItem(y,"true"),window.localStorage.setItem(N,String(Date.now()));}async function R(o,n){if(typeof window>"u")return;let g=n?.forceLogin===true,i=n?.clearTokenOnForce!==false;window.localStorage.removeItem(y),window.localStorage.removeItem(N);let l=window.localStorage.getItem(S);window.localStorage.removeItem(S);try{if(g){if(i)try{await n?.clearToken?.();}catch{}window.location.replace("/login");return}if(await o()){let k=l&&l!=="/maintenance"?l:"/";window.location.replace(k);}else window.location.replace("/login");}catch{window.location.replace("/login");}}var P={init(o){let n=o.localStorageUtils??I(),g=o.sessionStorageUtils??E(),i=o.db,l=false,d=[],k=(e,t=null)=>{d?.forEach(a=>{e?a.reject(e):a.resolve(t);}),d=[];},r=h.create({adapter:h.defaults.adapter,baseURL:o.baseUrl,timeout:5e4,paramsSerializer:e=>new URLSearchParams(e).toString()});if(typeof window<"u"){let e=window.localStorage.getItem(y)==="true",t=window.location.pathname==="/maintenance";if(e&&!t&&(U=true,window.location.replace("/maintenance")),e&&t){let a=o.healthUrl||`${(o.baseUrl||"").replace(/\/+$/,"")}/health`;(async()=>{try{await h.get(a,{timeout:8e3}),await R(()=>n.getAccessToken(),{forceLogin:!0,clearTokenOnForce:!0,clearToken:()=>n.clearToken()});}catch{}})();}}r.interceptors.request.use(async e=>{let t=await n.getAccessToken();return t&&(e.headers.Authorization="Bearer "+t),e},e=>Promise.reject(e)),r.interceptors.response.use(e=>{if(typeof window<"u"){let t=window.localStorage.getItem(y)==="true",a=window.location.pathname==="/maintenance";t&&a?(async()=>await R(()=>n.getAccessToken(),{forceLogin:true,clearTokenOnForce:true,clearToken:()=>n.clearToken()}))():t&&(window.localStorage.removeItem(y),window.localStorage.removeItem(N),window.localStorage.removeItem(S));}return v(e)},async e=>{if(e?.response?.status===503)return typeof window<"u"&&(L(),!U&&window.location.pathname!=="/maintenance"&&(U=true,window.location.replace("/maintenance"))),Promise.reject({code:503,message:"SERVICE_UNAVAILABLE",original:e?.response?.data});let a=async m=>{if(!m.response)return m;let{data:u}=m.response;return u&&u.code===400&&["invalid_grant"].includes(u.data?.error)&&await T(),u},A=e.config;if((e.response?.status===403||e.response?.status===401||e.response?.status===404)&&["TOKEN_EXPIRED","AUTHEN_FAIL",401].includes(e.response.data.code)){if(l)return new Promise(function(c,_){d.push({resolve:c,reject:_});}).then(c=>(A.headers.Authorization="Bearer "+c,r.request(A))).catch(async c=>{(c.response?.status===400||c.response?.status===401)&&["invalid_grant"].includes(c.response.data.error)&&await T();});let m=await g.getBrowserSession(),u=await n.getRefreshToken(),x=await n.getAccessToken();if(l=true,!u&&(!m||m=="unActive"))await T();else {let c=Object.fromEntries(Object.entries({refresh_token:u,grant_type:"refresh_token",client_id:o.config.clientId,client_secret:o.config.clientSecret}).filter(([_,s])=>!!s));return new Promise(function(_){h.post(`${o.baseUrl}/authentication/oauth2/token`,c,{headers:{"Content-Type":"multipart/form-data",Authorization:`Bearer ${x}`}}).then(async s=>{let f=s.data;await n.setToken(f.access_token),await n.setRefreshToken(f.refresh_token),h.defaults.headers.common.Authorization="Bearer "+f.access_token,A.headers.Authorization="Bearer "+f.access_token,k(null,f.access_token),_(r.request(A));}).catch(async s=>{if(s&&(s?.error_code==="AUTHEN_FAIL"||s?.error_code==="TOKEN_EXPIRED"||s?.error_code==="TOKEN_INCORRECT"||s?.code==="ERR_BAD_REQUEST")&&await T(),s&&s.response){let{error_code:f}=s.response?.data||{};f==="AUTHEN_FAIL"&&await T();}k(s,null);}).finally(()=>{l=false;});})}}return Promise.reject(await a(e))});let v=e=>e&&e.data?e.data:e,T=async()=>{await n.clearToken(),typeof window<"u"&&(window.location.href="/login");};function w(e,t){return e+(t?"?db="+t:"")}let p=e=>e;return {get:(e,t)=>r.get(w(e,i),t).then(p),post:(e,t,a)=>r.post(w(e,i),t,{headers:a}).then(p),post_excel:(e,t,a)=>r.post(w(e,i),t,{responseType:"arraybuffer",headers:{"Content-Type":typeof window<"u"?"application/json":"application/javascript",Accept:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}}).then(p),put:(e,t,a)=>r.put(w(e,i),t,a).then(p),patch:(e,t)=>r.patch(w(e,i),t).then(p),delete:(e,t)=>r.delete(w(e,i),t).then(p)}}};export{I as a,E as b,P as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {g as g$1}from'./chunk-6QAALOXO.mjs';import {d}from'./chunk-AT7T7PUJ.mjs';import {c}from'./chunk-3VUHHO7T.mjs';var P={async loadAction({idAction:e,context:t}){let n=d(),o={action_id:e,with_context:{...t}};return n.requests.post("/load_action",o,{headers:{"Content-Type":"application/json"}})},async callButton({model:e,ids:t=[],context:n,method:o}){try{let r=d(),a={model:e,method:o,ids:t,with_context:n};return r.requests.post("/call",a,{headers:{"Content-Type":"application/json"}})}catch(r){throw console.error("Error when calling button action:",r),r}},async removeRows({model:e,ids:t,context:n}){let o=d(),r={model:e,method:"unlink",ids:t,with_context:n};return o.requests.post("/call",r,{headers:{"Content-Type":"application/json"}})},async duplicateRecord({model:e,id:t,context:n}){let o=d(),r={model:e,method:"copy",ids:t,with_context:n};return o.requests.post("/call",r,{headers:{"Content-Type":"application/json"}})},async print({id:e,report:t,db:n}){let o=d(),a=g$1({report:t,id:e,type:"pdf",file_response:true,db:n}),i=`/report?${a}`;return o.requests.get(i,{headers:{"Content-Type":"application/json"},responseType:"arraybuffer"})},async runAction({idAction:e,context:t}){let n=d(),o={action_id:e,with_context:{...t}};return n.requests.post("/run_action",o,{headers:{"Content-Type":"application/json"}})}},f=P;var x={async login(e){let t=d(),n=Object.fromEntries(Object.entries({username:e.email,password:e.password,grant_type:t?.config?.grantType||"",client_id:t?.config?.clientId||"",client_secret:t?.config?.clientSecret||""}).filter(([r,a])=>!!a)),o=new URLSearchParams(n).toString();return t?.requests?.post(e.path,o,{headers:{"Content-Type":"application/x-www-form-urlencoded"}})},async forgotPassword(e){let t=d(),n={login:e,url:`${window.location.origin}/reset-password`};return t?.requests?.post("/reset_password",n,{headers:{"Content-Type":"application/json"}})},async resetPassword(e,t){let n=d(),o={token:t,password:e.password,new_password:e.confirmPassword};return n?.requests?.post("/change_password",o,{headers:{"Content-Type":"application/json"}})},async updatePassword(e,t){let n=d(),o={token:t,old_password:e.oldPassword,new_password:e.newPassword};return n?.requests?.post("/change_password_parent",o,{headers:{"Content-Type":"application/json"}})},async isValidToken(e){let t=d(),n={token:e};return t?.requests?.post("/check_token",n,{headers:{"Content-Type":"application/json"}})},async loginSocial({state:e,access_token:t}){return d()?.requests?.post("/token/generate",{state:e,access_token:t},{headers:{"Content-Type":"application/json"}})},async getProviders(e){return d()?.requests?.get("/oauth/providers",{params:{db:e}})}},h=x;var S={async getCurrentCompany(){return await d().requests.get("/company",{headers:{"Content-Type":"application/json"}})},async getInfoCompany(e){let t=d(),n={ids:[e],model:"res.company",method:"web_read",kwargs:{specification:{primary_color:{},secondary_color:{},logo:{},display_name:{},secondary_logo:{}}}};return await t?.requests?.post("/call",n,{headers:{"Content-Type":"application/json"}})}},g=S;var j={async uploadFile({formData:e}){return d().requests.post("/upload/file",e,{headers:{"Content-Type":"multipart/form-data"}})},async uploadIdFile({formData:e}){return d().requests.post("/upload/file",e,{headers:{"Content-Type":"multipart/form-data"}})},async parsePreview({id:e,selectedSheet:t,isHeader:n,context:o}){let r=d(),a={model:"base_import.import",method:"parse_preview",ids:[e],kwargs:{options:{import_skip_records:[],import_set_empty_fields:[],fallback_values:{},name_create_enabled_fields:{},encoding:"",separator:"",quoting:'"',date_format:"",datetime_format:"",float_thousand_separator:",",float_decimal_separator:".",advanced:true,has_headers:n,keep_matches:false,limit:2e3,sheets:[],sheet:t,skip:0,tracking_disable:true}},with_context:o};return r.requests.post("/call",a,{headers:{"Content-Type":"multipart/form-data"}})},async executeImport({columns:e,fields:t,idFile:n,options:o,dryrun:r,context:a}){let i=d(),c={model:"base_import.import",method:"execute_import",ids:[n],kwargs:{fields:t,columns:e,options:o,dryrun:r},with_context:a};return i.requests.post("/call",c,{headers:{"Content-Type":"multipart/form-data"}})},async getFileExcel({model:e,context:t}){let n=d(),o={model:e,method:"get_import_templates",args:[],with_context:t};return n.requests.post("/call",o)},async getFieldExport({ids:e,model:t,isShow:n,parentField:o,fieldType:r,parentName:a,prefix:i,name:c,context:d$1,importCompat:l}){let E=d(),p={model:t,import_compat:l,domain:[["id","in",e]],with_context:d$1};return n&&(p.parent_field=o,p.parent_field_type=r,p.parent_name=a,p.name=c,p.prefix=i,p.exclude=[null]),E.requests.post("/export/get_fields",p)},async exportExcel({model:e,domain:t,ids:n,fields:o,type:r,importCompat:a,context:i,groupby:c}){let d$1=d(),l={model:e,domain:t,ids:n,import_compat:a,fields:o,with_context:i,groupby:c??[]};return d$1.requests.post_excel(`/export/${r}`,l)}},w=j;var L={async getComment({data:e}){try{let t=d(),n={thread_id:e.thread_id,thread_model:e.thread_model,limit:100,with_context:{lang:e.lang}};return t.requests.post("/chatter/thread/messages",n,{headers:{"Content-Type":"application/json"}})}catch(t){throw console.error("Error when sending message:",t),t}},async sentComment({data:e}){try{let t=d(),n={context:{tz:"Asia/Saigon",uid:2,allowed_company_ids:[1],mail_post_autofollow:!1,temporary_id:142183.01},post_data:{body:e.message,message_type:"comment",attachment_ids:e.attachment_ids,attachment_tokens:[],subtype_xmlid:e.subtype},thread_id:Number(e.thread_id),thread_model:e.thread_model};return t.requests.post("/chatter/message/post",n,{headers:{"Content-Type":"application/json"}})}catch(t){throw console.error("Error when sent message:",t),t}},async deleteComment({data:e}){try{let t=d(),n={attachment_ids:[],attachment_tokens:[],body:"",message_id:e.message_id};return t.requests.post("/chatter/message/update_content",n,{headers:{"Content-Type":"application/json"}})}catch(t){throw console.error("Error when sent message:",t),t}},async getImage({data:e}){try{return d().requests.get(`/web/image?filename=${e.filename}&unique=${e.checksum}&width=1920&height=300`,{headers:{"Content-Type":"application/json"}})}catch(t){throw console.error("Error when sent message:",t),t}},async uploadImage({data:e}){try{return d().requests.post("/mail/attachment/upload",e,{headers:{"Content-Type":"multipart/form-data"}})}catch(t){throw console.error("Error when sent message:",t),t}},async getFormView({data:e}){try{let t=d(),n={model:e.model,method:"get_formview_action",ids:e.id?[e.id]:[],with_context:e.context};return t.requests.post("/call",n,{headers:{"Content-Type":"application/json"}})}catch(t){throw console.error("Error when fetching form view:",t),t}},async changeStatus({data:e}){let t=d(),n={[e.name]:e.stage_id},o={model:e.model,method:"web_save",with_context:{lang:e.lang,allowed_company_ids:[1],uid:2,search_default_my_ticket:true,search_default_is_open:true},ids:[e.id],kwargs:{vals:n,specification:{}}};return t.requests.post("/call",o,{headers:{"Content-Type":"application/json"}})}},C=L;var m=2,_={async getAll({data:e}){let t=d(),n=e.type=="calendar"?{fields:e?.fields}:e.fields&&e.fields.length>0&&e.groupby&&e.groupby.length>0&&e.groupby[0]?{fields:e.fields,groupby:e.groupby}:{count_limit:10001,order:e.sort,specification:e.specification},o={model:String(e.model),method:e.type=="calendar"?"search_read":n.fields&&n.groupby?"web_read_group":"web_search_read",ids:e.ids,with_context:e.context,kwargs:{domain:e.domain,limit:e.limit,offset:e.offset,...n}};return t?.requests.post("/call",o,{headers:{"Content-Type":"application/json"}})},async getList({model:e,ids:t=[],specification:n={},domain:o=[],offset:r,order:a,context:i={},limit:c=10}){let d$1=d(),l={model:e,method:"web_search_read",ids:t,with_context:i,kwargs:{specification:n,domain:o,limit:c,offset:r,order:a}};return d$1?.requests?.post("/call",l,{headers:{"Content-Type":"application/json"}})},async getDetail({ids:e=[],model:t,specification:n,context:o}){let r=d(),a={model:t,method:"web_read",ids:e,with_context:o,kwargs:{specification:n}};return r?.requests?.post("/call",a,{headers:{"Content-Type":"application/json"}})},async save({model:e,ids:t=[],data:n={},specification:o={},context:r={}}){let a=d(),i={model:e,method:"web_save",with_context:r,ids:t,kwargs:{vals:n,specification:o}};return a?.requests?.post("/call",i,{headers:{"Content-Type":"application/json"}})},async delete({ids:e=[],model:t}){let n=d(),o={model:t,method:"unlink",ids:e};return n?.requests?.post("/call",o,{headers:{"Content-Type":"application/json"}})},async onChange({ids:e=[],model:t,object:n,specification:o,context:r,fieldChange:a}){let i=d(),c={model:t,method:"onchange",ids:e,with_context:r,args:[n||{},a||[],o]};return i?.requests?.post("/call",c,{headers:{"Content-Type":"application/json"}})},async getListFieldsOnchange({model:e}){let t=d(),n={model:e,method:"get_fields_onchange"};return t?.requests?.post("/call",n,{headers:{"Content-Type":"application/json"}})},parseORMOdoo(e){for(let t in e)t==="display_name"&&delete e[t],!e[t]&&e[t]!==0?e[t]=false:e[t]==="Draft"&&(e[t]="/");return {...e}},toDataJS(e,t,n){for(let o in e)e[o]===false?t&&n?t?.models?.[n]?.[o]?.type!=="boolean"&&(e[o]=null):e[o]=null:e[o]==="/"?e[o]="Draft":e[o]!==false&&n!==void 0&&(t?.models?.[n]?.[o]?.type==="one2many"||t?.models?.[n]?.[o]?.type==="many2many")&&(e[o]=(e[o]??=[])?.map((r,a)=>{let i=t?.models?.[n]?.[o]?.relation;if(i!==void 0)if(t?.models?.[i])if(r?.length>=3){if(r[0]===2){delete e[o][a];return}return _.toDataJS({...r[m],id:`virtual_${a}`},t,i)}else return _.toDataJS(r,t,i);else if(r?.length>=3){if(!r[m]||r[0]===2){delete e[o][a];return}return r[m]}else return r}));return {...e}}},v=_;var D={async getProfile(){return d().requests.get("/userinfo",{headers:{"Content-Type":"application/x-www-form-urlencoded"}})},async getUser({context:e,id:t}){let n=d(),o={model:"res.users",method:"web_read",ids:[t],with_context:e,kwargs:{specification:{display_name:{},image_1920:{},name:{},login:{},email:{},password:{},visible_group_id:{fields:{id:{},display_name:{}}},company_id:{fields:{id:{},display_name:{}}}}}};return n.requests.post("/call",o,{headers:{"Content-Type":"application/json"}})},switchUserLocale:async({id:e,values:t})=>{let n=d(),o={model:"res.users",domain:[["id","=",e]],values:t};return n?.requests.post(c?.CREATE_UPDATE_PATH,o,{headers:{"Content-Type":"application/json"}})}},A=D;var q={async getView({model:e,views:t,context:n={},options:o={},aid:r}){let a=d(),i={load_filters:true,toolbar:true,action_id:r},c={model:e,method:"get_fields_view_v2",kwargs:{views:t,options:{...o,...i}},with_context:n};return a?.requests?.post("/call",c,{headers:{"Content-Type":"application/json"}})},async getMenu(e){let t=d(),n={model:"ir.ui.menu",method:"web_search_read",ids:[],with_context:e,kwargs:{specification:{active:{},name:{},is_display:{},sequence:{},complete_name:{},action:{fields:{display_name:{},type:{},binding_view_types:{}}},url_icon:{},web_icon:{},web_icon_data:{},groups_id:{fields:{full_name:{}},limit:40,order:""},display_name:{},child_id:{fields:{active:{},name:{},is_display:{},sequence:{},complete_name:{},action:{fields:{display_name:{},type:{},binding_view_types:{}}},url_icon:{},web_icon:{},web_icon_data:{},groups_id:{fields:{full_name:{}},limit:40,order:""},display_name:{},child_id:{fields:{active:{},name:{},is_display:{},sequence:{},complete_name:{},action:{fields:{display_name:{},type:{},binding_view_types:{}}},url_icon:{},web_icon:{},web_icon_data:{},groups_id:{fields:{full_name:{}},limit:40,order:""},display_name:{},child_id:{fields:{active:{},name:{},is_display:{},sequence:{},complete_name:{},action:{fields:{display_name:{},type:{},binding_view_types:{}}},url_icon:{},web_icon:{},web_icon_data:{},groups_id:{fields:{full_name:{}},limit:40,order:""},display_name:{},child_id:{fields:{},limit:40,order:""}},limit:40,order:""}},limit:40,order:""}},limit:40,order:""}},domain:["&",["is_display","=",true],"&",["active","=",true],["parent_id","=",false]]}};return t?.requests?.post("/call",n,{headers:{"Content-Type":"application/json"}})},async getSelectionItem({data:e}){let t=d(),n={model:e.model,ids:[],method:"get_data_select",with_context:e.context,kwargs:{count_limit:10001,domain:e.domain?e.domain:[],offset:0,order:"",specification:e?.specification??{id:{},name:{},display_name:{}}}};return t?.requests.post("/call",n,{headers:{"Content-Type":"application/json"}})},async loadMessages(){return d().requests.post("/load_message_failures",{},{headers:{"Content-Type":"application/json"}})},async getVersion(){return d()?.requests.get("",{headers:{"Content-Type":"application/json"}})}},T=q;export{f as a,h as b,g as c,w as d,C as e,v as f,A as g,T as h};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a as a$1}from'./chunk-CDLT5L7M.mjs';import {f,b as b$1,c,e,d,g,a as a$2,h}from'./chunk-QKRSQCY2.mjs';import {b as b$2,a,m}from'./chunk-6QAALOXO.mjs';import {useMutation,useQuery}from'@tanstack/react-query';import w,{useEffect}from'react';var ve=()=>useMutation({mutationFn:e=>b$1.forgotPassword(e)}),M=ve;var Ge=()=>useMutation({mutationFn:e=>b$1.getProviders(e?.db)}),P=Ge;var he=()=>useMutation({mutationFn:e=>b$1.isValidToken(e)}),A=he;var Pe=()=>useMutation({mutationFn:e=>b$1.login(e)}),I=Pe;var Ie=()=>useMutation({mutationFn:e=>b$1.loginSocial(e)}),b=Ie;var qe=()=>useMutation({mutationFn:e=>b$1.resetPassword(e.data,e.token)}),q=qe;var Oe=()=>useMutation({mutationFn:e=>b$1.updatePassword(e.data,e.token)}),E=Oe;var De=e=>{let[t,o]=w.useState(true),[r,s]=w.useState(false),[p,y]=w.useState(false),{invisible:x,required:l,readonly:F,onchangeData:f,rootField:G,index:xe,name:Fe}=e,ge=G?`${G?.name}.${xe}.${Fe}`:null;return useEffect(()=>{f&&Object.keys(f).length>0&&(s(typeof l=="object"?b$2(f,l):a(f,l)),o(b$2(f,x)),y(typeof l=="object"?b$2(f,F):a(f,F)));},[f]),{invisible:t,required:r,readonly:p,nameField:ge}},O=De;var Ue=()=>useMutation({mutationFn:e=>c.getInfoCompany(e)}),T=Ue;var Ve=()=>useMutation({mutationFn:()=>c.getCurrentCompany()}),D=Ve;var Be=()=>useMutation({mutationFn:({data:e$1})=>e.changeStatus({data:e$1})}),R=Be;var We=()=>useMutation({mutationFn:({data:e$1})=>e.deleteComment({data:e$1})}),U=We;var _e=({data:e$1,queryKey:t})=>useQuery({queryKey:t,queryFn:()=>e.getComment({data:e$1}).then(o=>{if(o)return o}),enabled:!!e$1.thread_id&&!isNaN(e$1.thread_id),refetchOnWindowFocus:false}),L=_e;var Ne=({data:e$1,queryKey:t,enabled:o})=>useQuery({queryKey:t,queryFn:()=>e.getFormView({data:e$1}).then(r=>{if(r)return r}),enabled:o,refetchOnWindowFocus:false}),V=Ne;var Je=({data:e$1,queryKey:t,src:o})=>useQuery({queryKey:t,queryFn:()=>e.getImage({data:e$1}).then(r=>{if(r)return r}),enabled:!o&&!m(o),refetchOnWindowFocus:false}),K=Je;var Ye=()=>useMutation({mutationFn:({data:e$1})=>e.sentComment({data:e$1})}),B=Ye;var Xe=()=>useMutation({mutationFn:({data:e$1})=>e.uploadImage({data:e$1})}),Q=Xe;var et=()=>useMutation({mutationFn:({model:e,domain:t,ids:o,fields:r,type:s,importCompat:p,context:y,groupby:x})=>d.exportExcel({model:e,domain:t,ids:o,fields:r,type:s,importCompat:p,context:y,groupby:x})}),W=et;var ot=()=>useMutation({mutationFn:({ids:e,model:t,isShow:o,parentField:r,fieldType:s,parentName:p,prefix:y,name:x,context:l,importCompat:F})=>d.getFieldExport({ids:e,model:t,isShow:o,parentField:r,fieldType:s,parentName:p,prefix:y,name:x,context:l,importCompat:F})}),k=ot;var nt=({model:e,context:t})=>useQuery({queryKey:[],queryFn:()=>d.getFileExcel({model:e,context:t}).then(o=>o||[]),refetchOnWindowFocus:false}),_=nt;var ut=()=>useMutation({mutationFn:({id:e,selectedSheet:t,isHeader:o,context:r})=>d.parsePreview({id:e,selectedSheet:t,isHeader:o,context:r})}),j=ut;var at=()=>useMutation({mutationFn:({formData:e})=>d.uploadFile({formData:e})}),N=at;var pt=()=>useMutation({mutationFn:({formData:e})=>d.uploadIdFile({formData:e})}),$=pt;var lt=()=>useMutation({mutationFn:({fields:e,columns:t,idFile:o,options:r,dryrun:s,context:p})=>d.executeImport({fields:e,columns:t,idFile:o,options:r,dryrun:s,context:p})}),J=lt;var ct=()=>useMutation({mutationFn:({ids:e,model:t})=>f.delete({ids:e,model:t})}),H=ct;var xt=({data:e,queryKey:t,viewResponse:o})=>useQuery({queryKey:t,queryFn:()=>f.getAll({data:e}).then(r=>{if(r)return r}),enabled:!!e.specification&&!!e.model&&!!e.domain&&!!o,refetchOnWindowFocus:false}),Y=xt;var gt=()=>useMutation({mutationFn:({model:e,ids:t,specification:o,context:r})=>f.getDetail({model:e,ids:t,specification:o,context:r})}),z=gt;var vt=({model:e})=>useQuery({queryKey:[`field-onchange-${e}`,e],queryFn:()=>f.getListFieldsOnchange({model:e}).then(t=>{if(t)return t}),refetchOnWindowFocus:false,staleTime:1/0}),X=vt;var wt=()=>({initModel:t=>{switch(t?.name){default:return new a$1(t)}}}),Z=wt;var Gt=()=>({toDataJS:f.toDataJS,parseORM:f.parseORMOdoo}),ee=Gt;var ht=()=>useMutation({mutationFn:({ids:e,model:t,specification:o,context:r,object:s,fieldChange:p})=>f.onChange({ids:e,model:t,specification:o,context:r,object:s,fieldChange:p})}),te=ht;var Pt=()=>useMutation({mutationFn:({ids:e,model:t,data:o,specification:r,context:s})=>f.save({ids:e,model:t,data:o,specification:r,context:s})}),oe=Pt;var It=()=>useMutation({mutationFn:()=>g.getProfile()}),re=It;var qt=()=>useMutation({mutationFn:({id:e,context:t})=>g.getUser({id:e,context:t})}),ne=qt;var Ot=()=>useMutation({mutationFn:({data:e})=>g.switchUserLocale({id:e.id,values:e.values})}),ie=Ot;var Dt=()=>useMutation({mutationFn:({model:e,ids:t,context:o,method:r})=>a$2.callButton({model:e,ids:t,context:o,method:r}),onSuccess:e=>e}),ue=Dt;var Ut=()=>useMutation({mutationFn:({id:e,model:t,context:o})=>a$2.duplicateRecord({id:e,model:t,context:o})}),me=Ut;var Vt=(e,t,o)=>useQuery({queryKey:t,queryFn:()=>f.getAll({data:e}).then(r=>r||[]),enabled:o,refetchOnWindowFocus:false,staleTime:0}),ae=Vt;var Bt=({context:e,enabled:t,queryKey:o})=>useQuery({queryKey:o,queryFn:async()=>{let r=await h.getMenu(e);return r?.records&&Array.isArray(r.records)&&r.records.length>0?r.records:[]},refetchOnWindowFocus:false,staleTime:1/0,enabled:t}),se=Bt;var Wt=({data:e,queryKey:t,enabled:o})=>useQuery({queryKey:t,queryFn:()=>h.getSelectionItem({data:e}),enabled:o,refetchOnWindowFocus:false}),pe=Wt;var _t=(e,t)=>useQuery({queryKey:["get_view_by_action",e],queryFn:()=>h.getView(e),enabled:!!t,refetchOnWindowFocus:false,staleTime:1/0}),fe=_t;var Nt=({idAction:e,context:t})=>useQuery({queryKey:["load_action",e],queryFn:()=>a$2.loadAction({idAction:e,context:t}),enabled:false,staleTime:1/0,gcTime:1/0}),le=Nt;var Jt=()=>useMutation({mutationFn:({id:e,report:t,db:o})=>a$2.print({id:e,report:t,db:o})}),de=Jt;var Yt=()=>useMutation({mutationFn:({model:e,ids:t,context:o})=>a$2.removeRows({model:e,ids:t,context:o})}),ce=Yt;var Xt=({idAction:e,context:t})=>useQuery({queryKey:["run_action",e],queryFn:()=>a$2.runAction({idAction:e,context:t}),enabled:false,staleTime:1/0,gcTime:1/0}),ye=Xt;export{z as A,X as B,Z as C,ee as D,te as E,oe as F,re as G,ne as H,ie as I,ue as J,me as K,ae as L,se as M,pe as N,fe as O,le as P,de as Q,ce as R,ye as S,M as a,P as b,A as c,I as d,b as e,q as f,E as g,O as h,T as i,D as j,R as k,U as l,L as m,V as n,K as o,B as p,Q as q,W as r,k as s,_ as t,j as u,N as v,$ as w,J as x,H as y,Y as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {h}from'./chunk-QKRSQCY2.mjs';import {fa}from'./chunk-4WC7TEQB.mjs';import {useState,useEffect}from'react';import {QueryClient,QueryClientProvider,useQueryClient}from'@tanstack/react-query';import {jsx,Fragment}from'react/jsx-runtime';import {Provider}from'react-redux';var n=({children:r})=>{let[i]=useState(()=>new QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:false,refetchOnMount:false,refetchOnReconnect:false,retry:false}}}));return jsx(QueryClientProvider,{client:i,children:r})};var c=({children:r})=>jsx(Provider,{store:fa,children:r});var l=({children:r})=>jsx(c,{children:jsx(n,{children:r})});var v=({children:r})=>{let i=useQueryClient(),[m,p]=useState(false);return useEffect(()=>{let a=()=>{i.clear(),localStorage.removeItem("__api_version__");};if((async()=>{let o=await h.getVersion();localStorage.getItem("__api_version__")!==o?.api_version?(a(),localStorage.setItem("__api_version__",o?.api_version)):console.log("Api version:",o?.api_version),p(true);})(),typeof window<"u"){let o=e=>{let t=e.key.toLowerCase();((t==="f5"||t==="r")&&e.ctrlKey&&(t!=="r"||e.shiftKey)||t==="r"&&e.metaKey&&e.shiftKey||t==="r"&&e.metaKey&&e.altKey)&&a();};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)}},[i]),m?jsx(Fragment,{children:r}):null};export{n as a,l as b,v as c};
|
package/dist/chunk-WAXGOBY2.mjs
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var u=(r=>(r.CHAR="char",r.TEXT="text",r.INTEGER="integer",r.FLOAT="float",r.BOOLEAN="boolean",r.DATE="date",r.DATETIME="datetime",r.BINARY="binary",r.SELECTION="selection",r.HTML="html",r.MANY2ONE="many2one",r.ONE2MANY="one2many",r.MANY2MANY="many2many",r.MONETARY="monetary",r.REFERENCE="reference",r.FUNCTION="function",r.PROPERTY="property",r))(u||{});var A=(a=>(a[a.CREATE=0]="CREATE",a[a.UPDATE=1]="UPDATE",a[a.DELETE=2]="DELETE",a[a.UNLINK=3]="UNLINK",a[a.NO_CHANGE=4]="NO_CHANGE",a))(A||{});var O=(E=>(E.MENU="ir.ui.menu",E.USER="res.users",E.COMPANY="res.company",E.WINDOW_ACTION="ir.actions.act_window",E.BASE_IMPORT="base_import.import",E.GET_IMPORT="get_import_templates",E))(O||{});var c=(m=>(m.TREE="tree",m.GROUP="group",m.LIST="list",m.FORM="form",m.FIELD="field",m.DIV="div",m.SPAN="span",m))(c||{}),t={FILTER:"filter_by",SEARCH:"search_by",GROUP:"group_by"};var R=(_=>(_.many2one_avatar_user="many2one_avatar_user",_.many2many_avatar_user="many2many_avatar_user",_))(R||{});var x=(_=>(_.many2many_tags="many2many_tags",_.helpdesk_sla_many2many_tags="helpdesk_sla_many2many_tags",_))(x||{});var I=(N=>(N.sla_status_ids="sla_status_ids",N))(I||{}),f=(N=>(N.sla_status_ids="sla_status_ids",N))(f||{});export{u as a,A as b,O as c,c as d,t as e,R as f,x as g,I as h,f as i};
|
package/dist/config.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
import './chunk-MLJQPO4Q.mjs';
|
|
1
|
+
export{c as axiosClient}from'./chunk-GHOANIO5.mjs';import'./chunk-3VUHHO7T.mjs';
|
package/dist/constants.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export { KeyConstants, MethodConstants, UriConstants } from './chunk-MLJQPO4Q.mjs';
|
|
1
|
+
export{d as ComponentType,a as FieldTypeConstants,b as MethodType,c as ModelConstants,e as SearchType,f as WIDGETAVATAR,g as WIDGETCOLOR,i as WIDGETNOSTRING,h as WIDGETSTATUS}from'./chunk-ZC4WZW6I.mjs';export{a as KeyConstants,b as MethodConstants,c as UriConstants}from'./chunk-3VUHHO7T.mjs';
|
package/dist/environment.mjs
CHANGED
|
@@ -1,4 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
import './chunk-QLUONJPQ.mjs';
|
|
3
|
-
import './chunk-227GQM56.mjs';
|
|
4
|
-
import './chunk-MLJQPO4Q.mjs';
|
|
1
|
+
export{a as EnvStore,b as env,d as getEnv,c as initEnv}from'./chunk-AT7T7PUJ.mjs';import'./chunk-4WC7TEQB.mjs';import'./chunk-GHOANIO5.mjs';import'./chunk-3VUHHO7T.mjs';
|
package/dist/hooks.mjs
CHANGED
|
@@ -1,9 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
import './chunk-HDWNBT3C.mjs';
|
|
3
|
-
import './chunk-QMO7DJNI.mjs';
|
|
4
|
-
import './chunk-MXBJCI62.mjs';
|
|
5
|
-
import './chunk-IGSNXETE.mjs';
|
|
6
|
-
import './chunk-QYYFZUNV.mjs';
|
|
7
|
-
import './chunk-QLUONJPQ.mjs';
|
|
8
|
-
import './chunk-227GQM56.mjs';
|
|
9
|
-
import './chunk-MLJQPO4Q.mjs';
|
|
1
|
+
export{J as useButton,k as useChangeStatus,y as useDelete,l as useDeleteComment,K as useDuplicateRecord,x as useExecuteImport,r as useExportExcel,h as useField,a as useForgotPassword,z as useGetAll,m as useGetComment,i as useGetCompanyInfo,j as useGetCurrentCompany,A as useGetDetail,s as useGetFieldExport,B as useGetFieldOnChange,t as useGetFileExcel,n as useGetFormView,o as useGetImage,L as useGetListData,M as useGetMenu,G as useGetProfile,b as useGetProvider,N as useGetSelection,H as useGetUser,O as useGetView,c as useIsValidToken,P as useLoadAction,d as useLoginCredential,e as useLoginSocial,C as useModel,D as useOdooDataTransform,E as useOnChangeForm,u as useParsePreview,Q as usePrint,R as useRemoveRow,f as useResetPassword,S as useRunAction,F as useSave,p as useSendComment,I as useSwitchLocale,g as useUpdatePassword,v as useUploadFile,w as useUploadIdFile,q as useUploadImage}from'./chunk-TWFPZEDT.mjs';import'./chunk-CDLT5L7M.mjs';import'./chunk-QKRSQCY2.mjs';import'./chunk-6QAALOXO.mjs';import'./chunk-ZC4WZW6I.mjs';import'./chunk-AT7T7PUJ.mjs';import'./chunk-4WC7TEQB.mjs';import'./chunk-GHOANIO5.mjs';import'./chunk-3VUHHO7T.mjs';
|
package/dist/index.mjs
CHANGED
|
@@ -1,12 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
export { use_button_default as useButton, use_change_status_default as useChangeStatus, use_delete_default as useDelete, use_delete_comment_default as useDeleteComment, use_duplicate_record_default as useDuplicateRecord, uss_execute_import_default as useExecuteImport, use_export_excel_default as useExportExcel, use_field_default as useField, use_forgot_password_default as useForgotPassword, use_get_all_default as useGetAll, use_get_comment_default as useGetComment, use_get_company_info_default as useGetCompanyInfo, use_get_current_company_default as useGetCurrentCompany, use_get_detail_default as useGetDetail, use_get_field_export_default as useGetFieldExport, use_get_field_onchange_default as useGetFieldOnChange, use_get_file_excel_default as useGetFileExcel, use_get_form_view_default as useGetFormView, use_get_image_default as useGetImage, use_get_list_data_default as useGetListData, use_get_menu_default as useGetMenu, use_get_profile_default as useGetProfile, use_get_provider_default as useGetProvider, use_get_selection_default as useGetSelection, use_get_user_default as useGetUser, use_get_view_default as useGetView, use_isvalid_token_default as useIsValidToken, use_load_action_default as useLoadAction, use_login_credential_default as useLoginCredential, use_login_socical_default as useLoginSocial, use_model_default as useModel, use_odoo_data_transform_default as useOdooDataTransform, use_onchange_form_default as useOnChangeForm, use_parse_preview_default as useParsePreview, use_print_default as usePrint, use_remove_row_default as useRemoveRow, use_reset_password_default as useResetPassword, use_run_action_default as useRunAction, use_save_default as useSave, use_send_comment_default as useSendComment, use_switch_locale_default as useSwitchLocale, use_update_password_default as useUpdatePassword, use_upload_file_default as useUploadFile, use_upload_id_file_default as useUploadIdFile, use_upload_image_default as useUploadImage } from './chunk-KYUV2PH4.mjs';
|
|
3
|
-
export { company_model_default as CompanyModel, user_model_default as UserModel } from './chunk-TT2ZKGNO.mjs';
|
|
4
|
-
export { base_model_default as BaseModel } from './chunk-HDWNBT3C.mjs';
|
|
5
|
-
export { MainProvider, ReactQueryProvider, VersionGate } from './chunk-A3OMRS6W.mjs';
|
|
6
|
-
export { action_service_default as ActionService, auth_service_default as AuthService, company_service_default as CompanyService, excel_service_default as ExcelService, form_service_default as FormService, model_service_default as ModelService, user_service_default as UserService, view_service_default as ViewService } from './chunk-QMO7DJNI.mjs';
|
|
7
|
-
export { checkIsImageLink, domainHelper, evalJSONContext, evalJSONDomain, formatFileSize, formatSortingString, formatUrlPath, getFieldsOnChange, getSubdomain, isBase64File, isBase64Image, removeUndefinedFields, stringToColor, toQueryString, useTabModel } from './chunk-MXBJCI62.mjs';
|
|
8
|
-
export { ComponentType, FieldTypeConstants, MethodType, ModelConstants, SearchType, WIDGETAVATAR, WIDGETCOLOR, WIDGETNOSTRING, WIDGETSTATUS } from './chunk-IGSNXETE.mjs';
|
|
9
|
-
export { EnvStore, env, getEnv, initEnv } from './chunk-QYYFZUNV.mjs';
|
|
10
|
-
export { clearSearchMap, envSlice, envStore, excelSlice, formSlice, listSlice, navbarSlice, profileSlice, removeKeyFromSearchMap, searchSlice, selectEnv, selectExcel, selectForm, selectList, selectNavbar, selectProfile, selectSearch, selectSearchMap, setAllowCompanies, setCompanies, setDataParse, setDataUser, setDefaultCompany, setDomainTable, setEnv, setEnvFile, setErrorData, setFieldTranslate, setFields, setFilterBy, setFirstDomain, setFormSubmitComponent, setGroupBy, setGroupByDomain, setHoveredIndexSearchList, setIdFile, setIndexRowTableModal, setIsFileLoaded, setIsShowModalTranslate, setIsShowingModalDetail, setLang, setListSubject, setLoadingImport, setMenuList, setModelSearch, setOrder, setPage, setPageLimit, setProfile, setSearchMap, setSearchString, setSelectedFile, setSelectedRowKeys, setSelectedTags, setTableHead, setTypeFieldsSearch, setUid, setUser, setViewDataStore, updateSearchMap, useAppDispatch, useAppSelector } from './chunk-QLUONJPQ.mjs';
|
|
11
|
-
export { axiosClient } from './chunk-227GQM56.mjs';
|
|
12
|
-
export { KeyConstants, MethodConstants, UriConstants } from './chunk-MLJQPO4Q.mjs';
|
|
1
|
+
import'./chunk-WAXGOBY2.mjs';export{J as useButton,k as useChangeStatus,y as useDelete,l as useDeleteComment,K as useDuplicateRecord,x as useExecuteImport,r as useExportExcel,h as useField,a as useForgotPassword,z as useGetAll,m as useGetComment,i as useGetCompanyInfo,j as useGetCurrentCompany,A as useGetDetail,s as useGetFieldExport,B as useGetFieldOnChange,t as useGetFileExcel,n as useGetFormView,o as useGetImage,L as useGetListData,M as useGetMenu,G as useGetProfile,b as useGetProvider,N as useGetSelection,H as useGetUser,O as useGetView,c as useIsValidToken,P as useLoadAction,d as useLoginCredential,e as useLoginSocial,C as useModel,D as useOdooDataTransform,E as useOnChangeForm,u as useParsePreview,Q as usePrint,R as useRemoveRow,f as useResetPassword,S as useRunAction,F as useSave,p as useSendComment,I as useSwitchLocale,g as useUpdatePassword,v as useUploadFile,w as useUploadIdFile,q as useUploadImage}from'./chunk-TWFPZEDT.mjs';export{a as CompanyModel,b as UserModel}from'./chunk-4HCNCH3K.mjs';export{a as BaseModel}from'./chunk-CDLT5L7M.mjs';export{b as MainProvider,a as ReactQueryProvider,c as VersionGate}from'./chunk-UBGANIIB.mjs';export{a as ActionService,b as AuthService,c as CompanyService,d as ExcelService,e as FormService,f as ModelService,g as UserService,h as ViewService}from'./chunk-QKRSQCY2.mjs';export{o as checkIsImageLink,f as domainHelper,c as evalJSONContext,d as evalJSONDomain,p as formatFileSize,e as formatSortingString,j as formatUrlPath,i as getFieldsOnChange,q as getSubdomain,m as isBase64File,n as isBase64Image,k as removeUndefinedFields,h as stringToColor,g as toQueryString,l as useTabModel}from'./chunk-6QAALOXO.mjs';export{d as ComponentType,a as FieldTypeConstants,b as MethodType,c as ModelConstants,e as SearchType,f as WIDGETAVATAR,g as WIDGETCOLOR,i as WIDGETNOSTRING,h as WIDGETSTATUS}from'./chunk-ZC4WZW6I.mjs';export{a as EnvStore,b as env,d as getEnv,c as initEnv}from'./chunk-AT7T7PUJ.mjs';export{ca as clearSearchMap,a as envSlice,fa as envStore,k as excelSlice,s as formSlice,B as listSlice,K as navbarSlice,N as profileSlice,aa as removeKeyFromSearchMap,Q as searchSlice,j as selectEnv,r as selectExcel,A as selectForm,J as selectList,M as selectNavbar,P as selectProfile,da as selectSearch,ea as selectSearchMap,e as setAllowCompanies,f as setCompanies,l as setDataParse,z as setDataUser,g as setDefaultCompany,I as setDomainTable,b as setEnv,i as setEnvFile,q as setErrorData,x as setFieldTranslate,D as setFields,X as setFilterBy,V as setFirstDomain,w as setFormSubmitComponent,ba as setGroupBy,R as setGroupByDomain,U as setHoveredIndexSearchList,m as setIdFile,G as setIndexRowTableModal,n as setIsFileLoaded,v as setIsShowModalTranslate,u as setIsShowingModalDetail,d as setLang,y as setListSubject,o as setLoadingImport,L as setMenuList,Z as setModelSearch,E as setOrder,H as setPage,C as setPageLimit,O as setProfile,_ as setSearchMap,T as setSearchString,p as setSelectedFile,F as setSelectedRowKeys,S as setSelectedTags,W as setTableHead,Y as setTypeFieldsSearch,c as setUid,h as setUser,t as setViewDataStore,$ as updateSearchMap,ga as useAppDispatch,ha as useAppSelector}from'./chunk-4WC7TEQB.mjs';export{c as axiosClient}from'./chunk-GHOANIO5.mjs';export{a as KeyConstants,b as MethodConstants,c as UriConstants}from'./chunk-3VUHHO7T.mjs';
|
package/dist/models.mjs
CHANGED
|
@@ -1,9 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export { base_model_default as BaseModel } from './chunk-HDWNBT3C.mjs';
|
|
3
|
-
import './chunk-QMO7DJNI.mjs';
|
|
4
|
-
import './chunk-MXBJCI62.mjs';
|
|
5
|
-
import './chunk-IGSNXETE.mjs';
|
|
6
|
-
import './chunk-QYYFZUNV.mjs';
|
|
7
|
-
import './chunk-QLUONJPQ.mjs';
|
|
8
|
-
import './chunk-227GQM56.mjs';
|
|
9
|
-
import './chunk-MLJQPO4Q.mjs';
|
|
1
|
+
export{a as CompanyModel,b as UserModel}from'./chunk-4HCNCH3K.mjs';export{a as BaseModel}from'./chunk-CDLT5L7M.mjs';import'./chunk-QKRSQCY2.mjs';import'./chunk-6QAALOXO.mjs';import'./chunk-ZC4WZW6I.mjs';import'./chunk-AT7T7PUJ.mjs';import'./chunk-4WC7TEQB.mjs';import'./chunk-GHOANIO5.mjs';import'./chunk-3VUHHO7T.mjs';
|
package/dist/provider.mjs
CHANGED
|
@@ -1,8 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
import './chunk-QMO7DJNI.mjs';
|
|
3
|
-
import './chunk-MXBJCI62.mjs';
|
|
4
|
-
import './chunk-IGSNXETE.mjs';
|
|
5
|
-
import './chunk-QYYFZUNV.mjs';
|
|
6
|
-
import './chunk-QLUONJPQ.mjs';
|
|
7
|
-
import './chunk-227GQM56.mjs';
|
|
8
|
-
import './chunk-MLJQPO4Q.mjs';
|
|
1
|
+
export{b as MainProvider,a as ReactQueryProvider,c as VersionGate}from'./chunk-UBGANIIB.mjs';import'./chunk-QKRSQCY2.mjs';import'./chunk-6QAALOXO.mjs';import'./chunk-ZC4WZW6I.mjs';import'./chunk-AT7T7PUJ.mjs';import'./chunk-4WC7TEQB.mjs';import'./chunk-GHOANIO5.mjs';import'./chunk-3VUHHO7T.mjs';
|
package/dist/services.mjs
CHANGED
|
@@ -1,7 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
import './chunk-MXBJCI62.mjs';
|
|
3
|
-
import './chunk-IGSNXETE.mjs';
|
|
4
|
-
import './chunk-QYYFZUNV.mjs';
|
|
5
|
-
import './chunk-QLUONJPQ.mjs';
|
|
6
|
-
import './chunk-227GQM56.mjs';
|
|
7
|
-
import './chunk-MLJQPO4Q.mjs';
|
|
1
|
+
export{a as ActionService,b as AuthService,c as CompanyService,d as ExcelService,e as FormService,f as ModelService,g as UserService,h as ViewService}from'./chunk-QKRSQCY2.mjs';import'./chunk-6QAALOXO.mjs';import'./chunk-ZC4WZW6I.mjs';import'./chunk-AT7T7PUJ.mjs';import'./chunk-4WC7TEQB.mjs';import'./chunk-GHOANIO5.mjs';import'./chunk-3VUHHO7T.mjs';
|
package/dist/store.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export{ca as clearSearchMap,a as envSlice,fa as envStore,k as excelSlice,s as formSlice,B as listSlice,K as navbarSlice,N as profileSlice,aa as removeKeyFromSearchMap,Q as searchSlice,j as selectEnv,r as selectExcel,A as selectForm,J as selectList,M as selectNavbar,P as selectProfile,da as selectSearch,ea as selectSearchMap,e as setAllowCompanies,f as setCompanies,l as setDataParse,z as setDataUser,g as setDefaultCompany,I as setDomainTable,b as setEnv,i as setEnvFile,q as setErrorData,x as setFieldTranslate,D as setFields,X as setFilterBy,V as setFirstDomain,w as setFormSubmitComponent,ba as setGroupBy,R as setGroupByDomain,U as setHoveredIndexSearchList,m as setIdFile,G as setIndexRowTableModal,n as setIsFileLoaded,v as setIsShowModalTranslate,u as setIsShowingModalDetail,d as setLang,y as setListSubject,o as setLoadingImport,L as setMenuList,Z as setModelSearch,E as setOrder,H as setPage,C as setPageLimit,O as setProfile,_ as setSearchMap,T as setSearchString,p as setSelectedFile,F as setSelectedRowKeys,S as setSelectedTags,W as setTableHead,Y as setTypeFieldsSearch,c as setUid,h as setUser,t as setViewDataStore,$ as updateSearchMap,ga as useAppDispatch,ha as useAppSelector}from'./chunk-4WC7TEQB.mjs';
|
package/dist/types.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import'./chunk-WAXGOBY2.mjs';
|
package/dist/utils.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export{o as checkIsImageLink,f as domainHelper,c as evalJSONContext,d as evalJSONDomain,p as formatFileSize,e as formatSortingString,j as formatUrlPath,i as getFieldsOnChange,q as getSubdomain,m as isBase64File,n as isBase64Image,k as removeUndefinedFields,h as stringToColor,g as toQueryString,l as useTabModel}from'./chunk-6QAALOXO.mjs';
|
package/package.json
CHANGED
|
@@ -1,90 +1,79 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@fctc/edu-logic-lib",
|
|
3
|
-
"version": "1.2.
|
|
4
|
-
"types": "dist/index.d.ts",
|
|
5
|
-
"main": "dist/index.
|
|
6
|
-
"module": "dist/index.mjs",
|
|
7
|
-
"sideEffects": false,
|
|
8
|
-
"exports": {
|
|
9
|
-
".": {
|
|
10
|
-
"types": "./dist/index.d.ts",
|
|
11
|
-
"import": "./dist/index.mjs"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
},
|
|
29
|
-
"./
|
|
30
|
-
"types": "./dist/
|
|
31
|
-
"import": "./dist/
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
},
|
|
49
|
-
"./
|
|
50
|
-
"types": "./dist/
|
|
51
|
-
"import": "./dist/
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
"
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
},
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
"
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
"react-redux": "^9.2.0"
|
|
81
|
-
},
|
|
82
|
-
"devDependencies": {
|
|
83
|
-
"@types/react": "^18.3.1",
|
|
84
|
-
"jest": "^29.7.0",
|
|
85
|
-
"react": "18.0.0",
|
|
86
|
-
"tsup": "^8.0.0",
|
|
87
|
-
"typescript": "^5.8.2"
|
|
88
|
-
},
|
|
89
|
-
"packageManager": "yarn@1.22.0"
|
|
90
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@fctc/edu-logic-lib",
|
|
3
|
+
"version": "1.2.1",
|
|
4
|
+
"types": "dist/index.d.ts",
|
|
5
|
+
"main": "dist/index.mjs",
|
|
6
|
+
"module": "dist/index.mjs",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.mjs"
|
|
12
|
+
},
|
|
13
|
+
"./config": {
|
|
14
|
+
"types": "./dist/config.d.ts",
|
|
15
|
+
"import": "./dist/config.mjs"
|
|
16
|
+
},
|
|
17
|
+
"./constants": {
|
|
18
|
+
"types": "./dist/constants.d.ts",
|
|
19
|
+
"import": "./dist/constants.mjs"
|
|
20
|
+
},
|
|
21
|
+
"./environment": {
|
|
22
|
+
"types": "./dist/environment.d.ts",
|
|
23
|
+
"import": "./dist/environment.mjs"
|
|
24
|
+
},
|
|
25
|
+
"./hooks": {
|
|
26
|
+
"types": "./dist/hooks.d.ts",
|
|
27
|
+
"import": "./dist/hooks.mjs"
|
|
28
|
+
},
|
|
29
|
+
"./models": {
|
|
30
|
+
"types": "./dist/models.d.ts",
|
|
31
|
+
"import": "./dist/models.mjs"
|
|
32
|
+
},
|
|
33
|
+
"./provider": {
|
|
34
|
+
"types": "./dist/provider.d.ts",
|
|
35
|
+
"import": "./dist/provider.mjs"
|
|
36
|
+
},
|
|
37
|
+
"./services": {
|
|
38
|
+
"types": "./dist/services.d.ts",
|
|
39
|
+
"import": "./dist/services.mjs"
|
|
40
|
+
},
|
|
41
|
+
"./store": {
|
|
42
|
+
"types": "./dist/store.d.ts",
|
|
43
|
+
"import": "./dist/store.mjs"
|
|
44
|
+
},
|
|
45
|
+
"./types": {
|
|
46
|
+
"types": "./dist/types.d.ts",
|
|
47
|
+
"import": "./dist/types.mjs"
|
|
48
|
+
},
|
|
49
|
+
"./utils": {
|
|
50
|
+
"types": "./dist/utils.d.ts",
|
|
51
|
+
"import": "./dist/utils.mjs"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"files": [
|
|
55
|
+
"dist"
|
|
56
|
+
],
|
|
57
|
+
"scripts": {
|
|
58
|
+
"build": "tsup",
|
|
59
|
+
"test": "jest"
|
|
60
|
+
},
|
|
61
|
+
"peerDependencies": {
|
|
62
|
+
"react": "18.0.0",
|
|
63
|
+
"@tanstack/react-query": "^5.83.0"
|
|
64
|
+
},
|
|
65
|
+
"dependencies": {
|
|
66
|
+
"@reduxjs/toolkit": "^2.8.2",
|
|
67
|
+
"@tanstack/react-query": "^5.83.0",
|
|
68
|
+
"axios": "^1.11.0",
|
|
69
|
+
"react-redux": "^9.2.0"
|
|
70
|
+
},
|
|
71
|
+
"devDependencies": {
|
|
72
|
+
"@types/react": "^18.3.1",
|
|
73
|
+
"jest": "^29.7.0",
|
|
74
|
+
"react": "18.0.0",
|
|
75
|
+
"tsup": "^8.0.0",
|
|
76
|
+
"typescript": "^5.8.2"
|
|
77
|
+
},
|
|
78
|
+
"packageManager": "yarn@1.22.0"
|
|
79
|
+
}
|