isite 2023.1.1 → 2023.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1375,7 +1375,7 @@ site.quee('sync event name 2', { name: 'x2' });
1375
1375
  - This Framework Free for Education and Supported For Ever
1376
1376
  - This Framework Upgraded Arround the Clock
1377
1377
  - This Framework Development by One Developer
1378
- - For Producation Contract what's up (+201090061266)
1378
+ - For Producation Contract what's up (+966568118373)
1379
1379
 
1380
1380
  # Contact Me
1381
1381
 
@@ -1384,4 +1384,4 @@ site.quee('sync event name 2', { name: 'x2' });
1384
1384
  - Linkedin : https://www.linkedin.com/in/absunstar
1385
1385
  - Github : https://github.com/absunstar
1386
1386
  - Paypal : https://paypal.me/absunstar
1387
- - What's up: +201090061266
1387
+ - What's up: +966568118373
@@ -207,14 +207,16 @@
207
207
  font-size: xx-large !important;
208
208
  }
209
209
 
210
- .rtl, .rtl input{
210
+ .rtl,
211
+ .rtl input {
211
212
  direction: rtl;
212
213
  }
213
-
214
- .ltr , .ltr input{
214
+
215
+ .ltr,
216
+ .ltr input {
215
217
  direction: ltr;
216
218
  }
217
-
219
+
218
220
  .height-auto {
219
221
  height: auto !important;
220
222
  }
@@ -249,6 +251,14 @@
249
251
  white-space: pre-wrap;
250
252
  }
251
253
 
254
+ .currency {
255
+ font-size: smaller;
256
+ font-weight: bold;
257
+ color: black;
258
+ text-shadow: 0 0 white;
259
+ text-transform: uppercase;
260
+ }
261
+
252
262
  .ww {
253
263
  width: 250px !important;
254
264
  white-space: pre-line !important;
@@ -4,8 +4,8 @@
4
4
  border-radius: 10px;
5
5
  }
6
6
  .logo {
7
- width: 48px;
8
- height: 48px;
7
+ width: 48px !important;
8
+ height: 48px !important;
9
9
  border-radius: 5px;
10
10
  }
11
11
 
@@ -16,8 +16,8 @@ i-image {
16
16
  border: var(--i-image-border);
17
17
  }
18
18
  i-image img {
19
- width: 256px;
20
- height: 256px;
19
+ width: auto;
20
+ min-height: 32px;
21
21
  object-fit: fill;
22
22
  background-size: contain;
23
23
  background-position: center;
@@ -30,23 +30,62 @@ i-image.full img {
30
30
  padding: 5px;
31
31
  }
32
32
 
33
+ i-image.img32 {
34
+ width: 32px !important;
35
+ height: 32px !important;
36
+ min-width: 32px !important;
37
+ min-height: 32px !important;
38
+ padding: 1px !important;
39
+ }
33
40
  i-image.img32 img {
34
- width: 32px;
35
- height: 32px;
41
+ width: 30px !important;
42
+ height: 30px !important;
43
+ min-width: 30px !important;
44
+ min-height: 30px !important;
45
+ }
46
+
47
+ i-image.img48 {
48
+ width: 48px !important;
49
+ height: 48px !important;
50
+ min-width: 48px !important;
51
+ min-height: 48px !important;
52
+ padding: 2px !important;
36
53
  }
37
- i-image.logo img,
38
54
  i-image.img48 img {
39
- width: 48px;
40
- height: 48px;
55
+ width: 44px !important;
56
+ height: 44px !important;
57
+ min-width: 44px !important;
58
+ min-height: 44px !important;
59
+ }
60
+
61
+ i-image.img64 {
62
+ width: 64px !important;
63
+ height: 64px !important;
64
+ min-width: 64px !important;
65
+ min-height: 64px !important;
66
+ padding: 2px !important;
41
67
  }
42
68
  i-image.img64 img {
43
- width: 64px;
44
- height: 64px;
69
+ width: 60px !important;
70
+ height: 60px !important;
71
+ min-width: 60px !important;
72
+ min-height: 60px !important;
73
+ }
74
+
75
+ i-image.img128 {
76
+ width: 128px !important;
77
+ height: 128px !important;
78
+ min-width: 128px !important;
79
+ min-height: 128px !important;
80
+ padding: 3px !important;
45
81
  }
46
82
  i-image.img128 img {
47
- width: 64px;
48
- height: 64px;
83
+ width: 122px !important;
84
+ height: 122px !important;
85
+ min-width: 122px !important;
86
+ min-height: 122px !important;
49
87
  }
88
+
50
89
  i-image.img256 {
51
90
  width: 256px !important;
52
91
  height: 256px !important;
@@ -13,7 +13,7 @@
13
13
 
14
14
  .table tr {
15
15
  border-bottom: var(--table-border);
16
- transition: all 0.3s ease;
16
+ transition: all 0.1s ease;
17
17
  }
18
18
 
19
19
  .table.hover tr:hover {
@@ -2,11 +2,11 @@
2
2
  display: inline-block;
3
3
  padding: 5px;
4
4
  width: 100%;
5
- transition: all 0.5s ease;
5
+ transition: all 0.1s ease;
6
6
  }
7
7
  .links .tabs{
8
8
  display: none;
9
- transition: all 0.5s ease;
9
+ transition: all 0.1s ease;
10
10
  }
11
11
  .links .tabs .tabs-header{
12
12
  width: 100%;
@@ -29,7 +29,7 @@
29
29
  outline: none;
30
30
  cursor: pointer;
31
31
  padding: 10px 12px;
32
- transition: 0.3s;
32
+ transition: 0.1s;
33
33
  font-size: var(--tabs-header-link-font-size);
34
34
  font-weight: var(--tabs-header-link-font-weight);
35
35
  color: var(--tabs-header-link-color);
@@ -6,7 +6,7 @@
6
6
 
7
7
  <div class="dropdown-content">
8
8
  <div class="padding" ng-show="showSearch">
9
- <input class="full-width search form-control" ng-model="ngSearch" />
9
+ <input class="full-width search form-control" />
10
10
  </div>
11
11
 
12
12
  <div class="dropdown-item row" ng-repeat="item in items | filter:{ $display : ngSearch}" ng-click="updateModel(item)">
@@ -11,6 +11,6 @@
11
11
 
12
12
  <br /><br />
13
13
  <p>call us on facebook <a href="https://www.facebook.com/SmartCodeCompany"> Smart Code Company Page </a></p>
14
- <p>call us on what's up ( +201090061266 )</p>
14
+ <p>call us on what's up ( +966568118373 )</p>
15
15
  </body>
16
16
  </html>
@@ -140,7 +140,16 @@ app.directive('iButton', function () {
140
140
  } else if ($scope.type.like('*save*')) {
141
141
  $scope.fa = 'fas fa-save';
142
142
  $scope.class = 'btn-success';
143
- } else if ($scope.type.like('*view*') || $scope.type.like('*details*')) {
143
+ } else if ($scope.type.like('*list*')) {
144
+ $scope.fa = 'fas fa-list';
145
+ $scope.class = 'btn-info';
146
+ } else if ($scope.type.like('unapprove')) {
147
+ $scope.fa = 'fas fa-eject';
148
+ $scope.class = 'btn-danger';
149
+ } else if ($scope.type.like('approve')) {
150
+ $scope.fa = 'fas fa-check-double';
151
+ $scope.class = 'btn-primary';
152
+ }else if ($scope.type.like('*view*') || $scope.type.like('*details*')) {
144
153
  $scope.fa = 'fas fa-eye';
145
154
  $scope.class = 'btn-info';
146
155
  } else if ($scope.type.like('*delete*') || $scope.type.like('*remove*')) {
@@ -203,6 +212,7 @@ app.directive('iList', [
203
212
  ngModel: '=',
204
213
  ngSearch: '=',
205
214
  ngChange: '&',
215
+ ngGet: '&',
206
216
  ngAdd: '&',
207
217
  items: '=',
208
218
  },
@@ -228,13 +238,15 @@ app.directive('iList', [
228
238
  $scope.fa_add = 'fa-plus';
229
239
  }
230
240
 
231
- if (typeof attrs.ngSearch == 'undefined') {
232
- $scope.showSearch = !1;
233
- } else {
241
+
242
+ if ($scope.ngSearch) {
243
+ $scope.showSearch = !0;
244
+ }
245
+ if ($scope.ngGet) {
234
246
  $scope.showSearch = !0;
235
247
  }
236
248
 
237
- let input = $(element).find('input');
249
+ let input = $(element).find('input.dropdown-text');
238
250
  $(element).hover(
239
251
  () => {
240
252
  $scope.popupElement.css('display', 'block');
@@ -332,6 +344,17 @@ app.directive('iList', [
332
344
  }
333
345
  });
334
346
 
347
+ $scope.searchElement.on('input' , ()=>{
348
+ $timeout(() => {
349
+ if ($scope.ngGet) {
350
+ $scope.ngGet({ $search: $scope.searchElement.val() });
351
+ } else if ($scope.ngSearch) {
352
+ $scope.ngSearch = $scope.searchElement.val();
353
+ }
354
+ }, 100);
355
+ })
356
+
357
+
335
358
  $scope.updateModel = function (item) {
336
359
  $scope.ngModel = $scope.getNgValue(item, $scope.ngValue);
337
360
  if ($scope.display2) {
@@ -1005,7 +1028,7 @@ app.directive('iTreeview', [
1005
1028
  v_node.nodes = v_node.nodes || [];
1006
1029
 
1007
1030
  nodes.forEach((node) => {
1008
- node.$parent_id = node.parent_id || node.parentId ||0;
1031
+ node.$parent_id = node.parent_id || node.parentId || 0;
1009
1032
  if (node.$parent_id == v_node.id) {
1010
1033
  node.v_display = node.v_display || '';
1011
1034
  node.v_display += node[attrs.display];
@@ -585,14 +585,15 @@
585
585
  };
586
586
 
587
587
  site.showTabContent = function (e, tabContentSelector) {
588
- let tabcontents = document.querySelectorAll('.tab-content');
589
- for (i = 0; i < tabcontents.length; i++) {
590
- tabcontents[i].style.display = 'none';
591
- }
592
- let tablinks = document.querySelectorAll('.tab-link');
593
- for (i = 0; i < tablinks.length; i++) {
594
- tablinks[i].className = tablinks[i].className.replace(' active', '');
595
- }
588
+ let parent = document.querySelector(tabContentSelector).parentNode.parentNode;
589
+
590
+ parent.querySelectorAll('.tab-content').forEach((tabContent) => {
591
+ tabContent.style.display = 'none';
592
+ });
593
+ parent.querySelectorAll('.tab-link').forEach((tabLink) => {
594
+ tabLink.className = tabLink.className.replace(' active', '');
595
+ });
596
+
596
597
  document.querySelectorAll(tabContentSelector + '.tab-content').forEach((el) => {
597
598
  el.style.display = 'block';
598
599
  });
@@ -1 +1 @@
1
- (function(e,t,n,r){function o(e){return e?("string"!=typeof e&&(e=e.toString()),e.replace(/[\/\\^$*+?.()\[\]{}]/g,"\\$&")):""}function a(e,t){let n="";return g.forEach(r=>{r.n==e&&(n=r.i0[t])}),n}function s(e,t){let n="";return 11==e?g.forEach(r=>{r.n==e&&(n=r.i0[t])}):12==e?g.forEach(r=>{r.n==e&&(n=r.i0[t])}):(g.forEach(r=>{r.n==e[1]&&(n=r.i0[t])}),g.forEach(r=>{r.n==e[0]&&(e[1]>0&&e[0]>1?n+=p.strings.space[t]+p.strings.and[t]:n+="",n+=r.i1[t])})),n}function l(e,t){let n="";g.forEach(r=>{r.n==e[0]&&(n=r.i2[t]+p.strings.space[t])});let r=s(e.substring(1),t);return r&&(n&&(n+=p.strings.and[t]),n+=r),n}function c(e,t){let n="";g.forEach(r=>{r.n==e[0]&&(n=r.i3[t]+p.strings.space[t])});let r=l(e.substring(1),t);return r&&(n&&(n+=p.strings.and[t]),n+=r),n}function u(e,t){let n=s(e.substring(0,2),t)+p.strings.space[t];1==e[0]?n+=p.strings[10][t]+p.strings.space[t]:n+=p.strings[20][t]+p.strings.space[t];let r=l(e.substring(2),t);return r&&(n+=p.strings.and[t]+r),n}function d(e,t){let n=l(e.substring(0,3),t)+p.strings.space[t];n+=p.strings[100][t]+p.strings.space[t];let r=l(e.substring(3),t);return r&&(n+=p.strings.and[t]+r),n}if(String.prototype.test||(String.prototype.test=function(e,t="gium"){try{return new RegExp(e,t).test(this)}catch(e){return!1}}),String.prototype.like||(String.prototype.like=function(e){if(!e)return!1;let t=!1;return e.split("|").forEach(e=>{e=e.split("*"),e.forEach((t,n)=>{e[n]=o(t)}),e=e.join(".*"),this.test("^"+e+"$","gium")&&(t=!0)}),t}),String.prototype.contains||(String.prototype.contains=function(e){let t=!1;return e?(e.split("|").forEach(e=>{e&&this.test("^.*"+o(e)+".*$","gium")&&(t=!0)}),t):t}),e.SOCIALBROWSER){if(SOCIALBROWSER.var=SOCIALBROWSER.var||{},SOCIALBROWSER.var.white_list=SOCIALBROWSER.var.white_list||[],t.location.hostname){let e=`*${t.location.hostname}*`,n=!1;SOCIALBROWSER.var.white_list.forEach(t=>{t.url==e&&(n=!0)}),n||(SOCIALBROWSER.var.white_list.push({url:e}),SOCIALBROWSER.call("set_var",{name:"white_list",data:SOCIALBROWSER.var.white_list}))}SOCIALBROWSER.var.blocking=SOCIALBROWSER.var.blocking||{},SOCIALBROWSER.var.blocking.block_ads=!1,SOCIALBROWSER.var.blocking.block_empty_iframe=!1,SOCIALBROWSER.var.blocking.remove_external_iframe=!1,SOCIALBROWSER.var.blocking.skip_video_ads=!1,SOCIALBROWSER.var.blocking.popup=SOCIALBROWSER.var.blocking.popup||{},SOCIALBROWSER.var.blocking.popup.allow_external=!0,SOCIALBROWSER.var.blocking.popup.allow_internal=!0,SOCIALBROWSER.var.blocking.javascript=SOCIALBROWSER.var.blocking.javascript||{},SOCIALBROWSER.var.blocking.javascript.block_window_open=!1,SOCIALBROWSER.var.blocking.javascript.block_eval=!1,SOCIALBROWSER.var.blocking.javascript.block_console_output=!1}let p={onLoad:function(e){"loading"!==t.readyState?e():t.addEventListener("DOMContentLoaded",()=>{e()})}};p.zoomNumber=parseInt(localStorage.getItem("zoomNumber")||100),p.zoom=function(e){"+"==e?p.zoomNumber+=25:"-"==e?p.zoomNumber-=25:"0"==e||(p.zoomNumber=100),localStorage.setItem("zoomNumber",p.zoomNumber.toString()),t.body.style.zoom=p.zoomNumber+"%"},p.onLoad(()=>{p.zoom("0")}),p.printerList=[],p.getPrinters=function(){return e.SOCIALBROWSER&&SOCIALBROWSER.currentWindow.webContents.getPrintersAsync?SOCIALBROWSER.currentWindow.webContents.getPrintersAsync().then(e=>{p.printerList=e}):e.SOCIALBROWSER&&SOCIALBROWSER.currentWindow.webContents.getPrinters?p.printerList=SOCIALBROWSER.currentWindow.webContents.getPrinters():fetch("http://127.0.0.1:60080/printers/all").then(e=>e.json()).then(e=>{p.printerList=e.list}).catch(e=>{p.printerList=[]}),p.printerList},p.render=function(e,n){let r=t.querySelector(e);return r?Mustache.render(r.innerHTML,n):""},p.html=function(e,t){return Mustache.render(e,t)},p.getUniqueObjects=function(e,t){const n=e.map(e=>e[t]).map((e,t,n)=>n.indexOf(e)===t&&t).filter(t=>e[t]).map(t=>e[t]);return n},p.$=function(e){let n=t.querySelectorAll(e);return n},p.modal_z_index=999999,p.showModal=function(t){r(t).click(()=>{r("popup").hide()}),p.modal_z_index++;let n=p.$(t);if(0===n.length)return;n[0].style.zIndex=p.modal_z_index,n[0].style.display="block";let o=n[0].getAttribute("fixed");""!==o&&n[0].addEventListener("click",function(){p.hideModal(t)});let a=p.$(t+" i-control input");a.length>0&&a[0].focus(),p.$(t+" .close").forEach(e=>{e.addEventListener("click",function(){p.hideModal(t)})}),p.$(t+" .modal-header").forEach(t=>{t.addEventListener("click",function(t){t=t||e.event,t.stopPropagation()})}),p.$(t+" .modal-body").forEach(t=>{t.addEventListener("click",function(t){t=t||e.event,t.stopPropagation()})}),p.$(t+" .modal-footer").forEach(t=>{t.addEventListener("click",function(t){t=t||e.event,t.stopPropagation()})})},p.hideModal=function(e){r("popup").hide();let t=p.$(e);t.length>0&&(t[0].style.display="none")},p.eventList=[],p.on=function(e,t){t=t||function(){},p.eventList.push({name:e,callback:t})},p.call=function(e,t){for(var n=0;n<p.eventList.length;n++){var r=p.eventList[n];r.name==e&&r.callback(t)}},p.translate=function(e,t){"string"==typeof e&&(e={text:e,lang:"ar"}),e.url=`https://translate.googleapis.com/translate_a/single?client=gtx&sl=auto&tl=${e.lang}&dt=t&dt=bd&dj=1&q=${e.text}`,p.getData(e,t)},p.getData=function(e,t,n){t=t||function(){},n=n||function(){},"string"==typeof e&&(e={url:e}),e.headers=e.headers||{Accept:"application/json","Content-Type":"application/json"},e.url=p.handle_url(e.url),fetch(e.url,{mode:"cors",method:"get",headers:e.headers}).then(e=>e.json()).then(e=>{t(e)}).catch(e=>{n(e)})},p.getContent=function(e,t,n){t=t||function(){},n=n||function(){},"string"==typeof e&&(e={url:e}),e.url=p.handle_url(e.url),fetch(e.url,{mode:"cors",method:"get"}).then(function(e){return e.text()}).then(function(e){t(e)})},p.handle_url=function(t){if("string"!=typeof t)return t;if(t=t.trim(),t.like("http*")||0===t.indexOf("//")||0===t.indexOf("data:"))t=t;else if(0===t.indexOf("/"))t=e.location.origin+t;else if(t.split("?")[0].split(".").length<3){let n=e.location.pathname.split("/").pop();t=e.location.origin+e.location.pathname.replace(n,"")+t}return t},p.postData=function(e,n,r){n=n||function(){},r=r||function(){},"string"==typeof e&&(e={url:e}),e.data=e.data||e.body,delete e.body,e.data&&"object"==typeof e.data&&(e.data=JSON.stringify(e.data)),e.headers=e.headers||{Accept:"application/json","Content-Type":"application/json"},e.data&&"string"==typeof e.data&&(e.headers["Content-Length"]=e.data.length.toString());try{e.headers.Cookie=t.cookie}catch(r){console.log(r)}e.method="post",e.redirect="follow",e.mode="cors",e.url=p.handle_url(e.url),fetch(e.url,{mode:e.mode,method:e.method,headers:e.headers,body:e.data,redirect:e.redirect}).then(e=>e.json()).then(e=>{n(e)}).catch(e=>{r(e)})},p.typeOf=function(e){return Object.prototype.toString.call(e).slice(8,-1)},p.toDateTime=function(e){return e?new Date(e):new Date},p.toDateX=function(e){let t=p.toDateTime(e);return t.getFullYear()+"-"+(t.getMonth()+1)+"-"+t.getDate()},p.toDateXT=function(e){let t=p.toDateTime(e);return t.getHours()+":"+t.getMinutes()+":"+t.getSeconds()},p.toDateXF=function(e){let t=p.toDateTime(e);return t.getFullYear()+"-"+(t.getMonth()+1)+"-"+t.getDate()+" "+t.getHours()+":"+t.getMinutes()+":"+t.getSeconds()},p.toDateOnly=function(e){let t=p.toDateTime(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0)},p.toDateT=function(e){return p.toDateOnly(e).getTime()},p.toDateF=function(e){return p.toDateTime(e).getTime()},p.addZero=function(e,t){let n=t-e.toString().length;for(let t=0;t<n;t++)e="0"+e.toString();return e},p.addSubZero=function(e,t){let n=t;if(2==e.toString().split(".").length){e.toString().split(".")[1].length;e=e.toString()}else e=e.toString()+".";for(let t=0;t<n;t++)e=e.toString()+0;return e},p.fixed=3,p.to_number=p.toNumber=function(e,t){let n=t||p.fixed,r=0;return e&&(r=parseFloat(e).toFixed(n)),parseFloat(r)},p.to_money=p.toMoney=function(e,t=!0){let n=0;if(e){e=e.toFixed(2).split(".");e[0];let t=e[1]||"00";if(t){let n=t[0]||"0",r=t[1]||"0";r&&parseInt(r)>5?(n=parseInt(n)+1,n*=10,100==n?(n=0,e[0]=parseInt(e[0])+1,e[1]=""):e[1]=n):r&&5==parseInt(r)?e[1]=t:r&&parseInt(r)>2?(r=5,e[1]=n+r):e[1]=n+"0"}n=e.join(".")}return t?p.to_float(n):(n&&n.endsWith(".")&&(n+="00"),n)},p.to_float=p.toFloat=function(e){return e?parseFloat(e):0},p.to_int=p.toInt=function(e){return e?parseInt(e):0},p.$base64Letter="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",p.$base64Numbers=[];for(let e=11;e<99;e++)e%10!=0&&e%11!=0&&p.$base64Numbers.push(e);p.toJson=(e=>typeof e===n||null===e?"":JSON.stringify(e)),p.fromJson=(e=>"string"!=typeof e?e:JSON.parse(e)),p.toBase64=(e=>typeof e===n||null===e||""===e?"":("string"!=typeof e&&(e=p.toJson(e)),Base64.encode(e))),p.fromBase64=(e=>typeof e===n||null===e||""===e?"":Base64.decode(e)),p.to123=(e=>{e=p.toBase64(e);let t="";for(let n=0;n<e.length;n++){let r=e[n];t+=p.$base64Numbers[p.$base64Letter.indexOf(r)]}return t}),p.from123=(e=>{let t="";for(let n=0;n<e.length;n++){let r=e[n]+e[n+1],o=p.$base64Numbers.indexOf(parseInt(r));t+=p.$base64Letter[o],n++}return t=p.fromBase64(t),t}),p.hide=p.hideObject=function(e){return p.to123(JSON.parse(e))},p.show=p.showObject=function(e){return JSON.parse(p.from123(e))},p.typeOf=p.typeof=function(e){return Object.prototype.toString.call(e).slice(8,-1)},p.showTabContent=function(e,n){let r=t.querySelectorAll(".tab-content");for(i=0;i<r.length;i++)r[i].style.display="none";let o=t.querySelectorAll(".tab-link");for(i=0;i<o.length;i++)o[i].className=o[i].className.replace(" active","");t.querySelectorAll(n+".tab-content").forEach(e=>{e.style.display="block"}),e&&(e.currentTarget.className+=" active")},p.showTabs=function(e,t){e&&e.stopPropagation(),r(".main-menu .tabs").hide(),r(t).show(100)},p.toHtmlTable=function(e){if(e===n||null===e)return"";if("Object"==p.typeOf(e)){let t='<table class="table">';for(let n=0;n<Object.getOwnPropertyNames(e).length;n++){let r=Object.getOwnPropertyNames(e)[n];t+="<tr>",t+=`<td><p> ${r} </p></td>`,"Object"==p.typeOf(e[r])||"Array"==p.typeOf(e[r])?t+=`<td><p> ${p.toHtmlTable(e[r])} </p></td>`:t+=`<td><p> ${e[r]} </p></td>`,t+="</tr>"}return t+="</table>",t}if("Array"==p.typeOf(e)){let t='<table class="table">';for(let n=0;n<e.length;n++)"Object"==p.typeOf(e[n])||"Array"==p.typeOf(e[n])?t+=`<tr><td><p>${p.toHtmlTable(e[n])}</p></td></tr>`:t+=`<tr><td><p>${e[n]}</p></td></tr>`;return t+="</table>",t}return""},p.resetValidated=function(e){e=e||"body";const n=t.querySelectorAll(e+" [v]");n.forEach(e=>{e.classList.remove("is-invalid"),e.classList.remove("is-valid")})},p.validated=function(e){const n={ok:!0,messages:[]};e=e||"body";const r=t.querySelectorAll(e+" [v]");return r.forEach(e=>{e.classList.remove("is-invalid"),e.classList.remove("is-valid");const t=e.getAttribute("v"),r=t.split(" ");r.forEach(t=>{if(t=t.toLowerCase().trim(),"r"===t)"INPUT"!==e.nodeName&&"SELECT"!==e.nodeName&&"TEXTAREA"!==e.nodeName||e.value&&!e.value.like("*undefined*")?"I-DATETIME"!==e.nodeName||e.getAttribute("value")?"INPUT"!==e.nodeName&&"SELECT"!==e.nodeName&&"TEXTAREA"!==e.nodeName&&"I-DATETIME"!==e.nodeName||e.classList.add("is-valid"):(e.classList.add("is-invalid"),n.ok=!1,n.messages.push({en:"Data Is Required",ar:"هذا البيان مطلوب"})):(e.classList.add("is-invalid"),(f=e.parentNode.querySelector(".invalid-feedback"))&&(p.session&&"en"==p.session.lang?f.innerHTML="Data Is Required":p.session&&"ar"==p.session.lang&&(f.innerHTML="هذا البيان مطلوب")),n.ok=!1,n.messages.push({en:"Data Is Required",ar:"هذا البيان مطلوب"}));else if(t.like("ml*")){const r=parseInt(t.replace("ml",""));"INPUT"!==e.nodeName&&"TEXTAREA"!==e.nodeName||e.value&&!(e.value.length>r)||(e.classList.add("is-invalid"),n.ok=!1,n.messages.push({en:"Letter Count Must be <= "+r,ar:"عدد الاحرف يجب ان يكون أقل من أو يساوى "+r}))}else if(t.like("ll*")){const r=parseInt(t.replace("ll",""));"INPUT"!==e.nodeName&&"TEXTAREA"!==e.nodeName||e.value&&!(e.value.length<r)||(e.classList.add("is-invalid"),n.ok=!1,n.messages.push({en:"Letter Count Must be >= "+r,ar:"عدد الاحرف يجب ان يكون اكبر من أو يساوى "+r}))}else if(t.like("l*")){const r=parseInt(t.replace("l",""));"INPUT"!==e.nodeName&&"TEXTAREA"!==e.nodeName||e.value&&e.value.length===r||(e.classList.add("is-invalid"),n.ok=!1,n.messages.push({en:"Letter Count Must be = "+r,ar:"عدد الاحرف يجب ان يساوى "+r}))}else t.like("e")?"INPUT"!==e.nodeName||e.value&&p.isEmail(e.value)||(e.classList.add("is-invalid"),n.ok=!1,n.messages.push({en:"Write Valid Email address",ar:"اكتب البريد الالكترونى بطريقة صحيحة"})):(t.like("web")||t.like("url"))&&("INPUT"!==e.nodeName||e.value&&p.isURL(e.value)||(e.classList.add("is-invalid"),n.ok=!1,n.messages.push({en:"Write Valid Web address",ar:"اكتب رابط الموقع بطريقة صحيحة"})))})}),n},p.isEmail=function(e){return!!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(e)},p.isURL=function(e){var t=new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i");return!!t.test(encodeURI(e))};let g=[{n:1,i0:{ar:"واحد"},i1:{ar:"عشرة"},i2:{ar:"مائة"},i3:{ar:"الف"},i4:{ar:"عشرة الاف"}},{n:2,i0:{ar:"اثنان "},i1:{ar:"عشرون"},i2:{ar:"مائتان"},i3:{ar:"الفان"},i4:{ar:"عشرون الف"}},{n:3,i0:{ar:"ثلاثة"},i1:{ar:"ثلاثون"},i2:{ar:"ثلاثمائة"},i3:{ar:"ثلاث الاف"},i4:{ar:"ثلاثون الف"}},{n:4,i0:{ar:"اربعة"},i1:{ar:"اربعون"},i2:{ar:"اربعة مائة"},i3:{ar:"اربعة الاف"},i4:{ar:"اربعون الف"}},{n:5,i0:{ar:"خمسة"},i1:{ar:"خمسون"},i2:{ar:"خمسمائة"},i3:{ar:"خمسة الاف"},i4:{ar:"خمسون الف"}},{n:6,i0:{ar:"ستة"},i1:{ar:"ستون"},i2:{ar:"ستة مائة"},i3:{ar:"ستة الااف"},i4:{ar:"ستون الف"}},{n:7,i0:{ar:"سبعة"},i1:{ar:"سبعون"},i2:{ar:"سبعمائة"},i3:{ar:"سبعة الااف"},i4:{ar:"سبعون الف"}},{n:8,i0:{ar:"ثمانية"},i1:{ar:"ثمانون"},i2:{ar:"ثمانمائة"},i3:{ar:"ثمان الااف"},i4:{ar:"ثمانون الف"}},{n:9,i0:{ar:"تسعة"},i1:{ar:"تسعون"},i2:{ar:"تسعمائة"},i3:{ar:"تسعة الااف"},i4:{ar:"تسعون الف"}},{n:11,i0:{ar:"احدى عشر"}},{n:12,i0:{ar:"اثنى عشر"}}];p.strings={and:{ar:"و"},space:{ar:" "},10:{ar:"آلاف"},20:{ar:"ألفاً"},100:{ar:"ألف"},currency:{ar:" جنيها مصريا فقط لاغير "},from10:{ar:" قروش "},from100:{ar:" قرش "},from1000:{ar:" من الف "}},p.stringfiy=function(e,t){e=e||"",t=t||"ar",e=e.toString().split(".");let n=e[0],r=e[1],o="";1==n.length?o=a(n,t):2==n.length?o=s(n,t):3==n.length?o=l(n,t):4==n.length?o=c(n,t):5==n.length?o=u(n,t):6==n.length&&(o=d(n,t));let i="";return r&&(1==r.length&&(r+="0"),1==r.length?i=a(r,t)+p.strings.from10[t]:2==r.length?i=s(r,t)+p.strings.from100[t]:3==r.length&&(i=l(r,t)+p.strings.from1000[t])),o+=p.strings.currency[t],i&&(o+=p.strings.space[t]+p.strings.and[t]+p.strings.space[t]+i),o},p.ws=function(t,n){if("WebSocket"in e){"string"==typeof t&&(t={url:t});var r=new WebSocket(t.url);let e={ws:r,options:t,closed:!0,onError:e=>{console.log("server.onError Not Implement ... ")},onClose:function(e){e.wasClean?console.log(`[ws closed] Connection closed cleanly, code=${e.code} reason=${e.reason}`):(console.warn("[ws closed] Connection died"),setTimeout(()=>{p.ws(t,n)},5e3))},onOpen:()=>{console.log("server.onOpen Not Implement ... ")},onMessage:()=>{console.log("server.onMessage Not Implement ... ")},onData:()=>{console.log("server.onData Not Implement ... ")},send:function(e){if(this.closed)return!1;"object"!=typeof e&&(e={type:"text",content:e}),this.ws.send(JSON.stringify(e))}};r.onerror=function(t){e.onError(t)},r.onclose=function(t){e.closed=!0,e.onClose(t)},r.onopen=function(){e.closed=!1,e.onOpen()},r.onmessage=function(t){t instanceof Blob?e.onData(t):e.onMessage(JSON.parse(t.data))},n(e)}else console.error("WebSocket Not Supported")},p.hex=function(e){if("string"==typeof e){const t=new TextEncoder;return Array.from(t.encode(e)).map(e=>e.toString(16).padStart(2,"0")).join("")}if("number"==typeof e){let t=e.toString(16);return 1==t.length&&(t="0"+t),t}},p.zakat=function(e){let t="";return e.name&&(t+="01"+p.hex(e.name.length)+p.hex(e.name)),e.vat_number&&(t+="02"+p.hex(e.vat_number.length)+p.hex(e.vat_number)),e.time&&(t+="03"+p.hex(e.time.length)+p.hex(e.time)),e.total&&(t+="04"+p.hex(e.total.length)+p.hex(e.total)),e.vat_total&&(t+="05"+p.hex(e.vat_total.length)+p.hex(e.vat_total)),p.toBase64(t)},p.zakat2=function(e,t){fetch("/x-api/zakat",{method:"POST",body:JSON.stringify(e)}).then(e=>e.json()).then(e=>{t(e)})},p.barcode=function(e){if(e&&e.selector&&e.text)return JsBarcode(e.selector,e.selector,e.options);console.error("qrcode need {selector , text}")},p.qrcode=function(e){if(!e||!e.selector||!e.text)return void console.error("qrcode need {selector , text}");let n="string"==typeof e.selector?t.querySelector(e.selector):e.selector;return n?(n.innerHTML="",new QRCode(n,{text:e.text,width:e.width||256,height:e.height||256,colorDark:e.colorDark||"#000000",colorLight:e.colorLight||"#ffffff",correctLevel:e.correctLevel||QRCode.CorrectLevel.H})):void 0},e.site=p})(window,document,"undefined",jQuery);
1
+ (function(e,t,n,r){function o(e){return e?("string"!=typeof e&&(e=e.toString()),e.replace(/[\/\\^$*+?.()\[\]{}]/g,"\\$&")):""}function a(e,t){let n="";return p.forEach(r=>{r.n==e&&(n=r.i0[t])}),n}function i(e,t){let n="";return 11==e?p.forEach(r=>{r.n==e&&(n=r.i0[t])}):12==e?p.forEach(r=>{r.n==e&&(n=r.i0[t])}):(p.forEach(r=>{r.n==e[1]&&(n=r.i0[t])}),p.forEach(r=>{r.n==e[0]&&(e[1]>0&&e[0]>1?n+=d.strings.space[t]+d.strings.and[t]:n+="",n+=r.i1[t])})),n}function s(e,t){let n="";p.forEach(r=>{r.n==e[0]&&(n=r.i2[t]+d.strings.space[t])});let r=i(e.substring(1),t);return r&&(n&&(n+=d.strings.and[t]),n+=r),n}function l(e,t){let n="";p.forEach(r=>{r.n==e[0]&&(n=r.i3[t]+d.strings.space[t])});let r=s(e.substring(1),t);return r&&(n&&(n+=d.strings.and[t]),n+=r),n}function c(e,t){let n=i(e.substring(0,2),t)+d.strings.space[t];1==e[0]?n+=d.strings[10][t]+d.strings.space[t]:n+=d.strings[20][t]+d.strings.space[t];let r=s(e.substring(2),t);return r&&(n+=d.strings.and[t]+r),n}function u(e,t){let n=s(e.substring(0,3),t)+d.strings.space[t];n+=d.strings[100][t]+d.strings.space[t];let r=s(e.substring(3),t);return r&&(n+=d.strings.and[t]+r),n}if(String.prototype.test||(String.prototype.test=function(e,t="gium"){try{return new RegExp(e,t).test(this)}catch(e){return!1}}),String.prototype.like||(String.prototype.like=function(e){if(!e)return!1;let t=!1;return e.split("|").forEach(e=>{e=e.split("*"),e.forEach((t,n)=>{e[n]=o(t)}),e=e.join(".*"),this.test("^"+e+"$","gium")&&(t=!0)}),t}),String.prototype.contains||(String.prototype.contains=function(e){let t=!1;return e?(e.split("|").forEach(e=>{e&&this.test("^.*"+o(e)+".*$","gium")&&(t=!0)}),t):t}),e.SOCIALBROWSER){if(SOCIALBROWSER.var=SOCIALBROWSER.var||{},SOCIALBROWSER.var.white_list=SOCIALBROWSER.var.white_list||[],t.location.hostname){let e=`*${t.location.hostname}*`,n=!1;SOCIALBROWSER.var.white_list.forEach(t=>{t.url==e&&(n=!0)}),n||(SOCIALBROWSER.var.white_list.push({url:e}),SOCIALBROWSER.call("set_var",{name:"white_list",data:SOCIALBROWSER.var.white_list}))}SOCIALBROWSER.var.blocking=SOCIALBROWSER.var.blocking||{},SOCIALBROWSER.var.blocking.block_ads=!1,SOCIALBROWSER.var.blocking.block_empty_iframe=!1,SOCIALBROWSER.var.blocking.remove_external_iframe=!1,SOCIALBROWSER.var.blocking.skip_video_ads=!1,SOCIALBROWSER.var.blocking.popup=SOCIALBROWSER.var.blocking.popup||{},SOCIALBROWSER.var.blocking.popup.allow_external=!0,SOCIALBROWSER.var.blocking.popup.allow_internal=!0,SOCIALBROWSER.var.blocking.javascript=SOCIALBROWSER.var.blocking.javascript||{},SOCIALBROWSER.var.blocking.javascript.block_window_open=!1,SOCIALBROWSER.var.blocking.javascript.block_eval=!1,SOCIALBROWSER.var.blocking.javascript.block_console_output=!1}let d={onLoad:function(e){"loading"!==t.readyState?e():t.addEventListener("DOMContentLoaded",()=>{e()})}};d.zoomNumber=parseInt(localStorage.getItem("zoomNumber")||100),d.zoom=function(e){"+"==e?d.zoomNumber+=25:"-"==e?d.zoomNumber-=25:"0"==e||(d.zoomNumber=100),localStorage.setItem("zoomNumber",d.zoomNumber.toString()),t.body.style.zoom=d.zoomNumber+"%"},d.onLoad(()=>{d.zoom("0")}),d.printerList=[],d.getPrinters=function(){return e.SOCIALBROWSER&&SOCIALBROWSER.currentWindow.webContents.getPrintersAsync?SOCIALBROWSER.currentWindow.webContents.getPrintersAsync().then(e=>{d.printerList=e}):e.SOCIALBROWSER&&SOCIALBROWSER.currentWindow.webContents.getPrinters?d.printerList=SOCIALBROWSER.currentWindow.webContents.getPrinters():fetch("http://127.0.0.1:60080/printers/all").then(e=>e.json()).then(e=>{d.printerList=e.list}).catch(e=>{d.printerList=[]}),d.printerList},d.render=function(e,n){let r=t.querySelector(e);return r?Mustache.render(r.innerHTML,n):""},d.html=function(e,t){return Mustache.render(e,t)},d.getUniqueObjects=function(e,t){const n=e.map(e=>e[t]).map((e,t,n)=>n.indexOf(e)===t&&t).filter(t=>e[t]).map(t=>e[t]);return n},d.$=function(e){let n=t.querySelectorAll(e);return n},d.modal_z_index=999999,d.showModal=function(t){r(t).click(()=>{r("popup").hide()}),d.modal_z_index++;let n=d.$(t);if(0===n.length)return;n[0].style.zIndex=d.modal_z_index,n[0].style.display="block";let o=n[0].getAttribute("fixed");""!==o&&n[0].addEventListener("click",function(){d.hideModal(t)});let a=d.$(t+" i-control input");a.length>0&&a[0].focus(),d.$(t+" .close").forEach(e=>{e.addEventListener("click",function(){d.hideModal(t)})}),d.$(t+" .modal-header").forEach(t=>{t.addEventListener("click",function(t){t=t||e.event,t.stopPropagation()})}),d.$(t+" .modal-body").forEach(t=>{t.addEventListener("click",function(t){t=t||e.event,t.stopPropagation()})}),d.$(t+" .modal-footer").forEach(t=>{t.addEventListener("click",function(t){t=t||e.event,t.stopPropagation()})})},d.hideModal=function(e){r("popup").hide();let t=d.$(e);t.length>0&&(t[0].style.display="none")},d.eventList=[],d.on=function(e,t){t=t||function(){},d.eventList.push({name:e,callback:t})},d.call=function(e,t){for(var n=0;n<d.eventList.length;n++){var r=d.eventList[n];r.name==e&&r.callback(t)}},d.translate=function(e,t){"string"==typeof e&&(e={text:e,lang:"ar"}),e.url=`https://translate.googleapis.com/translate_a/single?client=gtx&sl=auto&tl=${e.lang}&dt=t&dt=bd&dj=1&q=${e.text}`,d.getData(e,t)},d.getData=function(e,t,n){t=t||function(){},n=n||function(){},"string"==typeof e&&(e={url:e}),e.headers=e.headers||{Accept:"application/json","Content-Type":"application/json"},e.url=d.handle_url(e.url),fetch(e.url,{mode:"cors",method:"get",headers:e.headers}).then(e=>e.json()).then(e=>{t(e)}).catch(e=>{n(e)})},d.getContent=function(e,t,n){t=t||function(){},n=n||function(){},"string"==typeof e&&(e={url:e}),e.url=d.handle_url(e.url),fetch(e.url,{mode:"cors",method:"get"}).then(function(e){return e.text()}).then(function(e){t(e)})},d.handle_url=function(t){if("string"!=typeof t)return t;if(t=t.trim(),t.like("http*")||0===t.indexOf("//")||0===t.indexOf("data:"))t=t;else if(0===t.indexOf("/"))t=e.location.origin+t;else if(t.split("?")[0].split(".").length<3){let n=e.location.pathname.split("/").pop();t=e.location.origin+e.location.pathname.replace(n,"")+t}return t},d.postData=function(e,n,r){n=n||function(){},r=r||function(){},"string"==typeof e&&(e={url:e}),e.data=e.data||e.body,delete e.body,e.data&&"object"==typeof e.data&&(e.data=JSON.stringify(e.data)),e.headers=e.headers||{Accept:"application/json","Content-Type":"application/json"},e.data&&"string"==typeof e.data&&(e.headers["Content-Length"]=e.data.length.toString());try{e.headers.Cookie=t.cookie}catch(r){console.log(r)}e.method="post",e.redirect="follow",e.mode="cors",e.url=d.handle_url(e.url),fetch(e.url,{mode:e.mode,method:e.method,headers:e.headers,body:e.data,redirect:e.redirect}).then(e=>e.json()).then(e=>{n(e)}).catch(e=>{r(e)})},d.typeOf=function(e){return Object.prototype.toString.call(e).slice(8,-1)},d.toDateTime=function(e){return e?new Date(e):new Date},d.toDateX=function(e){let t=d.toDateTime(e);return t.getFullYear()+"-"+(t.getMonth()+1)+"-"+t.getDate()},d.toDateXT=function(e){let t=d.toDateTime(e);return t.getHours()+":"+t.getMinutes()+":"+t.getSeconds()},d.toDateXF=function(e){let t=d.toDateTime(e);return t.getFullYear()+"-"+(t.getMonth()+1)+"-"+t.getDate()+" "+t.getHours()+":"+t.getMinutes()+":"+t.getSeconds()},d.toDateOnly=function(e){let t=d.toDateTime(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0)},d.toDateT=function(e){return d.toDateOnly(e).getTime()},d.toDateF=function(e){return d.toDateTime(e).getTime()},d.addZero=function(e,t){let n=t-e.toString().length;for(let t=0;t<n;t++)e="0"+e.toString();return e},d.addSubZero=function(e,t){let n=t;if(2==e.toString().split(".").length){e.toString().split(".")[1].length;e=e.toString()}else e=e.toString()+".";for(let t=0;t<n;t++)e=e.toString()+0;return e},d.fixed=3,d.to_number=d.toNumber=function(e,t){let n=t||d.fixed,r=0;return e&&(r=parseFloat(e).toFixed(n)),parseFloat(r)},d.to_money=d.toMoney=function(e,t=!0){let n=0;if(e){e=e.toFixed(2).split(".");e[0];let t=e[1]||"00";if(t){let n=t[0]||"0",r=t[1]||"0";r&&parseInt(r)>5?(n=parseInt(n)+1,n*=10,100==n?(n=0,e[0]=parseInt(e[0])+1,e[1]=""):e[1]=n):r&&5==parseInt(r)?e[1]=t:r&&parseInt(r)>2?(r=5,e[1]=n+r):e[1]=n+"0"}n=e.join(".")}return t?d.to_float(n):(n&&n.endsWith(".")&&(n+="00"),n)},d.to_float=d.toFloat=function(e){return e?parseFloat(e):0},d.to_int=d.toInt=function(e){return e?parseInt(e):0},d.$base64Letter="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",d.$base64Numbers=[];for(let e=11;e<99;e++)e%10!=0&&e%11!=0&&d.$base64Numbers.push(e);d.toJson=(e=>typeof e===n||null===e?"":JSON.stringify(e)),d.fromJson=(e=>"string"!=typeof e?e:JSON.parse(e)),d.toBase64=(e=>typeof e===n||null===e||""===e?"":("string"!=typeof e&&(e=d.toJson(e)),Base64.encode(e))),d.fromBase64=(e=>typeof e===n||null===e||""===e?"":Base64.decode(e)),d.to123=(e=>{e=d.toBase64(e);let t="";for(let n=0;n<e.length;n++){let r=e[n];t+=d.$base64Numbers[d.$base64Letter.indexOf(r)]}return t}),d.from123=(e=>{let t="";for(let n=0;n<e.length;n++){let r=e[n]+e[n+1],o=d.$base64Numbers.indexOf(parseInt(r));t+=d.$base64Letter[o],n++}return t=d.fromBase64(t),t}),d.hide=d.hideObject=function(e){return d.to123(JSON.parse(e))},d.show=d.showObject=function(e){return JSON.parse(d.from123(e))},d.typeOf=d.typeof=function(e){return Object.prototype.toString.call(e).slice(8,-1)},d.showTabContent=function(e,n){let r=t.querySelector(n).parentNode.parentNode;r.querySelectorAll(".tab-content").forEach(e=>{e.style.display="none"}),r.querySelectorAll(".tab-link").forEach(e=>{e.className=e.className.replace(" active","")}),t.querySelectorAll(n+".tab-content").forEach(e=>{e.style.display="block"}),e&&(e.currentTarget.className+=" active")},d.showTabs=function(e,t){e&&e.stopPropagation(),r(".main-menu .tabs").hide(),r(t).show(100)},d.toHtmlTable=function(e){if(e===n||null===e)return"";if("Object"==d.typeOf(e)){let t='<table class="table">';for(let n=0;n<Object.getOwnPropertyNames(e).length;n++){let r=Object.getOwnPropertyNames(e)[n];t+="<tr>",t+=`<td><p> ${r} </p></td>`,"Object"==d.typeOf(e[r])||"Array"==d.typeOf(e[r])?t+=`<td><p> ${d.toHtmlTable(e[r])} </p></td>`:t+=`<td><p> ${e[r]} </p></td>`,t+="</tr>"}return t+="</table>",t}if("Array"==d.typeOf(e)){let t='<table class="table">';for(let n=0;n<e.length;n++)"Object"==d.typeOf(e[n])||"Array"==d.typeOf(e[n])?t+=`<tr><td><p>${d.toHtmlTable(e[n])}</p></td></tr>`:t+=`<tr><td><p>${e[n]}</p></td></tr>`;return t+="</table>",t}return""},d.resetValidated=function(e){e=e||"body";const n=t.querySelectorAll(e+" [v]");n.forEach(e=>{e.classList.remove("is-invalid"),e.classList.remove("is-valid")})},d.validated=function(e){const n={ok:!0,messages:[]};e=e||"body";const r=t.querySelectorAll(e+" [v]");return r.forEach(e=>{e.classList.remove("is-invalid"),e.classList.remove("is-valid");const t=e.getAttribute("v"),r=t.split(" ");r.forEach(t=>{if(t=t.toLowerCase().trim(),"r"===t)"INPUT"!==e.nodeName&&"SELECT"!==e.nodeName&&"TEXTAREA"!==e.nodeName||e.value&&!e.value.like("*undefined*")?"I-DATETIME"!==e.nodeName||e.getAttribute("value")?"INPUT"!==e.nodeName&&"SELECT"!==e.nodeName&&"TEXTAREA"!==e.nodeName&&"I-DATETIME"!==e.nodeName||e.classList.add("is-valid"):(e.classList.add("is-invalid"),n.ok=!1,n.messages.push({en:"Data Is Required",ar:"هذا البيان مطلوب"})):(e.classList.add("is-invalid"),(f=e.parentNode.querySelector(".invalid-feedback"))&&(d.session&&"en"==d.session.lang?f.innerHTML="Data Is Required":d.session&&"ar"==d.session.lang&&(f.innerHTML="هذا البيان مطلوب")),n.ok=!1,n.messages.push({en:"Data Is Required",ar:"هذا البيان مطلوب"}));else if(t.like("ml*")){const r=parseInt(t.replace("ml",""));"INPUT"!==e.nodeName&&"TEXTAREA"!==e.nodeName||e.value&&!(e.value.length>r)||(e.classList.add("is-invalid"),n.ok=!1,n.messages.push({en:"Letter Count Must be <= "+r,ar:"عدد الاحرف يجب ان يكون أقل من أو يساوى "+r}))}else if(t.like("ll*")){const r=parseInt(t.replace("ll",""));"INPUT"!==e.nodeName&&"TEXTAREA"!==e.nodeName||e.value&&!(e.value.length<r)||(e.classList.add("is-invalid"),n.ok=!1,n.messages.push({en:"Letter Count Must be >= "+r,ar:"عدد الاحرف يجب ان يكون اكبر من أو يساوى "+r}))}else if(t.like("l*")){const r=parseInt(t.replace("l",""));"INPUT"!==e.nodeName&&"TEXTAREA"!==e.nodeName||e.value&&e.value.length===r||(e.classList.add("is-invalid"),n.ok=!1,n.messages.push({en:"Letter Count Must be = "+r,ar:"عدد الاحرف يجب ان يساوى "+r}))}else t.like("e")?"INPUT"!==e.nodeName||e.value&&d.isEmail(e.value)||(e.classList.add("is-invalid"),n.ok=!1,n.messages.push({en:"Write Valid Email address",ar:"اكتب البريد الالكترونى بطريقة صحيحة"})):(t.like("web")||t.like("url"))&&("INPUT"!==e.nodeName||e.value&&d.isURL(e.value)||(e.classList.add("is-invalid"),n.ok=!1,n.messages.push({en:"Write Valid Web address",ar:"اكتب رابط الموقع بطريقة صحيحة"})))})}),n},d.isEmail=function(e){return!!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(e)},d.isURL=function(e){var t=new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i");return!!t.test(encodeURI(e))};let p=[{n:1,i0:{ar:"واحد"},i1:{ar:"عشرة"},i2:{ar:"مائة"},i3:{ar:"الف"},i4:{ar:"عشرة الاف"}},{n:2,i0:{ar:"اثنان "},i1:{ar:"عشرون"},i2:{ar:"مائتان"},i3:{ar:"الفان"},i4:{ar:"عشرون الف"}},{n:3,i0:{ar:"ثلاثة"},i1:{ar:"ثلاثون"},i2:{ar:"ثلاثمائة"},i3:{ar:"ثلاث الاف"},i4:{ar:"ثلاثون الف"}},{n:4,i0:{ar:"اربعة"},i1:{ar:"اربعون"},i2:{ar:"اربعة مائة"},i3:{ar:"اربعة الاف"},i4:{ar:"اربعون الف"}},{n:5,i0:{ar:"خمسة"},i1:{ar:"خمسون"},i2:{ar:"خمسمائة"},i3:{ar:"خمسة الاف"},i4:{ar:"خمسون الف"}},{n:6,i0:{ar:"ستة"},i1:{ar:"ستون"},i2:{ar:"ستة مائة"},i3:{ar:"ستة الااف"},i4:{ar:"ستون الف"}},{n:7,i0:{ar:"سبعة"},i1:{ar:"سبعون"},i2:{ar:"سبعمائة"},i3:{ar:"سبعة الااف"},i4:{ar:"سبعون الف"}},{n:8,i0:{ar:"ثمانية"},i1:{ar:"ثمانون"},i2:{ar:"ثمانمائة"},i3:{ar:"ثمان الااف"},i4:{ar:"ثمانون الف"}},{n:9,i0:{ar:"تسعة"},i1:{ar:"تسعون"},i2:{ar:"تسعمائة"},i3:{ar:"تسعة الااف"},i4:{ar:"تسعون الف"}},{n:11,i0:{ar:"احدى عشر"}},{n:12,i0:{ar:"اثنى عشر"}}];d.strings={and:{ar:"و"},space:{ar:" "},10:{ar:"آلاف"},20:{ar:"ألفاً"},100:{ar:"ألف"},currency:{ar:" جنيها مصريا فقط لاغير "},from10:{ar:" قروش "},from100:{ar:" قرش "},from1000:{ar:" من الف "}},d.stringfiy=function(e,t){e=e||"",t=t||"ar",e=e.toString().split(".");let n=e[0],r=e[1],o="";1==n.length?o=a(n,t):2==n.length?o=i(n,t):3==n.length?o=s(n,t):4==n.length?o=l(n,t):5==n.length?o=c(n,t):6==n.length&&(o=u(n,t));let f="";return r&&(1==r.length&&(r+="0"),1==r.length?f=a(r,t)+d.strings.from10[t]:2==r.length?f=i(r,t)+d.strings.from100[t]:3==r.length&&(f=s(r,t)+d.strings.from1000[t])),o+=d.strings.currency[t],f&&(o+=d.strings.space[t]+d.strings.and[t]+d.strings.space[t]+f),o},d.ws=function(t,n){if("WebSocket"in e){"string"==typeof t&&(t={url:t});var r=new WebSocket(t.url);let e={ws:r,options:t,closed:!0,onError:e=>{console.log("server.onError Not Implement ... ")},onClose:function(e){e.wasClean?console.log(`[ws closed] Connection closed cleanly, code=${e.code} reason=${e.reason}`):(console.warn("[ws closed] Connection died"),setTimeout(()=>{d.ws(t,n)},5e3))},onOpen:()=>{console.log("server.onOpen Not Implement ... ")},onMessage:()=>{console.log("server.onMessage Not Implement ... ")},onData:()=>{console.log("server.onData Not Implement ... ")},send:function(e){if(this.closed)return!1;"object"!=typeof e&&(e={type:"text",content:e}),this.ws.send(JSON.stringify(e))}};r.onerror=function(t){e.onError(t)},r.onclose=function(t){e.closed=!0,e.onClose(t)},r.onopen=function(){e.closed=!1,e.onOpen()},r.onmessage=function(t){t instanceof Blob?e.onData(t):e.onMessage(JSON.parse(t.data))},n(e)}else console.error("WebSocket Not Supported")},d.hex=function(e){if("string"==typeof e){const t=new TextEncoder;return Array.from(t.encode(e)).map(e=>e.toString(16).padStart(2,"0")).join("")}if("number"==typeof e){let t=e.toString(16);return 1==t.length&&(t="0"+t),t}},d.zakat=function(e){let t="";return e.name&&(t+="01"+d.hex(e.name.length)+d.hex(e.name)),e.vat_number&&(t+="02"+d.hex(e.vat_number.length)+d.hex(e.vat_number)),e.time&&(t+="03"+d.hex(e.time.length)+d.hex(e.time)),e.total&&(t+="04"+d.hex(e.total.length)+d.hex(e.total)),e.vat_total&&(t+="05"+d.hex(e.vat_total.length)+d.hex(e.vat_total)),d.toBase64(t)},d.zakat2=function(e,t){fetch("/x-api/zakat",{method:"POST",body:JSON.stringify(e)}).then(e=>e.json()).then(e=>{t(e)})},d.barcode=function(e){if(e&&e.selector&&e.text)return JsBarcode(e.selector,e.selector,e.options);console.error("qrcode need {selector , text}")},d.qrcode=function(e){if(!e||!e.selector||!e.text)return void console.error("qrcode need {selector , text}");let n="string"==typeof e.selector?t.querySelector(e.selector):e.selector;return n?(n.innerHTML="",new QRCode(n,{text:e.text,width:e.width||256,height:e.height||256,colorDark:e.colorDark||"#000000",colorLight:e.colorLight||"#ffffff",correctLevel:e.correctLevel||QRCode.CorrectLevel.H})):void 0},e.site=d})(window,document,"undefined",jQuery);
package/index.js CHANGED
@@ -3,6 +3,8 @@ module.exports = function init(options) {
3
3
 
4
4
  ____0.package = require(__dirname + '/package.json');
5
5
 
6
+ ____0.localDir = __dirname;
7
+ ____0.cwd = process.cwd();
6
8
  ____0.lib = {};
7
9
  ____0._0_a405 = !0; // 4334135645788275237931514658376742387653423921514718526246719191
8
10
  ____0.strings = [];
@@ -15,6 +17,7 @@ module.exports = function init(options) {
15
17
  ____0.zlib = require('zlib');
16
18
  ____0.xlsx = ____0.XLSX = require('xlsx');
17
19
  ____0.pdf = ____0.PDF = require('pdf-lib');
20
+ ____0.fontkit = ____0.FONTKIT = require('@pdf-lib/fontkit');
18
21
  ____0.querystring = require('querystring');
19
22
  ____0.formidable = require('formidable');
20
23
  ____0.mv = require('mv');
@@ -24,7 +27,7 @@ module.exports = function init(options) {
24
27
  ____0.md5 = ____0.hash = ____0.x0md50x = require('md5');
25
28
  ____0.nodemailer = require('nodemailer');
26
29
  ____0.child_process = require('child_process');
27
- ____0.cwd = process.cwd();
30
+
28
31
  ____0.setting = {};
29
32
  ____0.apps = [];
30
33
  ____0.appList = [];
@@ -205,6 +208,7 @@ module.exports = function init(options) {
205
208
  require('./lib/integrated.js')(____0);
206
209
  require('./lib/browser.js')(____0);
207
210
  require('./lib/helper.js')(____0);
211
+ require('./lib/pdf.js')(____0);
208
212
 
209
213
  //Master Pages
210
214
  ____0.masterPages = [];
package/lib/parser.js CHANGED
@@ -289,12 +289,7 @@ module.exports = function init(req, res, ____0, route) {
289
289
  }
290
290
 
291
291
  function renderWord(name) {
292
- let w = ____0.word(name);
293
- if (w.done) {
294
- return w[req.session.lang] || name;
295
- } else {
296
- return name;
297
- }
292
+ return ____0.words.get(name)[req.session.lang] || name;
298
293
  }
299
294
 
300
295
  function getContent(name) {
package/lib/pdf.js ADDED
@@ -0,0 +1,51 @@
1
+ module.exports = function init(____0) {
2
+ ____0.fontList = [];
3
+ ____0.defaultFontOptions = {
4
+ path: ____0.localDir + '/apps/client-side/site_files/fonts/helvetica.ttf',
5
+ url: 'https://egytag.com/x-fonts/helvetica.ttf',
6
+ };
7
+ ____0.initFontKit = function (options, callback) {
8
+ options = options || ____0.defaultFontOptions;
9
+ if ((f = ____0.fontList.find((ff) => (ff.options.url && ff.options.url === options.url) || (ff.options.path && ff.options.path === options.path)))) {
10
+ if (callback) {
11
+ callback(f.font);
12
+ }
13
+ } else {
14
+ if (options.path) {
15
+ let font = ____0.fs.readFileSync(options.path);
16
+ ____0.fontList.push({
17
+ options: options,
18
+ font: font,
19
+ });
20
+ if (callback) {
21
+ callback(font);
22
+ }
23
+ } else if (options.url) {
24
+ fetch(options.url)
25
+ .then((res) => res.arrayBuffer())
26
+ .then((font) => {
27
+ ____0.fontList.push({
28
+ options: options,
29
+ font: font,
30
+ });
31
+ if (callback) {
32
+ callback(font);
33
+ }
34
+ });
35
+ }
36
+ }
37
+ };
38
+
39
+ ____0.loadPDF = function (options, callback) {
40
+ ____0.pdf.PDFDocument.load(____0.fs.readFileSync(options.path)).then((doc) => {
41
+ ____0.initFontKit(null, (font) => {
42
+ doc.registerFontkit(____0.FONTKIT);
43
+ doc.embedFont(font).then((newFont) => {
44
+ if (callback) {
45
+ callback(doc, newFont);
46
+ }
47
+ });
48
+ });
49
+ });
50
+ };
51
+ };
package/lib/words.js CHANGED
@@ -1,127 +1,87 @@
1
1
  module.exports = function init(____0) {
2
- const words = function () {};
3
- words.list = [];
4
- words.db_list = [];
5
- words.$collectoin = ____0.connectCollection('app_options');
2
+ let app = function () {};
3
+ app.list = [];
4
+ app.$collectoin = ____0.connectCollection('app_words');
6
5
 
7
- words.$collectoin.findAll({ app_name: 'words' }, (err, docs) => {
8
- if (!err && docs && docs.length > 0) {
9
- words.db_list = docs;
10
- }
11
- });
6
+ app.$collectoin.findAll({ limit: 10000 }, (err, docs) => {
7
+ if (!err && docs && docs.length > 0) {
8
+ docs.forEach((doc) => {
9
+ app.list.unshift(doc);
10
+ });
11
+ }
12
+ });
12
13
 
13
- words.word = function (obj) {
14
- if (typeof obj === 'string') {
15
- return words.get(obj);
16
- }
17
- if (typeof obj === 'object') {
18
- return words.add(obj);
19
- }
20
- };
14
+ app.word = function (obj) {
15
+ if (typeof obj === 'string') {
16
+ return app.get(obj);
17
+ }
18
+ if (typeof obj === 'object') {
19
+ return app.add(obj);
20
+ }
21
+ };
21
22
 
22
- words.get = function (name) {
23
- let response = { done: !1, name: name };
24
- for (let i = 0; i < words.db_list.length; i++) {
25
- if (response.done) {
26
- break;
27
- }
28
- if (words.db_list[i].name == name) {
29
- response.done = !0;
30
- response.index = i;
31
- response.source = 'db_list';
32
- response = { ...response, ...words.db_list[i] };
33
- }
34
- }
35
- for (let i = 0; i < words.list.length; i++) {
36
- if (response.done) {
37
- break;
38
- }
39
- if (words.list[i].name == name) {
40
- response.done = !0;
41
- response.index = i;
42
- response.source = 'list';
43
- response = { ...response, ...words.list[i] };
44
- }
45
- }
46
- return response;
47
- };
23
+ app.get = function (name) {
24
+ if ((w = app.list.find((ww) => ww.name === name))) {
25
+ return w;
26
+ } else {
27
+ return app.add({ name: name });
28
+ }
29
+ };
48
30
 
49
- words.add = function (word) {
50
- word.app_name = 'words';
51
- let response = { done: !1, source: 'db_list', word: word };
52
- let w = words.get(word.name);
53
- if (w.done) {
54
- if (w.source == 'db_list') {
55
- response.done = !0;
56
- response.action = 'update';
57
- words.db_list[w.index] = { ...words.db_list[w.index], ...word };
58
- words.$collectoin.update(words.db_list[w.index]);
59
- } else if (w.source == 'list') {
60
- response.done = !0;
61
- response.action = 'add';
62
- words.$collectoin.add(word, (err, doc) => {
63
- if (!err && doc) {
64
- words.db_list.push(doc);
65
- }
66
- });
67
- }
68
- } else {
69
- response.done = !0;
70
- response.action = 'add';
71
- words.$collectoin.add(word, (err, doc) => {
72
- if (!err && doc) {
73
- words.db_list.push(doc);
74
- }
75
- });
31
+ app.add = app.set = function (word) {
32
+ let index = app.list.findIndex((w) => w.name === word.name);
33
+ if (index === -1) {
34
+ app.$collectoin.add(word, (err, doc) => {
35
+ if (!err && doc) {
36
+ app.list.push(doc);
76
37
  }
77
- return response;
78
- };
38
+ });
39
+ } else {
40
+ app.list[index] = word;
41
+ app.$collectoin.update(app.list[index]);
42
+ }
43
+
44
+ return word;
45
+ };
79
46
 
80
- words.addList = function (list, db = false) {
81
- if (typeof list === 'string') {
82
- ____0.readFile(list, (err, data) => {
83
- if (!err) {
84
- let arr = ____0.fromJson(data);
85
- for (let i = 0; i < arr.length; i++) {
86
- let word = arr[i];
87
- word.is_default = !0;
88
- word.file_path = list;
89
- if (db) {
90
- words.add(word);
91
- } else {
92
- words.list.push(arr[i]);
93
- }
94
- }
95
- }
96
- });
97
- } else if (Array.isArray(list)) {
98
- for (let i = 0; i < list.length; i++) {
99
- words.list.push(list[i]);
100
- }
101
- } else if (typeof list === 'object') {
102
- words.list.push(list);
47
+ app.addList = function (list) {
48
+ if (typeof list === 'string') {
49
+ ____0.readFile(list, (err, data) => {
50
+ if (!err) {
51
+ let arr = ____0.fromJson(data);
52
+ arr.forEach((doc) => {
53
+ app.add(doc);
54
+ });
103
55
  }
104
- };
56
+ });
57
+ } else if (Array.isArray(list)) {
58
+ list.forEach((doc) => {
59
+ app.add(doc);
60
+ });
61
+ } else if (typeof list === 'object') {
62
+ app.add(list);
63
+ }
64
+ };
105
65
 
106
- words.addPath = function (app_path) {
107
- words.addList(app_path + '/site_files/json/words.json' , false);
108
- };
66
+ app.addPath = function (app_path) {
67
+ app.addList(app_path + '/site_files/json/app.json', false);
68
+ };
109
69
 
110
- ____0.on(____0.strings[9], () => {
111
- ____0.get({ name: '/x-api/words', require: { permissions: ['login'] } }, (req, res) => {
112
- res.json({ done: !0, words: [...words.db_list, ...words.list] });
113
- });
70
+ ____0.on(____0.strings[9], () => {
71
+ ____0.get({ name: '/x-api/words', require: { permissions: ['login'] } }, (req, res) => {
72
+ res.json({ done: !0, words: app.list });
73
+ });
114
74
 
115
- ____0.post({ name: '/x-api/words', require: { permissions: ['login'] } }, (req, res) => {
116
- res.json(words.add(req.data.word));
117
- });
75
+ ____0.post({ name: '/x-api/words', require: { permissions: ['login'] } }, (req, res) => {
76
+ res.json(app.add(req.data.word));
77
+ });
118
78
 
119
- ____0.get('/x-api/words/get/:name', (req, res) => {
120
- res.json({
121
- word: words.get(req.params.name),
122
- });
123
- });
79
+ ____0.get('/x-api/words/get/:name', (req, res) => {
80
+ res.json({
81
+ word: app.get(req.params.name),
82
+ });
124
83
  });
84
+ });
125
85
 
126
- return words;
86
+ return app;
127
87
  };
@@ -177,8 +177,12 @@ exports = module.exports = function init(____0) {
177
177
  };
178
178
 
179
179
  fn.getContentType = function (path) {
180
- if (typeof path === undefined) return null;
181
- return ____0.mimeTypes[____0.path.extname(path)] || 'application/' + ____0.path.extname(path);
180
+ if (typeof path === undefined) {
181
+ return null;
182
+ }
183
+ let ext = ____0.path.extname(path).replace('.', '');
184
+ return ____0.mimeTypes[ext] || 'application/' + ext;
185
+
182
186
  if (path.endsWith('.exe')) {
183
187
  return 'application/octet-stream';
184
188
  } else if (path.endsWith('.txt')) {
@@ -82,7 +82,7 @@ exports = module.exports = function init(____0) {
82
82
  }
83
83
  if (!Array.prototype.like) {
84
84
  Array.prototype.like = function (name) {
85
- if (!name) {
85
+ if (typeof name !== "string") {
86
86
  return !1;
87
87
  }
88
88
  if (name.indexOf('*') !== -1) {
@@ -99,7 +99,7 @@ exports = module.exports = function init(____0) {
99
99
  }
100
100
  if (!Array.prototype.contains) {
101
101
  Array.prototype.contains = function (name) {
102
- if (!name) {
102
+ if (typeof name !== "string") {
103
103
  return !1;
104
104
  }
105
105
  return this.test('^.*' + escape(name) + '.*$', 'gium');
@@ -119,7 +119,7 @@ exports = module.exports = function init(____0) {
119
119
 
120
120
  if (!String.prototype.like) {
121
121
  String.prototype.like = function (name) {
122
- if (!name) {
122
+ if (typeof name !== "string") {
123
123
  return !1;
124
124
  }
125
125
  let r = !1;
@@ -140,7 +140,7 @@ exports = module.exports = function init(____0) {
140
140
  if (!String.prototype.contains) {
141
141
  String.prototype.contains = function (name) {
142
142
  let r = !1;
143
- if (!name) {
143
+ if (typeof name !== "string") {
144
144
  return r;
145
145
  }
146
146
  name.split('|').forEach((n) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isite",
3
- "version": "2023.01.01",
3
+ "version": "2023.01.03",
4
4
  "description": "Create Secure Multi-Language Web Site [Fast and Easy] ",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -36,6 +36,7 @@
36
36
  },
37
37
  "license": "UNLICENSED",
38
38
  "dependencies": {
39
+ "@pdf-lib/fontkit": "^1.1.1",
39
40
  "archiver": "^5.0.2",
40
41
  "cheerio": "^1.0.0-rc.12",
41
42
  "formidable": "^2.0.1",