Instagram Feed - Version 2.6.2

Version Description

  • Tweak: If the image resizing feature isn't able to work successfully due to an issue, then the GDPR setting will be disabled unless manually enabled to prevent blank images in the feed.
  • Fix: In some situations the GDPR setting was incorrectly reporting an error with image resizing.
Download this release

Release Info

Developer smashballoon
Plugin Icon 128x128 Instagram Feed
Version 2.6.2
Comparing to
See all releases

Code changes from version 2.6.1 to 2.6.2

README.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: smashballoon, craig-at-smash-balloon
3
  Tags: Instagram, Instagram feed, Instagram photos, Instagram widget, Instagram gallery
4
  Requires at least: 3.4
5
  Tested up to: 5.6
6
- Stable tag: 2.6.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -332,8 +332,12 @@ We understand that sometimes you need help, have issues or just have questions.
332
  * Plus more customization options added all the time!
333
 
334
  == Changelog ==
 
 
 
 
335
  = 2.6.1 =
336
- * Fix: PHP error due to missing file.
337
 
338
  = 2.6 =
339
  * New: Integrations with popular GDPR cookie consent solutions added: Cookie Notice by dFactory, GDPR Cookie Consent by WebToffee, Cookiebot by Cybot A/S, Complianz by Really Simple Plugins, and Borlabs Cookie by Borlabs. Visit the Instagram Feed settings page, Customize tab, GDPR section for more information.
3
  Tags: Instagram, Instagram feed, Instagram photos, Instagram widget, Instagram gallery
4
  Requires at least: 3.4
5
  Tested up to: 5.6
6
+ Stable tag: 2.6.2
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
332
  * Plus more customization options added all the time!
333
 
334
  == Changelog ==
335
+ = 2.6.2 =
336
+ * Tweak: If the image resizing feature isn't able to work successfully due to an issue, then the GDPR setting will be disabled unless manually enabled to prevent blank images in the feed.
337
+ * Fix: In some situations the GDPR setting was incorrectly reporting an error with image resizing.
338
+
339
  = 2.6.1 =
340
+ * Fix: Fixed PHP error related to a missing file.
341
 
342
  = 2.6 =
343
  * New: Integrations with popular GDPR cookie consent solutions added: Cookie Notice by dFactory, GDPR Cookie Consent by WebToffee, Cookiebot by Cybot A/S, Complianz by Really Simple Plugins, and Borlabs Cookie by Borlabs. Visit the Instagram Feed settings page, Customize tab, GDPR section for more information.
inc/admin/main.php CHANGED
@@ -2285,7 +2285,7 @@ function sb_instagram_settings_page() {
2285
  </div>
2286
  </div>
2287
 
2288
- <?php if ( ! SB_Instagram_GDPR_Integrations::gdpr_tests_successful() ) :
2289
  $errors = SB_Instagram_GDPR_Integrations::gdpr_tests_error_message();
2290
  ?>
2291
  <div class="sb_instagram_box sbi_gdpr_error">
2285
  </div>
2286
  </div>
2287
 
2288
+ <?php if ( ! SB_Instagram_GDPR_Integrations::gdpr_tests_successful( isset( $_GET['retest'] ) ) ) :
2289
  $errors = SB_Instagram_GDPR_Integrations::gdpr_tests_error_message();
2290
  ?>
2291
  <div class="sb_instagram_box sbi_gdpr_error">
inc/class-sb-instagram-feed.php CHANGED
@@ -1087,6 +1087,9 @@ class SB_Instagram_Feed
1087
  }
1088
  if ( SB_Instagram_GDPR_Integrations::doing_gdpr( $settings ) ) {
1089
  $flags[] = 'gdpr';
 
 
 
1090
  }
1091
  if ( isset( $_GET['sbi_debug'] ) ) {
1092
  $flags[] = 'debug';
1087
  }
1088
  if ( SB_Instagram_GDPR_Integrations::doing_gdpr( $settings ) ) {
1089
  $flags[] = 'gdpr';
1090
+ if ( ! SB_Instagram_GDPR_Integrations::blocking_cdn( $settings ) ) {
1091
+ $flags[] = 'overrideBlockCDN';
1092
+ }
1093
  }
1094
  if ( isset( $_GET['sbi_debug'] ) ) {
1095
  $flags[] = 'debug';
inc/class-sb-instagram-gdpr-integrations.php CHANGED
@@ -79,6 +79,22 @@ class SB_Instagram_GDPR_Integrations {
79
  return (SB_Instagram_GDPR_Integrations::gdpr_plugins_active() !== false);
80
  }
81
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  /**
83
  * GDPR features are reliant on the image resizing features
84
  *
@@ -86,7 +102,7 @@ class SB_Instagram_GDPR_Integrations {
86
  *
87
  * @return bool
88
  */
89
- public static function gdpr_tests_successful( $retest = true ) {
90
  $sbi_statuses_option = get_option( 'sbi_statuses', array() );
91
 
92
  if ( ! isset( $sbi_statuses_option['gdpr'] ) || $retest ) {
@@ -94,11 +110,15 @@ class SB_Instagram_GDPR_Integrations {
94
 
95
  $image_editor = wp_get_image_editor( $test_image );
96
 
 
97
  // not uncommon for the image editor to not work using it this way
98
  if ( ! is_wp_error( $image_editor ) ) {
99
  $sbi_statuses_option['gdpr']['image_editor'] = true;
100
  } else {
101
- $sbi_statuses_option['gdpr']['image_editor'] = false;
 
 
 
102
  }
103
 
104
  $upload = wp_upload_dir();
@@ -148,7 +168,18 @@ class SB_Instagram_GDPR_Integrations {
148
  $errors[] = sprintf( __( 'An image editor is not available on your server. Instagram Feed is unable to create local resized images. See %sthis FAQ%s for more information' ), '<a href="https://smashballoon.com/doc/the-images-in-my-feed-are-missing-or-showing-errors/" target="_blank" rel="noopener noreferrer">','</a>' );
149
  }
150
 
 
 
 
 
151
  return implode( '<br>', $errors );
152
  }
153
 
 
 
 
 
 
 
 
154
  }
79
  return (SB_Instagram_GDPR_Integrations::gdpr_plugins_active() !== false);
80
  }
81
 
82
+ public static function blocking_cdn( $settings ) {
83
+ $gdpr = isset( $settings['gdpr'] ) ? $settings['gdpr'] : 'auto';
84
+ if ( $gdpr === 'no' ) {
85
+ return false;
86
+ }
87
+ if ( $gdpr === 'yes' ) {
88
+ return true;
89
+ }
90
+ $sbi_statuses_option = get_option( 'sbi_statuses', array() );
91
+
92
+ if ( $sbi_statuses_option['gdpr']['from_update_success'] ) {
93
+ return (SB_Instagram_GDPR_Integrations::gdpr_plugins_active() !== false);
94
+ }
95
+ return false;
96
+ }
97
+
98
  /**
99
  * GDPR features are reliant on the image resizing features
100
  *
102
  *
103
  * @return bool
104
  */
105
+ public static function gdpr_tests_successful( $retest = false ) {
106
  $sbi_statuses_option = get_option( 'sbi_statuses', array() );
107
 
108
  if ( ! isset( $sbi_statuses_option['gdpr'] ) || $retest ) {
110
 
111
  $image_editor = wp_get_image_editor( $test_image );
112
 
113
+ $sbi_statuses_option['gdpr']['image_editor'] = false;
114
  // not uncommon for the image editor to not work using it this way
115
  if ( ! is_wp_error( $image_editor ) ) {
116
  $sbi_statuses_option['gdpr']['image_editor'] = true;
117
  } else {
118
+ $image_editor = wp_get_image_editor( 'http://plugin.smashballoon.com/editor-test.png' );
119
+ if ( ! is_wp_error( $image_editor ) ) {
120
+ $sbi_statuses_option['gdpr']['image_editor'] = true;
121
+ }
122
  }
123
 
124
  $upload = wp_upload_dir();
168
  $errors[] = sprintf( __( 'An image editor is not available on your server. Instagram Feed is unable to create local resized images. See %sthis FAQ%s for more information' ), '<a href="https://smashballoon.com/doc/the-images-in-my-feed-are-missing-or-showing-errors/" target="_blank" rel="noopener noreferrer">','</a>' );
169
  }
170
 
171
+ if ( isset( $_GET['tab'] ) && $_GET['tab'] !== 'support' ) {
172
+ $errors[] = '<a href="?page=sb-instagram-feed&amp;tab=customize-advanced&amp;retest=1" class="button button-secondary">' . __( 'Retest', 'instagram-feed' ) . '</a>';
173
+ }
174
+
175
  return implode( '<br>', $errors );
176
  }
177
 
178
+ public static function statuses() {
179
+ $sbi_statuses_option = get_option( 'sbi_statuses', array() );
180
+
181
+ $return = isset( $sbi_statuses_option['gdpr'] ) ? $sbi_statuses_option['gdpr'] : array();
182
+ return $return;
183
+ }
184
+
185
  }
