Server : LiteSpeed System : Linux server 3.10.0-1160.90.1.el7.x86_64 #1 SMP Thu May 4 15:21:22 UTC 2023 x86_64 User : alsaif ( 1057) PHP Version : 7.4.33 Disable Function : show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname Directory : /home/alsaif/public_html/media/plg_system_nrframework/js/vendor/ |
/*!
* Flickr's Justified Gallery [fjGallery] v2.2.0 (https://flickr-justified-gallery.nkdev.info)
* Copyright 2024 nK <https://nkdev.info>
* Licensed under MIT (https://github.com/nk-o/flickr-justified-gallery/blob/master/LICENSE)
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).fjGallery=e()}(this,(function(){"use strict";let t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var e=t;function i(t,e,i){var o=(i||{}).atBegin;return function(t,e,i){var o,n=i||{},s=n.noTrailing,a=void 0!==s&&s,r=n.noLeading,h=void 0!==r&&r,c=n.debounceMode,l=void 0===c?void 0:c,g=!1,d=0;function u(){o&&clearTimeout(o)}function p(){for(var i=arguments.length,n=new Array(i),s=0;s<i;s++)n[s]=arguments[s];var r=this,c=Date.now()-d;function p(){d=Date.now(),e.apply(r,n)}function f(){o=void 0}g||(h||!l||o||p(),u(),void 0===l&&c>t?h?(d=Date.now(),a||(o=setTimeout(l?f:p,t))):p():!0!==a&&(o=setTimeout(l?f:p,void 0===l?t-c:t)))}return p.cancel=function(t){var e=(t||{}).upcomingOnly,i=void 0!==e&&e;u(),g=!i},p}(t,e,{debounceMode:!1!==(void 0!==o&&o)})}var o=function(t){var e=[],i=null,o=function(){for(var o=arguments.length,n=new Array(o),s=0;s<o;s++)n[s]=arguments[s];e=n,i||(i=requestAnimationFrame((function(){i=null,t.apply(void 0,e)})))};return o.cancel=function(){i&&(cancelAnimationFrame(i),i=null)},o};function n(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}const s=function(t){this.index=t.index,this.top=t.top,this.left=t.left,this.width=t.width,this.spacing=t.spacing,this.targetRowHeight=t.targetRowHeight,this.targetRowHeightTolerance=t.targetRowHeightTolerance,this.minAspectRatio=this.width/t.targetRowHeight*(1-t.targetRowHeightTolerance),this.maxAspectRatio=this.width/t.targetRowHeight*(1+t.targetRowHeightTolerance),this.edgeCaseMinRowHeight=t.edgeCaseMinRowHeight,this.edgeCaseMaxRowHeight=t.edgeCaseMaxRowHeight,this.widowLayoutStyle=t.widowLayoutStyle,this.isBreakoutRow=t.isBreakoutRow,this.items=[],this.height=0};
/*!
* Copyright 2019 SmugMug, Inc. | Copyright 2024 nK
* Licensed under the terms of the MIT license. Please see LICENSE file in the project root for terms.
* @license
*/
function a(t,e){let i;return!1!==t.fullWidthBreakoutRowCadence&&(e._rows.length+1)%t.fullWidthBreakoutRowCadence==0&&(i=!0),new s({index:e._rows.length,top:e._containerHeight,left:t.containerPadding.left,width:t.containerWidth-t.containerPadding.left-t.containerPadding.right,spacing:t.boxSpacing.horizontal,targetRowHeight:t.targetRowHeight,targetRowHeightTolerance:t.targetRowHeightTolerance,edgeCaseMinRowHeight:t.edgeCaseMinRowHeight*t.targetRowHeight,edgeCaseMaxRowHeight:t.edgeCaseMaxRowHeight*t.targetRowHeight,rightToLeft:!1,isBreakoutRow:i,widowLayoutStyle:t.widowLayoutStyle})}function r(t,e,i){return e._rows.push(i),e._layoutItems=e._layoutItems.concat(i.getItems()),e._containerHeight+=i.height+t.boxSpacing.vertical,i.items}s.prototype={addItem:function(t){const e=this.items.concat(t),i=this.width-(e.length-1)*this.spacing,o=e.reduce((function(t,e){return t+e.aspectRatio}),0),n=i/this.targetRowHeight;let s,a,r;return this.isBreakoutRow&&0===this.items.length&&t.aspectRatio>=1?(this.items.push(t),this.completeLayout(i/t.aspectRatio,"justify"),!0):o<this.minAspectRatio?(this.items.push(Object.assign({},t)),!0):o>this.maxAspectRatio?0===this.items.length?(this.items.push(Object.assign({},t)),this.completeLayout(i/o,"justify"),!0):(s=this.width-(this.items.length-1)*this.spacing,a=this.items.reduce((function(t,e){return t+e.aspectRatio}),0),r=s/this.targetRowHeight,Math.abs(o-n)>Math.abs(a-r)?(this.completeLayout(s/a,"justify"),!1):(this.items.push(Object.assign({},t)),this.completeLayout(i/o,"justify"),!0)):(this.items.push(Object.assign({},t)),this.completeLayout(i/o,"justify"),!0)},isLayoutComplete:function(){return this.height>0},completeLayout:function(t,e){let i=this.left;const o=this.width-(this.items.length-1)*this.spacing;let n,s,a,r,h,c;(void 0===e||["justify","center","left"].indexOf(e)<0)&&(e="left"),s=Math.max(this.edgeCaseMinRowHeight,Math.min(t,this.edgeCaseMaxRowHeight)),t!==s?(this.height=s,n=o/s/(o/t)):(this.height=t,n=1),this.items.forEach((function(t){t.row=this.index,t.top=this.top,t.width=t.aspectRatio*this.height*n,t.height=this.height,t.left=i,i+=t.width+this.spacing}),this),"justify"===e?(i-=this.spacing+this.left,a=(i-this.width)/this.items.length,r=this.items.map((function(t,e){return Math.round((e+1)*a)})),1===this.items.length?(h=this.items[0],h.width-=Math.round(a)):this.items.forEach((function(t,e){e>0?(t.left-=r[e-1],t.width-=r[e]-r[e-1]):t.width-=r[e]}))):"center"===e&&(c=(this.width-i)/2,this.items.forEach((function(t){t.left+=c+this.spacing}),this))},forceComplete:function(t,e){"number"==typeof e?this.completeLayout(e,this.widowLayoutStyle):this.completeLayout(this.targetRowHeight,this.widowLayoutStyle)},getItems:function(){return this.items}};var h=n((function(t,e){let i={};const o={},n={containerWidth:1060,containerPadding:10,boxSpacing:10,targetRowHeight:320,targetRowHeightTolerance:.25,edgeCaseMinRowHeight:.5,edgeCaseMaxRowHeight:2.5,maxNumRows:Number.POSITIVE_INFINITY,forceAspectRatio:!1,showWidows:!0,fullWidthBreakoutRowCadence:!1,widowLayoutStyle:"left"},s={},h={};return e=e||{},i=Object.assign(n,e),s.top=isNaN(parseFloat(i.containerPadding.top))?i.containerPadding:i.containerPadding.top,s.right=isNaN(parseFloat(i.containerPadding.right))?i.containerPadding:i.containerPadding.right,s.bottom=isNaN(parseFloat(i.containerPadding.bottom))?i.containerPadding:i.containerPadding.bottom,s.left=isNaN(parseFloat(i.containerPadding.left))?i.containerPadding:i.containerPadding.left,h.horizontal=isNaN(parseFloat(i.boxSpacing.horizontal))?i.boxSpacing:i.boxSpacing.horizontal,h.vertical=isNaN(parseFloat(i.boxSpacing.vertical))?i.boxSpacing:i.boxSpacing.vertical,i.containerPadding=s,i.boxSpacing=h,o._layoutItems=[],o._awakeItems=[],o._inViewportItems=[],o._leadingOrphans=[],o._trailingOrphans=[],o._containerHeight=i.containerPadding.top,o._rows=[],o._orphans=[],i._widowCount=0,function(t,e,i){let o,n,s,h=[];return t.forceAspectRatio&&i.forEach((function(e){e.forcedAspectRatio=!0,e.aspectRatio=t.forceAspectRatio})),i.some((function(i,s){if(isNaN(i.aspectRatio))throw new Error("Item "+s+" has an invalid aspect ratio");if(n||(n=a(t,e)),o=n.addItem(i),n.isLayoutComplete()){if(h=h.concat(r(t,e,n)),e._rows.length>=t.maxNumRows)return n=null,!0;if(n=a(t,e),!o&&(o=n.addItem(i),n.isLayoutComplete())){if(h=h.concat(r(t,e,n)),e._rows.length>=t.maxNumRows)return n=null,!0;n=a(t,e)}}})),n&&n.getItems().length&&t.showWidows&&(e._rows.length?(s=e._rows[e._rows.length-1].isBreakoutRow?e._rows[e._rows.length-1].targetRowHeight:e._rows[e._rows.length-1].height,n.forceComplete(!1,s)):n.forceComplete(!1),h=h.concat(r(t,e,n)),t._widowCount=n.getItems().length),e._containerHeight=e._containerHeight-t.boxSpacing.vertical,e._containerHeight=e._containerHeight+t.containerPadding.bottom,{containerHeight:e._containerHeight,widowCount:t._widowCount,boxes:e._layoutItems}}(i,o,t.map((function(t){return t.width&&t.height?{aspectRatio:t.width/t.height}:{aspectRatio:t}})))}));function c(t,e){let i,o=!1,n=!1;const s=()=>{o?e(o):t.naturalWidth&&(o={width:t.naturalWidth,height:t.naturalHeight},e(o),clearInterval(i),n&&c())},a=()=>{s()},r=()=>{s()},h=()=>{t.naturalWidth>0&&s()},c=()=>{n=!1,t.removeEventListener("load",a),t.removeEventListener("error",r)};h(),o||(n=!0,t.addEventListener("load",a),t.addEventListener("error",r),i=setInterval(h,100))}const l=[],g=o((()=>{l.forEach((t=>{t.resize()}))}));var d;e.addEventListener("resize",g),e.addEventListener("orientationchange",g),e.addEventListener("load",g),d=()=>{g()},"complete"===document.readyState||"interactive"===document.readyState?d():document.addEventListener("DOMContentLoaded",d,{capture:!0,once:!0,passive:!0});let u=0;class p{constructor(t,e){const n=this;n.instanceID=u,u+=1,n.$container=t,n.images=[],n.defaults={itemSelector:".fj-gallery-item",imageSelector:"img",gutter:10,rowHeight:320,rowHeightTolerance:.25,maxRowsCount:Number.POSITIVE_INFINITY,edgeCaseMinRowHeight:.5,edgeCaseMaxRowHeight:2.5,lastRow:"left",transitionDuration:"0.3s",calculateItemsHeight:!1,resizeDebounce:100,isRtl:"rtl"===n.css(n.$container,"direction"),onInit:null,onDestroy:null,onAppendImages:null,onBeforeJustify:null,onJustify:null};const s=n.$container.dataset||{},a={};Object.keys(s).forEach((t=>{const e=t.substr(0,1).toLowerCase()+t.substr(1);e&&void 0!==n.defaults[e]&&(a[e]=s[t])})),n.options={...n.defaults,...a,...e},n.pureOptions={...n.options},n.resize=i(n.options.resizeDebounce,n.resize),n.justify=o(n.justify.bind(n)),n.init()}css(t,i){return"string"==typeof i?e.getComputedStyle(t).getPropertyValue(i):(Object.keys(i).forEach((e=>{t.style[e]=i[e]})),t)}applyTransition(t,e){const i=this;i.onTransitionEnd(t)(),i.css(t,{"transition-property":e.join(", "),"transition-duration":i.options.transitionDuration}),t.addEventListener("transitionend",i.onTransitionEnd(t,e),!1)}onTransitionEnd(t){const e=this;return()=>{e.css(t,{"transition-property":"","transition-duration":""}),t.removeEventListener("transitionend",e.onTransitionEnd(t))}}addToFjGalleryList(){l.push(this),g()}removeFromFjGalleryList(){const t=this;l.forEach(((e,i)=>{e.instanceID===t.instanceID&&l.splice(i,1)}))}init(){const t=this;t.appendImages(t.$container.querySelectorAll(t.options.itemSelector)),t.addToFjGalleryList(),t.options.onInit&&t.options.onInit.call(t)}appendImages(t){const i=this;e.jQuery&&t instanceof e.jQuery&&(t=t.get()),t&&t.length&&(t.forEach((t=>{if(t&&!t.fjGalleryImage&&t.querySelector){const e=t.querySelector(i.options.imageSelector);if(e){t.fjGalleryImage=i;const o={$item:t,$image:e,width:parseFloat(e.getAttribute("width"))||!1,height:parseFloat(e.getAttribute("height"))||!1,loadSizes(){const t=this;c(e,(e=>{t.width===e.width&&t.height===e.height||(t.width=e.width,t.height=e.height,i.resize())}))}};o.loadSizes(),i.images.push(o)}}})),i.options.onAppendImages&&i.options.onAppendImages.call(i,[t]),i.justify())}justify(){const t=this,e=[];t.justifyCount=(t.justifyCount||0)+1,t.options.onBeforeJustify&&t.options.onBeforeJustify.call(t),t.images.forEach((t=>{t.width&&t.height&&e.push(t.width/t.height)}));const i={containerWidth:t.$container.getBoundingClientRect().width,containerPadding:{top:parseFloat(t.css(t.$container,"padding-top"))||0,right:parseFloat(t.css(t.$container,"padding-right"))||0,bottom:parseFloat(t.css(t.$container,"padding-bottom"))||0,left:parseFloat(t.css(t.$container,"padding-left"))||0},boxSpacing:t.options.gutter,targetRowHeight:t.options.rowHeight,targetRowHeightTolerance:t.options.rowHeightTolerance,maxNumRows:t.options.maxRowsCount,edgeCaseMinRowHeight:t.options.edgeCaseMinRowHeight,edgeCaseMaxRowHeight:t.options.edgeCaseMaxRowHeight,showWidows:"hide"!==t.options.lastRow},o=h(e,i);if(o.widowCount&&("center"===t.options.lastRow||"right"===t.options.lastRow)){const e=o.boxes[o.boxes.length-1];let n=i.containerWidth-e.width-e.left;"center"===t.options.lastRow&&(n/=2),"right"===t.options.lastRow&&(n-=i.containerPadding.right);for(let t=1;t<=o.widowCount;t+=1)o.boxes[o.boxes.length-t].left=o.boxes[o.boxes.length-t].left+n}t.options.isRtl&&o.boxes.forEach(((t,e)=>{o.boxes[e].left=i.containerWidth-o.boxes[e].left-o.boxes[e].width-i.containerPadding.right+i.containerPadding.left}));let n=0,s=0;const a={};t.images.forEach(((e,i)=>{if(o.boxes[n]&&e.width&&e.height){if(t.options.calculateItemsHeight&&void 0===a[o.boxes[n].row]&&Object.keys(a).length&&(s+=a[Object.keys(a).pop()]-o.boxes[i-1].height),t.options.transitionDuration&&t.justifyCount>1&&t.applyTransition(e.$item,["transform"]),t.css(e.$item,{display:"",position:"absolute",transform:`translateX(${o.boxes[n].left}px) translateY(${o.boxes[n].top+s}px) translateZ(0)`,width:`${o.boxes[n].width}px`}),t.options.calculateItemsHeight){const t=e.$item.getBoundingClientRect();(void 0===a[o.boxes[n].row]||a[o.boxes[n].row]<t.height)&&(a[o.boxes[n].row]=t.height)}n+=1}else t.css(e.$item,{display:"none"})})),t.options.calculateItemsHeight&&Object.keys(a).length&&(s+=a[Object.keys(a).pop()]-o.boxes[o.boxes.length-1].height),t.options.transitionDuration&&t.applyTransition(t.$container,["height"]),t.css(t.$container,{height:`${o.containerHeight+s}px`}),t.options.onJustify&&t.options.onJustify.call(t)}updateOptions(t){const e=this;e.options={...e.options,...t},e.justify()}destroy(){const t=this;t.removeFromFjGalleryList(),t.justifyCount=0,t.options.onDestroy&&t.options.onDestroy.call(t),t.css(t.$container,{height:"",transition:""}),t.images.forEach((e=>{t.css(e.$item,{position:"",transform:"",transition:"",width:"",height:""})})),t.images.forEach((t=>{delete t.$item.fjGalleryImage})),delete t.$container.fjGallery}resize(){this.justify()}}const f=function(t,e,...i){("object"==typeof HTMLElement?t instanceof HTMLElement:t&&"object"==typeof t&&null!==t&&1===t.nodeType&&"string"==typeof t.nodeName)&&(t=[t]);const o=t.length;let n,s=0;for(;s<o;s+=1)if("object"==typeof e||void 0===e?t[s].fjGallery||(t[s].fjGallery=new p(t[s],e)):t[s].fjGallery&&(n=t[s].fjGallery[e].apply(t[s].fjGallery,i)),void 0!==n)return n;return t};f.constructor=p;const w=e.jQuery;if(void 0!==w){const t=f.constructor.prototype.init;f.constructor.prototype.init=function(){w(this.$container).data("fjGallery",this),t&&t.call(this)};const i=f.constructor.prototype.destroy;f.constructor.prototype.destroy=function(){this.$container&&w(this.$container).removeData("fjGallery"),i&&i.call(this)};const o=function(...t){Array.prototype.unshift.call(t,this);const i=f.apply(e,t);return"object"!=typeof i?i:this};o.constructor=f.constructor;const n=w.fn.fjGallery;w.fn.fjGallery=o,w.fn.fjGallery.noConflict=function(){return w.fn.fjGallery=n,this}}return f}));