inc/class-sb-instagram-parse.php CHANGED
@@ -268,7 +268,14 @@ class SB_Instagram_Parse
268
  } elseif ( ! empty( $header_data['local_avatar'] ) ) {
269
  return $header_data['local_avatar'];
270
  } else {
271
- if ( ! SB_Instagram_GDPR_Integrations::doing_gdpr( $settings ) ) {
 
 
 
 
 
 
 
272
  if ( isset( $header_data['profile_picture'] ) ) {
273
  return $header_data['profile_picture'];
274
  } elseif ( isset( $header_data['profile_picture_url'] ) ) {
268
  } elseif ( ! empty( $header_data['local_avatar'] ) ) {
269
  return $header_data['local_avatar'];
270
  } else {
271
+ $use_cdn = true;
272
+ if ( SB_Instagram_GDPR_Integrations::doing_gdpr( $settings ) ) {
273
+ $use_cdn = false;
274
+ if ( ! SB_Instagram_GDPR_Integrations::blocking_cdn( $settings ) ) {
275
+ $use_cdn = true;
276
+ }
277
+ }
278
+ if ( $use_cdn ) {
279
  if ( isset( $header_data['profile_picture'] ) ) {
280
  return $header_data['profile_picture'];
281
  } elseif ( isset( $header_data['profile_picture_url'] ) ) {
inc/if-functions.php CHANGED
@@ -490,6 +490,22 @@ function sbi_debug_report( $instagram_feed, $feed_id ) {
490
 
491
  <?php endif; endforeach; ?>
492
  </ul>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
493
  <?php
494
  }
495
  add_action( 'sbi_before_feed_end', 'sbi_debug_report', 11, 2 );
490
 
491
  <?php endif; endforeach; ?>
492
  </ul>
493
+ <p>GDPR</p>
494
+ <ul>
495
+ <?php
496
+ $statuses = SB_Instagram_GDPR_Integrations::statuses();
497
+ foreach ( $statuses as $status_key => $value) : ?>
498
+ <li>
499
+ <small><?php echo esc_html( $status_key ); ?>:</small>
500
+ <?php if ( $value == 1 ) { echo 'success'; } else { echo 'failed'; } ?>
501
+ </li>
502
+
503
+ <?php endforeach; ?>
504
+ <li>
505
+ <small>Enabled:</small>
506
+ <?php echo SB_Instagram_GDPR_Integrations::doing_gdpr( $database_settings ); ?>
507
+ </li>
508
+ </ul>
509
  <?php
510
  }
511
  add_action( 'sbi_before_feed_end', 'sbi_debug_report', 11, 2 );
instagram-feed.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Smash Balloon Instagram Feed
4
  Plugin URI: https://smashballoon.com/instagram-feed
5
  Description: Display beautifully clean, customizable, and responsive Instagram feeds.
6
- Version: 2.6.1
7
  Author: Smash Balloon
8
  Author URI: https://smashballoon.com/
9
  License: GPLv2 or later
@@ -23,11 +23,11 @@ along with this program; if not, write to the Free Software
23
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24
  */
25
  if ( ! defined( 'SBIVER' ) ) {
26
- define( 'SBIVER', '2.6.1' );
27
  }
28
  // Db version.
29
  if ( ! defined( 'SBI_DBVERSION' ) ) {
30
- define( 'SBI_DBVERSION', '1.6' );
31
  }
32
 
33
  // Upload folder name for local image files for posts
@@ -540,6 +540,24 @@ if ( function_exists( 'sb_instagram_feed_init' ) ) {
540
  update_option( 'sbi_db_version', SBI_DBVERSION );
541
  }
542
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
543
 
544
  }
545
 
3
  Plugin Name: Smash Balloon Instagram Feed
4
  Plugin URI: https://smashballoon.com/instagram-feed
5
  Description: Display beautifully clean, customizable, and responsive Instagram feeds.
6
+ Version: 2.6.2
7
  Author: Smash Balloon
8
  Author URI: https://smashballoon.com/
9
  License: GPLv2 or later
23
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24
  */
25
  if ( ! defined( 'SBIVER' ) ) {
26
+ define( 'SBIVER', '2.6.2' );
27
  }
28
  // Db version.
29
  if ( ! defined( 'SBI_DBVERSION' ) ) {
30
+ define( 'SBI_DBVERSION', '1.7' );
31
  }
32
 
33
  // Upload folder name for local image files for posts
540
  update_option( 'sbi_db_version', SBI_DBVERSION );
541
  }
542
 
543
+ if ( (float) $db_ver < 1.7 ) {
544
+ include_once trailingslashit( SBI_PLUGIN_DIR ) . 'inc/class-sb-instagram-gdpr-integrations.php';
545
+ $sbi_options = get_option( 'sb_instagram_settings', array() );
546
+ $disable_resizing = isset( $sbi_options['sb_instagram_disable_resize'] ) ? $sbi_options['sb_instagram_disable_resize'] === 'on' || $sbi_options['sb_instagram_disable_resize'] === true : false;
547
+
548
+ $sbi_statuses_option = get_option( 'sbi_statuses', array() );
549
+
550
+ if ( $disable_resizing || ! SB_Instagram_GDPR_Integrations::gdpr_tests_successful( true ) ) {
551
+ $sbi_statuses_option['gdpr']['from_update_success'] = false;
552
+ } else {
553
+ $sbi_statuses_option['gdpr']['from_update_success'] = true;
554
+ }
555
+
556
+ update_option( 'sbi_statuses', $sbi_statuses_option );
557
+
558
+ update_option( 'sbi_db_version', SBI_DBVERSION );
559
+ }
560
+
561
 
562
  }
563
 
js/sb-instagram-2-2.js CHANGED
@@ -197,6 +197,7 @@ if(!sbi_js_exists) {
197
  favorLocal : (flags.indexOf('favorLocal') > -1),
198
  ajaxPostLoad : (flags.indexOf('ajaxPostLoad') > -1),
199
  gdpr : (flags.indexOf('gdpr') > -1),
 
200
  consentGiven : false,
201
  autoMinRes : 1,
202
  general : general
@@ -799,7 +800,7 @@ if(!sbi_js_exists) {
799
  getImageUrls: function ($item) {
800
  var srcSet = JSON.parse($item.find('.sbi_photo').attr('data-img-src-set').replace(/\\\//g, '/')),
801
  id = $item.attr('id').replace('sbi_', '');
802
- if (!this.settings.consentGiven) {
803
  srcSet = [];
804
  }
805
  if (typeof this.resizedImages[id] !== 'undefined'
@@ -1026,7 +1027,7 @@ if(!sbi_js_exists) {
1026
  },1000);
1027
  });
1028
 
1029
- // Cookie Notice by dFactory
1030
  $('#cookie-law-info-bar a').click(function() {
1031
  setTimeout(function() {
1032
  $.each(window.sbi.feeds,function(index){
197
  favorLocal : (flags.indexOf('favorLocal') > -1),
198
  ajaxPostLoad : (flags.indexOf('ajaxPostLoad') > -1),
199
  gdpr : (flags.indexOf('gdpr') > -1),
200
+ overrideBlockCDN : (flags.indexOf('overrideBlockCDN') > -1),
201
  consentGiven : false,
202
  autoMinRes : 1,
203
  general : general
800
  getImageUrls: function ($item) {
801
  var srcSet = JSON.parse($item.find('.sbi_photo').attr('data-img-src-set').replace(/\\\//g, '/')),
802
  id = $item.attr('id').replace('sbi_', '');
803
+ if (!this.settings.consentGiven && !this.settings.overrideBlockCDN) {
804
  srcSet = [];
805
  }
806
  if (typeof this.resizedImages[id] !== 'undefined'
1027
  },1000);
1028
  });
1029
 
1030
+ // GDPR Cookie Consent by WebToffee
1031
  $('#cookie-law-info-bar a').click(function() {
1032
  setTimeout(function() {
1033
  $.each(window.sbi.feeds,function(index){
js/sb-instagram-2-2.min.js CHANGED
@@ -1 +1 @@
1
- var sbi_js_exists=void 0!==sbi_js_exists;sbi_js_exists||(function(b){function e(){var r,i,e,s,l=l||{VER:"0.9.944"};l.bgs_Available=!1,l.bgs_CheckRunned=!1,(r=jQuery).fn.extend({sbi_imgLiquid:function(i){var e,s,t;this.defaults={fill:!0,verticalAlign:"center",horizontalAlign:"center",useBackgroundSize:!0,useDataHtmlAttr:!0,responsive:!0,delay:0,fadeInTime:0,removeBoxBackground:!0,hardPixels:!0,responsiveCheckTime:500,timecheckvisibility:500,onStart:null,onFinish:null,onItemStart:null,onItemFinish:null,onItemError:null},l.bgs_CheckRunned||(l.bgs_CheckRunned=!0,e=r('<span style="background-size:cover" />'),r("body").append(e),(t=e[0])&&window.getComputedStyle&&((s=window.getComputedStyle(t,null))&&s.backgroundSize&&(l.bgs_Available="cover"===s.backgroundSize)),e.remove());var d=this;return this.options=i,this.settings=r.extend({},this.defaults,this.options),this.settings.onStart&&this.settings.onStart(),this.each(function(c){function s(){(f.responsive||_.data("sbi_imgLiquid_oldProcessed"))&&_.data("sbi_imgLiquid_settings")&&(f=_.data("sbi_imgLiquid_settings"),b.actualSize=b.get(0).offsetWidth+b.get(0).offsetHeight/1e4,b.sizeOld&&b.actualSize!==b.sizeOld&&n(),b.sizeOld=b.actualSize,setTimeout(s,f.responsiveCheckTime))}function t(){_.data("sbi_imgLiquid_error",!0),b.addClass("sbi_imgLiquid_error"),f.onItemError&&f.onItemError(c,b,_),u()}function n(){var i,e,s,t,n,a,o,d,r=0,l=0,h=b.width(),g=b.height();void 0===_.data("owidth")&&_.data("owidth",_[0].width),void 0===_.data("oheight")&&_.data("oheight",_[0].height),t=f.fill===h/g>=_.data("owidth")/_.data("oheight")?(i="100%",e="auto",s=Math.floor(h),Math.floor(h*(_.data("oheight")/_.data("owidth")))):(i="auto",e="100%",s=Math.floor(g*(_.data("owidth")/_.data("oheight"))),Math.floor(g)),o=h-s,"left"===(n=f.horizontalAlign.toLowerCase())&&(l=0),"center"===n&&(l=.5*o),"right"===n&&(l=o),-1===n.indexOf("%")||0<(n=parseInt(n.replace("%",""),10))&&(l=o*n*.01),d=g-t,"left"===(a=f.verticalAlign.toLowerCase())&&(r=0),"center"===a&&(r=.5*d),"bottom"===a&&(r=d),-1===a.indexOf("%")||0<(a=parseInt(a.replace("%",""),10))&&(r=d*a*.01),f.hardPixels&&(i=s,e=t),_.css({width:i,height:e,"margin-left":Math.floor(l),"margin-top":Math.floor(r)}),_.data("sbi_imgLiquid_oldProcessed")||(_.fadeTo(f.fadeInTime,1),_.data("sbi_imgLiquid_oldProcessed",!0),f.removeBoxBackground&&b.css("background-image","none"),b.addClass("sbi_imgLiquid_nobgSize"),b.addClass("sbi_imgLiquid_ready")),f.onItemFinish&&f.onItemFinish(c,b,_),u()}function u(){c===d.length-1&&d.settings.onFinish&&d.settings.onFinish()}var i,e,a,o,f=d.settings,b=r(this),_=r("img:first",b);return _.length?(f=_.data("sbi_imgLiquid_settings")?(b.removeClass("sbi_imgLiquid_error").removeClass("sbi_imgLiquid_ready"),r.extend({},_.data("sbi_imgLiquid_settings"),d.options)):r.extend({},d.settings,(o={},d.settings.useDataHtmlAttr&&(i=b.attr("data-sbi_imgLiquid-fill"),e=b.attr("data-sbi_imgLiquid-horizontalAlign"),a=b.attr("data-sbi_imgLiquid-verticalAlign"),"true"!==i&&"false"!==i||(o.fill=Boolean("true"===i)),void 0===e||"left"!==e&&"center"!==e&&"right"!==e&&-1===e.indexOf("%")||(o.horizontalAlign=e),void 0===a||"top"!==a&&"bottom"!==a&&"center"!==a&&-1===a.indexOf("%")||(o.verticalAlign=a)),l.isIE&&d.settings.ieFadeInDisabled&&(o.fadeInTime=0),o)),_.data("sbi_imgLiquid_settings",f),f.onItemStart&&f.onItemStart(c,b,_),void(l.bgs_Available&&f.useBackgroundSize?(-1===b.css("background-image").indexOf(encodeURI(_.attr("src")))&&b.css({"background-image":'url("'+encodeURI(_.attr("src"))+'")'}),b.css({"background-size":f.fill?"cover":"contain","background-position":(f.horizontalAlign+" "+f.verticalAlign).toLowerCase(),"background-repeat":"no-repeat"}),r("a:first",b).css({display:"block",width:"100%",height:"100%"}),r("img",b).css({display:"none"}),f.onItemFinish&&f.onItemFinish(c,b,_),b.addClass("sbi_imgLiquid_bgSize"),b.addClass("sbi_imgLiquid_ready"),u()):function i(){if(_.data("oldSrc")&&_.data("oldSrc")!==_.attr("src")){var e=_.clone().removeAttr("style");return e.data("sbi_imgLiquid_settings",_.data("sbi_imgLiquid_settings")),_.parent().prepend(e),_.remove(),(_=e)[0].width=0,void setTimeout(i,10)}return _.data("sbi_imgLiquid_oldProcessed")?void n():(_.data("sbi_imgLiquid_oldProcessed",!1),_.data("oldSrc",_.attr("src")),r("img:not(:first)",b).css("display","none"),b.css({overflow:"hidden"}),_.fadeTo(0,0).removeAttr("width").removeAttr("height").css({visibility:"visible","max-width":"none","max-height":"none",width:"auto",height:"auto",display:"block"}),_.on("error",t),_[0].onerror=t,function i(){_.data("sbi_imgLiquid_error")||_.data("sbi_imgLiquid_loaded")||_.data("sbi_imgLiquid_oldProcessed")||(b.is(":visible")&&_[0].complete&&0<_[0].width&&0<_[0].height?(_.data("sbi_imgLiquid_loaded",!0),setTimeout(n,c*f.delay)):setTimeout(i,f.timecheckvisibility))}(),void s())}())):void t()})}}),i=l.injectCss,e=document.getElementsByTagName("head")[0],(s=document.createElement("style")).type="text/css",s.styleSheet?s.styleSheet.cssText=i:s.appendChild(document.createTextNode(i)),e.appendChild(s)}function i(){this.feeds={},this.options=sb_instagram_js_options}function o(i,e,s){this.el=i,this.index=e,this.settings=s,this.minImageWidth=0,this.imageResolution=150,this.resizedImages={},this.needsResizing=[],this.outOfPages=!1,this.isInitialized=!1}function d(i,e){b.ajax({url:sbiajaxurl,type:"post",data:i,success:e})}i.prototype={createPage:function(i,e){void 0!==window.sbiajaxurl&&-1!==window.sbiajaxurl.indexOf(window.location.hostname)||(window.sbiajaxurl=location.protocol+"//"+window.location.hostname+"/wp-admin/admin-ajax.php"),b(".sbi_no_js_error_message").remove(),b(".sbi_no_js").removeClass("sbi_no_js"),i(e)},createFeeds:function(i){i.whenFeedsCreated(b(".sbi").each(function(i){b(this).attr("data-sbi-index",i+1);var e=b(this),s=void 0!==e.attr("data-sbi-flags")?e.attr("data-sbi-flags").split(","):[],t=void 0!==e.attr("data-options")?JSON.parse(e.attr("data-options")):{};-1<s.indexOf("testAjax")&&(window.sbi.triggeredTest=!0,d({action:"sbi_on_ajax_test_trigger"},function(i){console.log("did test")}));var n={cols:e.attr("data-cols"),colsmobile:void 0!==e.attr("data-colsmobile")&&"same"!==e.attr("data-colsmobile")?e.attr("data-colsmobile"):e.attr("data-cols"),num:e.attr("data-num"),imgRes:e.attr("data-res"),feedID:e.attr("data-feedid"),shortCodeAtts:e.attr("data-shortcode-atts"),resizingEnabled:-1===s.indexOf("resizeDisable"),imageLoadEnabled:-1===s.indexOf("imageLoadDisable"),debugEnabled:-1<s.indexOf("debug"),favorLocal:-1<s.indexOf("favorLocal"),ajaxPostLoad:-1<s.indexOf("ajaxPostLoad"),gdpr:-1<s.indexOf("gdpr"),consentGiven:!1,autoMinRes:1,general:t};window.sbi.feeds[i]=new o(this,i,n),window.sbi.feeds[i].setResizedImages(),window.sbi.feeds[i].init();var a=jQuery.Event("sbiafterfeedcreate");a.feed=window.sbi.feeds[i],jQuery(window).trigger(a)}))},afterFeedsCreated:function(){b(".sb_instagram_header").each(function(){var i=b(this);i.find(".sbi_header_link").hover(function(){i.find(".sbi_header_img_hover").addClass("sbi_fade_in")},function(){i.find(".sbi_header_img_hover").removeClass("sbi_fade_in")})})},encodeHTML:function(i){if(void 0===i)return"";var e=i.replace(/(>)/g,"&gt;");return e=(e=(e=e.replace(/(<)/g,"&lt;")).replace(/(&lt;br\/&gt;)/g,"<br>")).replace(/(&lt;br&gt;)/g,"<br>")},urlDetect:function(i){return i.match(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g)}},o.prototype={init:function(){var i=this;i.settings.consentGiven=i.checkConsent(),b(this.el).find(".sbi_photo").parent("p").length&&b(this.el).addClass("sbi_no_autop"),b(this.el).find("#sbi_mod_error").length&&b(this.el).prepend(b(this.el).find("#sbi_mod_error")),this.settings.ajaxPostLoad?this.getNewPostSet():this.afterInitialImagesLoaded();var s,e=(s=0,function(i,e){clearTimeout(s),s=setTimeout(i,e)});jQuery(window).resize(function(){e(function(){i.afterResize()},500)}),b(this.el).find(".sbi_item").each(function(){i.lazyLoadCheck(b(this))})},initLayout:function(){},afterInitialImagesLoaded:function(){this.initLayout(),this.loadMoreButtonInit(),this.hideExtraImagesForWidth(),this.beforeNewImagesRevealed(),this.revealNewImages(),this.afterNewImagesRevealed()},afterResize:function(){this.setImageHeight(),this.setImageResolution(),this.maybeRaiseImageResolution(),this.setImageSizeClass()},afterLoadMoreClicked:function(i){i.find(".sbi_loader").removeClass("sbi_hidden"),i.find(".sbi_btn_text").addClass("sbi_hidden"),i.closest(".sbi").find(".sbi_num_diff_hide").addClass("sbi_transition").removeClass("sbi_num_diff_hide")},afterNewImagesLoaded:function(){var i=b(this.el),e=this;this.beforeNewImagesRevealed(),this.revealNewImages(),this.afterNewImagesRevealed(),setTimeout(function(){i.find(".sbi_loader").addClass("sbi_hidden"),i.find(".sbi_btn_text").removeClass("sbi_hidden"),e.maybeRaiseImageResolution()},500)},beforeNewImagesRevealed:function(){this.setImageHeight(),this.maybeRaiseImageResolution(!0),this.setImageSizeClass()},revealNewImages:function(){var i=b(this.el);i.find(".sbi-screenreader").each(function(){b(this).find("img").remove()}),"function"==typeof sbi_custom_js&&setTimeout(function(){sbi_custom_js()},100),this.applyImageLiquid(),i.find(".sbi_item").each(function(i){jQuery(this).find(".sbi_photo").hover(function(){jQuery(this).fadeTo(200,.85)},function(){jQuery(this).stop().fadeTo(500,1)})}),setTimeout(function(){jQuery("#sbi_images .sbi_item.sbi_new").removeClass("sbi_new");var e=10;i.find(".sbi_transition").each(function(){var i=jQuery(this);setTimeout(function(){i.removeClass("sbi_transition")},e),e+=10})},500)},lazyLoadCheck:function(i){if(i.find(".sbi_photo").length&&!i.closest(".sbi").hasClass("sbi-no-ll-check")){var e=this.getImageUrls(i),s=void 0!==e[640]?e[640]:i.find(".sbi_photo").attr("data-full-res");if(!this.settings.consentGiven&&-1<s.indexOf("scontent"))return;i.find(".sbi_photo img").each(function(){s&&void 0!==b(this).attr("data-src")&&b(this).attr("data-src",s),s&&void 0!==b(this).attr("data-orig-src")&&b(this).attr("data-orig-src",s),b(this).on("load",function(){!b(this).hasClass("sbi-replaced")&&-1<b(this).attr("src").indexOf("placeholder")&&(b(this).addClass("sbi-replaced"),s&&(b(this).attr("src",s),b(this).closest(".sbi_imgLiquid_bgSize").length&&b(this).closest(".sbi_imgLiquid_bgSize").css("background-image","url("+s+")")))})})}},afterNewImagesRevealed:function(){this.listenForVisibilityChange(),this.sendNeedsResizingToServer(),this.settings.imageLoadEnabled||b(".sbi_no_resraise").removeClass("sbi_no_resraise");var i=b.Event("sbiafterimagesloaded");i.el=b(this.el),b(window).trigger(i)},setResizedImages:function(){b(this.el).find(".sbi_resized_image_data").length&&void 0!==b(this.el).find(".sbi_resized_image_data").attr("data-resized")&&0===b(this.el).find(".sbi_resized_image_data").attr("data-resized").indexOf('{"')&&(this.resizedImages=JSON.parse(b(this.el).find(".sbi_resized_image_data").attr("data-resized")),b(this.el).find(".sbi_resized_image_data").remove())},sendNeedsResizingToServer:function(){var i,e,t=this;0<t.needsResizing.length&&t.settings.resizingEnabled&&(i=b(this.el).find(".sbi_item").length,e=void 0!==t.settings.general.cache_all&&t.settings.general.cache_all,d({action:"sbi_resized_images_submit",needs_resizing:t.needsResizing,offset:i,feed_id:t.settings.feedID,atts:t.settings.shortCodeAtts,cache_all:e},function(i){if(0===i.trim().indexOf("{")){var e=JSON.parse(i);for(var s in t.settings.debugEnabled&&console.log(e),e)e.hasOwnProperty(s)&&(t.resizedImages[s]=e[s]);t.maybeRaiseImageResolution(),setTimeout(function(){t.afterResize()},500)}}))},loadMoreButtonInit:function(){var i=b(this.el),e=this;i.find("#sbi_load .sbi_load_btn").off().on("click",function(){e.afterLoadMoreClicked(jQuery(this)),e.getNewPostSet()})},getNewPostSet:function(){var s=b(this.el),t=this;d({action:"sbi_load_more_clicked",offset:s.find(".sbi_item").length,feed_id:t.settings.feedID,atts:t.settings.shortCodeAtts,current_resolution:t.imageResolution},function(i){var e;0===i.trim().indexOf("{")&&(e=JSON.parse(i),t.settings.debugEnabled&&console.log(e),t.appendNewPosts(e.html),t.addResizedImages(e.resizedImages),t.settings.ajaxPostLoad?(t.settings.ajaxPostLoad=!1,t.afterInitialImagesLoaded()):t.afterNewImagesLoaded(),e.feedStatus.shouldPaginate?t.outOfPages=!1:(t.outOfPages=!0,s.find(".sbi_load_btn").hide()),b(".sbi_no_js").removeClass("sbi_no_js"))})},appendNewPosts:function(i){var e=b(this.el);e.find("#sbi_images .sbi_item").length?e.find("#sbi_images .sbi_item").last().after(i):e.find("#sbi_images").append(i)},addResizedImages:function(i){for(var e in i)this.resizedImages[e]=i[e]},setImageHeight:function(){var s=b(this.el),i=s.find(".sbi_photo").eq(0).innerWidth(),e=this.getColumnCount(),t=s.find("#sbi_images").innerWidth()-s.find("#sbi_images").width(),n=t/2;sbi_photo_width_manual=s.find("#sbi_images").width()/e-t,s.find(".sbi_photo").css("height",i),s.find(".sbi-owl-nav").length&&setTimeout(function(){var i=2;s.find(".sbi_owl2row-item").length&&(i=1);var e=s.find(".sbi_photo").eq(0).innerWidth()/i;e+=parseInt(n)*(2-i+2),s.find(".sbi-owl-nav div").css("top",e)},100)},maybeRaiseSingleImageResolution:function(t,i,s){var n=this,a=n.getImageUrls(t),o=t.find(".sbi_photo img").attr("src"),d=150,e=t.find("img").get(0),r=o===window.sbi.options.placeholder?1:e.naturalWidth/e.naturalHeight,s=void 0!==s&&s;if(!(t.hasClass("sbi_no_resraise")||t.hasClass("sbi_had_error")||t.find(".sbi_link_area").length&&t.find(".sbi_link_area").hasClass("sbi_had_error")))if(a.length<1)t.find(".sbi_link_area").length&&t.find(".sbi_link_area").attr("href",window.sbi.options.placeholder.replace("placeholder.png","thumb-placeholder.png"));else{(t.find(".sbi_link_area").length&&t.find(".sbi_link_area").attr("href")===window.sbi.options.placeholder.replace("placeholder.png","thumb-placeholder.png")||!n.settings.consentGiven)&&t.find(".sbi_link_area").attr("href",a[a.length-1]),void 0!==a[640]&&t.find(".sbi_photo").attr("data-full-res",a[640]),b.each(a,function(i,e){e===o&&(d=parseInt(i),s=!1)});var l,h,g,c=640;switch(n.settings.imgRes){case"thumb":c=150;break;case"medium":c=320;break;case"full":c=640;break;default:var u=Math.max(n.settings.autoMinRes,t.find(".sbi_photo").innerWidth()),f=n.getBestResolutionForAuto(u,r,t);switch(f){case 320:c=320;break;case 150:c=150}}(d<c||o===window.sbi.options.placeholder||s)&&(n.settings.debugEnabled&&(l=o===window.sbi.options.placeholder?"was placeholder":"too small",console.log("rais res for "+o,l)),h=a[c].split("?ig_cache_key")[0],o!==h&&(t.find(".sbi_photo img").attr("src",h),t.find(".sbi_photo").css("background-image",'url("'+h+'")')),d=c,"auto"===n.settings.imgRes&&(g=!1,t.find(".sbi_photo img").on("load",function(){var i,e=b(this),s=e.get(0).naturalWidth/e.get(0).naturalHeight;if(1e3!==e.get(0).naturalWidth&&r<s&&!g){switch(n.settings.debugEnabled&&console.log("rais res again for aspect ratio change "+o),g=!0,u=t.find(".sbi_photo").innerWidth(),f=n.getBestResolutionForAuto(u,s,t),c=640,f){case 320:c=320;break;case 150:c=150}d<c&&(h=a[c].split("?ig_cache_key")[0],e.attr("src",h),e.closest(".sbi_photo").css("background-image",'url("'+h+'")')),"masonry"!==n.layout&&"highlight"!==n.layout||(b(n.el).find("#sbi_images").smashotope(n.isotopeArgs),setTimeout(function(){b(n.el).find("#sbi_images").smashotope(n.isotopeArgs)},500))}else{n.settings.debugEnabled&&(i=g?"already checked":"no aspect ratio change",console.log("not raising res for replacement "+o,i))}}))),t.find("img").on("error",function(){var i;b(this).hasClass("sbi_img_error")?console.log("unfixed error "+b(this).attr("src")):(b(this).addClass("sbi_img_error"),-1<b(this).attr("src").indexOf("media/?size=")||-1<b(this).attr("src").indexOf("cdninstagram")||-1<b(this).attr("src").indexOf("fbcdn")?(n.settings.favorLocal=!0,void 0!==(i=n.getImageUrls(b(this).closest(".sbi_item")))[640]&&(b(this).attr("src",i[640]),b(this).closest(".sbi_photo").css("background-image","url("+i[640]+")"),b(this).closest(".sbi_item").addClass("sbi_had_error").find(".sbi_link_area").attr("href",i[640]).addClass("sbi_had_error"))):"undefined"!==b(this).closest(".sbi_photo").attr("data-img-src-set")&&void 0!==(i=JSON.parse(b(this).closest(".sbi_photo").attr("data-img-src-set").replace(/\\\//g,"/"))).d&&(b(this).attr("src",i.d),b(this).closest(".sbi_photo").css("background-image","url("+i.d+")"),b(this).closest(".sbi_item").addClass("sbi_had_error").find(".sbi_link_area").attr("href",i[640]).addClass("sbi_had_error")),setTimeout(function(){n.afterResize()},1500))})}},maybeRaiseImageResolution:function(i){var e=this,s=void 0!==i&&!0===i?".sbi_item.sbi_new":".sbi_item",t=!e.isInitialized;b(e.el).find(s).each(function(i){!b(this).hasClass("sbi_num_diff_hide")&&b(this).find(".sbi_photo").length&&void 0!==b(this).find(".sbi_photo").attr("data-img-src-set")&&e.maybeRaiseSingleImageResolution(b(this),i,t)}),e.isInitialized=!0},getBestResolutionForAuto:function(i,e,s){(isNaN(e)||e<1)&&(e=1);var t,n=i*e,a=10*Math.ceil(n/10),o=[150,320,640];return s.hasClass("sbi_highlighted")&&(a*=2),-1===o.indexOf(parseInt(a))&&(t=!1,b.each(o,function(i,e){e>parseInt(a)&&!t&&(a=e,t=!0)})),a},hideExtraImagesForWidth:function(){var i,e,s;"carousel"!==this.layout&&(e=void 0!==(i=b(this.el)).attr("data-num")&&""!==i.attr("data-num")?parseInt(i.attr("data-num")):1,s=void 0!==i.attr("data-nummobile")&&""!==i.attr("data-nummobile")?parseInt(i.attr("data-nummobile")):e,b(window).width()<480?s<i.find(".sbi_item").length&&i.find(".sbi_item").slice(s-i.find(".sbi_item").length).addClass("sbi_num_diff_hide"):e<i.find(".sbi_item").length&&i.find(".sbi_item").slice(e-i.find(".sbi_item").length).addClass("sbi_num_diff_hide"))},setImageSizeClass:function(){var i=b(this.el);i.removeClass("sbi_small sbi_medium");var e=i.innerWidth(),s=parseInt(i.find("#sbi_images").outerWidth()-i.find("#sbi_images").width())/2,t=this.getColumnCount(),n=(e-s*(t+2))/t;120<n&&n<240?i.addClass("sbi_medium"):n<=120&&i.addClass("sbi_small")},setMinImageWidth:function(){b(this.el).find(".sbi_item .sbi_photo").first().length?this.minImageWidth=b(this.el).find(".sbi_item .sbi_photo").first().innerWidth():this.minImageWidth=150},setImageResolution:function(){if("auto"===this.settings.imgRes)this.imageResolution="auto";else switch(this.settings.imgRes){case"thumb":this.imageResolution=150;break;case"medium":this.imageResolution=320;break;default:this.imageResolution=640}},getImageUrls:function(i){var e,s=JSON.parse(i.find(".sbi_photo").attr("data-img-src-set").replace(/\\\//g,"/")),t=i.attr("id").replace("sbi_","");return this.settings.consentGiven||(s=[]),void 0!==this.resizedImages[t]&&"video"!==this.resizedImages[t]&&"pending"!==this.resizedImages[t]&&"error"!==this.resizedImages[t].id&&"video"!==this.resizedImages[t].id&&"pending"!==this.resizedImages[t].id?void 0!==this.resizedImages[t].sizes&&(e=[],void 0!==this.resizedImages[t].sizes.full&&(s[640]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"full.jpg",e.push(640)),void 0!==this.resizedImages[t].sizes.low&&(s[320]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"low.jpg",e.push(320)),void 0!==this.resizedImages[t].sizes.thumb&&(e.push(150),s[150]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"thumb.jpg"),this.settings.favorLocal&&(-1===e.indexOf(640)&&-1<e.indexOf(320)&&(s[640]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"low.jpg"),-1===e.indexOf(320)&&(-1<e.indexOf(640)?s[320]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"full.jpg":-1<e.indexOf(150)&&(s[320]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"thumb.jpg")),-1===e.indexOf(150)&&(-1<e.indexOf(320)?s[150]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"low.jpg":-1<e.indexOf(640)&&(s[150]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"full.jpg")))):(void 0===this.resizedImages[t]||void 0!==this.resizedImages[t].id&&"pending"!==this.resizedImages[t].id&&"error"!==this.resizedImages[t].id)&&this.addToNeedsResizing(t),s},getAvatarUrl:function(i,e){if(""===i)return"";var s=this.settings.general.avatars;return"local"===(e=void 0!==e?e:"local")?void 0!==s["LCL"+i]&&1===parseInt(s["LCL"+i])?sb_instagram_js_options.resized_url+i+".jpg":void 0!==s[i]?s[i]:"":void 0!==s[i]?s[i]:void 0!==s["LCL"+i]&&1===parseInt(s["LCL"+i])?sb_instagram_js_options.resized_url+i+".jpg":""},addToNeedsResizing:function(i){-1===this.needsResizing.indexOf(i)&&this.needsResizing.push(i)},applyImageLiquid:function(){var i=b(this.el);e(),"function"==typeof i.find(".sbi_photo").sbi_imgLiquid&&i.find(".sbi_photo").sbi_imgLiquid({fill:!0})},listenForVisibilityChange:function(){var s,t,n,a=this;s=jQuery,t={callback:function(){},runOnLoad:!0,frequency:100,sbiPreviousVisibility:null},n={sbiCheckVisibility:function(i,e){var s,t;jQuery.contains(document,i[0])&&(s=e.sbiPreviousVisibility,t=i.is(":visible"),e.sbiPreviousVisibility=t,null==s?e.runOnLoad&&e.callback(i,t):s!==t&&e.callback(i,t),setTimeout(function(){n.sbiCheckVisibility(i,e)},e.frequency))}},s.fn.sbiVisibilityChanged=function(i){var e=s.extend({},t,i);return this.each(function(){n.sbiCheckVisibility(s(this),e)})},"function"==typeof b(this.el).filter(":hidden").sbiVisibilityChanged&&b(this.el).filter(":hidden").sbiVisibilityChanged({callback:function(i,e){a.afterResize()},runOnLoad:!1})},getColumnCount:function(){var i=b(this.el),e=this.settings.cols,s=this.settings.colsmobile,t=e;return sbiWindowWidth=window.innerWidth,i.hasClass("sbi_mob_col_auto")?(sbiWindowWidth<640&&2<parseInt(e)&&parseInt(e)<7&&(t=2),sbiWindowWidth<640&&6<parseInt(e)&&parseInt(e)<11&&(t=4),sbiWindowWidth<=480&&2<parseInt(e)&&(t=1)):sbiWindowWidth<=480&&(t=s),parseInt(t)},checkConsent:function(){if(this.settings.consentGiven||!this.settings.gdpr)return!0;var i,e;"undefined"!=typeof CLI_Cookie?null!==CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME)&&(this.settings.consentGiven="yes"===CLI_Cookie.read("cookielawinfo-checkbox-non-necessary")):void 0!==window.cnArgs?2===(i=("; "+document.cookie).split("; cookie_notice_accepted=")).length&&(e=i.pop().split(";").shift(),this.settings.consentGiven="true"===e):void 0!==window.cookieconsent?this.settings.consentGiven="allow"===function(i){for(var e=i+"=",s=window.document.cookie.split(";"),t=0;t<s.length;t++){var n=s[t].trim();if(0==n.indexOf(e))return n.substring(e.length,n.length)}return""}("complianz_consent_status"):void 0!==window.Cookiebot&&(this.settings.consentGiven=Cookiebot.consented);var s=jQuery.Event("sbicheckconsent");return s.feed=this,jQuery(window).trigger(s),this.settings.consentGiven},afterConsentToggled:function(){var i;this.checkConsent()&&((i=this).maybeRaiseImageResolution(),setTimeout(function(){i.afterResize()},500))}},window.sbi_init=function(){window.sbi=new i,window.sbi.createPage(window.sbi.createFeeds,{whenFeedsCreated:window.sbi.afterFeedsCreated})}}(jQuery),jQuery(document).ready(function(e){void 0===window.sb_instagram_js_options&&(window.sb_instagram_js_options={font_method:"svg",resized_url:location.protocol+"//"+window.location.hostname+"/wp-content/uploads/sb-instagram-feed-images/",placeholder:location.protocol+"//"+window.location.hostname+"/wp-content/plugins/instagram-feed/img/placeholder.png"}),void 0!==window.sb_instagram_js_options.resized_url&&-1===window.sb_instagram_js_options.resized_url.indexOf(location.protocol)&&("http:"===location.protocol?window.sb_instagram_js_options.resized_url=window.sb_instagram_js_options.resized_url.replace("https:","http:"):window.sb_instagram_js_options.resized_url=window.sb_instagram_js_options.resized_url.replace("http:","https:")),sbi_init(),e("#cookie-notice a").click(function(){setTimeout(function(){e.each(window.sbi.feeds,function(i){window.sbi.feeds[i].afterConsentToggled()})},1e3)}),e("#cookie-law-info-bar a").click(function(){setTimeout(function(){e.each(window.sbi.feeds,function(i){window.sbi.feeds[i].afterConsentToggled()})},1e3)}),e(".cli-user-preference-checkbox").click(function(){setTimeout(function(){e.each(window.sbi.feeds,function(i){window.sbi.feeds[i].settings.consentGiven=!1,window.sbi.feeds[i].afterConsentToggled()})},1e3)}),e(window).on("CookiebotOnAccept",function(i){e.each(window.sbi.feeds,function(i){window.sbi.feeds[i].settings.consentGiven=!0,window.sbi.feeds[i].afterConsentToggled()})}),e(document).on("cmplzAcceptAll",function(i){e.each(window.sbi.feeds,function(i){window.sbi.feeds[i].settings.consentGiven=!0,window.sbi.feeds[i].afterConsentToggled()})}),e(document).on("cmplzRevoke",function(i){e.each(window.sbi.feeds,function(i){window.sbi.feeds[i].settings.consentGiven=!1,window.sbi.feeds[i].afterConsentToggled()})})}));
1
+ var sbi_js_exists=void 0!==sbi_js_exists;sbi_js_exists||(!function(i){function e(){var i,e,t,s=s||{VER:"0.9.944"};s.bgs_Available=!1,s.bgs_CheckRunned=!1,function(i){i.fn.extend({sbi_imgLiquid:function(e){this.defaults={fill:!0,verticalAlign:"center",horizontalAlign:"center",useBackgroundSize:!0,useDataHtmlAttr:!0,responsive:!0,delay:0,fadeInTime:0,removeBoxBackground:!0,hardPixels:!0,responsiveCheckTime:500,timecheckvisibility:500,onStart:null,onFinish:null,onItemStart:null,onItemFinish:null,onItemError:null},function(){if(!s.bgs_CheckRunned){s.bgs_CheckRunned=!0;var e=i('<span style="background-size:cover" />');i("body").append(e),function(){var i=e[0];if(i&&window.getComputedStyle){var t=window.getComputedStyle(i,null);t&&t.backgroundSize&&(s.bgs_Available="cover"===t.backgroundSize)}}(),e.remove()}}();var t=this;return this.options=e,this.settings=i.extend({},this.defaults,this.options),this.settings.onStart&&this.settings.onStart(),this.each(function(e){function n(){(r.responsive||h.data("sbi_imgLiquid_oldProcessed"))&&h.data("sbi_imgLiquid_settings")&&(r=h.data("sbi_imgLiquid_settings"),l.actualSize=l.get(0).offsetWidth+l.get(0).offsetHeight/1e4,l.sizeOld&&l.actualSize!==l.sizeOld&&o(),l.sizeOld=l.actualSize,setTimeout(n,r.responsiveCheckTime))}function a(){h.data("sbi_imgLiquid_error",!0),l.addClass("sbi_imgLiquid_error"),r.onItemError&&r.onItemError(e,l,h),d()}function o(){var i,t,s,n,a,o,g,c,f=0,u=0,b=l.width(),_=l.height();void 0===h.data("owidth")&&h.data("owidth",h[0].width),void 0===h.data("oheight")&&h.data("oheight",h[0].height),r.fill===b/_>=h.data("owidth")/h.data("oheight")?(i="100%",t="auto",s=Math.floor(b),n=Math.floor(b*(h.data("oheight")/h.data("owidth")))):(i="auto",t="100%",s=Math.floor(_*(h.data("owidth")/h.data("oheight"))),n=Math.floor(_)),g=b-s,"left"===(a=r.horizontalAlign.toLowerCase())&&(u=0),"center"===a&&(u=.5*g),"right"===a&&(u=g),-1!==a.indexOf("%")&&((a=parseInt(a.replace("%",""),10))>0&&(u=g*a*.01)),c=_-n,"left"===(o=r.verticalAlign.toLowerCase())&&(f=0),"center"===o&&(f=.5*c),"bottom"===o&&(f=c),-1!==o.indexOf("%")&&((o=parseInt(o.replace("%",""),10))>0&&(f=c*o*.01)),r.hardPixels&&(i=s,t=n),h.css({width:i,height:t,"margin-left":Math.floor(u),"margin-top":Math.floor(f)}),h.data("sbi_imgLiquid_oldProcessed")||(h.fadeTo(r.fadeInTime,1),h.data("sbi_imgLiquid_oldProcessed",!0),r.removeBoxBackground&&l.css("background-image","none"),l.addClass("sbi_imgLiquid_nobgSize"),l.addClass("sbi_imgLiquid_ready")),r.onItemFinish&&r.onItemFinish(e,l,h),d()}function d(){e===t.length-1&&t.settings.onFinish&&t.settings.onFinish()}var r=t.settings,l=i(this),h=i("img:first",l);return h.length?(h.data("sbi_imgLiquid_settings")?(l.removeClass("sbi_imgLiquid_error").removeClass("sbi_imgLiquid_ready"),r=i.extend({},h.data("sbi_imgLiquid_settings"),t.options)):r=i.extend({},t.settings,function(){var i={};if(t.settings.useDataHtmlAttr){var e=l.attr("data-sbi_imgLiquid-fill"),n=l.attr("data-sbi_imgLiquid-horizontalAlign"),a=l.attr("data-sbi_imgLiquid-verticalAlign");("true"===e||"false"===e)&&(i.fill=Boolean("true"===e)),void 0===n||"left"!==n&&"center"!==n&&"right"!==n&&-1===n.indexOf("%")||(i.horizontalAlign=n),void 0===a||"top"!==a&&"bottom"!==a&&"center"!==a&&-1===a.indexOf("%")||(i.verticalAlign=a)}return s.isIE&&t.settings.ieFadeInDisabled&&(i.fadeInTime=0),i}()),h.data("sbi_imgLiquid_settings",r),r.onItemStart&&r.onItemStart(e,l,h),void(s.bgs_Available&&r.useBackgroundSize?(-1===l.css("background-image").indexOf(encodeURI(h.attr("src")))&&l.css({"background-image":'url("'+encodeURI(h.attr("src"))+'")'}),l.css({"background-size":r.fill?"cover":"contain","background-position":(r.horizontalAlign+" "+r.verticalAlign).toLowerCase(),"background-repeat":"no-repeat"}),i("a:first",l).css({display:"block",width:"100%",height:"100%"}),i("img",l).css({display:"none"}),r.onItemFinish&&r.onItemFinish(e,l,h),l.addClass("sbi_imgLiquid_bgSize"),l.addClass("sbi_imgLiquid_ready"),d()):function t(){if(h.data("oldSrc")&&h.data("oldSrc")!==h.attr("src")){var s=h.clone().removeAttr("style");return s.data("sbi_imgLiquid_settings",h.data("sbi_imgLiquid_settings")),h.parent().prepend(s),h.remove(),(h=s)[0].width=0,void setTimeout(t,10)}return h.data("sbi_imgLiquid_oldProcessed")?void o():(h.data("sbi_imgLiquid_oldProcessed",!1),h.data("oldSrc",h.attr("src")),i("img:not(:first)",l).css("display","none"),l.css({overflow:"hidden"}),h.fadeTo(0,0).removeAttr("width").removeAttr("height").css({visibility:"visible","max-width":"none","max-height":"none",width:"auto",height:"auto",display:"block"}),h.on("error",a),h[0].onerror=a,function i(){h.data("sbi_imgLiquid_error")||h.data("sbi_imgLiquid_loaded")||h.data("sbi_imgLiquid_oldProcessed")||(l.is(":visible")&&h[0].complete&&h[0].width>0&&h[0].height>0?(h.data("sbi_imgLiquid_loaded",!0),setTimeout(o,e*r.delay)):setTimeout(i,r.timecheckvisibility))}(),void n())}())):void a()})}})}(jQuery),i=s.injectCss,e=document.getElementsByTagName("head")[0],(t=document.createElement("style")).type="text/css",t.styleSheet?t.styleSheet.cssText=i:t.appendChild(document.createTextNode(i)),e.appendChild(t)}function t(){this.feeds={},this.options=sb_instagram_js_options}function s(i,e,t){this.el=i,this.index=e,this.settings=t,this.minImageWidth=0,this.imageResolution=150,this.resizedImages={},this.needsResizing=[],this.outOfPages=!1,this.isInitialized=!1}function n(e,t){i.ajax({url:sbiajaxurl,type:"post",data:e,success:t})}t.prototype={createPage:function(e,t){void 0!==window.sbiajaxurl&&-1!==window.sbiajaxurl.indexOf(window.location.hostname)||(window.sbiajaxurl=location.protocol+"//"+window.location.hostname+"/wp-admin/admin-ajax.php"),i(".sbi_no_js_error_message").remove(),i(".sbi_no_js").removeClass("sbi_no_js"),e(t)},createFeeds:function(e){e.whenFeedsCreated(i(".sbi").each(function(e){i(this).attr("data-sbi-index",e+1);var t=i(this),a=void 0!==t.attr("data-sbi-flags")?t.attr("data-sbi-flags").split(","):[],o=void 0!==t.attr("data-options")?JSON.parse(t.attr("data-options")):{};if(a.indexOf("testAjax")>-1){window.sbi.triggeredTest=!0;n({action:"sbi_on_ajax_test_trigger"},function(i){console.log("did test")})}var d={cols:t.attr("data-cols"),colsmobile:void 0!==t.attr("data-colsmobile")&&"same"!==t.attr("data-colsmobile")?t.attr("data-colsmobile"):t.attr("data-cols"),num:t.attr("data-num"),imgRes:t.attr("data-res"),feedID:t.attr("data-feedid"),shortCodeAtts:t.attr("data-shortcode-atts"),resizingEnabled:-1===a.indexOf("resizeDisable"),imageLoadEnabled:-1===a.indexOf("imageLoadDisable"),debugEnabled:a.indexOf("debug")>-1,favorLocal:a.indexOf("favorLocal")>-1,ajaxPostLoad:a.indexOf("ajaxPostLoad")>-1,gdpr:a.indexOf("gdpr")>-1,overrideBlockCDN:a.indexOf("overrideBlockCDN")>-1,consentGiven:!1,autoMinRes:1,general:o};window.sbi.feeds[e]=function(i,e,t){return new s(i,e,t)}(this,e,d),window.sbi.feeds[e].setResizedImages(),window.sbi.feeds[e].init();var r=jQuery.Event("sbiafterfeedcreate");r.feed=window.sbi.feeds[e],jQuery(window).trigger(r)}))},afterFeedsCreated:function(){i(".sb_instagram_header").each(function(){var e=i(this);e.find(".sbi_header_link").hover(function(){e.find(".sbi_header_img_hover").addClass("sbi_fade_in")},function(){e.find(".sbi_header_img_hover").removeClass("sbi_fade_in")})})},encodeHTML:function(i){return void 0===i?"":i.replace(/(>)/g,"&gt;").replace(/(<)/g,"&lt;").replace(/(&lt;br\/&gt;)/g,"<br>").replace(/(&lt;br&gt;)/g,"<br>")},urlDetect:function(i){return i.match(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&\/\/=]*)/g)}},s.prototype={init:function(){var e=this;e.settings.consentGiven=e.checkConsent(),i(this.el).find(".sbi_photo").parent("p").length&&i(this.el).addClass("sbi_no_autop"),i(this.el).find("#sbi_mod_error").length&&i(this.el).prepend(i(this.el).find("#sbi_mod_error")),this.settings.ajaxPostLoad?this.getNewPostSet():this.afterInitialImagesLoaded();var t,s=(t=0,function(i,e){clearTimeout(t),t=setTimeout(i,e)});jQuery(window).resize(function(){s(function(){e.afterResize()},500)}),i(this.el).find(".sbi_item").each(function(){e.lazyLoadCheck(i(this))})},initLayout:function(){},afterInitialImagesLoaded:function(){this.initLayout(),this.loadMoreButtonInit(),this.hideExtraImagesForWidth(),this.beforeNewImagesRevealed(),this.revealNewImages(),this.afterNewImagesRevealed()},afterResize:function(){this.setImageHeight(),this.setImageResolution(),this.maybeRaiseImageResolution(),this.setImageSizeClass()},afterLoadMoreClicked:function(i){i.find(".sbi_loader").removeClass("sbi_hidden"),i.find(".sbi_btn_text").addClass("sbi_hidden"),i.closest(".sbi").find(".sbi_num_diff_hide").addClass("sbi_transition").removeClass("sbi_num_diff_hide")},afterNewImagesLoaded:function(){var e=i(this.el),t=this;this.beforeNewImagesRevealed(),this.revealNewImages(),this.afterNewImagesRevealed(),setTimeout(function(){e.find(".sbi_loader").addClass("sbi_hidden"),e.find(".sbi_btn_text").removeClass("sbi_hidden"),t.maybeRaiseImageResolution()},500)},beforeNewImagesRevealed:function(){this.setImageHeight(),this.maybeRaiseImageResolution(!0),this.setImageSizeClass()},revealNewImages:function(){var e=i(this.el);e.find(".sbi-screenreader").each(function(){i(this).find("img").remove()}),"function"==typeof sbi_custom_js&&setTimeout(function(){sbi_custom_js()},100),this.applyImageLiquid(),e.find(".sbi_item").each(function(i){jQuery(this).find(".sbi_photo").hover(function(){jQuery(this).fadeTo(200,.85)},function(){jQuery(this).stop().fadeTo(500,1)})}),setTimeout(function(){jQuery("#sbi_images .sbi_item.sbi_new").removeClass("sbi_new");var i=10;e.find(".sbi_transition").each(function(){var e=jQuery(this);setTimeout(function(){e.removeClass("sbi_transition")},i),i+=10})},500)},lazyLoadCheck:function(e){if(e.find(".sbi_photo").length&&!e.closest(".sbi").hasClass("sbi-no-ll-check")){var t=this.getImageUrls(e),s=void 0!==t[640]?t[640]:e.find(".sbi_photo").attr("data-full-res");if(!this.settings.consentGiven&&s.indexOf("scontent")>-1)return;e.find(".sbi_photo img").each(function(){s&&void 0!==i(this).attr("data-src")&&i(this).attr("data-src",s),s&&void 0!==i(this).attr("data-orig-src")&&i(this).attr("data-orig-src",s),i(this).on("load",function(){!i(this).hasClass("sbi-replaced")&&i(this).attr("src").indexOf("placeholder")>-1&&(i(this).addClass("sbi-replaced"),s&&(i(this).attr("src",s),i(this).closest(".sbi_imgLiquid_bgSize").length&&i(this).closest(".sbi_imgLiquid_bgSize").css("background-image","url("+s+")")))})})}},afterNewImagesRevealed:function(){this.listenForVisibilityChange(),this.sendNeedsResizingToServer(),this.settings.imageLoadEnabled||i(".sbi_no_resraise").removeClass("sbi_no_resraise");var e=i.Event("sbiafterimagesloaded");e.el=i(this.el),i(window).trigger(e)},setResizedImages:function(){i(this.el).find(".sbi_resized_image_data").length&&void 0!==i(this.el).find(".sbi_resized_image_data").attr("data-resized")&&0===i(this.el).find(".sbi_resized_image_data").attr("data-resized").indexOf('{"')&&(this.resizedImages=JSON.parse(i(this.el).find(".sbi_resized_image_data").attr("data-resized")),i(this.el).find(".sbi_resized_image_data").remove())},sendNeedsResizingToServer:function(){var e=this;if(e.needsResizing.length>0&&e.settings.resizingEnabled){var t=i(this.el).find(".sbi_item").length,s=void 0!==e.settings.general.cache_all&&e.settings.general.cache_all;n({action:"sbi_resized_images_submit",needs_resizing:e.needsResizing,offset:t,feed_id:e.settings.feedID,atts:e.settings.shortCodeAtts,cache_all:s},function(i){if(0===i.trim().indexOf("{")){var t=JSON.parse(i);for(var s in e.settings.debugEnabled&&console.log(t),t)t.hasOwnProperty(s)&&(e.resizedImages[s]=t[s]);e.maybeRaiseImageResolution(),setTimeout(function(){e.afterResize()},500)}})}},loadMoreButtonInit:function(){var e=i(this.el),t=this;e.find("#sbi_load .sbi_load_btn").off().on("click",function(){t.afterLoadMoreClicked(jQuery(this)),t.getNewPostSet()})},getNewPostSet:function(){var e=i(this.el),t=this;n({action:"sbi_load_more_clicked",offset:e.find(".sbi_item").length,feed_id:t.settings.feedID,atts:t.settings.shortCodeAtts,current_resolution:t.imageResolution},function(s){if(0===s.trim().indexOf("{")){var n=JSON.parse(s);t.settings.debugEnabled&&console.log(n),t.appendNewPosts(n.html),t.addResizedImages(n.resizedImages),t.settings.ajaxPostLoad?(t.settings.ajaxPostLoad=!1,t.afterInitialImagesLoaded()):t.afterNewImagesLoaded(),n.feedStatus.shouldPaginate?t.outOfPages=!1:(t.outOfPages=!0,e.find(".sbi_load_btn").hide()),i(".sbi_no_js").removeClass("sbi_no_js")}})},appendNewPosts:function(e){var t=i(this.el);t.find("#sbi_images .sbi_item").length?t.find("#sbi_images .sbi_item").last().after(e):t.find("#sbi_images").append(e)},addResizedImages:function(i){for(var e in i)this.resizedImages[e]=i[e]},setImageHeight:function(){var e=i(this.el),t=e.find(".sbi_photo").eq(0).innerWidth(),s=this.getColumnCount(),n=e.find("#sbi_images").innerWidth()-e.find("#sbi_images").width(),a=n/2;sbi_photo_width_manual=e.find("#sbi_images").width()/s-n,e.find(".sbi_photo").css("height",t),e.find(".sbi-owl-nav").length&&setTimeout(function(){var i=2;e.find(".sbi_owl2row-item").length&&(i=1);var t=e.find(".sbi_photo").eq(0).innerWidth()/i;t+=parseInt(a)*(2-i+2),e.find(".sbi-owl-nav div").css("top",t)},100)},maybeRaiseSingleImageResolution:function(e,t,s){var n=this,a=n.getImageUrls(e),o=e.find(".sbi_photo img").attr("src"),d=150,r=e.find("img").get(0),l=o===window.sbi.options.placeholder?1:r.naturalWidth/r.naturalHeight;s=void 0!==s&&s;if(!(e.hasClass("sbi_no_resraise")||e.hasClass("sbi_had_error")||e.find(".sbi_link_area").length&&e.find(".sbi_link_area").hasClass("sbi_had_error")))if(a.length<1)e.find(".sbi_link_area").length&&e.find(".sbi_link_area").attr("href",window.sbi.options.placeholder.replace("placeholder.png","thumb-placeholder.png"));else{(e.find(".sbi_link_area").length&&e.find(".sbi_link_area").attr("href")===window.sbi.options.placeholder.replace("placeholder.png","thumb-placeholder.png")||!n.settings.consentGiven)&&e.find(".sbi_link_area").attr("href",a[a.length-1]),void 0!==a[640]&&e.find(".sbi_photo").attr("data-full-res",a[640]),i.each(a,function(i,e){e===o&&(d=parseInt(i),s=!1)});var h=640;switch(n.settings.imgRes){case"thumb":h=150;break;case"medium":h=320;break;case"full":h=640;break;default:var g=Math.max(n.settings.autoMinRes,e.find(".sbi_photo").innerWidth()),c=n.getBestResolutionForAuto(g,l,e);switch(c){case 320:h=320;break;case 150:h=150}}if(h>d||o===window.sbi.options.placeholder||s){if(n.settings.debugEnabled){var f=o===window.sbi.options.placeholder?"was placeholder":"too small";console.log("rais res for "+o,f)}var u=a[h].split("?ig_cache_key")[0];if(o!==u&&(e.find(".sbi_photo img").attr("src",u),e.find(".sbi_photo").css("background-image",'url("'+u+'")')),d=h,"auto"===n.settings.imgRes){var b=!1;e.find(".sbi_photo img").on("load",function(){var t=i(this),s=t.get(0).naturalWidth/t.get(0).naturalHeight;if(1e3!==t.get(0).naturalWidth&&s>l&&!b){switch(n.settings.debugEnabled&&console.log("rais res again for aspect ratio change "+o),b=!0,g=e.find(".sbi_photo").innerWidth(),c=n.getBestResolutionForAuto(g,s,e),h=640,c){case 320:h=320;break;case 150:h=150}h>d&&(u=a[h].split("?ig_cache_key")[0],t.attr("src",u),t.closest(".sbi_photo").css("background-image",'url("'+u+'")')),"masonry"!==n.layout&&"highlight"!==n.layout||(i(n.el).find("#sbi_images").smashotope(n.isotopeArgs),setTimeout(function(){i(n.el).find("#sbi_images").smashotope(n.isotopeArgs)},500))}else if(n.settings.debugEnabled){var r=b?"already checked":"no aspect ratio change";console.log("not raising res for replacement "+o,r)}})}}e.find("img").on("error",function(){if(i(this).hasClass("sbi_img_error"))console.log("unfixed error "+i(this).attr("src"));else{var e;if(i(this).addClass("sbi_img_error"),i(this).attr("src").indexOf("media/?size=")>-1||i(this).attr("src").indexOf("cdninstagram")>-1||i(this).attr("src").indexOf("fbcdn")>-1)n.settings.favorLocal=!0,void 0!==(e=n.getImageUrls(i(this).closest(".sbi_item")))[640]&&(i(this).attr("src",e[640]),i(this).closest(".sbi_photo").css("background-image","url("+e[640]+")"),i(this).closest(".sbi_item").addClass("sbi_had_error").find(".sbi_link_area").attr("href",e[640]).addClass("sbi_had_error"));else if("undefined"!==i(this).closest(".sbi_photo").attr("data-img-src-set"))void 0!==(e=JSON.parse(i(this).closest(".sbi_photo").attr("data-img-src-set").replace(/\\\//g,"/"))).d&&(i(this).attr("src",e.d),i(this).closest(".sbi_photo").css("background-image","url("+e.d+")"),i(this).closest(".sbi_item").addClass("sbi_had_error").find(".sbi_link_area").attr("href",e[640]).addClass("sbi_had_error"));setTimeout(function(){n.afterResize()},1500)}})}},maybeRaiseImageResolution:function(e){var t=this,s=void 0!==e&&!0===e?".sbi_item.sbi_new":".sbi_item",n=!t.isInitialized;i(t.el).find(s).each(function(e){!i(this).hasClass("sbi_num_diff_hide")&&i(this).find(".sbi_photo").length&&void 0!==i(this).find(".sbi_photo").attr("data-img-src-set")&&t.maybeRaiseSingleImageResolution(i(this),e,n)}),t.isInitialized=!0},getBestResolutionForAuto:function(e,t,s){(isNaN(t)||t<1)&&(t=1);var n=e*t,a=10*Math.ceil(n/10),o=[150,320,640];if(s.hasClass("sbi_highlighted")&&(a*=2),-1===o.indexOf(parseInt(a))){var d=!1;i.each(o,function(i,e){e>parseInt(a)&&!d&&(a=e,d=!0)})}return a},hideExtraImagesForWidth:function(){if("carousel"!==this.layout){var e=i(this.el),t=void 0!==e.attr("data-num")&&""!==e.attr("data-num")?parseInt(e.attr("data-num")):1,s=void 0!==e.attr("data-nummobile")&&""!==e.attr("data-nummobile")?parseInt(e.attr("data-nummobile")):t;i(window).width()<480?s<e.find(".sbi_item").length&&e.find(".sbi_item").slice(s-e.find(".sbi_item").length).addClass("sbi_num_diff_hide"):t<e.find(".sbi_item").length&&e.find(".sbi_item").slice(t-e.find(".sbi_item").length).addClass("sbi_num_diff_hide")}},setImageSizeClass:function(){var e=i(this.el);e.removeClass("sbi_small sbi_medium");var t=e.innerWidth(),s=parseInt(e.find("#sbi_images").outerWidth()-e.find("#sbi_images").width())/2,n=this.getColumnCount(),a=(t-s*(n+2))/n;a>120&&a<240?e.addClass("sbi_medium"):a<=120&&e.addClass("sbi_small")},setMinImageWidth:function(){i(this.el).find(".sbi_item .sbi_photo").first().length?this.minImageWidth=i(this.el).find(".sbi_item .sbi_photo").first().innerWidth():this.minImageWidth=150},setImageResolution:function(){if("auto"===this.settings.imgRes)this.imageResolution="auto";else switch(this.settings.imgRes){case"thumb":this.imageResolution=150;break;case"medium":this.imageResolution=320;break;default:this.imageResolution=640}},getImageUrls:function(i){var e=JSON.parse(i.find(".sbi_photo").attr("data-img-src-set").replace(/\\\//g,"/")),t=i.attr("id").replace("sbi_","");if(this.settings.consentGiven||this.settings.overrideBlockCDN||(e=[]),void 0!==this.resizedImages[t]&&"video"!==this.resizedImages[t]&&"pending"!==this.resizedImages[t]&&"error"!==this.resizedImages[t].id&&"video"!==this.resizedImages[t].id&&"pending"!==this.resizedImages[t].id){if(void 0!==this.resizedImages[t].sizes){var s=[];void 0!==this.resizedImages[t].sizes.full&&(e[640]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"full.jpg",s.push(640)),void 0!==this.resizedImages[t].sizes.low&&(e[320]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"low.jpg",s.push(320)),void 0!==this.resizedImages[t].sizes.thumb&&(s.push(150),e[150]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"thumb.jpg"),this.settings.favorLocal&&(-1===s.indexOf(640)&&s.indexOf(320)>-1&&(e[640]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"low.jpg"),-1===s.indexOf(320)&&(s.indexOf(640)>-1?e[320]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"full.jpg":s.indexOf(150)>-1&&(e[320]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"thumb.jpg")),-1===s.indexOf(150)&&(s.indexOf(320)>-1?e[150]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"low.jpg":s.indexOf(640)>-1&&(e[150]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"full.jpg")))}}else(void 0===this.resizedImages[t]||void 0!==this.resizedImages[t].id&&"pending"!==this.resizedImages[t].id&&"error"!==this.resizedImages[t].id)&&this.addToNeedsResizing(t);return e},getAvatarUrl:function(i,e){if(""===i)return"";var t=this.settings.general.avatars;return"local"===(e=void 0!==e?e:"local")?void 0!==t["LCL"+i]&&1===parseInt(t["LCL"+i])?sb_instagram_js_options.resized_url+i+".jpg":void 0!==t[i]?t[i]:"":void 0!==t[i]?t[i]:void 0!==t["LCL"+i]&&1===parseInt(t["LCL"+i])?sb_instagram_js_options.resized_url+i+".jpg":""},addToNeedsResizing:function(i){-1===this.needsResizing.indexOf(i)&&this.needsResizing.push(i)},applyImageLiquid:function(){var t=i(this.el);e(),"function"==typeof t.find(".sbi_photo").sbi_imgLiquid&&t.find(".sbi_photo").sbi_imgLiquid({fill:!0})},listenForVisibilityChange:function(){var e,t,s,n=this;e=jQuery,t={callback:function(){},runOnLoad:!0,frequency:100,sbiPreviousVisibility:null},s={sbiCheckVisibility:function(i,e){if(jQuery.contains(document,i[0])){var t=e.sbiPreviousVisibility,n=i.is(":visible");e.sbiPreviousVisibility=n,null==t?e.runOnLoad&&e.callback(i,n):t!==n&&e.callback(i,n),setTimeout(function(){s.sbiCheckVisibility(i,e)},e.frequency)}}},e.fn.sbiVisibilityChanged=function(i){var n=e.extend({},t,i);return this.each(function(){s.sbiCheckVisibility(e(this),n)})},"function"==typeof i(this.el).filter(":hidden").sbiVisibilityChanged&&i(this.el).filter(":hidden").sbiVisibilityChanged({callback:function(i,e){n.afterResize()},runOnLoad:!1})},getColumnCount:function(){var e=i(this.el),t=this.settings.cols,s=this.settings.colsmobile,n=t;return sbiWindowWidth=window.innerWidth,e.hasClass("sbi_mob_col_auto")?(sbiWindowWidth<640&&parseInt(t)>2&&parseInt(t)<7&&(n=2),sbiWindowWidth<640&&parseInt(t)>6&&parseInt(t)<11&&(n=4),sbiWindowWidth<=480&&parseInt(t)>2&&(n=1)):sbiWindowWidth<=480&&(n=s),parseInt(n)},checkConsent:function(){if(this.settings.consentGiven||!this.settings.gdpr)return!0;if("undefined"!=typeof CLI_Cookie)null!==CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME)&&(this.settings.consentGiven="yes"===CLI_Cookie.read("cookielawinfo-checkbox-non-necessary"));else if(void 0!==window.cnArgs){var i=("; "+document.cookie).split("; cookie_notice_accepted=");if(2===i.length){var e=i.pop().split(";").shift();this.settings.consentGiven="true"===e}}else void 0!==window.cookieconsent?this.settings.consentGiven="allow"===function(i){for(var e=i+"=",t=window.document.cookie.split(";"),s=0;s<t.length;s++){var n=t[s].trim();if(0==n.indexOf(e))return n.substring(e.length,n.length)}return""}("complianz_consent_status"):void 0!==window.Cookiebot&&(this.settings.consentGiven=Cookiebot.consented);var t=jQuery.Event("sbicheckconsent");return t.feed=this,jQuery(window).trigger(t),this.settings.consentGiven},afterConsentToggled:function(){if(this.checkConsent()){var i=this;i.maybeRaiseImageResolution(),setTimeout(function(){i.afterResize()},500)}}},window.sbi_init=function(){window.sbi=new t,window.sbi.createPage(window.sbi.createFeeds,{whenFeedsCreated:window.sbi.afterFeedsCreated})}}(jQuery),jQuery(document).ready(function(i){void 0===window.sb_instagram_js_options&&(window.sb_instagram_js_options={font_method:"svg",resized_url:location.protocol+"//"+window.location.hostname+"/wp-content/uploads/sb-instagram-feed-images/",placeholder:location.protocol+"//"+window.location.hostname+"/wp-content/plugins/instagram-feed/img/placeholder.png"}),void 0!==window.sb_instagram_js_options.resized_url&&-1===window.sb_instagram_js_options.resized_url.indexOf(location.protocol)&&("http:"===location.protocol?window.sb_instagram_js_options.resized_url=window.sb_instagram_js_options.resized_url.replace("https:","http:"):window.sb_instagram_js_options.resized_url=window.sb_instagram_js_options.resized_url.replace("http:","https:")),sbi_init(),i("#cookie-notice a").click(function(){setTimeout(function(){i.each(window.sbi.feeds,function(i){window.sbi.feeds[i].afterConsentToggled()})},1e3)}),i("#cookie-law-info-bar a").click(function(){setTimeout(function(){i.each(window.sbi.feeds,function(i){window.sbi.feeds[i].afterConsentToggled()})},1e3)}),i(".cli-user-preference-checkbox").click(function(){setTimeout(function(){i.each(window.sbi.feeds,function(i){window.sbi.feeds[i].settings.consentGiven=!1,window.sbi.feeds[i].afterConsentToggled()})},1e3)}),i(window).on("CookiebotOnAccept",function(e){i.each(window.sbi.feeds,function(i){window.sbi.feeds[i].settings.consentGiven=!0,window.sbi.feeds[i].afterConsentToggled()})}),i(document).on("cmplzAcceptAll",function(e){i.each(window.sbi.feeds,function(i){window.sbi.feeds[i].settings.consentGiven=!0,window.sbi.feeds[i].afterConsentToggled()})}),i(document).on("cmplzRevoke",function(e){i.each(window.sbi.feeds,function(i){window.sbi.feeds[i].settings.consentGiven=!1,window.sbi.feeds[i].afterConsentToggled()})})}));
js/sbi-scripts.js CHANGED
@@ -197,6 +197,7 @@ if(!sbi_js_exists) {
197
  favorLocal : (flags.indexOf('favorLocal') > -1),
198
  ajaxPostLoad : (flags.indexOf('ajaxPostLoad') > -1),
199
  gdpr : (flags.indexOf('gdpr') > -1),
 
200
  consentGiven : false,
201
  autoMinRes : 1,
202
  general : general
@@ -799,7 +800,7 @@ if(!sbi_js_exists) {
799
  getImageUrls: function ($item) {
800
  var srcSet = JSON.parse($item.find('.sbi_photo').attr('data-img-src-set').replace(/\\\//g, '/')),
801
  id = $item.attr('id').replace('sbi_', '');
802
- if (!this.settings.consentGiven) {
803
  srcSet = [];
804
  }
805
  if (typeof this.resizedImages[id] !== 'undefined'
197
  favorLocal : (flags.indexOf('favorLocal') > -1),
198
  ajaxPostLoad : (flags.indexOf('ajaxPostLoad') > -1),
199
  gdpr : (flags.indexOf('gdpr') > -1),
200
+ overrideBlockCDN : (flags.indexOf('overrideBlockCDN') > -1),
201
  consentGiven : false,
202
  autoMinRes : 1,
203
  general : general
800
  getImageUrls: function ($item) {
801
  var srcSet = JSON.parse($item.find('.sbi_photo').attr('data-img-src-set').replace(/\\\//g, '/')),
802
  id = $item.attr('id').replace('sbi_', '');
803
+ if (!this.settings.consentGiven && !this.settings.overrideBlockCDN) {
804
  srcSet = [];
805
  }
806
  if (typeof this.resizedImages[id] !== 'undefined'
js/sbi-scripts.min.js CHANGED
@@ -1 +1 @@
1
- var sbi_js_exists=void 0!==sbi_js_exists;sbi_js_exists||(function(b){function e(){var r,i,e,s,l=l||{VER:"0.9.944"};l.bgs_Available=!1,l.bgs_CheckRunned=!1,(r=jQuery).fn.extend({sbi_imgLiquid:function(i){var e,s,t;this.defaults={fill:!0,verticalAlign:"center",horizontalAlign:"center",useBackgroundSize:!0,useDataHtmlAttr:!0,responsive:!0,delay:0,fadeInTime:0,removeBoxBackground:!0,hardPixels:!0,responsiveCheckTime:500,timecheckvisibility:500,onStart:null,onFinish:null,onItemStart:null,onItemFinish:null,onItemError:null},l.bgs_CheckRunned||(l.bgs_CheckRunned=!0,e=r('<span style="background-size:cover" />'),r("body").append(e),(t=e[0])&&window.getComputedStyle&&((s=window.getComputedStyle(t,null))&&s.backgroundSize&&(l.bgs_Available="cover"===s.backgroundSize)),e.remove());var d=this;return this.options=i,this.settings=r.extend({},this.defaults,this.options),this.settings.onStart&&this.settings.onStart(),this.each(function(c){function s(){(f.responsive||_.data("sbi_imgLiquid_oldProcessed"))&&_.data("sbi_imgLiquid_settings")&&(f=_.data("sbi_imgLiquid_settings"),b.actualSize=b.get(0).offsetWidth+b.get(0).offsetHeight/1e4,b.sizeOld&&b.actualSize!==b.sizeOld&&n(),b.sizeOld=b.actualSize,setTimeout(s,f.responsiveCheckTime))}function t(){_.data("sbi_imgLiquid_error",!0),b.addClass("sbi_imgLiquid_error"),f.onItemError&&f.onItemError(c,b,_),u()}function n(){var i,e,s,t,n,a,o,d,r=0,l=0,h=b.width(),g=b.height();void 0===_.data("owidth")&&_.data("owidth",_[0].width),void 0===_.data("oheight")&&_.data("oheight",_[0].height),t=f.fill===h/g>=_.data("owidth")/_.data("oheight")?(i="100%",e="auto",s=Math.floor(h),Math.floor(h*(_.data("oheight")/_.data("owidth")))):(i="auto",e="100%",s=Math.floor(g*(_.data("owidth")/_.data("oheight"))),Math.floor(g)),o=h-s,"left"===(n=f.horizontalAlign.toLowerCase())&&(l=0),"center"===n&&(l=.5*o),"right"===n&&(l=o),-1===n.indexOf("%")||0<(n=parseInt(n.replace("%",""),10))&&(l=o*n*.01),d=g-t,"left"===(a=f.verticalAlign.toLowerCase())&&(r=0),"center"===a&&(r=.5*d),"bottom"===a&&(r=d),-1===a.indexOf("%")||0<(a=parseInt(a.replace("%",""),10))&&(r=d*a*.01),f.hardPixels&&(i=s,e=t),_.css({width:i,height:e,"margin-left":Math.floor(l),"margin-top":Math.floor(r)}),_.data("sbi_imgLiquid_oldProcessed")||(_.fadeTo(f.fadeInTime,1),_.data("sbi_imgLiquid_oldProcessed",!0),f.removeBoxBackground&&b.css("background-image","none"),b.addClass("sbi_imgLiquid_nobgSize"),b.addClass("sbi_imgLiquid_ready")),f.onItemFinish&&f.onItemFinish(c,b,_),u()}function u(){c===d.length-1&&d.settings.onFinish&&d.settings.onFinish()}var i,e,a,o,f=d.settings,b=r(this),_=r("img:first",b);return _.length?(f=_.data("sbi_imgLiquid_settings")?(b.removeClass("sbi_imgLiquid_error").removeClass("sbi_imgLiquid_ready"),r.extend({},_.data("sbi_imgLiquid_settings"),d.options)):r.extend({},d.settings,(o={},d.settings.useDataHtmlAttr&&(i=b.attr("data-sbi_imgLiquid-fill"),e=b.attr("data-sbi_imgLiquid-horizontalAlign"),a=b.attr("data-sbi_imgLiquid-verticalAlign"),"true"!==i&&"false"!==i||(o.fill=Boolean("true"===i)),void 0===e||"left"!==e&&"center"!==e&&"right"!==e&&-1===e.indexOf("%")||(o.horizontalAlign=e),void 0===a||"top"!==a&&"bottom"!==a&&"center"!==a&&-1===a.indexOf("%")||(o.verticalAlign=a)),l.isIE&&d.settings.ieFadeInDisabled&&(o.fadeInTime=0),o)),_.data("sbi_imgLiquid_settings",f),f.onItemStart&&f.onItemStart(c,b,_),void(l.bgs_Available&&f.useBackgroundSize?(-1===b.css("background-image").indexOf(encodeURI(_.attr("src")))&&b.css({"background-image":'url("'+encodeURI(_.attr("src"))+'")'}),b.css({"background-size":f.fill?"cover":"contain","background-position":(f.horizontalAlign+" "+f.verticalAlign).toLowerCase(),"background-repeat":"no-repeat"}),r("a:first",b).css({display:"block",width:"100%",height:"100%"}),r("img",b).css({display:"none"}),f.onItemFinish&&f.onItemFinish(c,b,_),b.addClass("sbi_imgLiquid_bgSize"),b.addClass("sbi_imgLiquid_ready"),u()):function i(){if(_.data("oldSrc")&&_.data("oldSrc")!==_.attr("src")){var e=_.clone().removeAttr("style");return e.data("sbi_imgLiquid_settings",_.data("sbi_imgLiquid_settings")),_.parent().prepend(e),_.remove(),(_=e)[0].width=0,void setTimeout(i,10)}return _.data("sbi_imgLiquid_oldProcessed")?void n():(_.data("sbi_imgLiquid_oldProcessed",!1),_.data("oldSrc",_.attr("src")),r("img:not(:first)",b).css("display","none"),b.css({overflow:"hidden"}),_.fadeTo(0,0).removeAttr("width").removeAttr("height").css({visibility:"visible","max-width":"none","max-height":"none",width:"auto",height:"auto",display:"block"}),_.on("error",t),_[0].onerror=t,function i(){_.data("sbi_imgLiquid_error")||_.data("sbi_imgLiquid_loaded")||_.data("sbi_imgLiquid_oldProcessed")||(b.is(":visible")&&_[0].complete&&0<_[0].width&&0<_[0].height?(_.data("sbi_imgLiquid_loaded",!0),setTimeout(n,c*f.delay)):setTimeout(i,f.timecheckvisibility))}(),void s())}())):void t()})}}),i=l.injectCss,e=document.getElementsByTagName("head")[0],(s=document.createElement("style")).type="text/css",s.styleSheet?s.styleSheet.cssText=i:s.appendChild(document.createTextNode(i)),e.appendChild(s)}function i(){this.feeds={},this.options=sb_instagram_js_options}function o(i,e,s){this.el=i,this.index=e,this.settings=s,this.minImageWidth=0,this.imageResolution=150,this.resizedImages={},this.needsResizing=[],this.outOfPages=!1,this.isInitialized=!1}function d(i,e){b.ajax({url:sbiajaxurl,type:"post",data:i,success:e})}i.prototype={createPage:function(i,e){void 0!==window.sbiajaxurl&&-1!==window.sbiajaxurl.indexOf(window.location.hostname)||(window.sbiajaxurl=location.protocol+"//"+window.location.hostname+"/wp-admin/admin-ajax.php"),b(".sbi_no_js_error_message").remove(),b(".sbi_no_js").removeClass("sbi_no_js"),i(e)},createFeeds:function(i){i.whenFeedsCreated(b(".sbi").each(function(i){b(this).attr("data-sbi-index",i+1);var e=b(this),s=void 0!==e.attr("data-sbi-flags")?e.attr("data-sbi-flags").split(","):[],t=void 0!==e.attr("data-options")?JSON.parse(e.attr("data-options")):{};-1<s.indexOf("testAjax")&&(window.sbi.triggeredTest=!0,d({action:"sbi_on_ajax_test_trigger"},function(i){console.log("did test")}));var n={cols:e.attr("data-cols"),colsmobile:void 0!==e.attr("data-colsmobile")&&"same"!==e.attr("data-colsmobile")?e.attr("data-colsmobile"):e.attr("data-cols"),num:e.attr("data-num"),imgRes:e.attr("data-res"),feedID:e.attr("data-feedid"),shortCodeAtts:e.attr("data-shortcode-atts"),resizingEnabled:-1===s.indexOf("resizeDisable"),imageLoadEnabled:-1===s.indexOf("imageLoadDisable"),debugEnabled:-1<s.indexOf("debug"),favorLocal:-1<s.indexOf("favorLocal"),ajaxPostLoad:-1<s.indexOf("ajaxPostLoad"),gdpr:-1<s.indexOf("gdpr"),consentGiven:!1,autoMinRes:1,general:t};window.sbi.feeds[i]=new o(this,i,n),window.sbi.feeds[i].setResizedImages(),window.sbi.feeds[i].init();var a=jQuery.Event("sbiafterfeedcreate");a.feed=window.sbi.feeds[i],jQuery(window).trigger(a)}))},afterFeedsCreated:function(){b(".sb_instagram_header").each(function(){var i=b(this);i.find(".sbi_header_link").hover(function(){i.find(".sbi_header_img_hover").addClass("sbi_fade_in")},function(){i.find(".sbi_header_img_hover").removeClass("sbi_fade_in")})})},encodeHTML:function(i){if(void 0===i)return"";var e=i.replace(/(>)/g,"&gt;");return e=(e=(e=e.replace(/(<)/g,"&lt;")).replace(/(&lt;br\/&gt;)/g,"<br>")).replace(/(&lt;br&gt;)/g,"<br>")},urlDetect:function(i){return i.match(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g)}},o.prototype={init:function(){var i=this;i.settings.consentGiven=i.checkConsent(),b(this.el).find(".sbi_photo").parent("p").length&&b(this.el).addClass("sbi_no_autop"),b(this.el).find("#sbi_mod_error").length&&b(this.el).prepend(b(this.el).find("#sbi_mod_error")),this.settings.ajaxPostLoad?this.getNewPostSet():this.afterInitialImagesLoaded();var s,e=(s=0,function(i,e){clearTimeout(s),s=setTimeout(i,e)});jQuery(window).resize(function(){e(function(){i.afterResize()},500)}),b(this.el).find(".sbi_item").each(function(){i.lazyLoadCheck(b(this))})},initLayout:function(){},afterInitialImagesLoaded:function(){this.initLayout(),this.loadMoreButtonInit(),this.hideExtraImagesForWidth(),this.beforeNewImagesRevealed(),this.revealNewImages(),this.afterNewImagesRevealed()},afterResize:function(){this.setImageHeight(),this.setImageResolution(),this.maybeRaiseImageResolution(),this.setImageSizeClass()},afterLoadMoreClicked:function(i){i.find(".sbi_loader").removeClass("sbi_hidden"),i.find(".sbi_btn_text").addClass("sbi_hidden"),i.closest(".sbi").find(".sbi_num_diff_hide").addClass("sbi_transition").removeClass("sbi_num_diff_hide")},afterNewImagesLoaded:function(){var i=b(this.el),e=this;this.beforeNewImagesRevealed(),this.revealNewImages(),this.afterNewImagesRevealed(),setTimeout(function(){i.find(".sbi_loader").addClass("sbi_hidden"),i.find(".sbi_btn_text").removeClass("sbi_hidden"),e.maybeRaiseImageResolution()},500)},beforeNewImagesRevealed:function(){this.setImageHeight(),this.maybeRaiseImageResolution(!0),this.setImageSizeClass()},revealNewImages:function(){var i=b(this.el);i.find(".sbi-screenreader").each(function(){b(this).find("img").remove()}),"function"==typeof sbi_custom_js&&setTimeout(function(){sbi_custom_js()},100),this.applyImageLiquid(),i.find(".sbi_item").each(function(i){jQuery(this).find(".sbi_photo").hover(function(){jQuery(this).fadeTo(200,.85)},function(){jQuery(this).stop().fadeTo(500,1)})}),setTimeout(function(){jQuery("#sbi_images .sbi_item.sbi_new").removeClass("sbi_new");var e=10;i.find(".sbi_transition").each(function(){var i=jQuery(this);setTimeout(function(){i.removeClass("sbi_transition")},e),e+=10})},500)},lazyLoadCheck:function(i){if(i.find(".sbi_photo").length&&!i.closest(".sbi").hasClass("sbi-no-ll-check")){var e=this.getImageUrls(i),s=void 0!==e[640]?e[640]:i.find(".sbi_photo").attr("data-full-res");if(!this.settings.consentGiven&&-1<s.indexOf("scontent"))return;i.find(".sbi_photo img").each(function(){s&&void 0!==b(this).attr("data-src")&&b(this).attr("data-src",s),s&&void 0!==b(this).attr("data-orig-src")&&b(this).attr("data-orig-src",s),b(this).on("load",function(){!b(this).hasClass("sbi-replaced")&&-1<b(this).attr("src").indexOf("placeholder")&&(b(this).addClass("sbi-replaced"),s&&(b(this).attr("src",s),b(this).closest(".sbi_imgLiquid_bgSize").length&&b(this).closest(".sbi_imgLiquid_bgSize").css("background-image","url("+s+")")))})})}},afterNewImagesRevealed:function(){this.listenForVisibilityChange(),this.sendNeedsResizingToServer(),this.settings.imageLoadEnabled||b(".sbi_no_resraise").removeClass("sbi_no_resraise");var i=b.Event("sbiafterimagesloaded");i.el=b(this.el),b(window).trigger(i)},setResizedImages:function(){b(this.el).find(".sbi_resized_image_data").length&&void 0!==b(this.el).find(".sbi_resized_image_data").attr("data-resized")&&0===b(this.el).find(".sbi_resized_image_data").attr("data-resized").indexOf('{"')&&(this.resizedImages=JSON.parse(b(this.el).find(".sbi_resized_image_data").attr("data-resized")),b(this.el).find(".sbi_resized_image_data").remove())},sendNeedsResizingToServer:function(){var i,e,t=this;0<t.needsResizing.length&&t.settings.resizingEnabled&&(i=b(this.el).find(".sbi_item").length,e=void 0!==t.settings.general.cache_all&&t.settings.general.cache_all,d({action:"sbi_resized_images_submit",needs_resizing:t.needsResizing,offset:i,feed_id:t.settings.feedID,atts:t.settings.shortCodeAtts,cache_all:e},function(i){if(0===i.trim().indexOf("{")){var e=JSON.parse(i);for(var s in t.settings.debugEnabled&&console.log(e),e)e.hasOwnProperty(s)&&(t.resizedImages[s]=e[s]);t.maybeRaiseImageResolution(),setTimeout(function(){t.afterResize()},500)}}))},loadMoreButtonInit:function(){var i=b(this.el),e=this;i.find("#sbi_load .sbi_load_btn").off().on("click",function(){e.afterLoadMoreClicked(jQuery(this)),e.getNewPostSet()})},getNewPostSet:function(){var s=b(this.el),t=this;d({action:"sbi_load_more_clicked",offset:s.find(".sbi_item").length,feed_id:t.settings.feedID,atts:t.settings.shortCodeAtts,current_resolution:t.imageResolution},function(i){var e;0===i.trim().indexOf("{")&&(e=JSON.parse(i),t.settings.debugEnabled&&console.log(e),t.appendNewPosts(e.html),t.addResizedImages(e.resizedImages),t.settings.ajaxPostLoad?(t.settings.ajaxPostLoad=!1,t.afterInitialImagesLoaded()):t.afterNewImagesLoaded(),e.feedStatus.shouldPaginate?t.outOfPages=!1:(t.outOfPages=!0,s.find(".sbi_load_btn").hide()),b(".sbi_no_js").removeClass("sbi_no_js"))})},appendNewPosts:function(i){var e=b(this.el);e.find("#sbi_images .sbi_item").length?e.find("#sbi_images .sbi_item").last().after(i):e.find("#sbi_images").append(i)},addResizedImages:function(i){for(var e in i)this.resizedImages[e]=i[e]},setImageHeight:function(){var s=b(this.el),i=s.find(".sbi_photo").eq(0).innerWidth(),e=this.getColumnCount(),t=s.find("#sbi_images").innerWidth()-s.find("#sbi_images").width(),n=t/2;sbi_photo_width_manual=s.find("#sbi_images").width()/e-t,s.find(".sbi_photo").css("height",i),s.find(".sbi-owl-nav").length&&setTimeout(function(){var i=2;s.find(".sbi_owl2row-item").length&&(i=1);var e=s.find(".sbi_photo").eq(0).innerWidth()/i;e+=parseInt(n)*(2-i+2),s.find(".sbi-owl-nav div").css("top",e)},100)},maybeRaiseSingleImageResolution:function(t,i,s){var n=this,a=n.getImageUrls(t),o=t.find(".sbi_photo img").attr("src"),d=150,e=t.find("img").get(0),r=o===window.sbi.options.placeholder?1:e.naturalWidth/e.naturalHeight,s=void 0!==s&&s;if(!(t.hasClass("sbi_no_resraise")||t.hasClass("sbi_had_error")||t.find(".sbi_link_area").length&&t.find(".sbi_link_area").hasClass("sbi_had_error")))if(a.length<1)t.find(".sbi_link_area").length&&t.find(".sbi_link_area").attr("href",window.sbi.options.placeholder.replace("placeholder.png","thumb-placeholder.png"));else{(t.find(".sbi_link_area").length&&t.find(".sbi_link_area").attr("href")===window.sbi.options.placeholder.replace("placeholder.png","thumb-placeholder.png")||!n.settings.consentGiven)&&t.find(".sbi_link_area").attr("href",a[a.length-1]),void 0!==a[640]&&t.find(".sbi_photo").attr("data-full-res",a[640]),b.each(a,function(i,e){e===o&&(d=parseInt(i),s=!1)});var l,h,g,c=640;switch(n.settings.imgRes){case"thumb":c=150;break;case"medium":c=320;break;case"full":c=640;break;default:var u=Math.max(n.settings.autoMinRes,t.find(".sbi_photo").innerWidth()),f=n.getBestResolutionForAuto(u,r,t);switch(f){case 320:c=320;break;case 150:c=150}}(d<c||o===window.sbi.options.placeholder||s)&&(n.settings.debugEnabled&&(l=o===window.sbi.options.placeholder?"was placeholder":"too small",console.log("rais res for "+o,l)),h=a[c].split("?ig_cache_key")[0],o!==h&&(t.find(".sbi_photo img").attr("src",h),t.find(".sbi_photo").css("background-image",'url("'+h+'")')),d=c,"auto"===n.settings.imgRes&&(g=!1,t.find(".sbi_photo img").on("load",function(){var i,e=b(this),s=e.get(0).naturalWidth/e.get(0).naturalHeight;if(1e3!==e.get(0).naturalWidth&&r<s&&!g){switch(n.settings.debugEnabled&&console.log("rais res again for aspect ratio change "+o),g=!0,u=t.find(".sbi_photo").innerWidth(),f=n.getBestResolutionForAuto(u,s,t),c=640,f){case 320:c=320;break;case 150:c=150}d<c&&(h=a[c].split("?ig_cache_key")[0],e.attr("src",h),e.closest(".sbi_photo").css("background-image",'url("'+h+'")')),"masonry"!==n.layout&&"highlight"!==n.layout||(b(n.el).find("#sbi_images").smashotope(n.isotopeArgs),setTimeout(function(){b(n.el).find("#sbi_images").smashotope(n.isotopeArgs)},500))}else{n.settings.debugEnabled&&(i=g?"already checked":"no aspect ratio change",console.log("not raising res for replacement "+o,i))}}))),t.find("img").on("error",function(){var i;b(this).hasClass("sbi_img_error")?console.log("unfixed error "+b(this).attr("src")):(b(this).addClass("sbi_img_error"),-1<b(this).attr("src").indexOf("media/?size=")||-1<b(this).attr("src").indexOf("cdninstagram")||-1<b(this).attr("src").indexOf("fbcdn")?(n.settings.favorLocal=!0,void 0!==(i=n.getImageUrls(b(this).closest(".sbi_item")))[640]&&(b(this).attr("src",i[640]),b(this).closest(".sbi_photo").css("background-image","url("+i[640]+")"),b(this).closest(".sbi_item").addClass("sbi_had_error").find(".sbi_link_area").attr("href",i[640]).addClass("sbi_had_error"))):"undefined"!==b(this).closest(".sbi_photo").attr("data-img-src-set")&&void 0!==(i=JSON.parse(b(this).closest(".sbi_photo").attr("data-img-src-set").replace(/\\\//g,"/"))).d&&(b(this).attr("src",i.d),b(this).closest(".sbi_photo").css("background-image","url("+i.d+")"),b(this).closest(".sbi_item").addClass("sbi_had_error").find(".sbi_link_area").attr("href",i[640]).addClass("sbi_had_error")),setTimeout(function(){n.afterResize()},1500))})}},maybeRaiseImageResolution:function(i){var e=this,s=void 0!==i&&!0===i?".sbi_item.sbi_new":".sbi_item",t=!e.isInitialized;b(e.el).find(s).each(function(i){!b(this).hasClass("sbi_num_diff_hide")&&b(this).find(".sbi_photo").length&&void 0!==b(this).find(".sbi_photo").attr("data-img-src-set")&&e.maybeRaiseSingleImageResolution(b(this),i,t)}),e.isInitialized=!0},getBestResolutionForAuto:function(i,e,s){(isNaN(e)||e<1)&&(e=1);var t,n=i*e,a=10*Math.ceil(n/10),o=[150,320,640];return s.hasClass("sbi_highlighted")&&(a*=2),-1===o.indexOf(parseInt(a))&&(t=!1,b.each(o,function(i,e){e>parseInt(a)&&!t&&(a=e,t=!0)})),a},hideExtraImagesForWidth:function(){var i,e,s;"carousel"!==this.layout&&(e=void 0!==(i=b(this.el)).attr("data-num")&&""!==i.attr("data-num")?parseInt(i.attr("data-num")):1,s=void 0!==i.attr("data-nummobile")&&""!==i.attr("data-nummobile")?parseInt(i.attr("data-nummobile")):e,b(window).width()<480?s<i.find(".sbi_item").length&&i.find(".sbi_item").slice(s-i.find(".sbi_item").length).addClass("sbi_num_diff_hide"):e<i.find(".sbi_item").length&&i.find(".sbi_item").slice(e-i.find(".sbi_item").length).addClass("sbi_num_diff_hide"))},setImageSizeClass:function(){var i=b(this.el);i.removeClass("sbi_small sbi_medium");var e=i.innerWidth(),s=parseInt(i.find("#sbi_images").outerWidth()-i.find("#sbi_images").width())/2,t=this.getColumnCount(),n=(e-s*(t+2))/t;120<n&&n<240?i.addClass("sbi_medium"):n<=120&&i.addClass("sbi_small")},setMinImageWidth:function(){b(this.el).find(".sbi_item .sbi_photo").first().length?this.minImageWidth=b(this.el).find(".sbi_item .sbi_photo").first().innerWidth():this.minImageWidth=150},setImageResolution:function(){if("auto"===this.settings.imgRes)this.imageResolution="auto";else switch(this.settings.imgRes){case"thumb":this.imageResolution=150;break;case"medium":this.imageResolution=320;break;default:this.imageResolution=640}},getImageUrls:function(i){var e,s=JSON.parse(i.find(".sbi_photo").attr("data-img-src-set").replace(/\\\//g,"/")),t=i.attr("id").replace("sbi_","");return this.settings.consentGiven||(s=[]),void 0!==this.resizedImages[t]&&"video"!==this.resizedImages[t]&&"pending"!==this.resizedImages[t]&&"error"!==this.resizedImages[t].id&&"video"!==this.resizedImages[t].id&&"pending"!==this.resizedImages[t].id?void 0!==this.resizedImages[t].sizes&&(e=[],void 0!==this.resizedImages[t].sizes.full&&(s[640]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"full.jpg",e.push(640)),void 0!==this.resizedImages[t].sizes.low&&(s[320]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"low.jpg",e.push(320)),void 0!==this.resizedImages[t].sizes.thumb&&(e.push(150),s[150]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"thumb.jpg"),this.settings.favorLocal&&(-1===e.indexOf(640)&&-1<e.indexOf(320)&&(s[640]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"low.jpg"),-1===e.indexOf(320)&&(-1<e.indexOf(640)?s[320]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"full.jpg":-1<e.indexOf(150)&&(s[320]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"thumb.jpg")),-1===e.indexOf(150)&&(-1<e.indexOf(320)?s[150]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"low.jpg":-1<e.indexOf(640)&&(s[150]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"full.jpg")))):(void 0===this.resizedImages[t]||void 0!==this.resizedImages[t].id&&"pending"!==this.resizedImages[t].id&&"error"!==this.resizedImages[t].id)&&this.addToNeedsResizing(t),s},getAvatarUrl:function(i,e){if(""===i)return"";var s=this.settings.general.avatars;return"local"===(e=void 0!==e?e:"local")?void 0!==s["LCL"+i]&&1===parseInt(s["LCL"+i])?sb_instagram_js_options.resized_url+i+".jpg":void 0!==s[i]?s[i]:"":void 0!==s[i]?s[i]:void 0!==s["LCL"+i]&&1===parseInt(s["LCL"+i])?sb_instagram_js_options.resized_url+i+".jpg":""},addToNeedsResizing:function(i){-1===this.needsResizing.indexOf(i)&&this.needsResizing.push(i)},applyImageLiquid:function(){var i=b(this.el);e(),"function"==typeof i.find(".sbi_photo").sbi_imgLiquid&&i.find(".sbi_photo").sbi_imgLiquid({fill:!0})},listenForVisibilityChange:function(){var s,t,n,a=this;s=jQuery,t={callback:function(){},runOnLoad:!0,frequency:100,sbiPreviousVisibility:null},n={sbiCheckVisibility:function(i,e){var s,t;jQuery.contains(document,i[0])&&(s=e.sbiPreviousVisibility,t=i.is(":visible"),e.sbiPreviousVisibility=t,null==s?e.runOnLoad&&e.callback(i,t):s!==t&&e.callback(i,t),setTimeout(function(){n.sbiCheckVisibility(i,e)},e.frequency))}},s.fn.sbiVisibilityChanged=function(i){var e=s.extend({},t,i);return this.each(function(){n.sbiCheckVisibility(s(this),e)})},"function"==typeof b(this.el).filter(":hidden").sbiVisibilityChanged&&b(this.el).filter(":hidden").sbiVisibilityChanged({callback:function(i,e){a.afterResize()},runOnLoad:!1})},getColumnCount:function(){var i=b(this.el),e=this.settings.cols,s=this.settings.colsmobile,t=e;return sbiWindowWidth=window.innerWidth,i.hasClass("sbi_mob_col_auto")?(sbiWindowWidth<640&&2<parseInt(e)&&parseInt(e)<7&&(t=2),sbiWindowWidth<640&&6<parseInt(e)&&parseInt(e)<11&&(t=4),sbiWindowWidth<=480&&2<parseInt(e)&&(t=1)):sbiWindowWidth<=480&&(t=s),parseInt(t)},checkConsent:function(){if(this.settings.consentGiven||!this.settings.gdpr)return!0;var i,e;"undefined"!=typeof CLI_Cookie?null!==CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME)&&(this.settings.consentGiven="yes"===CLI_Cookie.read("cookielawinfo-checkbox-non-necessary")):void 0!==window.cnArgs?2===(i=("; "+document.cookie).split("; cookie_notice_accepted=")).length&&(e=i.pop().split(";").shift(),this.settings.consentGiven="true"===e):void 0!==window.cookieconsent?this.settings.consentGiven="allow"===function(i){for(var e=i+"=",s=window.document.cookie.split(";"),t=0;t<s.length;t++){var n=s[t].trim();if(0==n.indexOf(e))return n.substring(e.length,n.length)}return""}("complianz_consent_status"):void 0!==window.Cookiebot&&(this.settings.consentGiven=Cookiebot.consented);var s=jQuery.Event("sbicheckconsent");return s.feed=this,jQuery(window).trigger(s),this.settings.consentGiven},afterConsentToggled:function(){var i;this.checkConsent()&&((i=this).maybeRaiseImageResolution(),setTimeout(function(){i.afterResize()},500))}},window.sbi_init=function(){window.sbi=new i,window.sbi.createPage(window.sbi.createFeeds,{whenFeedsCreated:window.sbi.afterFeedsCreated})}}(jQuery),jQuery(document).ready(function(e){void 0===window.sb_instagram_js_options&&(window.sb_instagram_js_options={font_method:"svg",resized_url:location.protocol+"//"+window.location.hostname+"/wp-content/uploads/sb-instagram-feed-images/",placeholder:location.protocol+"//"+window.location.hostname+"/wp-content/plugins/instagram-feed/img/placeholder.png"}),void 0!==window.sb_instagram_js_options.resized_url&&-1===window.sb_instagram_js_options.resized_url.indexOf(location.protocol)&&("http:"===location.protocol?window.sb_instagram_js_options.resized_url=window.sb_instagram_js_options.resized_url.replace("https:","http:"):window.sb_instagram_js_options.resized_url=window.sb_instagram_js_options.resized_url.replace("http:","https:")),sbi_init(),e("#cookie-notice a").click(function(){setTimeout(function(){e.each(window.sbi.feeds,function(i){window.sbi.feeds[i].afterConsentToggled()})},1e3)}),e("#cookie-law-info-bar a").click(function(){setTimeout(function(){e.each(window.sbi.feeds,function(i){window.sbi.feeds[i].afterConsentToggled()})},1e3)}),e(".cli-user-preference-checkbox").click(function(){setTimeout(function(){e.each(window.sbi.feeds,function(i){window.sbi.feeds[i].settings.consentGiven=!1,window.sbi.feeds[i].afterConsentToggled()})},1e3)}),e(window).on("CookiebotOnAccept",function(i){e.each(window.sbi.feeds,function(i){window.sbi.feeds[i].settings.consentGiven=!0,window.sbi.feeds[i].afterConsentToggled()})}),e(document).on("cmplzAcceptAll",function(i){e.each(window.sbi.feeds,function(i){window.sbi.feeds[i].settings.consentGiven=!0,window.sbi.feeds[i].afterConsentToggled()})}),e(document).on("cmplzRevoke",function(i){e.each(window.sbi.feeds,function(i){window.sbi.feeds[i].settings.consentGiven=!1,window.sbi.feeds[i].afterConsentToggled()})})}));
1
+ var sbi_js_exists=void 0!==sbi_js_exists;sbi_js_exists||(!function(i){function e(){var i,e,t,s=s||{VER:"0.9.944"};s.bgs_Available=!1,s.bgs_CheckRunned=!1,function(i){i.fn.extend({sbi_imgLiquid:function(e){this.defaults={fill:!0,verticalAlign:"center",horizontalAlign:"center",useBackgroundSize:!0,useDataHtmlAttr:!0,responsive:!0,delay:0,fadeInTime:0,removeBoxBackground:!0,hardPixels:!0,responsiveCheckTime:500,timecheckvisibility:500,onStart:null,onFinish:null,onItemStart:null,onItemFinish:null,onItemError:null},function(){if(!s.bgs_CheckRunned){s.bgs_CheckRunned=!0;var e=i('<span style="background-size:cover" />');i("body").append(e),function(){var i=e[0];if(i&&window.getComputedStyle){var t=window.getComputedStyle(i,null);t&&t.backgroundSize&&(s.bgs_Available="cover"===t.backgroundSize)}}(),e.remove()}}();var t=this;return this.options=e,this.settings=i.extend({},this.defaults,this.options),this.settings.onStart&&this.settings.onStart(),this.each(function(e){function n(){(r.responsive||h.data("sbi_imgLiquid_oldProcessed"))&&h.data("sbi_imgLiquid_settings")&&(r=h.data("sbi_imgLiquid_settings"),l.actualSize=l.get(0).offsetWidth+l.get(0).offsetHeight/1e4,l.sizeOld&&l.actualSize!==l.sizeOld&&o(),l.sizeOld=l.actualSize,setTimeout(n,r.responsiveCheckTime))}function a(){h.data("sbi_imgLiquid_error",!0),l.addClass("sbi_imgLiquid_error"),r.onItemError&&r.onItemError(e,l,h),d()}function o(){var i,t,s,n,a,o,g,c,f=0,u=0,b=l.width(),_=l.height();void 0===h.data("owidth")&&h.data("owidth",h[0].width),void 0===h.data("oheight")&&h.data("oheight",h[0].height),r.fill===b/_>=h.data("owidth")/h.data("oheight")?(i="100%",t="auto",s=Math.floor(b),n=Math.floor(b*(h.data("oheight")/h.data("owidth")))):(i="auto",t="100%",s=Math.floor(_*(h.data("owidth")/h.data("oheight"))),n=Math.floor(_)),g=b-s,"left"===(a=r.horizontalAlign.toLowerCase())&&(u=0),"center"===a&&(u=.5*g),"right"===a&&(u=g),-1!==a.indexOf("%")&&((a=parseInt(a.replace("%",""),10))>0&&(u=g*a*.01)),c=_-n,"left"===(o=r.verticalAlign.toLowerCase())&&(f=0),"center"===o&&(f=.5*c),"bottom"===o&&(f=c),-1!==o.indexOf("%")&&((o=parseInt(o.replace("%",""),10))>0&&(f=c*o*.01)),r.hardPixels&&(i=s,t=n),h.css({width:i,height:t,"margin-left":Math.floor(u),"margin-top":Math.floor(f)}),h.data("sbi_imgLiquid_oldProcessed")||(h.fadeTo(r.fadeInTime,1),h.data("sbi_imgLiquid_oldProcessed",!0),r.removeBoxBackground&&l.css("background-image","none"),l.addClass("sbi_imgLiquid_nobgSize"),l.addClass("sbi_imgLiquid_ready")),r.onItemFinish&&r.onItemFinish(e,l,h),d()}function d(){e===t.length-1&&t.settings.onFinish&&t.settings.onFinish()}var r=t.settings,l=i(this),h=i("img:first",l);return h.length?(h.data("sbi_imgLiquid_settings")?(l.removeClass("sbi_imgLiquid_error").removeClass("sbi_imgLiquid_ready"),r=i.extend({},h.data("sbi_imgLiquid_settings"),t.options)):r=i.extend({},t.settings,function(){var i={};if(t.settings.useDataHtmlAttr){var e=l.attr("data-sbi_imgLiquid-fill"),n=l.attr("data-sbi_imgLiquid-horizontalAlign"),a=l.attr("data-sbi_imgLiquid-verticalAlign");("true"===e||"false"===e)&&(i.fill=Boolean("true"===e)),void 0===n||"left"!==n&&"center"!==n&&"right"!==n&&-1===n.indexOf("%")||(i.horizontalAlign=n),void 0===a||"top"!==a&&"bottom"!==a&&"center"!==a&&-1===a.indexOf("%")||(i.verticalAlign=a)}return s.isIE&&t.settings.ieFadeInDisabled&&(i.fadeInTime=0),i}()),h.data("sbi_imgLiquid_settings",r),r.onItemStart&&r.onItemStart(e,l,h),void(s.bgs_Available&&r.useBackgroundSize?(-1===l.css("background-image").indexOf(encodeURI(h.attr("src")))&&l.css({"background-image":'url("'+encodeURI(h.attr("src"))+'")'}),l.css({"background-size":r.fill?"cover":"contain","background-position":(r.horizontalAlign+" "+r.verticalAlign).toLowerCase(),"background-repeat":"no-repeat"}),i("a:first",l).css({display:"block",width:"100%",height:"100%"}),i("img",l).css({display:"none"}),r.onItemFinish&&r.onItemFinish(e,l,h),l.addClass("sbi_imgLiquid_bgSize"),l.addClass("sbi_imgLiquid_ready"),d()):function t(){if(h.data("oldSrc")&&h.data("oldSrc")!==h.attr("src")){var s=h.clone().removeAttr("style");return s.data("sbi_imgLiquid_settings",h.data("sbi_imgLiquid_settings")),h.parent().prepend(s),h.remove(),(h=s)[0].width=0,void setTimeout(t,10)}return h.data("sbi_imgLiquid_oldProcessed")?void o():(h.data("sbi_imgLiquid_oldProcessed",!1),h.data("oldSrc",h.attr("src")),i("img:not(:first)",l).css("display","none"),l.css({overflow:"hidden"}),h.fadeTo(0,0).removeAttr("width").removeAttr("height").css({visibility:"visible","max-width":"none","max-height":"none",width:"auto",height:"auto",display:"block"}),h.on("error",a),h[0].onerror=a,function i(){h.data("sbi_imgLiquid_error")||h.data("sbi_imgLiquid_loaded")||h.data("sbi_imgLiquid_oldProcessed")||(l.is(":visible")&&h[0].complete&&h[0].width>0&&h[0].height>0?(h.data("sbi_imgLiquid_loaded",!0),setTimeout(o,e*r.delay)):setTimeout(i,r.timecheckvisibility))}(),void n())}())):void a()})}})}(jQuery),i=s.injectCss,e=document.getElementsByTagName("head")[0],(t=document.createElement("style")).type="text/css",t.styleSheet?t.styleSheet.cssText=i:t.appendChild(document.createTextNode(i)),e.appendChild(t)}function t(){this.feeds={},this.options=sb_instagram_js_options}function s(i,e,t){this.el=i,this.index=e,this.settings=t,this.minImageWidth=0,this.imageResolution=150,this.resizedImages={},this.needsResizing=[],this.outOfPages=!1,this.isInitialized=!1}function n(e,t){i.ajax({url:sbiajaxurl,type:"post",data:e,success:t})}t.prototype={createPage:function(e,t){void 0!==window.sbiajaxurl&&-1!==window.sbiajaxurl.indexOf(window.location.hostname)||(window.sbiajaxurl=location.protocol+"//"+window.location.hostname+"/wp-admin/admin-ajax.php"),i(".sbi_no_js_error_message").remove(),i(".sbi_no_js").removeClass("sbi_no_js"),e(t)},createFeeds:function(e){e.whenFeedsCreated(i(".sbi").each(function(e){i(this).attr("data-sbi-index",e+1);var t=i(this),a=void 0!==t.attr("data-sbi-flags")?t.attr("data-sbi-flags").split(","):[],o=void 0!==t.attr("data-options")?JSON.parse(t.attr("data-options")):{};if(a.indexOf("testAjax")>-1){window.sbi.triggeredTest=!0;n({action:"sbi_on_ajax_test_trigger"},function(i){console.log("did test")})}var d={cols:t.attr("data-cols"),colsmobile:void 0!==t.attr("data-colsmobile")&&"same"!==t.attr("data-colsmobile")?t.attr("data-colsmobile"):t.attr("data-cols"),num:t.attr("data-num"),imgRes:t.attr("data-res"),feedID:t.attr("data-feedid"),shortCodeAtts:t.attr("data-shortcode-atts"),resizingEnabled:-1===a.indexOf("resizeDisable"),imageLoadEnabled:-1===a.indexOf("imageLoadDisable"),debugEnabled:a.indexOf("debug")>-1,favorLocal:a.indexOf("favorLocal")>-1,ajaxPostLoad:a.indexOf("ajaxPostLoad")>-1,gdpr:a.indexOf("gdpr")>-1,overrideBlockCDN:a.indexOf("overrideBlockCDN")>-1,consentGiven:!1,autoMinRes:1,general:o};window.sbi.feeds[e]=function(i,e,t){return new s(i,e,t)}(this,e,d),window.sbi.feeds[e].setResizedImages(),window.sbi.feeds[e].init();var r=jQuery.Event("sbiafterfeedcreate");r.feed=window.sbi.feeds[e],jQuery(window).trigger(r)}))},afterFeedsCreated:function(){i(".sb_instagram_header").each(function(){var e=i(this);e.find(".sbi_header_link").hover(function(){e.find(".sbi_header_img_hover").addClass("sbi_fade_in")},function(){e.find(".sbi_header_img_hover").removeClass("sbi_fade_in")})})},encodeHTML:function(i){return void 0===i?"":i.replace(/(>)/g,"&gt;").replace(/(<)/g,"&lt;").replace(/(&lt;br\/&gt;)/g,"<br>").replace(/(&lt;br&gt;)/g,"<br>")},urlDetect:function(i){return i.match(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&\/\/=]*)/g)}},s.prototype={init:function(){var e=this;e.settings.consentGiven=e.checkConsent(),i(this.el).find(".sbi_photo").parent("p").length&&i(this.el).addClass("sbi_no_autop"),i(this.el).find("#sbi_mod_error").length&&i(this.el).prepend(i(this.el).find("#sbi_mod_error")),this.settings.ajaxPostLoad?this.getNewPostSet():this.afterInitialImagesLoaded();var t,s=(t=0,function(i,e){clearTimeout(t),t=setTimeout(i,e)});jQuery(window).resize(function(){s(function(){e.afterResize()},500)}),i(this.el).find(".sbi_item").each(function(){e.lazyLoadCheck(i(this))})},initLayout:function(){},afterInitialImagesLoaded:function(){this.initLayout(),this.loadMoreButtonInit(),this.hideExtraImagesForWidth(),this.beforeNewImagesRevealed(),this.revealNewImages(),this.afterNewImagesRevealed()},afterResize:function(){this.setImageHeight(),this.setImageResolution(),this.maybeRaiseImageResolution(),this.setImageSizeClass()},afterLoadMoreClicked:function(i){i.find(".sbi_loader").removeClass("sbi_hidden"),i.find(".sbi_btn_text").addClass("sbi_hidden"),i.closest(".sbi").find(".sbi_num_diff_hide").addClass("sbi_transition").removeClass("sbi_num_diff_hide")},afterNewImagesLoaded:function(){var e=i(this.el),t=this;this.beforeNewImagesRevealed(),this.revealNewImages(),this.afterNewImagesRevealed(),setTimeout(function(){e.find(".sbi_loader").addClass("sbi_hidden"),e.find(".sbi_btn_text").removeClass("sbi_hidden"),t.maybeRaiseImageResolution()},500)},beforeNewImagesRevealed:function(){this.setImageHeight(),this.maybeRaiseImageResolution(!0),this.setImageSizeClass()},revealNewImages:function(){var e=i(this.el);e.find(".sbi-screenreader").each(function(){i(this).find("img").remove()}),"function"==typeof sbi_custom_js&&setTimeout(function(){sbi_custom_js()},100),this.applyImageLiquid(),e.find(".sbi_item").each(function(i){jQuery(this).find(".sbi_photo").hover(function(){jQuery(this).fadeTo(200,.85)},function(){jQuery(this).stop().fadeTo(500,1)})}),setTimeout(function(){jQuery("#sbi_images .sbi_item.sbi_new").removeClass("sbi_new");var i=10;e.find(".sbi_transition").each(function(){var e=jQuery(this);setTimeout(function(){e.removeClass("sbi_transition")},i),i+=10})},500)},lazyLoadCheck:function(e){if(e.find(".sbi_photo").length&&!e.closest(".sbi").hasClass("sbi-no-ll-check")){var t=this.getImageUrls(e),s=void 0!==t[640]?t[640]:e.find(".sbi_photo").attr("data-full-res");if(!this.settings.consentGiven&&s.indexOf("scontent")>-1)return;e.find(".sbi_photo img").each(function(){s&&void 0!==i(this).attr("data-src")&&i(this).attr("data-src",s),s&&void 0!==i(this).attr("data-orig-src")&&i(this).attr("data-orig-src",s),i(this).on("load",function(){!i(this).hasClass("sbi-replaced")&&i(this).attr("src").indexOf("placeholder")>-1&&(i(this).addClass("sbi-replaced"),s&&(i(this).attr("src",s),i(this).closest(".sbi_imgLiquid_bgSize").length&&i(this).closest(".sbi_imgLiquid_bgSize").css("background-image","url("+s+")")))})})}},afterNewImagesRevealed:function(){this.listenForVisibilityChange(),this.sendNeedsResizingToServer(),this.settings.imageLoadEnabled||i(".sbi_no_resraise").removeClass("sbi_no_resraise");var e=i.Event("sbiafterimagesloaded");e.el=i(this.el),i(window).trigger(e)},setResizedImages:function(){i(this.el).find(".sbi_resized_image_data").length&&void 0!==i(this.el).find(".sbi_resized_image_data").attr("data-resized")&&0===i(this.el).find(".sbi_resized_image_data").attr("data-resized").indexOf('{"')&&(this.resizedImages=JSON.parse(i(this.el).find(".sbi_resized_image_data").attr("data-resized")),i(this.el).find(".sbi_resized_image_data").remove())},sendNeedsResizingToServer:function(){var e=this;if(e.needsResizing.length>0&&e.settings.resizingEnabled){var t=i(this.el).find(".sbi_item").length,s=void 0!==e.settings.general.cache_all&&e.settings.general.cache_all;n({action:"sbi_resized_images_submit",needs_resizing:e.needsResizing,offset:t,feed_id:e.settings.feedID,atts:e.settings.shortCodeAtts,cache_all:s},function(i){if(0===i.trim().indexOf("{")){var t=JSON.parse(i);for(var s in e.settings.debugEnabled&&console.log(t),t)t.hasOwnProperty(s)&&(e.resizedImages[s]=t[s]);e.maybeRaiseImageResolution(),setTimeout(function(){e.afterResize()},500)}})}},loadMoreButtonInit:function(){var e=i(this.el),t=this;e.find("#sbi_load .sbi_load_btn").off().on("click",function(){t.afterLoadMoreClicked(jQuery(this)),t.getNewPostSet()})},getNewPostSet:function(){var e=i(this.el),t=this;n({action:"sbi_load_more_clicked",offset:e.find(".sbi_item").length,feed_id:t.settings.feedID,atts:t.settings.shortCodeAtts,current_resolution:t.imageResolution},function(s){if(0===s.trim().indexOf("{")){var n=JSON.parse(s);t.settings.debugEnabled&&console.log(n),t.appendNewPosts(n.html),t.addResizedImages(n.resizedImages),t.settings.ajaxPostLoad?(t.settings.ajaxPostLoad=!1,t.afterInitialImagesLoaded()):t.afterNewImagesLoaded(),n.feedStatus.shouldPaginate?t.outOfPages=!1:(t.outOfPages=!0,e.find(".sbi_load_btn").hide()),i(".sbi_no_js").removeClass("sbi_no_js")}})},appendNewPosts:function(e){var t=i(this.el);t.find("#sbi_images .sbi_item").length?t.find("#sbi_images .sbi_item").last().after(e):t.find("#sbi_images").append(e)},addResizedImages:function(i){for(var e in i)this.resizedImages[e]=i[e]},setImageHeight:function(){var e=i(this.el),t=e.find(".sbi_photo").eq(0).innerWidth(),s=this.getColumnCount(),n=e.find("#sbi_images").innerWidth()-e.find("#sbi_images").width(),a=n/2;sbi_photo_width_manual=e.find("#sbi_images").width()/s-n,e.find(".sbi_photo").css("height",t),e.find(".sbi-owl-nav").length&&setTimeout(function(){var i=2;e.find(".sbi_owl2row-item").length&&(i=1);var t=e.find(".sbi_photo").eq(0).innerWidth()/i;t+=parseInt(a)*(2-i+2),e.find(".sbi-owl-nav div").css("top",t)},100)},maybeRaiseSingleImageResolution:function(e,t,s){var n=this,a=n.getImageUrls(e),o=e.find(".sbi_photo img").attr("src"),d=150,r=e.find("img").get(0),l=o===window.sbi.options.placeholder?1:r.naturalWidth/r.naturalHeight;s=void 0!==s&&s;if(!(e.hasClass("sbi_no_resraise")||e.hasClass("sbi_had_error")||e.find(".sbi_link_area").length&&e.find(".sbi_link_area").hasClass("sbi_had_error")))if(a.length<1)e.find(".sbi_link_area").length&&e.find(".sbi_link_area").attr("href",window.sbi.options.placeholder.replace("placeholder.png","thumb-placeholder.png"));else{(e.find(".sbi_link_area").length&&e.find(".sbi_link_area").attr("href")===window.sbi.options.placeholder.replace("placeholder.png","thumb-placeholder.png")||!n.settings.consentGiven)&&e.find(".sbi_link_area").attr("href",a[a.length-1]),void 0!==a[640]&&e.find(".sbi_photo").attr("data-full-res",a[640]),i.each(a,function(i,e){e===o&&(d=parseInt(i),s=!1)});var h=640;switch(n.settings.imgRes){case"thumb":h=150;break;case"medium":h=320;break;case"full":h=640;break;default:var g=Math.max(n.settings.autoMinRes,e.find(".sbi_photo").innerWidth()),c=n.getBestResolutionForAuto(g,l,e);switch(c){case 320:h=320;break;case 150:h=150}}if(h>d||o===window.sbi.options.placeholder||s){if(n.settings.debugEnabled){var f=o===window.sbi.options.placeholder?"was placeholder":"too small";console.log("rais res for "+o,f)}var u=a[h].split("?ig_cache_key")[0];if(o!==u&&(e.find(".sbi_photo img").attr("src",u),e.find(".sbi_photo").css("background-image",'url("'+u+'")')),d=h,"auto"===n.settings.imgRes){var b=!1;e.find(".sbi_photo img").on("load",function(){var t=i(this),s=t.get(0).naturalWidth/t.get(0).naturalHeight;if(1e3!==t.get(0).naturalWidth&&s>l&&!b){switch(n.settings.debugEnabled&&console.log("rais res again for aspect ratio change "+o),b=!0,g=e.find(".sbi_photo").innerWidth(),c=n.getBestResolutionForAuto(g,s,e),h=640,c){case 320:h=320;break;case 150:h=150}h>d&&(u=a[h].split("?ig_cache_key")[0],t.attr("src",u),t.closest(".sbi_photo").css("background-image",'url("'+u+'")')),"masonry"!==n.layout&&"highlight"!==n.layout||(i(n.el).find("#sbi_images").smashotope(n.isotopeArgs),setTimeout(function(){i(n.el).find("#sbi_images").smashotope(n.isotopeArgs)},500))}else if(n.settings.debugEnabled){var r=b?"already checked":"no aspect ratio change";console.log("not raising res for replacement "+o,r)}})}}e.find("img").on("error",function(){if(i(this).hasClass("sbi_img_error"))console.log("unfixed error "+i(this).attr("src"));else{var e;if(i(this).addClass("sbi_img_error"),i(this).attr("src").indexOf("media/?size=")>-1||i(this).attr("src").indexOf("cdninstagram")>-1||i(this).attr("src").indexOf("fbcdn")>-1)n.settings.favorLocal=!0,void 0!==(e=n.getImageUrls(i(this).closest(".sbi_item")))[640]&&(i(this).attr("src",e[640]),i(this).closest(".sbi_photo").css("background-image","url("+e[640]+")"),i(this).closest(".sbi_item").addClass("sbi_had_error").find(".sbi_link_area").attr("href",e[640]).addClass("sbi_had_error"));else if("undefined"!==i(this).closest(".sbi_photo").attr("data-img-src-set"))void 0!==(e=JSON.parse(i(this).closest(".sbi_photo").attr("data-img-src-set").replace(/\\\//g,"/"))).d&&(i(this).attr("src",e.d),i(this).closest(".sbi_photo").css("background-image","url("+e.d+")"),i(this).closest(".sbi_item").addClass("sbi_had_error").find(".sbi_link_area").attr("href",e[640]).addClass("sbi_had_error"));setTimeout(function(){n.afterResize()},1500)}})}},maybeRaiseImageResolution:function(e){var t=this,s=void 0!==e&&!0===e?".sbi_item.sbi_new":".sbi_item",n=!t.isInitialized;i(t.el).find(s).each(function(e){!i(this).hasClass("sbi_num_diff_hide")&&i(this).find(".sbi_photo").length&&void 0!==i(this).find(".sbi_photo").attr("data-img-src-set")&&t.maybeRaiseSingleImageResolution(i(this),e,n)}),t.isInitialized=!0},getBestResolutionForAuto:function(e,t,s){(isNaN(t)||t<1)&&(t=1);var n=e*t,a=10*Math.ceil(n/10),o=[150,320,640];if(s.hasClass("sbi_highlighted")&&(a*=2),-1===o.indexOf(parseInt(a))){var d=!1;i.each(o,function(i,e){e>parseInt(a)&&!d&&(a=e,d=!0)})}return a},hideExtraImagesForWidth:function(){if("carousel"!==this.layout){var e=i(this.el),t=void 0!==e.attr("data-num")&&""!==e.attr("data-num")?parseInt(e.attr("data-num")):1,s=void 0!==e.attr("data-nummobile")&&""!==e.attr("data-nummobile")?parseInt(e.attr("data-nummobile")):t;i(window).width()<480?s<e.find(".sbi_item").length&&e.find(".sbi_item").slice(s-e.find(".sbi_item").length).addClass("sbi_num_diff_hide"):t<e.find(".sbi_item").length&&e.find(".sbi_item").slice(t-e.find(".sbi_item").length).addClass("sbi_num_diff_hide")}},setImageSizeClass:function(){var e=i(this.el);e.removeClass("sbi_small sbi_medium");var t=e.innerWidth(),s=parseInt(e.find("#sbi_images").outerWidth()-e.find("#sbi_images").width())/2,n=this.getColumnCount(),a=(t-s*(n+2))/n;a>120&&a<240?e.addClass("sbi_medium"):a<=120&&e.addClass("sbi_small")},setMinImageWidth:function(){i(this.el).find(".sbi_item .sbi_photo").first().length?this.minImageWidth=i(this.el).find(".sbi_item .sbi_photo").first().innerWidth():this.minImageWidth=150},setImageResolution:function(){if("auto"===this.settings.imgRes)this.imageResolution="auto";else switch(this.settings.imgRes){case"thumb":this.imageResolution=150;break;case"medium":this.imageResolution=320;break;default:this.imageResolution=640}},getImageUrls:function(i){var e=JSON.parse(i.find(".sbi_photo").attr("data-img-src-set").replace(/\\\//g,"/")),t=i.attr("id").replace("sbi_","");if(this.settings.consentGiven||this.settings.overrideBlockCDN||(e=[]),void 0!==this.resizedImages[t]&&"video"!==this.resizedImages[t]&&"pending"!==this.resizedImages[t]&&"error"!==this.resizedImages[t].id&&"video"!==this.resizedImages[t].id&&"pending"!==this.resizedImages[t].id){if(void 0!==this.resizedImages[t].sizes){var s=[];void 0!==this.resizedImages[t].sizes.full&&(e[640]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"full.jpg",s.push(640)),void 0!==this.resizedImages[t].sizes.low&&(e[320]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"low.jpg",s.push(320)),void 0!==this.resizedImages[t].sizes.thumb&&(s.push(150),e[150]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"thumb.jpg"),this.settings.favorLocal&&(-1===s.indexOf(640)&&s.indexOf(320)>-1&&(e[640]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"low.jpg"),-1===s.indexOf(320)&&(s.indexOf(640)>-1?e[320]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"full.jpg":s.indexOf(150)>-1&&(e[320]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"thumb.jpg")),-1===s.indexOf(150)&&(s.indexOf(320)>-1?e[150]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"low.jpg":s.indexOf(640)>-1&&(e[150]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"full.jpg")))}}else(void 0===this.resizedImages[t]||void 0!==this.resizedImages[t].id&&"pending"!==this.resizedImages[t].id&&"error"!==this.resizedImages[t].id)&&this.addToNeedsResizing(t);return e},getAvatarUrl:function(i,e){if(""===i)return"";var t=this.settings.general.avatars;return"local"===(e=void 0!==e?e:"local")?void 0!==t["LCL"+i]&&1===parseInt(t["LCL"+i])?sb_instagram_js_options.resized_url+i+".jpg":void 0!==t[i]?t[i]:"":void 0!==t[i]?t[i]:void 0!==t["LCL"+i]&&1===parseInt(t["LCL"+i])?sb_instagram_js_options.resized_url+i+".jpg":""},addToNeedsResizing:function(i){-1===this.needsResizing.indexOf(i)&&this.needsResizing.push(i)},applyImageLiquid:function(){var t=i(this.el);e(),"function"==typeof t.find(".sbi_photo").sbi_imgLiquid&&t.find(".sbi_photo").sbi_imgLiquid({fill:!0})},listenForVisibilityChange:function(){var e,t,s,n=this;e=jQuery,t={callback:function(){},runOnLoad:!0,frequency:100,sbiPreviousVisibility:null},s={sbiCheckVisibility:function(i,e){if(jQuery.contains(document,i[0])){var t=e.sbiPreviousVisibility,n=i.is(":visible");e.sbiPreviousVisibility=n,null==t?e.runOnLoad&&e.callback(i,n):t!==n&&e.callback(i,n),setTimeout(function(){s.sbiCheckVisibility(i,e)},e.frequency)}}},e.fn.sbiVisibilityChanged=function(i){var n=e.extend({},t,i);return this.each(function(){s.sbiCheckVisibility(e(this),n)})},"function"==typeof i(this.el).filter(":hidden").sbiVisibilityChanged&&i(this.el).filter(":hidden").sbiVisibilityChanged({callback:function(i,e){n.afterResize()},runOnLoad:!1})},getColumnCount:function(){var e=i(this.el),t=this.settings.cols,s=this.settings.colsmobile,n=t;return sbiWindowWidth=window.innerWidth,e.hasClass("sbi_mob_col_auto")?(sbiWindowWidth<640&&parseInt(t)>2&&parseInt(t)<7&&(n=2),sbiWindowWidth<640&&parseInt(t)>6&&parseInt(t)<11&&(n=4),sbiWindowWidth<=480&&parseInt(t)>2&&(n=1)):sbiWindowWidth<=480&&(n=s),parseInt(n)},checkConsent:function(){if(this.settings.consentGiven||!this.settings.gdpr)return!0;if("undefined"!=typeof CLI_Cookie)null!==CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME)&&(this.settings.consentGiven="yes"===CLI_Cookie.read("cookielawinfo-checkbox-non-necessary"));else if(void 0!==window.cnArgs){var i=("; "+document.cookie).split("; cookie_notice_accepted=");if(2===i.length){var e=i.pop().split(";").shift();this.settings.consentGiven="true"===e}}else void 0!==window.cookieconsent?this.settings.consentGiven="allow"===function(i){for(var e=i+"=",t=window.document.cookie.split(";"),s=0;s<t.length;s++){var n=t[s].trim();if(0==n.indexOf(e))return n.substring(e.length,n.length)}return""}("complianz_consent_status"):void 0!==window.Cookiebot&&(this.settings.consentGiven=Cookiebot.consented);var t=jQuery.Event("sbicheckconsent");return t.feed=this,jQuery(window).trigger(t),this.settings.consentGiven},afterConsentToggled:function(){if(this.checkConsent()){var i=this;i.maybeRaiseImageResolution(),setTimeout(function(){i.afterResize()},500)}}},window.sbi_init=function(){window.sbi=new t,window.sbi.createPage(window.sbi.createFeeds,{whenFeedsCreated:window.sbi.afterFeedsCreated})}}(jQuery),jQuery(document).ready(function(i){void 0===window.sb_instagram_js_options&&(window.sb_instagram_js_options={font_method:"svg",resized_url:location.protocol+"//"+window.location.hostname+"/wp-content/uploads/sb-instagram-feed-images/",placeholder:location.protocol+"//"+window.location.hostname+"/wp-content/plugins/instagram-feed/img/placeholder.png"}),void 0!==window.sb_instagram_js_options.resized_url&&-1===window.sb_instagram_js_options.resized_url.indexOf(location.protocol)&&("http:"===location.protocol?window.sb_instagram_js_options.resized_url=window.sb_instagram_js_options.resized_url.replace("https:","http:"):window.sb_instagram_js_options.resized_url=window.sb_instagram_js_options.resized_url.replace("http:","https:")),sbi_init(),i("#cookie-notice a").click(function(){setTimeout(function(){i.each(window.sbi.feeds,function(i){window.sbi.feeds[i].afterConsentToggled()})},1e3)}),i("#cookie-law-info-bar a").click(function(){setTimeout(function(){i.each(window.sbi.feeds,function(i){window.sbi.feeds[i].afterConsentToggled()})},1e3)}),i(".cli-user-preference-checkbox").click(function(){setTimeout(function(){i.each(window.sbi.feeds,function(i){window.sbi.feeds[i].settings.consentGiven=!1,window.sbi.feeds[i].afterConsentToggled()})},1e3)}),i(window).on("CookiebotOnAccept",function(e){i.each(window.sbi.feeds,function(i){window.sbi.feeds[i].settings.consentGiven=!0,window.sbi.feeds[i].afterConsentToggled()})}),i(document).on("cmplzAcceptAll",function(e){i.each(window.sbi.feeds,function(i){window.sbi.feeds[i].settings.consentGiven=!0,window.sbi.feeds[i].afterConsentToggled()})}),i(document).on("cmplzRevoke",function(e){i.each(window.sbi.feeds,function(i){window.sbi.feeds[i].settings.consentGiven=!1,window.sbi.feeds[i].afterConsentToggled()})})}));