SiteOrigin Widgets Bundle - Version 1.13.4

Version Description

  • 6 December 2018 =
  • Widget block: Fix Layout Slider not being editable.
  • Widget block: Correct used of i18n for block editor.
  • Widget block: Fix previews.
  • Google map: Move global API key override to modify_instance to ensure key is available in form.
  • Widget block: Prevent multiple API requests.
Download this release

Release Info

Developer gpriday
Plugin Icon 128x128 SiteOrigin Widgets Bundle
Version 1.13.4
Comparing to
See all releases

Code changes from version 1.13.3 to 1.13.4

Files changed (57) hide show
  1. admin/admin.min.js +1 -1
  2. admin/trianglify.min.js +1 -2
  3. base/inc/fields/icon.class.php +93 -93
  4. base/inc/fields/js/autocomplete-field.min.js +1 -1
  5. base/inc/fields/js/code-field.min.js +1 -1
  6. base/inc/fields/js/date-range-field.min.js +1 -1
  7. base/inc/fields/js/icon-field.js +183 -183
  8. base/inc/fields/js/icon-field.min.js +1 -1
  9. base/inc/fields/js/media-field.min.js +1 -1
  10. base/inc/fields/js/multi-measurement-field.min.js +1 -1
  11. base/inc/fields/js/order-field.min.js +1 -1
  12. base/inc/fields/js/posts-field.min.js +1 -1
  13. base/inc/fields/js/presets-field.min.js +1 -1
  14. base/inc/fields/js/tinymce-field-pre48.min.js +1 -1
  15. base/inc/fields/js/tinymce-field.min.js +1 -1
  16. base/inc/routes/siteorigin-widgets-resource.class.php +2 -30
  17. base/js/admin.min.js +1 -1
  18. base/js/meta-box-manager.min.js +1 -1
  19. compat/beaver-builder/sowb-beaver-builder.min.js +1 -1
  20. compat/block-editor/widget-block.js +24 -38
  21. compat/block-editor/widget-block.min.js +1 -1
  22. compat/block-editor/widget-block.php +18 -0
  23. compat/elementor/sowb-elementor.min.js +1 -1
  24. compat/visual-composer/sowb-vc-widget.min.js +1 -1
  25. icons/fontawesome/filter.php +793 -793
  26. icons/fontawesome/font/fontawesome-webfont.svg +2671 -2671
  27. icons/fontawesome/style.css +30 -30
  28. icons/icons.php +25 -25
  29. js/jquery.cycle.min.js +1 -1
  30. js/jquery.cycle.swipe.min.js +1 -1
  31. js/jquery.touchSwipe.min.js +1 -1
  32. js/lib/imagesloaded.pkgd.min.js +1 -1
  33. js/lib/packery.pkgd.min.js +1 -2
  34. js/lib/pikaday.jquery.min.js +1 -1
  35. js/lib/pikaday.min.js +1 -1
  36. js/slider/jquery.slider.js +2 -1
  37. js/slider/jquery.slider.min.js +1 -1
  38. js/sow.google-map.min.js +1 -1
  39. js/sow.jquery.fittext.min.js +1 -1
  40. lang/so-widgets-bundle.pot +6 -6
  41. readme.txt +9 -2
  42. so-widgets-bundle.php +2 -2
  43. widgets/accordion/js/accordion.min.js +1 -1
  44. widgets/contact/js/contact.min.js +1 -1
  45. widgets/cta/css/style.css +1 -1
  46. widgets/cta/js/cta.min.js +1 -1
  47. widgets/google-map/google-map.php +14 -7
  48. widgets/google-map/js/static-map.min.js +1 -1
  49. widgets/image-grid/js/image-grid.min.js +1 -1
  50. widgets/layout-slider/layout-slider.php +1 -1
  51. widgets/post-carousel/css/style.css +1 -1
  52. widgets/post-carousel/js/carousel.min.js +1 -1
  53. widgets/price-table/js/pricetable.min.js +1 -1
  54. widgets/simple-masonry/js/simple-masonry.min.js +1 -1
  55. widgets/social-media-buttons/js/social-media-buttons-admin.min.js +1 -1
  56. widgets/tabs/js/tabs.min.js +1 -1
  57. widgets/video/js/so-video-widget.min.js +1 -1
admin/admin.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(function(i){i(".so-widget-toggle-active button").click(function(){var e=i(this),s=e.data("status"),t=e.closest(".so-widget");s?t.addClass("so-widget-is-active").removeClass("so-widget-is-inactive"):t.removeClass("so-widget-is-active").addClass("so-widget-is-inactive"),i.post(soWidgetsAdmin.toggleUrl,{widget:t.data("id"),active:s},function(i){})}),i(".so-widget-banner").each(function(){var e=i(this),s=e.find("img");if(s.length)s.width()>128&&s.css("margin-left",-(s.width()-128)/2);else{var t=Trianglify({width:128,height:128,variance:1,cell_size:32,seed:e.data("seed")});e.append(t.svg())}});var e=function(){var e=i(this).val().toLowerCase();""===e?i(".so-widget-wrap").show():i(".so-widget").each(function(){var s=i(this);s.find("h3").html().toLowerCase().indexOf(e)>-1?s.parent().show():s.parent().hide()})};i("#sow-widget-search input").on({keyup:e,search:e}),i(window).resize(function(){var e=i(".so-widget-text").css("height","auto"),s=0;e.each(function(){s=Math.max(s,i(this).height())}),e.each(function(){i(this).css("height",s)})}).resize(),i("#sow-widgets-page .page-nav a").click(function(e){e.preventDefault();var s=i(this),t=s.attr("href"),a=s.closest("li");switch(i("#sow-widgets-page .page-nav li").not(a).removeClass("active"),a.addClass("active"),t){case"#all":i(".so-widget-wrap").show();break;case"#enabled":i(".so-widget-wrap").hide(),i(".so-widget-wrap .so-widget-is-active").each(function(){i(this).closest(".so-widget-wrap").show()}),i(".so-widget-wrap .so-widget-is-inactive").each(function(){i(this).closest(".so-widget-wrap").hide()});break;case"#disabled":i(".so-widget-wrap .so-widget-is-active").each(function(){i(this).closest(".so-widget-wrap").hide()}),i(".so-widget-wrap .so-widget-is-inactive").each(function(){i(this).closest(".so-widget-wrap").show()})}i(window).resize()}),i("#widgets-list").addClass("so-animated");var s=i("#sow-settings-dialog");i("#widgets-list .so-widget-settings").click(function(e){var t=i(this);e.preventDefault(),s.find(".so-content").empty().addClass("so-loading").load(t.data("form-url"),function(){i(this).removeClass("so-loading")}),s.show()}),s.find(".so-close").click(function(i){i.preventDefault(),s.hide()}),s.find(".so-save").click(function(e){e.preventDefault();var t=i(this);t.prop("disabled",!0),i("#widgets-list .so-widget-settings").prop("disabled",!0),s.find("form").submit(function(){t.prop("disabled",!1),s.hide()}).submit()}),i("#so-widget-settings-save").load(function(){i("#widgets-list .so-widget-settings").prop("disabled",!1)})});
1
+ jQuery(function(a){a(".so-widget-toggle-active button").click(function(){var i=a(this),e=i.data("status"),s=i.closest(".so-widget");e?s.addClass("so-widget-is-active").removeClass("so-widget-is-inactive"):s.removeClass("so-widget-is-active").addClass("so-widget-is-inactive"),a.post(soWidgetsAdmin.toggleUrl,{widget:s.data("id"),active:e},function(i){})}),a(".so-widget-banner").each(function(){var i=a(this),e=i.find("img");if(e.length)128<e.width()&&e.css("margin-left",-(e.width()-128)/2);else{var s=Trianglify({width:128,height:128,variance:1,cell_size:32,seed:i.data("seed")});i.append(s.svg())}});var i=function(){var e=a(this).val().toLowerCase();""===e?a(".so-widget-wrap").show():a(".so-widget").each(function(){var i=a(this);-1<i.find("h3").html().toLowerCase().indexOf(e)?i.parent().show():i.parent().hide()})};a("#sow-widget-search input").on({keyup:i,search:i}),a(window).resize(function(){var i=a(".so-widget-text").css("height","auto"),e=0;i.each(function(){e=Math.max(e,a(this).height())}),i.each(function(){a(this).css("height",e)})}).resize(),a("#sow-widgets-page .page-nav a").click(function(i){i.preventDefault();var e=a(this),s=e.attr("href"),t=e.closest("li");switch(a("#sow-widgets-page .page-nav li").not(t).removeClass("active"),t.addClass("active"),s){case"#all":a(".so-widget-wrap").show();break;case"#enabled":a(".so-widget-wrap").hide(),a(".so-widget-wrap .so-widget-is-active").each(function(){a(this).closest(".so-widget-wrap").show()}),a(".so-widget-wrap .so-widget-is-inactive").each(function(){a(this).closest(".so-widget-wrap").hide()});break;case"#disabled":a(".so-widget-wrap .so-widget-is-active").each(function(){a(this).closest(".so-widget-wrap").hide()}),a(".so-widget-wrap .so-widget-is-inactive").each(function(){a(this).closest(".so-widget-wrap").show()})}a(window).resize()}),a("#widgets-list").addClass("so-animated");var s=a("#sow-settings-dialog");a("#widgets-list .so-widget-settings").click(function(i){var e=a(this);i.preventDefault(),s.find(".so-content").empty().addClass("so-loading").load(e.data("form-url"),function(){a(this).removeClass("so-loading")}),s.show()}),s.find(".so-close").click(function(i){i.preventDefault(),s.hide()}),s.find(".so-save").click(function(i){i.preventDefault();var e=a(this);e.prop("disabled",!0),a("#widgets-list .so-widget-settings").prop("disabled",!0),s.find("form").submit(function(){e.prop("disabled",!1),s.hide()}).submit()}),a("#so-widget-settings-save").load(function(){a("#widgets-list .so-widget-settings").prop("disabled",!1)})});
admin/trianglify.min.js CHANGED
@@ -1,2 +1 @@
1
- !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r;r="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,r.Trianglify=e()}}(function(){var e;return function e(r,n,t){function f(o,i){if(!n[o]){if(!r[o]){var c="function"==typeof require&&require;if(!i&&c)return c(o,!0);if(a)return a(o,!0);var d=new Error("Cannot find module '"+o+"'");throw d.code="MODULE_NOT_FOUND",d}var s=n[o]={exports:{}};r[o][0].call(s.exports,function(e){var n=r[o][1][e];return f(n||e)},s,s.exports,e,r,n,t)}return n[o].exports}for(var a="function"==typeof require&&require,o=0;o<t.length;o++)f(t[o]);return f}({"./lib/trianglify.js":[function(e,r,n){function t(e){function r(e,r,n){return(e-r[0])*(n[1]-n[0])/(r[1]-r[0])+n[0]}function n(){if(e.palette instanceof Array)return e.palette[Math.floor(rand()*e.palette.length)];var r=Object.keys(e.palette);return e.palette[r[Math.floor(rand()*r.length)]]}if(e=function(e,r){var n={};for(var t in e)n[t]=e[t];for(t in r){if(!e.hasOwnProperty(t))throw new Error(t+" is not a configuration option for Trianglify. Check your spelling?");n[t]=r[t]}return n}(d,e),rand=a(e.seed),"random"===e.x_colors&&(e.x_colors=n()),"random"===e.y_colors&&(e.y_colors=n()),"match_x"===e.y_colors&&(e.y_colors=e.x_colors),!(e.width>0&&e.height>0))throw new Error("Width and height must be numbers greater than 0");if(e.cell_size<2)throw new Error("Cell size must be greater than 2.");var t;if(e.color_function)t=function(r,n){return o(e.color_function(r,n))};else{var i=o.scale(e.x_colors).mode(e.color_space),s=o.scale(e.y_colors).mode(e.color_space);t=function(r,n){return o.interpolate(i(r),s(n),.5,e.color_space)}}for(var u=e.width,l=e.height,b=Math.floor((u+4*e.cell_size)/e.cell_size),h=Math.floor((l+4*e.cell_size)/e.cell_size),g=(b*e.cell_size-u)/2,p=(h*e.cell_size-l)/2,m=e.cell_size*e.variance/2,y=function(n,t){for(var f=[],a=-g;a<n+g;a+=e.cell_size)for(var o=-p;o<t+p;o+=e.cell_size){var i=a+e.cell_size/2+r(rand(),[0,1],[-m,m]),c=o+e.cell_size/2+r(rand(),[0,1],[-m,m]);f.push([i,c].map(Math.floor))}return f}(u,l),w=f.triangulate(y),v=[],x=function(e){return y[e]},_=0;_<w.length;_+=3){var k=[w[_],w[_+1],w[_+2]].map(x),j=function(e){return{x:(e[0][0]+e[1][0]+e[2][0])/3,y:(e[0][1]+e[1][1]+e[2][1])/3}}(k),M=t(function(e){return r(e,[-g,u+g],[0,1])}(j.x),function(e){return r(e,[-p,l+p],[0,1])}(j.y)).hex();v.push([M,k])}return c(v,e)}var f=e("delaunay-fast"),a=e("seedrandom"),o=e("chroma-js"),i=e("./colorbrewer"),c=e("./pattern"),d={width:600,height:400,cell_size:75,variance:.75,seed:null,x_colors:"random",y_colors:"match_x",palette:i,color_space:"lab",color_function:null,stroke_width:1.51};t.colorbrewer=i,t.defaults=d,r.exports=t},{"./colorbrewer":"/Users/gpriday/Downloads/trianglify-master 2/lib/colorbrewer.js","./pattern":"/Users/gpriday/Downloads/trianglify-master 2/lib/pattern.js","chroma-js":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/chroma-js/chroma.js","delaunay-fast":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/delaunay-fast/delaunay.js",seedrandom:"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/index.js"}],"/Users/gpriday/Downloads/trianglify-master 2/lib/colorbrewer.js":[function(e,r,n){r.exports={YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"]}},{}],"/Users/gpriday/Downloads/trianglify-master 2/lib/pattern.js":[function(e,r,n){(function(n){function t(r,t){function a(){var e=f.createElementNS("http://www.w3.org/2000/svg","svg");return e.setAttribute("width",t.width),e.setAttribute("height",t.height),r.forEach(function(r){var n=f.createElementNS("http://www.w3.org/2000/svg","path");n.setAttribute("d","M"+r[1].join("L")+"Z"),n.setAttribute("fill",r[0]),n.setAttribute("stroke",r[0]),n.setAttribute("stroke-width",t.stroke_width),e.appendChild(n)}),e}function o(a){if(void 0!==n)try{e("canvas")}catch(e){throw Error("The optional node-canvas dependency is needed for Trianglify to render using canvas in node.")}return a||(a=f.createElement("canvas")),a.setAttribute("width",t.width),a.setAttribute("height",t.height),ctx=a.getContext("2d"),ctx.canvas.width=t.width,ctx.canvas.height=t.height,r.forEach(function(e){ctx.fillStyle=ctx.strokeStyle=e[0],ctx.lineWidth=t.stroke_width,ctx.beginPath(),ctx.moveTo.apply(ctx,e[1][0]),ctx.lineTo.apply(ctx,e[1][1]),ctx.lineTo.apply(ctx,e[1][2]),ctx.fill(),ctx.stroke()}),a}function i(){return o().toDataURL("image/png")}return{polys:r,opts:t,svg:a,canvas:o,png:i}}var f="undefined"!=typeof document?document:e("jsdom").jsdom("<html/>");r.exports=t}).call(this,e("_process"))},{_process:"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/process/browser.js",canvas:"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/browser-resolve/empty.js",jsdom:"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/browser-resolve/empty.js"}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/browser-resolve/empty.js":[function(e,r,n){},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/process/browser.js":[function(e,r,n){function t(){if(!i){i=!0;for(var e,r=o.length;r;){e=o,o=[];for(var n=-1;++n<r;)e[n]();r=o.length}i=!1}}function f(){}var a=r.exports={},o=[],i=!1;a.nextTick=function(e){o.push(e),i||setTimeout(t,0)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=f,a.addListener=f,a.once=f,a.off=f,a.removeListener=f,a.removeAllListeners=f,a.emit=f,a.binding=function(e){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(e){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/chroma-js/chroma.js":[function(r,n,t){(function(){var r,f,a,o,i,c,d,s,u,l,b,h,g,p,m,y,w,v,x,_,k,j,M,N,D,U,A,P,z,G,E,B,I,q,R;s=function(e,n,t,f){return new r(e,n,t,f)},void 0!==n&&null!==n&&null!=n.exports&&(n.exports=s),"function"==typeof e&&e.amd?e([],function(){return s}):(E=void 0!==t&&null!==t?t:this,E.chroma=s),s.color=function(e,n,t,f){return new r(e,n,t,f)},s.hsl=function(e,n,t,f){return new r(e,n,t,f,"hsl")},s.hsv=function(e,n,t,f){return new r(e,n,t,f,"hsv")},s.rgb=function(e,n,t,f){return new r(e,n,t,f,"rgb")},s.hex=function(e){return new r(e)},s.css=function(e){return new r(e)},s.lab=function(e,n,t){return new r(e,n,t,"lab")},s.lch=function(e,n,t){return new r(e,n,t,"lch")},s.hsi=function(e,n,t){return new r(e,n,t,"hsi")},s.gl=function(e,n,t,f){return new r(255*e,255*n,255*t,f,"gl")},s.interpolate=function(e,n,t,f){return null==e||null==n?"#000":("string"===B(e)&&(e=new r(e)),"string"===B(n)&&(n=new r(n)),e.interpolate(t,n,f))},s.mix=s.interpolate,s.contrast=function(e,n){var t,f;return"string"===B(e)&&(e=new r(e)),"string"===B(n)&&(n=new r(n)),t=e.luminance(),f=n.luminance(),t>f?(t+.05)/(f+.05):(f+.05)/(t+.05)},s.luminance=function(e){return s(e).luminance()},s._Color=r,r=function(){function e(){var e,r,n,t,f,a,o,i,c,d,s,l,b,y,v;for(f=this,n=[],c=0,d=arguments.length;c<d;c++)null!=(r=arguments[c])&&n.push(r);if(0===n.length)s=[255,0,255,1,"rgb"],a=s[0],o=s[1],i=s[2],e=s[3],t=s[4];else if("array"===B(n[0])){if(3===n[0].length)l=n[0],a=l[0],o=l[1],i=l[2],e=1;else{if(4!==n[0].length)throw"unknown input argument";b=n[0],a=b[0],o=b[1],i=b[2],e=b[3]}t=null!=(y=n[1])?y:"rgb"}else"string"===B(n[0])?(a=n[0],t="hex"):"object"===B(n[0])?(v=n[0]._rgb,a=v[0],o=v[1],i=v[2],e=v[3],t="rgb"):n.length>=3&&(a=n[0],o=n[1],i=n[2]);3===n.length?(t="rgb",e=1):4===n.length?"string"===B(n[3])?(t=n[3],e=1):"number"===B(n[3])&&(t="rgb",e=n[3]):5===n.length&&(e=n[3],t=n[4]),null==e&&(e=1),"rgb"===t?f._rgb=[a,o,i,e]:"gl"===t?f._rgb=[255*a,255*o,255*i,e]:"hsl"===t?(f._rgb=p(a,o,i),f._rgb[3]=e):"hsv"===t?(f._rgb=m(a,o,i),f._rgb[3]=e):"hex"===t?f._rgb=h(a):"lab"===t?(f._rgb=w(a,o,i),f._rgb[3]=e):"lch"===t?(f._rgb=_(a,o,i),f._rgb[3]=e):"hsi"===t&&(f._rgb=g(a,o,i),f._rgb[3]=e),u(f._rgb)}return e.prototype.rgb=function(){return this._rgb.slice(0,3)},e.prototype.rgba=function(){return this._rgb},e.prototype.hex=function(){return N(this._rgb)},e.prototype.toString=function(){return this.name()},e.prototype.hsl=function(){return U(this._rgb)},e.prototype.hsv=function(){return A(this._rgb)},e.prototype.lab=function(){return P(this._rgb)},e.prototype.lch=function(){return z(this._rgb)},e.prototype.hsi=function(){return D(this._rgb)},e.prototype.gl=function(){return[this._rgb[0]/255,this._rgb[1]/255,this._rgb[2]/255,this._rgb[3]]},e.prototype.luminance=function(r,n){var t,f,a,o;return null==n&&(n="rgb"),arguments.length?(0===r&&(this._rgb=[0,0,0,this._rgb[3]]),1===r&&(this._rgb=[255,255,255,this._rgb[3]]),t=j(this._rgb),f=1e-7,a=20,o=function(e,t){var i,c;return c=e.interpolate(.5,t,n),i=c.luminance(),Math.abs(r-i)<f||!a--?c:i>r?o(e,c):o(c,t)},this._rgb=(t>r?o(new e("black"),this):o(this,new e("white"))).rgba(),this):j(this._rgb)},e.prototype.name=function(){var e,r;e=this.hex();for(r in s.colors)if(e===s.colors[r])return r;return e},e.prototype.alpha=function(e){return arguments.length?(this._rgb[3]=e,this):this._rgb[3]},e.prototype.css=function(e){var r,n,t,f;return null==e&&(e="rgb"),n=this,t=n._rgb,3===e.length&&t[3]<1&&(e+="a"),"rgb"===e?e+"("+t.slice(0,3).map(Math.round).join(",")+")":"rgba"===e?e+"("+t.slice(0,3).map(Math.round).join(",")+","+t[3]+")":"hsl"===e||"hsla"===e?(r=n.hsl(),f=function(e){return Math.round(100*e)/100},r[0]=f(r[0]),r[1]=f(100*r[1])+"%",r[2]=f(100*r[2])+"%",4===e.length&&(r[3]=t[3]),e+"("+r.join(",")+")"):void 0},e.prototype.interpolate=function(r,n,t){var f,a,o,i,c,d,s,u,l,b,h,g,p,m;if(u=this,null==t&&(t="rgb"),"string"===B(n)&&(n=new e(n)),"hsl"===t||"hsv"===t||"lch"===t||"hsi"===t)"hsl"===t?(p=u.hsl(),m=n.hsl()):"hsv"===t?(p=u.hsv(),m=n.hsv()):"hsi"===t?(p=u.hsi(),m=n.hsi()):"lch"===t&&(p=u.lch(),m=n.lch()),"h"===t.substr(0,1)?(o=p[0],h=p[1],d=p[2],i=m[0],g=m[1],s=m[2]):(d=p[0],h=p[1],o=p[2],s=m[0],g=m[1],i=m[2]),isNaN(o)||isNaN(i)?isNaN(o)?isNaN(i)?a=Number.NaN:(a=i,1!==d&&0!==d||"hsv"===t||(b=g)):(a=o,1!==s&&0!==s||"hsv"===t||(b=h)):(f=i>o&&i-o>180?i-(o+360):i<o&&o-i>180?i+360-o:i-o,a=o+r*f),null==b&&(b=h+r*(g-h)),c=d+r*(s-d),l="h"===t.substr(0,1)?new e(a,b,c,t):new e(c,b,a,t);else if("rgb"===t)p=u._rgb,m=n._rgb,l=new e(p[0]+r*(m[0]-p[0]),p[1]+r*(m[1]-p[1]),p[2]+r*(m[2]-p[2]),t);else{if("lab"!==t)throw"color mode "+t+" is not supported";p=u.lab(),m=n.lab(),l=new e(p[0]+r*(m[0]-p[0]),p[1]+r*(m[1]-p[1]),p[2]+r*(m[2]-p[2]),t)}return l.alpha(u.alpha()+r*(n.alpha()-u.alpha())),l},e.prototype.premultiply=function(){var e,r;return r=this.rgb(),e=this.alpha(),s(r[0]*e,r[1]*e,r[2]*e,e)},e.prototype.darken=function(e){var r,n;return null==e&&(e=20),n=this,r=n.lch(),r[0]-=e,s.lch(r).alpha(n.alpha())},e.prototype.darker=function(e){return this.darken(e)},e.prototype.brighten=function(e){return null==e&&(e=20),this.darken(-e)},e.prototype.brighter=function(e){return this.brighten(e)},e.prototype.saturate=function(e){var r,n;return null==e&&(e=20),n=this,r=n.lch(),r[1]+=e,s.lch(r).alpha(n.alpha())},e.prototype.desaturate=function(e){return null==e&&(e=20),this.saturate(-e)},e}(),u=function(e){var r;for(r in e)r<3?(e[r]<0&&(e[r]=0),e[r]>255&&(e[r]=255)):3===r&&(e[r]<0&&(e[r]=0),e[r]>1&&(e[r]=1));return e},b=function(e){var r,n,t,f,a,o,i,c;if(e=e.toLowerCase(),null!=s.colors&&s.colors[e])return h(s.colors[e]);if(t=e.match(/rgb\(\s*(\-?\d+),\s*(\-?\d+)\s*,\s*(\-?\d+)\s*\)/)){for(f=t.slice(1,4),n=a=0;a<=2;n=++a)f[n]=+f[n];f[3]=1}else if(t=e.match(/rgba\(\s*(\-?\d+),\s*(\-?\d+)\s*,\s*(\-?\d+)\s*,\s*([01]|[01]?\.\d+)\)/))for(f=t.slice(1,5),n=o=0;o<=3;n=++o)f[n]=+f[n];else if(t=e.match(/rgb\(\s*(\-?\d+(?:\.\d+)?)%,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*\)/)){for(f=t.slice(1,4),n=i=0;i<=2;n=++i)f[n]=Math.round(2.55*f[n]);f[3]=1}else if(t=e.match(/rgba\(\s*(\-?\d+(?:\.\d+)?)%,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)/)){for(f=t.slice(1,5),n=c=0;c<=2;n=++c)f[n]=Math.round(2.55*f[n]);f[3]=+f[3]}else(t=e.match(/hsl\(\s*(\-?\d+(?:\.\d+)?),\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*\)/))?(r=t.slice(1,4),r[1]*=.01,r[2]*=.01,f=p(r),f[3]=1):(t=e.match(/hsla\(\s*(\-?\d+(?:\.\d+)?),\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)/))&&(r=t.slice(1,4),r[1]*=.01,r[2]*=.01,f=p(r),f[3]=+t[4]);return f},h=function(e){var r,n,t,f,a,o;if(e.match(/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})#x2F;))return 4!==e.length&&7!==e.length||(e=e.substr(1)),3===e.length&&(e=e.split(""),e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),o=parseInt(e,16),f=o>>16,t=o>>8&255,n=255&o,[f,t,n,1];if(e.match(/^#?([A-Fa-f0-9]{8})#x2F;))return 9===e.length&&(e=e.substr(1)),o=parseInt(e,16),f=o>>24&255,t=o>>16&255,n=o>>8&255,r=255&o,[f,t,n,r];if(a=b(e))return a;throw"unknown color: "+e},g=function(e,r,n){var t,o,i,c;return c=I(arguments),e=c[0],r=c[1],n=c[2],e/=360,e<1/3?(t=(1-r)/3,i=(1+r*l(a*e)/l(f-a*e))/3,o=1-(t+i)):e<2/3?(e-=1/3,i=(1-r)/3,o=(1+r*l(a*e)/l(f-a*e))/3,t=1-(i+o)):(e-=2/3,o=(1-r)/3,t=(1+r*l(a*e)/l(f-a*e))/3,i=1-(o+t)),i=k(n*i*3),o=k(n*o*3),t=k(n*t*3),[255*i,255*o,255*t]},p=function(){var e,r,n,t,f,a,o,i,c,d,s,u,l,b;if(l=I(arguments),t=l[0],i=l[1],a=l[2],0===i)o=n=e=255*a;else{for(s=[0,0,0],r=[0,0,0],d=a<.5?a*(1+i):a+i-a*i,c=2*a-d,t/=360,s[0]=t+1/3,s[1]=t,s[2]=t-1/3,f=u=0;u<=2;f=++u)s[f]<0&&(s[f]+=1),s[f]>1&&(s[f]-=1),6*s[f]<1?r[f]=c+6*(d-c)*s[f]:2*s[f]<1?r[f]=d:3*s[f]<2?r[f]=c+(d-c)*(2/3-s[f])*6:r[f]=c;b=[Math.round(255*r[0]),Math.round(255*r[1]),Math.round(255*r[2])],o=b[0],n=b[1],e=b[2]}return[o,n,e]},m=function(){var e,r,n,t,f,a,o,i,c,d,s,u,l,b,h,g,p,m;if(u=I(arguments),t=u[0],c=u[1],s=u[2],s*=255,0===c)i=n=e=s;else switch(360===t&&(t=0),t>360&&(t-=360),t<0&&(t+=360),t/=60,f=Math.floor(t),r=t-f,a=s*(1-c),o=s*(1-c*r),d=s*(1-c*(1-r)),f){case 0:l=[s,d,a],i=l[0],n=l[1],e=l[2];break;case 1:b=[o,s,a],i=b[0],n=b[1],e=b[2];break;case 2:h=[a,s,d],i=h[0],n=h[1],e=h[2];break;case 3:g=[a,o,s],i=g[0],n=g[1],e=g[2];break;case 4:p=[d,a,s],i=p[0],n=p[1],e=p[2];break;case 5:m=[s,a,o],i=m[0],n=m[1],e=m[2]}return i=Math.round(i),n=Math.round(n),e=Math.round(e),[i,n,e]},o=.95047,i=1,c=1.08883,y=function(){var e,r,n,t,f,a;return a=I(arguments),f=a[0],e=a[1],r=a[2],n=Math.sqrt(e*e+r*r),t=Math.atan2(r,e)/Math.PI*180,[f,n,t]},w=function(e,r,n){var t,f,a,d,s,u,l;return void 0!==e&&3===e.length&&(u=e,e=u[0],r=u[1],n=u[2]),void 0!==e&&3===e.length&&(l=e,e=l[0],r=l[1],n=l[2]),d=(e+16)/116,a=d+r/500,s=d-n/200,a=v(a)*o,d=v(d)*i,s=v(s)*c,f=R(3.2404542*a-1.5371385*d-.4985314*s),t=R(-.969266*a+1.8760108*d+.041556*s),n=R(.0556434*a-.2040259*d+1.0572252*s),[k(f,0,255),k(t,0,255),k(n,0,255),1]},v=function(e){return e>.206893034?e*e*e:(e-4/29)/7.787037},R=function(e){return Math.round(255*(e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055))},x=function(){var e,r,n,t;return t=I(arguments),n=t[0],e=t[1],r=t[2],r=r*Math.PI/180,[n,Math.cos(r)*e,Math.sin(r)*e]},_=function(e,r,n){var t,f,a,o,i,c,d;return c=x(e,r,n),t=c[0],f=c[1],a=c[2],d=w(t,f,a),i=d[0],o=d[1],a=d[2],[k(i,0,255),k(o,0,255),k(a,0,255)]},j=function(e,r,n){var t;return t=I(arguments),e=t[0],r=t[1],n=t[2],e=M(e),r=M(r),n=M(n),.2126*e+.7152*r+.0722*n},M=function(e){return e/=255,e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)},N=function(){var e,r,n,t,f,a;return a=I(arguments),n=a[0],r=a[1],e=a[2],f=n<<16|r<<8|e,t="000000"+f.toString(16),"#"+t.substr(t.length-6)},D=function(){var e,r,n,t,f,a,o,i,c;return c=I(arguments),o=c[0],n=c[1],r=c[2],e=2*Math.PI,o/=255,n/=255,r/=255,a=Math.min(o,n,r),f=(o+n+r)/3,i=1-a/f,0===i?t=0:(t=(o-n+(o-r))/2,t/=Math.sqrt((o-n)*(o-n)+(o-r)*(n-r)),t=Math.acos(t),r>n&&(t=e-t),t/=e),[360*t,i,f]},U=function(e,r,n){var t,f,a,o,i,c;return void 0!==e&&e.length>=3&&(c=e,e=c[0],r=c[1],n=c[2]),e/=255,r/=255,n/=255,o=Math.min(e,r,n),a=Math.max(e,r,n),f=(a+o)/2,a===o?(i=0,t=Number.NaN):i=f<.5?(a-o)/(a+o):(a-o)/(2-a-o),e===a?t=(r-n)/(a-o):r===a?t=2+(n-e)/(a-o):n===a&&(t=4+(e-r)/(a-o)),t*=60,t<0&&(t+=360),[t,i,f]},A=function(){var e,r,n,t,f,a,o,i,c,d;return d=I(arguments),o=d[0],n=d[1],e=d[2],a=Math.min(o,n,e),f=Math.max(o,n,e),r=f-a,c=f/255,0===f?(t=Number.NaN,i=0):(i=r/f,o===f&&(t=(n-e)/r),n===f&&(t=2+(e-o)/r),e===f&&(t=4+(o-n)/r),(t*=60)<0&&(t+=360)),[t,i,c]},P=function(){var e,r,n,t,f,a,d;return d=I(arguments),n=d[0],r=d[1],e=d[2],n=G(n),r=G(r),e=G(e),t=q((.4124564*n+.3575761*r+.1804375*e)/o),f=q((.2126729*n+.7151522*r+.072175*e)/i),a=q((.0193339*n+.119192*r+.9503041*e)/c),[116*f-16,500*(t-f),200*(f-a)]},G=function(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)},q=function(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29},z=function(){var e,r,n,t,f,a,o;return a=I(arguments),f=a[0],n=a[1],r=a[2],o=P(f,n,r),t=o[0],e=o[1],r=o[2],y(t,e,r)},s.scale=function(e,r){var n,t,f,a,o,i,c,d,u,l,b,h,g,p,m,y,w,v,x;return p="rgb",m=s("#ccc"),x=0,!1,b=[0,1],u=[],w=!1,v=[],g=0,h=1,l=!1,y=0,d={},o=function(e,r){var n,t,f,o,i,c,d;if(null==e&&(e=["#ddd","#222"]),null!=e&&"string"===B(e)&&null!=(null!=(i=s.brewer)?i[e]:void 0)&&(e=s.brewer[e]),"array"===B(e)){for(e=e.slice(0),n=f=0,c=e.length-1;0<=c?f<=c:f>=c;n=0<=c?++f:--f)t=e[n],"string"===B(t)&&(e[n]=s(t));if(null!=r)v=r;else for(v=[],n=o=0,d=e.length-1;0<=d?o<=d:o>=d;n=0<=d?++o:--o)v.push(n/(e.length-1))}return a(),u=e},i=function(e){return null==e&&(e=[]),b=e,g=e[0],h=e[e.length-1],a(),y=2===e.length?0:e.length-1},t=function(e){var r,n;if(null!=b){for(n=b.length-1,r=0;r<n&&e>=b[r];)r++;return r-1}return 0},c=function(e){return e},function(e){var r,n,f,a,o;return o=e,b.length>2&&(a=b.length-1,r=t(e),f=b[0]+(b[1]-b[0])*(0+.5*x),n=b[a-1]+(b[a]-b[a-1])*(1-.5*x),o=g+(b[r]+.5*(b[r+1]-b[r])-f)/(n-f)*(h-g)),o},f=function(e,r){var n,f,a,o,i,l,w,x;if(null==r&&(r=!1),isNaN(e))return m;if(r?l=e:b.length>2?(n=t(e),l=n/(y-1)):(l=g!==h?(e-g)/(h-g):0,l=(e-g)/(h-g),l=Math.min(1,Math.max(0,l))),r||(l=c(l)),o=Math.floor(1e4*l),d[o])f=d[o];else{if("array"===B(u))for(a=w=0,x=v.length-1;0<=x?w<=x:w>=x;a=0<=x?++w:--w){if(i=v[a],l<=i){f=u[a];break}if(l>=i&&a===v.length-1){f=u[a];break}if(l>i&&l<v[a+1]){l=(l-i)/(v[a+1]-i),f=s.interpolate(u[a],u[a+1],l,p);break}}else"function"===B(u)&&(f=u(l));d[o]=f}return f},a=function(){return d={}},o(e,r),n=function(e){var r;return r=f(e),w&&r[w]?r[w]():r},n.domain=function(e,r,t,f){var a;return null==t&&(t="e"),arguments.length?(null!=r&&(a=s.analyze(e,f),e=0===r?[a.min,a.max]:s.limits(a,t,r)),i(e),n):b},n.mode=function(e){return arguments.length?(p=e,a(),n):p},n.range=function(e,r){return o(e,r),n},n.out=function(e){return w=e,n},n.spread=function(e){return arguments.length?(x=e,n):x},n.correctLightness=function(e){return arguments.length?(l=e,a(),c=l?function(e){var r,n,t,a,o,i,c,d,s;for(r=f(0,!0).lab()[0],n=f(1,!0).lab()[0],c=r>n,t=f(e,!0).lab()[0],o=r+(n-r)*e,a=t-o,d=0,s=1,i=20;Math.abs(a)>.01&&i-- >0;)!function(){c&&(a*=-1),a<0?(d=e,e+=.5*(s-e)):(s=e,e+=.5*(d-e)),t=f(e,!0).lab()[0],a=t-o}();return e}:function(e){return e},n):l},n.colors=function(r){var t,f,a,o,i,c;if(null==r&&(r="hex"),e=[],f=[],b.length>2)for(t=a=1,c=b.length;1<=c?a<c:a>c;t=1<=c?++a:--a)f.push(.5*(b[t-1]+b[t]));else f=b;for(o=0,i=f.length;o<i;o++)t=f[o],e.push(n(t)[r]());return e},n},null==s.scales&&(s.scales={}),s.scales.cool=function(){return s.scale([s.hsl(180,1,.9),s.hsl(250,.7,.4)])},s.scales.hot=function(){return s.scale(["#000","#f00","#ff0","#fff"],[0,.25,.75,1]).mode("rgb")},s.analyze=function(e,r,n){var t,f,a,o,i,c,d;if(a={min:Number.MAX_VALUE,max:-1*Number.MAX_VALUE,sum:0,values:[],count:0},null==n&&(n=function(){return!0}),t=function(e){null==e||isNaN(e)||(a.values.push(e),a.sum+=e,e<a.min&&(a.min=e),e>a.max&&(a.max=e),a.count+=1)},i=function(e,f){if(n(e,f))return t(null!=r&&"function"===B(r)?r(e):null!=r&&"string"===B(r)||"number"===B(r)?e[r]:e)},"array"===B(e))for(c=0,d=e.length;c<d;c++)o=e[c],i(o);else for(f in e)o=e[f],i(o,f);return a.domain=[a.min,a.max],a.limits=function(e,r){return s.limits(a,e,r)},a},s.limits=function(e,r,n){var t,f,a,o,i,c,d,u,l,b,h,g,p,m,y,w,v,x,_,k,j,M,N,D,U,A,P,z,G,E,I,q,R,S,O,C,T,Y,L,F,V,X,W,$,Z,H,J,K,Q,ee,re,ne,te,fe,ae;if(null==r&&(r="equal"),null==n&&(n=7),"array"===B(e)&&(e=s.analyze(e)),p=e.min,h=e.max,e.sum,U=e.values.sort(function(e,r){return e-r}),b=[],"c"===r.substr(0,1)&&(b.push(p),b.push(h)),"e"===r.substr(0,1)){for(b.push(p),d=A=1,C=n-1;1<=C?A<=C:A>=C;d=1<=C?++A:--A)b.push(p+d/n*(h-p));b.push(h)}else if("l"===r.substr(0,1)){if(p<=0)throw"Logarithmic scales are only possible for values > 0";for(m=Math.LOG10E*Math.log(p),g=Math.LOG10E*Math.log(h),b.push(p),d=P=1,W=n-1;1<=W?P<=W:P>=W;d=1<=W?++P:--P)b.push(Math.pow(10,m+d/n*(g-m)));b.push(h)}else if("q"===r.substr(0,1)){for(b.push(p),d=z=1,$=n-1;1<=$?z<=$:z>=$;d=1<=$?++z:--z)_=U.length*d/n,k=Math.floor(_),k===_?b.push(U[k]):(j=_-k,b.push(U[k]*j+U[k+1]*(1-j)));b.push(h)}else if("k"===r.substr(0,1)){for(w=U.length,t=new Array(w),i=new Array(n),M=!0,v=0,a=null,a=[],a.push(p),d=G=1,Z=n-1;1<=Z?G<=Z:G>=Z;d=1<=Z?++G:--G)a.push(p+d/n*(h-p));for(a.push(h);M;){for(u=E=0,H=n-1;0<=H?E<=H:E>=H;u=0<=H?++E:--E)i[u]=0;for(d=I=0,J=w-1;0<=J?I<=J:I>=J;d=0<=J?++I:--I){for(D=U[d],y=Number.MAX_VALUE,u=q=0,K=n-1;0<=K?q<=K:q>=K;u=0<=K?++q:--q)(c=Math.abs(a[u]-D))<y&&(y=c,f=u);i[f]++,t[d]=f}for(x=new Array(n),u=R=0,Q=n-1;0<=Q?R<=Q:R>=Q;u=0<=Q?++R:--R)x[u]=null;for(d=S=0,ee=w-1;0<=ee?S<=ee:S>=ee;d=0<=ee?++S:--S)o=t[d],null===x[o]?x[o]=U[d]:x[o]+=U[d];for(u=O=0,T=n-1;0<=T?O<=T:O>=T;u=0<=T?++O:--O)x[u]*=1/i[u];for(M=!1,u=re=0,Y=n-1;0<=Y?re<=Y:re>=Y;u=0<=Y?++re:--re)if(x[u]!==a[d]){M=!0;break}a=x,v++,v>200&&(M=!1)}for(l={},u=ne=0,L=n-1;0<=L?ne<=L:ne>=L;u=0<=L?++ne:--ne)l[u]=[];for(d=te=0,F=w-1;0<=F?te<=F:te>=F;d=0<=F?++te:--te)o=t[d],l[o].push(U[d]);for(N=[],u=fe=0,V=n-1;0<=V?fe<=V:fe>=V;u=0<=V?++fe:--fe)N.push(l[u][0]),N.push(l[u][l[u].length-1]);for(N=N.sort(function(e,r){return e-r}),b.push(N[0]),d=ae=1,X=N.length-1;ae<=X;d=ae+=2)isNaN(N[d])||b.push(N[d])}return b},s.brewer={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},s.colors={indigo:"#4b0082",gold:"#ffd700",hotpink:"#ff69b4",firebrick:"#b22222",indianred:"#cd5c5c",yellow:"#ffff00",mistyrose:"#ffe4e1",darkolivegreen:"#556b2f",olive:"#808000",darkseagreen:"#8fbc8f",pink:"#ffc0cb",tomato:"#ff6347",lightcoral:"#f08080",orangered:"#ff4500",navajowhite:"#ffdead",lime:"#00ff00",palegreen:"#98fb98",darkslategrey:"#2f4f4f",greenyellow:"#adff2f",burlywood:"#deb887",seashell:"#fff5ee",mediumspringgreen:"#00fa9a",fuchsia:"#ff00ff",papayawhip:"#ffefd5",blanchedalmond:"#ffebcd",chartreuse:"#7fff00",dimgray:"#696969",black:"#000000",peachpuff:"#ffdab9",springgreen:"#00ff7f",aquamarine:"#7fffd4",white:"#ffffff",orange:"#ffa500",lightsalmon:"#ffa07a",darkslategray:"#2f4f4f",brown:"#a52a2a",ivory:"#fffff0",dodgerblue:"#1e90ff",peru:"#cd853f",lawngreen:"#7cfc00",chocolate:"#d2691e",crimson:"#dc143c",forestgreen:"#228b22",darkgrey:"#a9a9a9",lightseagreen:"#20b2aa",cyan:"#00ffff",mintcream:"#f5fffa",silver:"#c0c0c0",antiquewhite:"#faebd7",mediumorchid:"#ba55d3",skyblue:"#87ceeb",gray:"#808080",darkturquoise:"#00ced1",goldenrod:"#daa520",darkgreen:"#006400",floralwhite:"#fffaf0",darkviolet:"#9400d3",darkgray:"#a9a9a9",moccasin:"#ffe4b5",saddlebrown:"#8b4513",grey:"#808080",darkslateblue:"#483d8b",lightskyblue:"#87cefa",lightpink:"#ffb6c1",mediumvioletred:"#c71585",slategrey:"#708090",red:"#ff0000",deeppink:"#ff1493",limegreen:"#32cd32",darkmagenta:"#8b008b",palegoldenrod:"#eee8aa",plum:"#dda0dd",turquoise:"#40e0d0",lightgrey:"#d3d3d3",lightgoldenrodyellow:"#fafad2",darkgoldenrod:"#b8860b",lavender:"#e6e6fa",maroon:"#800000",yellowgreen:"#9acd32",sandybrown:"#f4a460",thistle:"#d8bfd8",violet:"#ee82ee",navy:"#000080",magenta:"#ff00ff",dimgrey:"#696969",tan:"#d2b48c",rosybrown:"#bc8f8f",olivedrab:"#6b8e23",blue:"#0000ff",lightblue:"#add8e6",ghostwhite:"#f8f8ff",honeydew:"#f0fff0",cornflowerblue:"#6495ed",slateblue:"#6a5acd",linen:"#faf0e6",darkblue:"#00008b",powderblue:"#b0e0e6",seagreen:"#2e8b57",darkkhaki:"#bdb76b",snow:"#fffafa",sienna:"#a0522d",mediumblue:"#0000cd",royalblue:"#4169e1",lightcyan:"#e0ffff",green:"#008000",mediumpurple:"#9370db",midnightblue:"#191970",cornsilk:"#fff8dc",paleturquoise:"#afeeee",bisque:"#ffe4c4",slategray:"#708090",darkcyan:"#008b8b",khaki:"#f0e68c",wheat:"#f5deb3",teal:"#008080",darkorchid:"#9932cc",deepskyblue:"#00bfff",salmon:"#fa8072",darkred:"#8b0000",steelblue:"#4682b4",palevioletred:"#db7093",lightslategray:"#778899",aliceblue:"#f0f8ff",lightslategrey:"#778899",lightgreen:"#90ee90",orchid:"#da70d6",gainsboro:"#dcdcdc",mediumseagreen:"#3cb371",lightgray:"#d3d3d3",mediumturquoise:"#48d1cc",lemonchiffon:"#fffacd",cadetblue:"#5f9ea0",lightyellow:"#ffffe0",lavenderblush:"#fff0f5",coral:"#ff7f50",purple:"#800080",aqua:"#00ffff",whitesmoke:"#f5f5f5",mediumslateblue:"#7b68ee",darkorange:"#ff8c00",mediumaquamarine:"#66cdaa",darksalmon:"#e9967a",beige:"#f5f5dc",blueviolet:"#8a2be2",azure:"#f0ffff",lightsteelblue:"#b0c4de",oldlace:"#fdf5e6"},B=function(){var e,r,n,t,f;for(e={},f="Boolean Number String Function Array Date RegExp Undefined Null".split(" "),n=0,t=f.length;n<t;n++)r=f[n],e["[object "+r+"]"]=r.toLowerCase();return function(r){var n;return n=Object.prototype.toString.call(r),e[n]||"object"}}(),k=function(e,r,n){return null==r&&(r=0),null==n&&(n=1),e<r&&(e=r),e>n&&(e=n),e},I=function(e){return e.length>=3?e:e[0]},a=2*Math.PI,f=Math.PI/3,l=Math.cos,d=function(e){var r,n,t,f,a,o,i,c,u,l,b;return e=function(){var r,n,t;for(t=[],r=0,n=e.length;r<n;r++)f=e[r],t.push(s(f));return t}(),2===e.length?(u=function(){var r,n,t;for(t=[],r=0,n=e.length;r<n;r++)f=e[r],t.push(f.lab());return t}(),a=u[0],o=u[1],r=function(e){var r,n;return n=function(){
2
- var n,t;for(t=[],r=n=0;n<=2;r=++n)t.push(a[r]+e*(o[r]-a[r]));return t}(),s.lab.apply(s,n)}):3===e.length?(l=function(){var r,n,t;for(t=[],r=0,n=e.length;r<n;r++)f=e[r],t.push(f.lab());return t}(),a=l[0],o=l[1],i=l[2],r=function(e){var r,n;return n=function(){var n,t;for(t=[],r=n=0;n<=2;r=++n)t.push((1-e)*(1-e)*a[r]+2*(1-e)*e*o[r]+e*e*i[r]);return t}(),s.lab.apply(s,n)}):4===e.length?(b=function(){var r,n,t;for(t=[],r=0,n=e.length;r<n;r++)f=e[r],t.push(f.lab());return t}(),a=b[0],o=b[1],i=b[2],c=b[3],r=function(e){var r,n;return n=function(){var n,t;for(t=[],r=n=0;n<=2;r=++n)t.push((1-e)*(1-e)*(1-e)*a[r]+3*(1-e)*(1-e)*e*o[r]+3*(1-e)*e*e*i[r]+e*e*e*c[r]);return t}(),s.lab.apply(s,n)}):5===e.length&&(n=d(e.slice(0,3)),t=d(e.slice(2,5)),r=function(e){return e<.5?n(2*e):t(2*(e-.5))}),r},s.interpolate.bezier=d}).call(this)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/delaunay-fast/delaunay.js":[function(e,r,n){var t;!function(){"use strict";function e(e){var r,n,t,f,a,o,i=Number.POSITIVE_INFINITY,c=Number.POSITIVE_INFINITY,d=Number.NEGATIVE_INFINITY,s=Number.NEGATIVE_INFINITY;for(r=e.length;r--;)e[r][0]<i&&(i=e[r][0]),e[r][0]>d&&(d=e[r][0]),e[r][1]<c&&(c=e[r][1]),e[r][1]>s&&(s=e[r][1]);return n=d-i,t=s-c,f=Math.max(n,t),a=i+.5*n,o=c+.5*t,[[a-20*f,o-f],[a,o+20*f],[a+20*f,o-f]]}function n(e,r,n,t){var f,o,i,c,d,s,u,l,b,h,g=e[r][0],p=e[r][1],m=e[n][0],y=e[n][1],w=e[t][0],v=e[t][1],x=Math.abs(p-y),_=Math.abs(y-v);if(x<a&&_<a)throw new Error("Eek! Coincident points!");return x<a?(c=-(w-m)/(v-y),s=(m+w)/2,l=(y+v)/2,f=(m+g)/2,o=c*(f-s)+l):_<a?(i=-(m-g)/(y-p),d=(g+m)/2,u=(p+y)/2,f=(w+m)/2,o=i*(f-d)+u):(i=-(m-g)/(y-p),c=-(w-m)/(v-y),d=(g+m)/2,s=(m+w)/2,u=(p+y)/2,l=(y+v)/2,f=(i*d-c*s+l-u)/(i-c),o=x>_?i*(f-d)+u:c*(f-s)+l),b=m-f,h=y-o,{i:r,j:n,k:t,x:f,y:o,r:b*b+h*h}}function f(e){var r,n,t,f,a,o;for(n=e.length;n;)for(f=e[--n],t=e[--n],r=n;r;)if(o=e[--r],a=e[--r],t===a&&f===o||t===o&&f===a){e.splice(n,2),e.splice(r,2);break}}var a=1/1048576;t={triangulate:function(r,t){var o,i,c,d,s,u,l,b,h,g,p,m,y=r.length;if(y<3)return[];if(r=r.slice(0),t)for(o=y;o--;)r[o]=r[o][t];for(c=new Array(y),o=y;o--;)c[o]=o;for(c.sort(function(e,n){return r[n][0]-r[e][0]}),d=e(r),r.push(d[0],d[1],d[2]),s=[n(r,y+0,y+1,y+2)],u=[],l=[],o=c.length;o--;l.length=0){for(m=c[o],i=s.length;i--;)b=r[m][0]-s[i].x,b>0&&b*b>s[i].r?(u.push(s[i]),s.splice(i,1)):(h=r[m][1]-s[i].y,b*b+h*h-s[i].r>a||(l.push(s[i].i,s[i].j,s[i].j,s[i].k,s[i].k,s[i].i),s.splice(i,1)));for(f(l),i=l.length;i;)p=l[--i],g=l[--i],s.push(n(r,g,p,m))}for(o=s.length;o--;)u.push(s[o]);for(s.length=0,o=u.length;o--;)u[o].i<y&&u[o].j<y&&u[o].k<y&&s.push(u[o].i,u[o].j,u[o].k);return s},contains:function(e,r){if(r[0]<e[0][0]&&r[0]<e[1][0]&&r[0]<e[2][0]||r[0]>e[0][0]&&r[0]>e[1][0]&&r[0]>e[2][0]||r[1]<e[0][1]&&r[1]<e[1][1]&&r[1]<e[2][1]||r[1]>e[0][1]&&r[1]>e[1][1]&&r[1]>e[2][1])return null;var n=e[1][0]-e[0][0],t=e[2][0]-e[0][0],f=e[1][1]-e[0][1],a=e[2][1]-e[0][1],o=n*a-t*f;if(0===o)return null;var i=(a*(r[0]-e[0][0])-t*(r[1]-e[0][1]))/o,c=(n*(r[1]-e[0][1])-f*(r[0]-e[0][0]))/o;return i<0||c<0||i+c>1?null:[i,c]}},void 0!==r&&(r.exports=t)}()},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/index.js":[function(e,r,n){var t=e("./lib/alea"),f=e("./lib/xor128"),a=e("./lib/xorwow"),o=e("./lib/xorshift7"),i=e("./lib/xor4096"),c=e("./lib/tychei"),d=e("./seedrandom");d.alea=t,d.xor128=f,d.xorwow=a,d.xorshift7=o,d.xor4096=i,d.tychei=c,r.exports=d},{"./lib/alea":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/alea.js","./lib/tychei":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/tychei.js","./lib/xor128":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xor128.js","./lib/xor4096":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xor4096.js","./lib/xorshift7":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xorshift7.js","./lib/xorwow":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xorwow.js","./seedrandom":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/seedrandom.js"}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/alea.js":[function(r,n,t){!function(e,r,n){function t(e){var r=this,n=o();r.next=function(){var e=2091639*r.s0+2.3283064365386963e-10*r.c;return r.s0=r.s1,r.s1=r.s2,r.s2=e-(r.c=0|e)},r.c=1,r.s0=n(" "),r.s1=n(" "),r.s2=n(" "),r.s0-=n(e),r.s0<0&&(r.s0+=1),r.s1-=n(e),r.s1<0&&(r.s1+=1),r.s2-=n(e),r.s2<0&&(r.s2+=1),n=null}function f(e,r){return r.c=e.c,r.s0=e.s0,r.s1=e.s1,r.s2=e.s2,r}function a(e,r){var n=new t(e),a=r&&r.state,o=n.next;return o.int32=function(){return 4294967296*n.next()|0},o.double=function(){return o()+1.1102230246251565e-16*(2097152*o()|0)},o.quick=o,a&&("object"==typeof a&&f(a,n),o.state=function(){return f(n,{})}),o}function o(){var e=4022871197;return function(r){r=r.toString();for(var n=0;n<r.length;n++){e+=r.charCodeAt(n);var t=.02519603282416938*e;e=t>>>0,t-=e,t*=e,e=t>>>0,t-=e,e+=4294967296*t}return 2.3283064365386963e-10*(e>>>0)}}r&&r.exports?r.exports=a:n&&n.amd?n(function(){return a}):this.alea=a}(0,"object"==typeof n&&n,"function"==typeof e&&e)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/tychei.js":[function(r,n,t){!function(e,r,n){function t(e){var r=this,n="";r.next=function(){var e=r.b,n=r.c,t=r.d,f=r.a;return e=e<<25^e>>>7^n,n=n-t|0,t=t<<24^t>>>8^f,f=f-e|0,r.b=e=e<<20^e>>>12^n,r.c=n=n-t|0,r.d=t<<16^n>>>16^f,r.a=f-e|0},r.a=0,r.b=0,r.c=-1640531527,r.d=1367130551,e===Math.floor(e)?(r.a=e/4294967296|0,r.b=0|e):n+=e;for(var t=0;t<n.length+20;t++)r.b^=0|n.charCodeAt(t),r.next()}function f(e,r){return r.a=e.a,r.b=e.b,r.c=e.c,r.d=e.d,r}function a(e,r){var n=new t(e),a=r&&r.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var e=n.next()>>>11,r=(n.next()>>>0)/4294967296,t=(e+r)/(1<<21)}while(0===t);return t},o.int32=n.next,o.quick=o,a&&("object"==typeof a&&f(a,n),o.state=function(){return f(n,{})}),o}r&&r.exports?r.exports=a:n&&n.amd?n(function(){return a}):this.tychei=a}(0,"object"==typeof n&&n,"function"==typeof e&&e)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xor128.js":[function(r,n,t){!function(e,r,n){function t(e){var r=this,n="";r.x=0,r.y=0,r.z=0,r.w=0,r.next=function(){var e=r.x^r.x<<11;return r.x=r.y,r.y=r.z,r.z=r.w,r.w^=r.w>>>19^e^e>>>8},e===(0|e)?r.x=e:n+=e;for(var t=0;t<n.length+64;t++)r.x^=0|n.charCodeAt(t),r.next()}function f(e,r){return r.x=e.x,r.y=e.y,r.z=e.z,r.w=e.w,r}function a(e,r){var n=new t(e),a=r&&r.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var e=n.next()>>>11,r=(n.next()>>>0)/4294967296,t=(e+r)/(1<<21)}while(0===t);return t},o.int32=n.next,o.quick=o,a&&("object"==typeof a&&f(a,n),o.state=function(){return f(n,{})}),o}r&&r.exports?r.exports=a:n&&n.amd?n(function(){return a}):this.xor128=a}(0,"object"==typeof n&&n,"function"==typeof e&&e)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xor4096.js":[function(r,n,t){!function(e,r,n){function t(e){var r=this;r.next=function(){var e,n,t=r.w,f=r.X,a=r.i;return r.w=t=t+1640531527|0,n=f[a+34&127],e=f[a=a+1&127],n^=n<<13,e^=e<<17,n^=n>>>15,e^=e>>>12,n=f[a]=n^e,r.i=a,n+(t^t>>>16)|0},function(e,r){var n,t,f,a,o,i=[],c=128;for(r===(0|r)?(t=r,r=null):(r+="\0",t=0,c=Math.max(c,r.length)),f=0,a=-32;a<c;++a)r&&(t^=r.charCodeAt((a+32)%r.length)),0===a&&(o=t),t^=t<<10,t^=t>>>15,t^=t<<4,t^=t>>>13,a>=0&&(o=o+1640531527|0,n=i[127&a]^=t+o,f=0==n?f+1:0);for(f>=128&&(i[127&(r&&r.length||0)]=-1),f=127,a=512;a>0;--a)t=i[f+34&127],n=i[f=f+1&127],t^=t<<13,n^=n<<17,t^=t>>>15,n^=n>>>12,i[f]=t^n;e.w=o,e.X=i,e.i=f}(r,e)}function f(e,r){return r.i=e.i,r.w=e.w,r.X=e.X.slice(),r}function a(e,r){null==e&&(e=+new Date);var n=new t(e),a=r&&r.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var e=n.next()>>>11,r=(n.next()>>>0)/4294967296,t=(e+r)/(1<<21)}while(0===t);return t},o.int32=n.next,o.quick=o,a&&(a.X&&f(a,n),o.state=function(){return f(n,{})}),o}r&&r.exports?r.exports=a:n&&n.amd?n(function(){return a}):this.xor4096=a}(0,"object"==typeof n&&n,"function"==typeof e&&e)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xorshift7.js":[function(r,n,t){!function(e,r,n){function t(e){var r=this;r.next=function(){var e,n,t=r.x,f=r.i;return e=t[f],e^=e>>>7,n=e^e<<24,e=t[f+1&7],n^=e^e>>>10,e=t[f+3&7],n^=e^e>>>3,e=t[f+4&7],n^=e^e<<7,e=t[f+7&7],e^=e<<13,n^=e^e<<9,t[f]=n,r.i=f+1&7,n},function(e,r){var n,t=[];if(r===(0|r))t[0]=r;else for(r=""+r,n=0;n<r.length;++n)t[7&n]=t[7&n]<<15^r.charCodeAt(n)+t[n+1&7]<<13;for(;t.length<8;)t.push(0);for(n=0;n<8&&0===t[n];++n);for(8==n?t[7]=-1:t[n],e.x=t,e.i=0,n=256;n>0;--n)e.next()}(r,e)}function f(e,r){return r.x=e.x.slice(),r.i=e.i,r}function a(e,r){null==e&&(e=+new Date);var n=new t(e),a=r&&r.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var e=n.next()>>>11,r=(n.next()>>>0)/4294967296,t=(e+r)/(1<<21)}while(0===t);return t},o.int32=n.next,o.quick=o,a&&(a.x&&f(a,n),o.state=function(){return f(n,{})}),o}r&&r.exports?r.exports=a:n&&n.amd?n(function(){return a}):this.xorshift7=a}(0,"object"==typeof n&&n,"function"==typeof e&&e)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xorwow.js":[function(r,n,t){!function(e,r,n){function t(e){var r=this,n="";r.next=function(){var e=r.x^r.x>>>2;return r.x=r.y,r.y=r.z,r.z=r.w,r.w=r.v,(r.d=r.d+362437|0)+(r.v=r.v^r.v<<4^e^e<<1)|0},r.x=0,r.y=0,r.z=0,r.w=0,r.v=0,e===(0|e)?r.x=e:n+=e;for(var t=0;t<n.length+64;t++)r.x^=0|n.charCodeAt(t),t==n.length&&(r.d=r.x<<10^r.x>>>4),r.next()}function f(e,r){return r.x=e.x,r.y=e.y,r.z=e.z,r.w=e.w,r.v=e.v,r.d=e.d,r}function a(e,r){var n=new t(e),a=r&&r.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var e=n.next()>>>11,r=(n.next()>>>0)/4294967296,t=(e+r)/(1<<21)}while(0===t);return t},o.int32=n.next,o.quick=o,a&&("object"==typeof a&&f(a,n),o.state=function(){return f(n,{})}),o}r&&r.exports?r.exports=a:n&&n.amd?n(function(){return a}):this.xorwow=a}(0,"object"==typeof n&&n,"function"==typeof e&&e)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/seedrandom.js":[function(r,n,t){!function(t,f){function a(e,r,n){var a=[];r=1==r?{entropy:!0}:r||{};var l=d(c(r.entropy?[e,u(t)]:null==e?s():e,3),a),b=new o(a),v=function(){for(var e=b.g(g),r=m,n=0;e<y;)e=(e+n)*h,r*=h,n=b.g(1);for(;e>=w;)e/=2,r/=2,n>>>=1;return(e+n)/r};return v.int32=function(){return 0|b.g(4)},v.quick=function(){return b.g(4)/4294967296},v.double=v,d(u(b.S),t),(r.pass||n||function(e,r,n,t){return t&&(t.S&&i(t,b),e.state=function(){return i(b,{})}),n?(f[p]=e,r):e})(v,l,"global"in r?r.global:this==f,r.state)}function o(e){var r,n=e.length,t=this,f=0,a=t.i=t.j=0,o=t.S=[];for(n||(e=[n++]);f<h;)o[f]=f++;for(f=0;f<h;f++)o[f]=o[a=v&a+e[f%n]+(r=o[f])],o[a]=r;(t.g=function(e){for(var r,n=0,f=t.i,a=t.j,o=t.S;e--;)r=o[f=v&f+1],n=n*h+o[v&(o[f]=o[a=v&a+r])+(o[a]=r)];return t.i=f,t.j=a,n})(h)}function i(e,r){return r.i=e.i,r.j=e.j,r.S=e.S.slice(),r}function c(e,r){var n,t=[],f=typeof e;if(r&&"object"==f)for(n in e)try{t.push(c(e[n],r-1))}catch(e){}return t.length?t:"string"==f?e:e+"\0"}function d(e,r){for(var n,t=e+"",f=0;f<t.length;)r[v&f]=v&(n^=19*r[v&f])+t.charCodeAt(f++);return u(r)}function s(){try{if(l)return u(l.randomBytes(h));var e=new Uint8Array(h);return(b.crypto||b.msCrypto).getRandomValues(e),u(e)}catch(e){var r=b.navigator,n=r&&r.plugins;return[+new Date,b,n,b.screen,u(t)]}}function u(e){return String.fromCharCode.apply(0,e)}var l,b=this,h=256,g=6,p="random",m=f.pow(h,g),y=f.pow(2,52),w=2*y,v=h-1;if(f["seed"+p]=a,d(f.random(),t),"object"==typeof n&&n.exports){n.exports=a;try{l=r("crypto")}catch(e){}}else"function"==typeof e&&e.amd&&e(function(){return a})}([],Math)},{crypto:!1}]},{},["./lib/trianglify.js"])("./lib/trianglify.js")});
1
+ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Trianglify=e()}}(function(){return function a(o,i,s){function d(n,e){if(!i[n]){if(!o[n]){var r="function"==typeof require&&require;if(!e&&r)return r(n,!0);if(c)return c(n,!0);var t=new Error("Cannot find module '"+n+"'");throw t.code="MODULE_NOT_FOUND",t}var f=i[n]={exports:{}};o[n][0].call(f.exports,function(e){var r=o[n][1][e];return d(r||e)},f,f.exports,a,o,i,s)}return i[n].exports}for(var c="function"==typeof require&&require,e=0;e<s.length;e++)d(s[e]);return d}({"./lib/trianglify.js":[function(e,r,n){var j=e("delaunay-fast"),M=e("seedrandom"),N=e("chroma-js"),t=e("./colorbrewer"),D=e("./pattern"),U={width:600,height:400,cell_size:75,variance:.75,seed:null,x_colors:"random",y_colors:"match_x",palette:t,color_space:"lab",color_function:null,stroke_width:1.51};function f(i){if(i=function(e,r){var n={};for(var t in e)n[t]=e[t];for(t in r){if(!e.hasOwnProperty(t))throw new Error(t+" is not a configuration option for Trianglify. Check your spelling?");n[t]=r[t]}return n}(U,i),rand=M(i.seed),"random"===i.x_colors&&(i.x_colors=k()),"random"===i.y_colors&&(i.y_colors=k()),"match_x"===i.y_colors&&(i.y_colors=i.x_colors),!(0<i.width&&0<i.height))throw new Error("Width and height must be numbers greater than 0");if(i.cell_size<2)throw new Error("Cell size must be greater than 2.");var e;if(i.color_function)e=function(e,r){return N(i.color_function(e,r))};else{var n=N.scale(i.x_colors).mode(i.color_space),t=N.scale(i.y_colors).mode(i.color_space);e=function(e,r){return N.interpolate(n(e),t(r),.5,i.color_space)}}for(var r,f,a,o=i.width,s=i.height,d=Math.floor((o+4*i.cell_size)/i.cell_size),c=Math.floor((s+4*i.cell_size)/i.cell_size),u=(d*i.cell_size-o)/2,l=(c*i.cell_size-s)/2,b=i.cell_size*i.variance/2,h=function(e,r){for(var n=[],t=-u;t<e+u;t+=i.cell_size)for(var f=-l;f<r+l;f+=i.cell_size){var a=t+i.cell_size/2+_(rand(),[0,1],[-b,b]),o=f+i.cell_size/2+_(rand(),[0,1],[-b,b]);n.push([a,o].map(Math.floor))}return n}(o,s),g=j.triangulate(h),p=[],m=function(e){return h[e]},y=0;y<g.length;y+=3){var w=[g[y],g[y+1],g[y+2]].map(m),v={x:((a=w)[0][0]+a[1][0]+a[2][0])/3,y:(a[0][1]+a[1][1]+a[2][1])/3},x=e((f=v.x,_(f,[-u,o+u],[0,1])),(r=v.y,_(r,[-l,s+l],[0,1]))).hex();p.push([x,w])}return D(p,i);function _(e,r,n){return(e-r[0])*(n[1]-n[0])/(r[1]-r[0])+n[0]}function k(){if(i.palette instanceof Array)return i.palette[Math.floor(rand()*i.palette.length)];var e=Object.keys(i.palette);return i.palette[e[Math.floor(rand()*e.length)]]}}f.colorbrewer=t,f.defaults=U,r.exports=f},{"./colorbrewer":"/Users/gpriday/Downloads/trianglify-master 2/lib/colorbrewer.js","./pattern":"/Users/gpriday/Downloads/trianglify-master 2/lib/pattern.js","chroma-js":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/chroma-js/chroma.js","delaunay-fast":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/delaunay-fast/delaunay.js",seedrandom:"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/index.js"}],"/Users/gpriday/Downloads/trianglify-master 2/lib/colorbrewer.js":[function(e,r,n){r.exports={YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"]}},{}],"/Users/gpriday/Downloads/trianglify-master 2/lib/pattern.js":[function(a,e,r){(function(n){var f="undefined"!=typeof document?document:a("jsdom").jsdom("<html/>");e.exports=function(r,t){function e(e){if(void 0!==n)try{a("canvas")}catch(e){throw Error("The optional node-canvas dependency is needed for Trianglify to render using canvas in node.")}return e||(e=f.createElement("canvas")),e.setAttribute("width",t.width),e.setAttribute("height",t.height),ctx=e.getContext("2d"),ctx.canvas.width=t.width,ctx.canvas.height=t.height,r.forEach(function(e){ctx.fillStyle=ctx.strokeStyle=e[0],ctx.lineWidth=t.stroke_width,ctx.beginPath(),ctx.moveTo.apply(ctx,e[1][0]),ctx.lineTo.apply(ctx,e[1][1]),ctx.lineTo.apply(ctx,e[1][2]),ctx.fill(),ctx.stroke()}),e}return{polys:r,opts:t,svg:function(){var n=f.createElementNS("http://www.w3.org/2000/svg","svg");return n.setAttribute("width",t.width),n.setAttribute("height",t.height),r.forEach(function(e){var r=f.createElementNS("http://www.w3.org/2000/svg","path");r.setAttribute("d","M"+e[1].join("L")+"Z"),r.setAttribute("fill",e[0]),r.setAttribute("stroke",e[0]),r.setAttribute("stroke-width",t.stroke_width),n.appendChild(r)}),n},canvas:e,png:function(){return e().toDataURL("image/png")}}}}).call(this,a("_process"))},{_process:"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/process/browser.js",canvas:"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/browser-resolve/empty.js",jsdom:"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/browser-resolve/empty.js"}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/browser-resolve/empty.js":[function(e,r,n){},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/process/browser.js":[function(e,r,n){var t=r.exports={},f=[],a=!1;function o(){if(!a){var e;a=!0;for(var r=f.length;r;){e=f,f=[];for(var n=-1;++n<r;)e[n]();r=f.length}a=!1}}function i(){}t.nextTick=function(e){f.push(e),a||setTimeout(o,0)},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={},t.on=i,t.addListener=i,t.once=i,t.off=i,t.removeListener=i,t.removeAllListeners=i,t.emit=i,t.binding=function(e){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(e){throw new Error("process.chdir is not supported")},t.umask=function(){return 0}},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/chroma-js/chroma.js":[function(e,A,P){(function(){var f,i,s,l,fe,g,d,t,m,y,w,v,c,x,u,b,_,h,r,a,e,n,o,k,j,M,p,ae,N,D,U;fe=function(e,r,n,t){return new f(e,r,n,t)},null!=A&&null!=A.exports&&(A.exports=fe),((null!=P?P:this).chroma=fe).color=function(e,r,n,t){return new f(e,r,n,t)},fe.hsl=function(e,r,n,t){return new f(e,r,n,t,"hsl")},fe.hsv=function(e,r,n,t){return new f(e,r,n,t,"hsv")},fe.rgb=function(e,r,n,t){return new f(e,r,n,t,"rgb")},fe.hex=function(e){return new f(e)},fe.css=function(e){return new f(e)},fe.lab=function(e,r,n){return new f(e,r,n,"lab")},fe.lch=function(e,r,n){return new f(e,r,n,"lch")},fe.hsi=function(e,r,n){return new f(e,r,n,"hsi")},fe.gl=function(e,r,n,t){return new f(255*e,255*r,255*n,t,"gl")},fe.mix=fe.interpolate=function(e,r,n,t){return null==e||null==r?"#000":("string"===ae(e)&&(e=new f(e)),"string"===ae(r)&&(r=new f(r)),e.interpolate(n,r,t))},fe.contrast=function(e,r){var n,t;return"string"===ae(e)&&(e=new f(e)),"string"===ae(r)&&(r=new f(r)),n=e.luminance(),(t=r.luminance())<n?(n+.05)/(t+.05):(t+.05)/(n+.05)},fe.luminance=function(e){return fe(e).luminance()},fe._Color=f,f=function(){function p(){var e,r,n,t,f,a,o,i,s,d,c,u,l,b,h;for(f=this,n=[],s=0,d=arguments.length;s<d;s++)null!=(r=arguments[s])&&n.push(r);if(0===n.length)a=(c=[255,0,255,1,"rgb"])[0],o=c[1],i=c[2],e=c[3],t=c[4];else if("array"===ae(n[0])){if(3===n[0].length)a=(u=n[0])[0],o=u[1],i=u[2],e=1;else{if(4!==n[0].length)throw"unknown input argument";a=(l=n[0])[0],o=l[1],i=l[2],e=l[3]}t=null!=(b=n[1])?b:"rgb"}else"string"===ae(n[0])?(a=n[0],t="hex"):"object"===ae(n[0])?(a=(h=n[0]._rgb)[0],o=h[1],i=h[2],e=h[3],t="rgb"):3<=n.length&&(a=n[0],o=n[1],i=n[2]);3===n.length?(t="rgb",e=1):4===n.length?"string"===ae(n[3])?(t=n[3],e=1):"number"===ae(n[3])&&(t="rgb",e=n[3]):5===n.length&&(e=n[3],t=n[4]),null==e&&(e=1),"rgb"===t?f._rgb=[a,o,i,e]:"gl"===t?f._rgb=[255*a,255*o,255*i,e]:"hsl"===t?(f._rgb=w(a,o,i),f._rgb[3]=e):"hsv"===t?(f._rgb=v(a,o,i),f._rgb[3]=e):"hex"===t?f._rgb=m(a):"lab"===t?(f._rgb=x(a,o,i),f._rgb[3]=e):"lch"===t?(f._rgb=_(a,o,i),f._rgb[3]=e):"hsi"===t&&(f._rgb=y(a,o,i),f._rgb[3]=e),g(f._rgb)}return p.prototype.rgb=function(){return this._rgb.slice(0,3)},p.prototype.rgba=function(){return this._rgb},p.prototype.hex=function(){return e(this._rgb)},p.prototype.toString=function(){return this.name()},p.prototype.hsl=function(){return o(this._rgb)},p.prototype.hsv=function(){return k(this._rgb)},p.prototype.lab=function(){return j(this._rgb)},p.prototype.lch=function(){return M(this._rgb)},p.prototype.hsi=function(){return n(this._rgb)},p.prototype.gl=function(){return[this._rgb[0]/255,this._rgb[1]/255,this._rgb[2]/255,this._rgb[3]]},p.prototype.luminance=function(f,a){var e,o,i;return null==a&&(a="rgb"),arguments.length?(0===f&&(this._rgb=[0,0,0,this._rgb[3]]),1===f&&(this._rgb=[255,255,255,this._rgb[3]]),e=r(this._rgb),1e-7,o=20,i=function(e,r){var n,t;return n=(t=e.interpolate(.5,r,a)).luminance(),Math.abs(f-n)<1e-7||!o--?t:f<n?i(e,t):i(t,r)},this._rgb=(f<e?i(new p("black"),this):i(this,new p("white"))).rgba(),this):r(this._rgb)},p.prototype.name=function(){var e,r;for(r in e=this.hex(),fe.colors)if(e===fe.colors[r])return r;return e},p.prototype.alpha=function(e){return arguments.length?(this._rgb[3]=e,this):this._rgb[3]},p.prototype.css=function(e){var r,n,t;return null==e&&(e="rgb"),n=this._rgb,3===e.length&&n[3]<1&&(e+="a"),"rgb"===e?e+"("+n.slice(0,3).map(Math.round).join(",")+")":"rgba"===e?e+"("+n.slice(0,3).map(Math.round).join(",")+","+n[3]+")":"hsl"===e||"hsla"===e?(t=function(e){return Math.round(100*e)/100},(r=this.hsl())[0]=t(r[0]),r[1]=t(100*r[1])+"%",r[2]=t(100*r[2])+"%",4===e.length&&(r[3]=n[3]),e+"("+r.join(",")+")"):void 0},p.prototype.interpolate=function(e,r,n){var t,f,a,o,i,s,d,c,u,l,b,h,g;if(d=this,null==n&&(n="rgb"),"string"===ae(r)&&(r=new p(r)),"hsl"===n||"hsv"===n||"lch"===n||"hsi"===n)"hsl"===n?(h=d.hsl(),g=r.hsl()):"hsv"===n?(h=d.hsv(),g=r.hsv()):"hsi"===n?(h=d.hsi(),g=r.hsi()):"lch"===n&&(h=d.lch(),g=r.lch()),"h"===n.substr(0,1)?(f=h[0],l=h[1],i=h[2],a=g[0],b=g[1],s=g[2]):(i=h[0],l=h[1],f=h[2],s=g[0],b=g[1],a=g[2]),isNaN(f)||isNaN(a)?isNaN(f)?isNaN(a)?t=Number.NaN:(t=a,1!==i&&0!==i||"hsv"===n||(u=b)):(t=f,1!==s&&0!==s||"hsv"===n||(u=l)):t=f+e*(f<a&&180<a-f?a-(f+360):a<f&&180<f-a?a+360-f:a-f),null==u&&(u=l+e*(b-l)),o=i+e*(s-i),c="h"===n.substr(0,1)?new p(t,u,o,n):new p(o,u,t,n);else if("rgb"===n)h=d._rgb,g=r._rgb,c=new p(h[0]+e*(g[0]-h[0]),h[1]+e*(g[1]-h[1]),h[2]+e*(g[2]-h[2]),n);else{if("lab"!==n)throw"color mode "+n+" is not supported";h=d.lab(),g=r.lab(),c=new p(h[0]+e*(g[0]-h[0]),h[1]+e*(g[1]-h[1]),h[2]+e*(g[2]-h[2]),n)}return c.alpha(d.alpha()+e*(r.alpha()-d.alpha())),c},p.prototype.premultiply=function(){var e,r;return r=this.rgb(),e=this.alpha(),fe(r[0]*e,r[1]*e,r[2]*e,e)},p.prototype.darken=function(e){var r;return null==e&&(e=20),(r=this.lch())[0]-=e,fe.lch(r).alpha(this.alpha())},p.prototype.darker=function(e){return this.darken(e)},p.prototype.brighten=function(e){return null==e&&(e=20),this.darken(-e)},p.prototype.brighter=function(e){return this.brighten(e)},p.prototype.saturate=function(e){var r;return null==e&&(e=20),(r=this.lch())[1]+=e,fe.lch(r).alpha(this.alpha())},p.prototype.desaturate=function(e){return null==e&&(e=20),this.saturate(-e)},p}(),g=function(e){var r;for(r in e)r<3?(e[r]<0&&(e[r]=0),255<e[r]&&(e[r]=255)):3===r&&(e[r]<0&&(e[r]=0),1<e[r]&&(e[r]=1));return e},t=function(e){var r,n,t,f,a,o,i,s;if(e=e.toLowerCase(),null!=fe.colors&&fe.colors[e])return m(fe.colors[e]);if(t=e.match(/rgb\(\s*(\-?\d+),\s*(\-?\d+)\s*,\s*(\-?\d+)\s*\)/)){for(f=t.slice(1,4),n=a=0;a<=2;n=++a)f[n]=+f[n];f[3]=1}else if(t=e.match(/rgba\(\s*(\-?\d+),\s*(\-?\d+)\s*,\s*(\-?\d+)\s*,\s*([01]|[01]?\.\d+)\)/))for(f=t.slice(1,5),n=o=0;o<=3;n=++o)f[n]=+f[n];else if(t=e.match(/rgb\(\s*(\-?\d+(?:\.\d+)?)%,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*\)/)){for(f=t.slice(1,4),n=i=0;i<=2;n=++i)f[n]=Math.round(2.55*f[n]);f[3]=1}else if(t=e.match(/rgba\(\s*(\-?\d+(?:\.\d+)?)%,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)/)){for(f=t.slice(1,5),n=s=0;s<=2;n=++s)f[n]=Math.round(2.55*f[n]);f[3]=+f[3]}else(t=e.match(/hsl\(\s*(\-?\d+(?:\.\d+)?),\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*\)/))?((r=t.slice(1,4))[1]*=.01,r[2]*=.01,(f=w(r))[3]=1):(t=e.match(/hsla\(\s*(\-?\d+(?:\.\d+)?),\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)/))&&((r=t.slice(1,4))[1]*=.01,r[2]*=.01,(f=w(r))[3]=+t[4]);return f},m=function(e){var r,n;if(e.match(/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})#x2F;))return 4!==e.length&&7!==e.length||(e=e.substr(1)),3===e.length&&(e=(e=e.split(""))[0]+e[0]+e[1]+e[1]+e[2]+e[2]),[(n=parseInt(e,16))>>16,n>>8&255,255&n,1];if(e.match(/^#?([A-Fa-f0-9]{8})#x2F;))return 9===e.length&&(e=e.substr(1)),[(n=parseInt(e,16))>>24&255,n>>16&255,n>>8&255,255&n];if(r=t(e))return r;throw"unknown color: "+e},y=function(e,r,n){var t,f,a,o;return e=(o=N(arguments))[0],r=o[1],n=o[2],(e/=360)<1/3?f=1-((t=(1-r)/3)+(a=(1+r*d(s*e)/d(i-s*e))/3)):e<2/3?t=1-((a=(1-r)/3)+(f=(1+r*d(s*(e-=1/3))/d(i-s*e))/3)):a=1-((f=(1-r)/3)+(t=(1+r*d(s*(e-=2/3))/d(i-s*e))/3)),[255*(a=h(n*a*3)),255*(f=h(n*f*3)),255*(t=h(n*t*3))]},w=function(){var e,r,n,t,f,a,o,i,s,d,c,u,l,b;if(t=(l=N(arguments))[0],i=l[1],a=l[2],0===i)o=n=e=255*a;else{for(r=[0,0,0],s=2*a-(d=a<.5?a*(1+i):a+i-a*i),(c=[0,0,0])[0]=(t/=360)+1/3,c[1]=t,c[2]=t-1/3,f=u=0;u<=2;f=++u)c[f]<0&&(c[f]+=1),1<c[f]&&(c[f]-=1),6*c[f]<1?r[f]=s+6*(d-s)*c[f]:2*c[f]<1?r[f]=d:3*c[f]<2?r[f]=s+(d-s)*(2/3-c[f])*6:r[f]=s;o=(b=[Math.round(255*r[0]),Math.round(255*r[1]),Math.round(255*r[2])])[0],n=b[1],e=b[2]}return[o,n,e]},v=function(){var e,r,n,t,f,a,o,i,s,d,c,u,l,b,h,g,p,m;if(t=(u=N(arguments))[0],s=u[1],c=u[2],c*=255,0===s)i=n=e=c;else switch(360===t&&(t=0),360<t&&(t-=360),t<0&&(t+=360),a=c*(1-s),o=c*(1-s*(r=(t/=60)-(f=Math.floor(t)))),d=c*(1-s*(1-r)),f){case 0:i=(l=[c,d,a])[0],n=l[1],e=l[2];break;case 1:i=(b=[o,c,a])[0],n=b[1],e=b[2];break;case 2:i=(h=[a,c,d])[0],n=h[1],e=h[2];break;case 3:i=(g=[a,o,c])[0],n=g[1],e=g[2];break;case 4:i=(p=[d,a,c])[0],n=p[1],e=p[2];break;case 5:i=(m=[c,a,o])[0],n=m[1],e=m[2]}return[i=Math.round(i),n=Math.round(n),e=Math.round(e)]},c=function(){var e,r,n,t;return n=(t=N(arguments))[0],e=t[1],r=t[2],[n,Math.sqrt(e*e+r*r),Math.atan2(r,e)/Math.PI*180]},x=function(e,r,n){var t,f,a,o,i,s,d;return void 0!==e&&3===e.length&&(e=(s=e)[0],r=s[1],n=s[2]),void 0!==e&&3===e.length&&(e=(d=e)[0],r=d[1],n=d[2]),i=(o=(e+16)/116)-n/200,a=.95047*u(a=o+r/500),o=1*u(o),i=1.08883*u(i),f=U(3.2404542*a-1.5371385*o-.4985314*i),t=U(-.969266*a+1.8760108*o+.041556*i),n=U(.0556434*a-.2040259*o+1.0572252*i),[h(f,0,255),h(t,0,255),h(n,0,255),1]},u=function(e){return.206893034<e?e*e*e:(e-4/29)/7.787037},U=function(e){return Math.round(255*(e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055))},b=function(){var e,r,n,t;return n=(t=N(arguments))[0],e=t[1],r=(r=t[2])*Math.PI/180,[n,Math.cos(r)*e,Math.sin(r)*e]},_=function(e,r,n){var t,f,a,o,i,s,d;return t=(s=b(e,r,n))[0],f=s[1],a=s[2],i=(d=x(t,f,a))[0],o=d[1],a=d[2],[h(i,0,255),h(o,0,255),h(a,0,255)]},r=function(e,r,n){var t;return e=(t=N(arguments))[0],r=t[1],n=t[2],.2126*(e=a(e))+.7152*(r=a(r))+.0722*(n=a(n))},a=function(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)},e=function(){var e,r;return"#"+(e="000000"+((r=N(arguments))[0]<<16|r[1]<<8|r[2]).toString(16)).substr(e.length-6)},n=function(){var e,r,n,t,f,a,o,i;return a=(i=N(arguments))[0],n=i[1],r=i[2],e=2*Math.PI,a/=255,n/=255,r/=255,0===(o=1-Math.min(a,n,r)/(f=(a+n+r)/3))?t=0:(t=(a-n+(a-r))/2,t/=Math.sqrt((a-n)*(a-n)+(a-r)*(n-r)),t=Math.acos(t),n<r&&(t=e-t),t/=e),[360*t,o,f]},o=function(e,r,n){var t,f,a,o,i,s;return void 0!==e&&3<=e.length&&(e=(s=e)[0],r=s[1],n=s[2]),e/=255,r/=255,n/=255,o=Math.min(e,r,n),f=((a=Math.max(e,r,n))+o)/2,a===o?(i=0,t=Number.NaN):i=f<.5?(a-o)/(a+o):(a-o)/(2-a-o),e===a?t=(r-n)/(a-o):r===a?t=2+(n-e)/(a-o):n===a&&(t=4+(e-r)/(a-o)),(t*=60)<0&&(t+=360),[t,i,f]},k=function(){var e,r,n,t,f,a,o,i,s,d;return o=(d=N(arguments))[0],n=d[1],e=d[2],a=Math.min(o,n,e),r=(f=Math.max(o,n,e))-a,s=f/255,0===f?(t=Number.NaN,i=0):(i=r/f,o===f&&(t=(n-e)/r),n===f&&(t=2+(e-o)/r),e===f&&(t=4+(o-n)/r),(t*=60)<0&&(t+=360)),[t,i,s]},j=function(){var e,r,n,t,f,a;return n=(a=N(arguments))[0],r=a[1],e=a[2],n=p(n),r=p(r),e=p(e),t=D((.4124564*n+.3575761*r+.1804375*e)/.95047),[116*(f=D((.2126729*n+.7151522*r+.072175*e)/1))-16,500*(t-f),200*(f-D((.0193339*n+.119192*r+.9503041*e)/1.08883))]},p=function(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)},D=function(e){return.008856<e?Math.pow(e,1/3):7.787037*e+4/29},M=function(){var e,r,n,t,f,a,o;return f=(a=N(arguments))[0],n=a[1],r=a[2],t=(o=j(f,n,r))[0],e=o[1],r=o[2],c(t,e,r)},fe.scale=function(i,e){var s,d,c,u,n,a,l,b,h,r,g,p,m,y,w,v,t,x,o;return y="rgb",w=fe("#ccc"),!1,g=[o=0,1],t=!(h=[]),x=[],r=!(p=1),v=m=0,b={},n=function(e,r){var n,t,f,a,o,i,s;if(null==e&&(e=["#ddd","#222"]),null!=e&&"string"===ae(e)&&null!=(null!=(o=fe.brewer)?o[e]:void 0)&&(e=fe.brewer[e]),"array"===ae(e)){for(n=f=0,i=(e=e.slice(0)).length-1;0<=i?f<=i:i<=f;n=0<=i?++f:--f)t=e[n],"string"===ae(t)&&(e[n]=fe(t));if(null!=r)x=r;else for(x=[],n=a=0,s=e.length-1;0<=s?a<=s:s<=a;n=0<=s?++a:--a)x.push(n/(e.length-1))}return u(),h=e},a=function(e){return null==e&&(e=[]),m=(g=e)[0],p=e[e.length-1],u(),v=2===e.length?0:e.length-1},d=function(e){var r,n;if(null==g)return 0;for(n=g.length-1,r=0;r<n&&e>=g[r];)r++;return r-1},l=function(e){return e},function(e){var r,n,t,f,a;return a=e,2<g.length&&(f=g.length-1,r=d(e),t=g[0]+(g[1]-g[0])*(0+.5*o),n=g[f-1]+(g[f]-g[f-1])*(1-.5*o),a=m+(g[r]+.5*(g[r+1]-g[r])-t)/(n-t)*(p-m)),a},c=function(e,r){var n,t,f,a,o,i,s;if(null==r&&(r=!1),isNaN(e))return w;if(o=r?e:2<g.length?d(e)/(v-1):(o=m!==p?(e-m)/(p-m):0,o=(e-m)/(p-m),Math.min(1,Math.max(0,o))),r||(o=l(o)),f=Math.floor(1e4*o),b[f])n=b[f];else{if("array"===ae(h))for(t=i=0,s=x.length-1;0<=s?i<=s:s<=i;t=0<=s?++i:--i){if(o<=(a=x[t])){n=h[t];break}if(a<=o&&t===x.length-1){n=h[t];break}if(a<o&&o<x[t+1]){o=(o-a)/(x[t+1]-a),n=fe.interpolate(h[t],h[t+1],o,y);break}}else"function"===ae(h)&&(n=h(o));b[f]=n}return n},u=function(){return b={}},n(i,e),(s=function(e){var r;return r=c(e),t&&r[t]?r[t]():r}).domain=function(e,r,n,t){var f;return null==n&&(n="e"),arguments.length?(null!=r&&(f=fe.analyze(e,t),e=0===r?[f.min,f.max]:fe.limits(f,n,r)),a(e),s):g},s.mode=function(e){return arguments.length?(y=e,u(),s):y},s.range=function(e,r){return n(e,r),s},s.out=function(e){return t=e,s},s.spread=function(e){return arguments.length?(o=e,s):o},s.correctLightness=function(e){return arguments.length?(r=e,u(),l=r?function(e){var r,n,t,f,a,o,i,s,d;for(r=c(0,!0).lab()[0],n=c(1,!0).lab()[0],i=n<r,t=c(e,!0).lab()[0],f=t-(a=r+(n-r)*e),s=0,d=1,o=20;.01<Math.abs(f)&&0<o--;)i&&(f*=-1),e+=f<0?.5*(d-(s=e)):.5*(s-(d=e)),t=c(e,!0).lab()[0],f=t-a;return e}:function(e){return e},s):r},s.colors=function(e){var r,n,t,f,a,o;if(null==e&&(e="hex"),i=[],n=[],2<g.length)for(r=t=1,o=g.length;1<=o?t<o:o<t;r=1<=o?++t:--t)n.push(.5*(g[r-1]+g[r]));else n=g;for(f=0,a=n.length;f<a;f++)r=n[f],i.push(s(r)[e]());return i},s},null==fe.scales&&(fe.scales={}),fe.scales.cool=function(){return fe.scale([fe.hsl(180,1,.9),fe.hsl(250,.7,.4)])},fe.scales.hot=function(){return fe.scale(["#000","#f00","#ff0","#fff"],[0,.25,.75,1]).mode("rgb")},fe.analyze=function(e,n,t){var f,r,a,o,i,s;if(a={min:Number.MAX_VALUE,max:-1*Number.MAX_VALUE,sum:0,values:[],count:0},null==t&&(t=function(){return!0}),f=function(e){null==e||isNaN(e)||(a.values.push(e),a.sum+=e,e<a.min&&(a.min=e),e>a.max&&(a.max=e),a.count+=1)},o=function(e,r){if(t(e,r))return null!=n&&"function"===ae(n)?f(n(e)):null!=n&&"string"===ae(n)||"number"===ae(n)?f(e[n]):f(e)},"array"===ae(e))for(i=0,s=e.length;i<s;i++)o(e[i]);else for(r in e)o(e[r],r);return a.domain=[a.min,a.max],a.limits=function(e,r){return fe.limits(a,e,r)},a},fe.limits=function(e,r,n){var t,f,a,o,i,s,d,c,u,l,b,h,g,p,m,y,w,v,x,_,k,j,M,N,D,U,A,P,z,G,E,B,I,q,R,S,O,C,T,Y,L,F,V,X,W,$,Z,H,J,K,Q,ee,re,ne,te;if(null==r&&(r="equal"),null==n&&(n=7),"array"===ae(e)&&(e=fe.analyze(e)),g=e.min,b=e.max,e.sum,D=e.values.sort(function(e,r){return e-r}),l=[],"c"===r.substr(0,1)&&(l.push(g),l.push(b)),"e"===r.substr(0,1)){for(l.push(g),d=U=1,S=n-1;1<=S?U<=S:S<=U;d=1<=S?++U:--U)l.push(g+d/n*(b-g));l.push(b)}else if("l"===r.substr(0,1)){if(g<=0)throw"Logarithmic scales are only possible for values > 0";for(p=Math.LOG10E*Math.log(g),h=Math.LOG10E*Math.log(b),l.push(g),d=A=1,V=n-1;1<=V?A<=V:V<=A;d=1<=V?++A:--A)l.push(Math.pow(10,p+d/n*(h-p)));l.push(b)}else if("q"===r.substr(0,1)){for(l.push(g),d=P=1,X=n-1;1<=X?P<=X:X<=P;d=1<=X?++P:--P)x=D.length*d/n,(_=Math.floor(x))===x?l.push(D[_]):(k=x-_,l.push(D[_]*k+D[_+1]*(1-k)));l.push(b)}else if("k"===r.substr(0,1)){for(y=D.length,t=new Array(y),i=new Array(n),j=!0,w=0,a=null,(a=[]).push(g),d=z=1,W=n-1;1<=W?z<=W:W<=z;d=1<=W?++z:--z)a.push(g+d/n*(b-g));for(a.push(b);j;){for(c=G=0,$=n-1;0<=$?G<=$:lt;=G;c=0<=$?++G:--G)i[c]=0;for(d=E=0,Z=y-1;0<=Z?E<=Z:Z<=E;d=0<=Z?++E:--E){for(N=D[d],m=Number.MAX_VALUE,c=B=0,H=n-1;0<=H?B<=H:H<=B;c=0<=H?++B:--B)(s=Math.abs(a[c]-N))<m&&(m=s,f=c);i[f]++,t[d]=f}for(v=new Array(n),c=I=0,J=n-1;0<=J?I<=J:J<=I;c=0<=J?++I:--I)v[c]=null;for(d=q=0,K=y-1;0<=K?q<=K:K<=q;d=0<=K?++q:--q)null===v[o=t[d]]?v[o]=D[d]:v[o]+=D[d];for(c=R=0,O=n-1;0<=O?R<=O:O<=R;c=0<=O?++R:--R)v[c]*=1/i[c];for(j=!1,c=Q=0,C=n-1;0<=C?Q<=C:C<=Q;c=0<=C?++Q:--Q)if(v[c]!==a[d]){j=!0;break}a=v,200<++w&&(j=!1)}for(u={},c=ee=0,T=n-1;0<=T?ee<=T:T<=ee;c=0<=T?++ee:--ee)u[c]=[];for(d=re=0,Y=y-1;0<=Y?re<=Y:Y<=re;d=0<=Y?++re:--re)u[o=t[d]].push(D[d]);for(M=[],c=ne=0,L=n-1;0<=L?ne<=L:L<=ne;c=0<=L?++ne:--ne)M.push(u[c][0]),M.push(u[c][u[c].length-1]);for(M=M.sort(function(e,r){return e-r}),l.push(M[0]),d=te=1,F=M.length-1;te<=F;d=te+=2)isNaN(M[d])||l.push(M[d])}return l},fe.brewer={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},fe.colors={indigo:"#4b0082",gold:"#ffd700",hotpink:"#ff69b4",firebrick:"#b22222",indianred:"#cd5c5c",yellow:"#ffff00",mistyrose:"#ffe4e1",darkolivegreen:"#556b2f",olive:"#808000",darkseagreen:"#8fbc8f",pink:"#ffc0cb",tomato:"#ff6347",lightcoral:"#f08080",orangered:"#ff4500",navajowhite:"#ffdead",lime:"#00ff00",palegreen:"#98fb98",darkslategrey:"#2f4f4f",greenyellow:"#adff2f",burlywood:"#deb887",seashell:"#fff5ee",mediumspringgreen:"#00fa9a",fuchsia:"#ff00ff",papayawhip:"#ffefd5",blanchedalmond:"#ffebcd",chartreuse:"#7fff00",dimgray:"#696969",black:"#000000",peachpuff:"#ffdab9",springgreen:"#00ff7f",aquamarine:"#7fffd4",white:"#ffffff",orange:"#ffa500",lightsalmon:"#ffa07a",darkslategray:"#2f4f4f",brown:"#a52a2a",ivory:"#fffff0",dodgerblue:"#1e90ff",peru:"#cd853f",lawngreen:"#7cfc00",chocolate:"#d2691e",crimson:"#dc143c",forestgreen:"#228b22",darkgrey:"#a9a9a9",lightseagreen:"#20b2aa",cyan:"#00ffff",mintcream:"#f5fffa",silver:"#c0c0c0",antiquewhite:"#faebd7",mediumorchid:"#ba55d3",skyblue:"#87ceeb",gray:"#808080",darkturquoise:"#00ced1",goldenrod:"#daa520",darkgreen:"#006400",floralwhite:"#fffaf0",darkviolet:"#9400d3",darkgray:"#a9a9a9",moccasin:"#ffe4b5",saddlebrown:"#8b4513",grey:"#808080",darkslateblue:"#483d8b",lightskyblue:"#87cefa",lightpink:"#ffb6c1",mediumvioletred:"#c71585",slategrey:"#708090",red:"#ff0000",deeppink:"#ff1493",limegreen:"#32cd32",darkmagenta:"#8b008b",palegoldenrod:"#eee8aa",plum:"#dda0dd",turquoise:"#40e0d0",lightgrey:"#d3d3d3",lightgoldenrodyellow:"#fafad2",darkgoldenrod:"#b8860b",lavender:"#e6e6fa",maroon:"#800000",yellowgreen:"#9acd32",sandybrown:"#f4a460",thistle:"#d8bfd8",violet:"#ee82ee",navy:"#000080",magenta:"#ff00ff",dimgrey:"#696969",tan:"#d2b48c",rosybrown:"#bc8f8f",olivedrab:"#6b8e23",blue:"#0000ff",lightblue:"#add8e6",ghostwhite:"#f8f8ff",honeydew:"#f0fff0",cornflowerblue:"#6495ed",slateblue:"#6a5acd",linen:"#faf0e6",darkblue:"#00008b",powderblue:"#b0e0e6",seagreen:"#2e8b57",darkkhaki:"#bdb76b",snow:"#fffafa",sienna:"#a0522d",mediumblue:"#0000cd",royalblue:"#4169e1",lightcyan:"#e0ffff",green:"#008000",mediumpurple:"#9370db",midnightblue:"#191970",cornsilk:"#fff8dc",paleturquoise:"#afeeee",bisque:"#ffe4c4",slategray:"#708090",darkcyan:"#008b8b",khaki:"#f0e68c",wheat:"#f5deb3",teal:"#008080",darkorchid:"#9932cc",deepskyblue:"#00bfff",salmon:"#fa8072",darkred:"#8b0000",steelblue:"#4682b4",palevioletred:"#db7093",lightslategray:"#778899",aliceblue:"#f0f8ff",lightslategrey:"#778899",lightgreen:"#90ee90",orchid:"#da70d6",gainsboro:"#dcdcdc",mediumseagreen:"#3cb371",lightgray:"#d3d3d3",mediumturquoise:"#48d1cc",lemonchiffon:"#fffacd",cadetblue:"#5f9ea0",lightyellow:"#ffffe0",lavenderblush:"#fff0f5",coral:"#ff7f50",purple:"#800080",aqua:"#00ffff",whitesmoke:"#f5f5f5",mediumslateblue:"#7b68ee",darkorange:"#ff8c00",mediumaquamarine:"#66cdaa",darksalmon:"#e9967a",beige:"#f5f5dc",blueviolet:"#8a2be2",azure:"#f0ffff",lightsteelblue:"#b0c4de",oldlace:"#fdf5e6"},ae=function(){var n,e,r,t,f;for(n={},r=0,t=(f="Boolean Number String Function Array Date RegExp Undefined Null".split(" ")).length;r<t;r++)e=f[r],n["[object "+e+"]"]=e.toLowerCase();return function(e){var r;return r=Object.prototype.toString.call(e),n[r]||"object"}}(),h=function(e,r,n){return null==r&&(r=0),null==n&&(n=1),e<r&&(e=r),n<e&&(e=n),e},N=function(e){return 3<=e.length?e:e[0]},s=2*Math.PI,i=Math.PI/3,d=Math.cos,l=function(t){var e,r,n,f,a,o,i,s,d,c,u;return 2===(t=function(){var e,r,n;for(n=[],e=0,r=t.length;e<r;e++)f=t[e],n.push(fe(f));return n}()).length?(d=function(){var e,r,n;for(n=[],e=0,r=t.length;e<r;e++)f=t[e],n.push(f.lab());return n}(),a=d[0],o=d[1],e=function(n){var t,e;return e=function(){var e,r;for(r=[],t=e=0;e<=2;t=++e)r.push(a[t]+n*(o[t]-a[t]));return r}(),fe.lab.apply(fe,e)}):3===t.length?(c=function(){var e,r,n;for(n=[],e=0,r=t.length;e<r;e++)f=t[e],n.push(f.lab());return n}(),a=c[0],o=c[1],i=c[2],e=function(n){var t,e;return e=function(){var e,r;for(r=[],t=e=0;e<=2;t=++e)r.push((1-n)*(1-n)*a[t]+2*(1-n)*n*o[t]+n*n*i[t]);return r}(),fe.lab.apply(fe,e)}):4===t.length?(u=function(){var e,r,n;for(n=[],e=0,r=t.length;e<r;e++)f=t[e],n.push(f.lab());return n}(),a=u[0],o=u[1],i=u[2],s=u[3],e=function(n){var t,e;return e=function(){var e,r;for(r=[],t=e=0;e<=2;t=++e)r.push((1-n)*(1-n)*(1-n)*a[t]+3*(1-n)*(1-n)*n*o[t]+3*(1-n)*n*n*i[t]+n*n*n*s[t]);return r}(),fe.lab.apply(fe,e)}):5===t.length&&(r=l(t.slice(0,3)),n=l(t.slice(2,5)),e=function(e){return e<.5?r(2*e):n(2*(e-.5))}),e},fe.interpolate.bezier=l}).call(this)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/delaunay-fast/delaunay.js":[function(e,r,n){var t;!function(){"use strict";var _=1/1048576;function g(e,r,n,t){var f,a,o,i,s,d,c,u,l,b,h=e[r][0],g=e[r][1],p=e[n][0],m=e[n][1],y=e[t][0],w=e[t][1],v=Math.abs(g-m),x=Math.abs(m-w);if(v<_&&x<_)throw new Error("Eek! Coincident points!");return a=v<_?(i=-(y-p)/(w-m))*((f=(p+h)/2)-(d=(p+y)/2))+(u=(m+w)/2):x<_?(o=-(p-h)/(m-g))*((f=(y+p)/2)-(s=(h+p)/2))+(c=(g+m)/2):(f=((o=-(p-h)/(m-g))*(s=(h+p)/2)-(i=-(y-p)/(w-m))*(d=(p+y)/2)+(u=(m+w)/2)-(c=(g+m)/2))/(o-i),x<v?o*(f-s)+c:i*(f-d)+u),{i:r,j:n,k:t,x:f,y:a,r:(l=p-f)*l+(b=m-a)*b}}function p(e){var r,n,t,f,a,o;for(n=e.length;n;)for(f=e[--n],t=e[--n],r=n;r;)if(o=e[--r],t===(a=e[--r])&&f===o||t===o&&f===a){e.splice(n,2),e.splice(r,2);break}}t={triangulate:function(n,e){var r,t,f,a,o,i,s,d,c,u,l,b,h=n.length;if(h<3)return[];if(n=n.slice(0),e)for(r=h;r--;)n[r]=n[r][e];for(f=new Array(h),r=h;r--;)f[r]=r;for(f.sort(function(e,r){return n[r][0]-n[e][0]}),a=function(e){var r,n,t,f,a,o,i=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY,d=Number.NEGATIVE_INFINITY,c=Number.NEGATIVE_INFINITY;for(r=e.length;r--;)e[r][0]<i&&(i=e[r][0]),e[r][0]>d&&(d=e[r][0]),e[r][1]<s&&(s=e[r][1]),e[r][1]>c&&(c=e[r][1]);return t=c-s,[[(a=i+.5*(n=d-i))-20*(f=Math.max(n,t)),(o=s+.5*t)-f],[a,o+20*f],[a+20*f,o-f]]}(n),n.push(a[0],a[1],a[2]),o=[g(n,h+0,h+1,h+2)],i=[],s=[],r=f.length;r--;s.length=0){for(b=f[r],t=o.length;t--;)0<(d=n[b][0]-o[t].x)&&d*d>o[t].r?(i.push(o[t]),o.splice(t,1)):d*d+(c=n[b][1]-o[t].y)*c-o[t].r>_||(s.push(o[t].i,o[t].j,o[t].j,o[t].k,o[t].k,o[t].i),o.splice(t,1));for(p(s),t=s.length;t;)l=s[--t],u=s[--t],o.push(g(n,u,l,b))}for(r=o.length;r--;)i.push(o[r]);for(o.length=0,r=i.length;r--;)i[r].i<h&&i[r].j<h&&i[r].k<h&&o.push(i[r].i,i[r].j,i[r].k);return o},contains:function(e,r){if(r[0]<e[0][0]&&r[0]<e[1][0]&&r[0]<e[2][0]||r[0]>e[0][0]&&r[0]>e[1][0]&&r[0]>e[2][0]||r[1]<e[0][1]&&r[1]<e[1][1]&&r[1]<e[2][1]||r[1]>e[0][1]&&r[1]>e[1][1]&&r[1]>e[2][1])return null;var n=e[1][0]-e[0][0],t=e[2][0]-e[0][0],f=e[1][1]-e[0][1],a=e[2][1]-e[0][1],o=n*a-t*f;if(0===o)return null;var i=(a*(r[0]-e[0][0])-t*(r[1]-e[0][1]))/o,s=(n*(r[1]-e[0][1])-f*(r[0]-e[0][0]))/o;return i<0||s<0||1<i+s?null:[i,s]}},void 0!==r&&(r.exports=t)}()},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/index.js":[function(e,r,n){var t=e("./lib/alea"),f=e("./lib/xor128"),a=e("./lib/xorwow"),o=e("./lib/xorshift7"),i=e("./lib/xor4096"),s=e("./lib/tychei"),d=e("./seedrandom");d.alea=t,d.xor128=f,d.xorwow=a,d.xorshift7=o,d.xor4096=i,d.tychei=s,r.exports=d},{"./lib/alea":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/alea.js","./lib/tychei":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/tychei.js","./lib/xor128":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xor128.js","./lib/xor4096":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xor4096.js","./lib/xorshift7":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xorshift7.js","./lib/xorwow":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xorwow.js","./seedrandom":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/seedrandom.js"}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/alea.js":[function(e,r,n){!function(e,r,n){function a(e){var t,r=this,n=(t=4022871197,function(e){e=e.toString();for(var r=0;r<e.length;r++){var n=.02519603282416938*(t+=e.charCodeAt(r));n-=t=n>>>0,t=(n*=t)>>>0,t+=4294967296*(n-=t)}return 2.3283064365386963e-10*(t>>>0)});r.next=function(){var e=2091639*r.s0+2.3283064365386963e-10*r.c;return r.s0=r.s1,r.s1=r.s2,r.s2=e-(r.c=0|e)},r.c=1,r.s0=n(" "),r.s1=n(" "),r.s2=n(" "),r.s0-=n(e),r.s0<0&&(r.s0+=1),r.s1-=n(e),r.s1<0&&(r.s1+=1),r.s2-=n(e),r.s2<0&&(r.s2+=1),n=null}function o(e,r){return r.c=e.c,r.s0=e.s0,r.s1=e.s1,r.s2=e.s2,r}function t(e,r){var n=new a(e),t=r&&r.state,f=n.next;return f.int32=function(){return 4294967296*n.next()|0},f.double=function(){return f()+11102230246251565e-32*(2097152*f()|0)},f.quick=f,t&&("object"==typeof t&&o(t,n),f.state=function(){return o(n,{})}),f}r&&r.exports?r.exports=t:n&&n.amd?n(function(){return t}):this.alea=t}(0,"object"==typeof r&&r,!1)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/tychei.js":[function(e,r,n){!function(e,r,n){function a(e){var f=this,r="";f.next=function(){var e=f.b,r=f.c,n=f.d,t=f.a;return e=e<<25^e>>>7^r,r=r-n|0,n=n<<24^n>>>8^t,t=t-e|0,f.b=e=e<<20^e>>>12^r,f.c=r=r-n|0,f.d=n<<16^r>>>16^t,f.a=t-e|0},f.a=0,f.b=0,f.c=-1640531527,f.d=1367130551,e===Math.floor(e)?(f.a=e/4294967296|0,f.b=0|e):r+=e;for(var n=0;n<r.length+20;n++)f.b^=0|r.charCodeAt(n),f.next()}function o(e,r){return r.a=e.a,r.b=e.b,r.c=e.c,r.d=e.d,r}function t(e,r){var n=new a(e),t=r&&r.state,f=function(){return(n.next()>>>0)/4294967296};return f.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},f.int32=n.next,f.quick=f,t&&("object"==typeof t&&o(t,n),f.state=function(){return o(n,{})}),f}r&&r.exports?r.exports=t:n&&n.amd?n(function(){return t}):this.tychei=t}(0,"object"==typeof r&&r,!1)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xor128.js":[function(e,r,n){!function(e,r,n){function a(e){var r=this,n="";r.x=0,r.y=0,r.z=0,r.w=0,r.next=function(){var e=r.x^r.x<<11;return r.x=r.y,r.y=r.z,r.z=r.w,r.w^=r.w>>>19^e^e>>>8},e===(0|e)?r.x=e:n+=e;for(var t=0;t<n.length+64;t++)r.x^=0|n.charCodeAt(t),r.next()}function o(e,r){return r.x=e.x,r.y=e.y,r.z=e.z,r.w=e.w,r}function t(e,r){var n=new a(e),t=r&&r.state,f=function(){return(n.next()>>>0)/4294967296};return f.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},f.int32=n.next,f.quick=f,t&&("object"==typeof t&&o(t,n),f.state=function(){return o(n,{})}),f}r&&r.exports?r.exports=t:n&&n.amd?n(function(){return t}):this.xor128=t}(0,"object"==typeof r&&r,!1)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xor4096.js":[function(e,r,n){!function(e,r,n){function a(e){var a=this;a.next=function(){var e,r,n=a.w,t=a.X,f=a.i;return a.w=n=n+1640531527|0,r=t[f+34&127],e=t[f=f+1&127],r^=r<<13,e^=e<<17,r^=r>>>15,e^=e>>>12,r=t[f]=r^e,a.i=f,r+(n^n>>>16)|0},function(e,r){var n,t,f,a,o,i=[],s=128;for(r===(0|r)?(t=r,r=null):(r+="\0",t=0,s=Math.max(s,r.length)),f=0,a=-32;a<s;++a)r&&(t^=r.charCodeAt((a+32)%r.length)),0===a&&(o=t),t^=t<<10,t^=t>>>15,t^=t<<4,t^=t>>>13,0<=a&&(o=o+1640531527|0,f=0==(n=i[127&a]^=t+o)?f+1:0);for(128<=f&&(i[127&(r&&r.length||0)]=-1),f=127,a=512;0<a;--a)t=i[f+34&127],n=i[f=f+1&127],t^=t<<13,n^=n<<17,t^=t>>>15,n^=n>>>12,i[f]=t^n;e.w=o,e.X=i,e.i=f}(a,e)}function o(e,r){return r.i=e.i,r.w=e.w,r.X=e.X.slice(),r}function t(e,r){null==e&&(e=+new Date);var n=new a(e),t=r&&r.state,f=function(){return(n.next()>>>0)/4294967296};return f.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},f.int32=n.next,f.quick=f,t&&(t.X&&o(t,n),f.state=function(){return o(n,{})}),f}r&&r.exports?r.exports=t:n&&n.amd?n(function(){return t}):this.xor4096=t}(0,"object"==typeof r&&r,!1)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xorshift7.js":[function(e,r,n){!function(e,r,n){function a(e){var f=this;f.next=function(){var e,r,n=f.x,t=f.i;return e=n[t],r=(e^=e>>>7)^e<<24,r^=(e=n[t+1&7])^e>>>10,r^=(e=n[t+3&7])^e>>>3,r^=(e=n[t+4&7])^e<<7,e=n[t+7&7],r^=(e^=e<<13)^e<<9,n[t]=r,f.i=t+1&7,r},function(e,r){var n,t=[];if(r===(0|r))t[0]=r;else for(r=""+r,n=0;n<r.length;++n)t[7&n]=t[7&n]<<15^r.charCodeAt(n)+t[n+1&7]<<13;for(;t.length<8;)t.push(0);for(n=0;n<8&&0===t[n];++n);for(8==n?t[7]=-1:t[n],e.x=t,e.i=0,n=256;0<n;--n)e.next()}(f,e)}function o(e,r){return r.x=e.x.slice(),r.i=e.i,r}function t(e,r){null==e&&(e=+new Date);var n=new a(e),t=r&&r.state,f=function(){return(n.next()>>>0)/4294967296};return f.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},f.int32=n.next,f.quick=f,t&&(t.x&&o(t,n),f.state=function(){return o(n,{})}),f}r&&r.exports?r.exports=t:n&&n.amd?n(function(){return t}):this.xorshift7=t}(0,"object"==typeof r&&r,!1)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xorwow.js":[function(e,r,n){!function(e,r,n){function a(e){var r=this,n="";r.next=function(){var e=r.x^r.x>>>2;return r.x=r.y,r.y=r.z,r.z=r.w,r.w=r.v,(r.d=r.d+362437|0)+(r.v=r.v^r.v<<4^e^e<<1)|0},r.x=0,r.y=0,r.z=0,r.w=0,e===((r.v=0)|e)?r.x=e:n+=e;for(var t=0;t<n.length+64;t++)r.x^=0|n.charCodeAt(t),t==n.length&&(r.d=r.x<<10^r.x>>>4),r.next()}function o(e,r){return r.x=e.x,r.y=e.y,r.z=e.z,r.w=e.w,r.v=e.v,r.d=e.d,r}function t(e,r){var n=new a(e),t=r&&r.state,f=function(){return(n.next()>>>0)/4294967296};return f.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},f.int32=n.next,f.quick=f,t&&("object"==typeof t&&o(t,n),f.state=function(){return o(n,{})}),f}r&&r.exports?r.exports=t:n&&n.amd?n(function(){return t}):this.xorwow=t}(0,"object"==typeof r&&r,!1)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/seedrandom.js":[function(r,n,e){!function(i,s){var d,c=this,u=256,l=6,b="random",h=s.pow(u,l),g=s.pow(2,52),p=2*g,m=u-1;function e(e,r,n){var t=[],f=v(function e(r,n){var t,f=[],a=typeof r;if(n&&"object"==a)for(t in r)try{f.push(e(r[t],n-1))}catch(e){}return f.length?f:"string"==a?r:r+"\0"}((r=1==r?{entropy:!0}:r||{}).entropy?[e,x(i)]:null==e?function(){try{if(d)return x(d.randomBytes(u));var e=new Uint8Array(u);return(c.crypto||c.msCrypto).getRandomValues(e),x(e)}catch(e){var r=c.navigator,n=r&&r.plugins;return[+new Date,c,n,c.screen,x(i)]}}():e,3),t),a=new y(t),o=function(){for(var e=a.g(l),r=h,n=0;e<g;)e=(e+n)*u,r*=u,n=a.g(1);for(;p<=e;)e/=2,r/=2,n>>>=1;return(e+n)/r};return o.int32=function(){return 0|a.g(4)},o.quick=function(){return a.g(4)/4294967296},o.double=o,v(x(a.S),i),(r.pass||n||function(e,r,n,t){return t&&(t.S&&w(t,a),e.state=function(){return w(a,{})}),n?(s[b]=e,r):e})(o,f,"global"in r?r.global:this==s,r.state)}function y(e){var r,n=e.length,o=this,t=0,f=o.i=o.j=0,a=o.S=[];for(n||(e=[n++]);t<u;)a[t]=t++;for(t=0;t<u;t++)a[t]=a[f=m&f+e[t%n]+(r=a[t])],a[f]=r;(o.g=function(e){for(var r,n=0,t=o.i,f=o.j,a=o.S;e--;)r=a[t=m&t+1],n=n*u+a[m&(a[t]=a[f=m&f+r])+(a[f]=r)];return o.i=t,o.j=f,n})(u)}function w(e,r){return r.i=e.i,r.j=e.j,r.S=e.S.slice(),r}function v(e,r){for(var n,t=e+"",f=0;f<t.length;)r[m&f]=m&(n^=19*r[m&f])+t.charCodeAt(f++);return x(r)}function x(e){return String.fromCharCode.apply(0,e)}if(s["seed"+b]=e,v(s.random(),i),"object"==typeof n&&n.exports){n.exports=e;try{d=r("crypto")}catch(e){}}else 0}([],Math)},{crypto:!1}]},{},["./lib/trianglify.js"])("./lib/trianglify.js")});
base/inc/fields/icon.class.php CHANGED
@@ -1,93 +1,93 @@
1
- <?php
2
-
3
- /**
4
- * Class SiteOrigin_Widget_Field_Icon
5
- */
6
- class SiteOrigin_Widget_Field_Icon extends SiteOrigin_Widget_Field_Base {
7
- /**
8
- * The number of visible rows in the icons selector.
9
- *
10
- * @access protected
11
- * @var int
12
- *
13
- */
14
- protected $rows = 3;
15
-
16
- protected $icons_callback;
17
-
18
- protected function render_field( $value, $instance ) {
19
- $widget_icon_families = $this->get_widget_icon_families();
20
- list( $value_family, $null ) = !empty($value) ? explode('-', $value, 2) : array('fontawesome', '');
21
-
22
- ?>
23
-
24
- <div class="siteorigin-widget-icon-selector-current">
25
- <div class="siteorigin-widget-icon"><span></span></div>
26
- <label><?php _e('Choose Icon', 'so-widgets-bundle') ?></label>
27
- </div>
28
-
29
- <a class="so-icon-remove" style="display: <?php echo !empty( $value ) ? 'inline-block' : 'none' ?>;"><?php esc_html_e( 'Remove', 'so-widgets-bundle' ) ?></a>
30
-
31
- <div class="clear"></div>
32
-
33
- <div class="siteorigin-widget-icon-selector siteorigin-widget-field-subcontainer">
34
- <select class="siteorigin-widget-icon-family" >
35
- <?php foreach( $widget_icon_families as $family_id => $family_info ) : ?>
36
- <option value="<?php echo esc_attr( $family_id ) ?>"
37
- <?php selected( $value_family, $family_id ) ?>
38
- <?php if( !empty( $this->icons_callback ) ) echo 'data-icons="' . esc_attr( json_encode( $family_info ) ) . '"' ?>
39
- >
40
- <?php echo esc_html( $family_info['name'] ) ?> (<?php echo count( $family_info['icons'] ) ?>)
41
- </option>
42
- <?php endforeach; ?>
43
- </select>
44
-
45
- <input type="search" class="siteorigin-widget-icon-search" placeholder="<?php esc_attr_e( 'Search Icons' ) ?>" />
46
-
47
- <input type="hidden" name="<?php echo esc_attr( $this->element_name ) ?>" value="<?php echo esc_attr( $value ) ?>"
48
- class="siteorigin-widget-icon-icon siteorigin-widget-input" />
49
-
50
- <div class="siteorigin-widget-icon-icons" style="height: <?php echo ( $this->rows * 54 ) - 3 ?>px;"></div>
51
- </div>
52
- <?php
53
- }
54
-
55
- protected function sanitize_field_input( $value, $instance ) {
56
- $sanitized_value = $value;
57
- // Alphanumeric characters and hyphens.
58
- if( preg_match( '/[\w\d]+[\w\d-]*/', $sanitized_value, $sanitized_matches ) ) {
59
- $sanitized_value = $sanitized_matches[0];
60
- }
61
- else {
62
- $sanitized_value = '';
63
- }
64
- list( $value_family, $value_icon ) = ( ! empty( $sanitized_value ) && strpos( $sanitized_value, '-' ) !== false ) ? explode( '-', $sanitized_value, 2 ) : array('', '');
65
-
66
- $widget_icon_families = $this->get_widget_icon_families();
67
- if( ! ( isset( $widget_icon_families[$value_family] ) && isset( $widget_icon_families[$value_family]['icons'][$value_icon] ) ) ) {
68
- $sanitized_value = isset( $this->default ) ? $this->default : '';
69
- }
70
-
71
- return $sanitized_value;
72
- }
73
-
74
- private function get_widget_icon_families(){
75
- if( !empty( $this->icons_callback ) ) {
76
- // We'll get the icons from the callback function
77
- $widget_icon_families = call_user_func( $this->icons_callback );
78
- }
79
- else {
80
- // We'll get icons from the main filter
81
- static $widget_icon_families;
82
- if( empty( $widget_icon_families ) ) $widget_icon_families = apply_filters('siteorigin_widgets_icon_families', array() );
83
- }
84
-
85
- return $widget_icon_families;
86
- }
87
-
88
- public function enqueue_scripts(){
89
- wp_enqueue_script( 'so-icon-field', plugin_dir_url( __FILE__ ) . 'js/icon-field' . SOW_BUNDLE_JS_SUFFIX . '.js', array( 'jquery' ), SOW_BUNDLE_VERSION );
90
- wp_enqueue_style( 'so-icon-field', plugin_dir_url( __FILE__ ) . 'css/icon-field.css', array( ), SOW_BUNDLE_VERSION );
91
- }
92
-
93
- }
1
+ <?php
2
+
3
+ /**
4
+ * Class SiteOrigin_Widget_Field_Icon
5
+ */
6
+ class SiteOrigin_Widget_Field_Icon extends SiteOrigin_Widget_Field_Base {
7
+ /**
8
+ * The number of visible rows in the icons selector.
9
+ *
10
+ * @access protected
11
+ * @var int
12
+ *
13
+ */
14
+ protected $rows = 3;
15
+
16
+ protected $icons_callback;
17
+
18
+ protected function render_field( $value, $instance ) {
19
+ $widget_icon_families = $this->get_widget_icon_families();
20
+ list( $value_family, $null ) = !empty($value) ? explode('-', $value, 2) : array('fontawesome', '');
21
+
22
+ ?>
23
+
24
+ <div class="siteorigin-widget-icon-selector-current">
25
+ <div class="siteorigin-widget-icon"><span></span></div>
26
+ <label><?php _e('Choose Icon', 'so-widgets-bundle') ?></label>
27
+ </div>
28
+
29
+ <a class="so-icon-remove" style="display: <?php echo !empty( $value ) ? 'inline-block' : 'none' ?>;"><?php esc_html_e( 'Remove', 'so-widgets-bundle' ) ?></a>
30
+
31
+ <div class="clear"></div>
32
+
33
+ <div class="siteorigin-widget-icon-selector siteorigin-widget-field-subcontainer">
34
+ <select class="siteorigin-widget-icon-family" >
35
+ <?php foreach( $widget_icon_families as $family_id => $family_info ) : ?>
36
+ <option value="<?php echo esc_attr( $family_id ) ?>"
37
+ <?php selected( $value_family, $family_id ) ?>
38
+ <?php if( !empty( $this->icons_callback ) ) echo 'data-icons="' . esc_attr( json_encode( $family_info ) ) . '"' ?>
39
+ >
40
+ <?php echo esc_html( $family_info['name'] ) ?> (<?php echo count( $family_info['icons'] ) ?>)
41
+ </option>
42
+ <?php endforeach; ?>
43
+ </select>
44
+
45
+ <input type="search" class="siteorigin-widget-icon-search" placeholder="<?php esc_attr_e( 'Search Icons' ) ?>" />
46
+
47
+ <input type="hidden" name="<?php echo esc_attr( $this->element_name ) ?>" value="<?php echo esc_attr( $value ) ?>"
48
+ class="siteorigin-widget-icon-icon siteorigin-widget-input" />
49
+
50
+ <div class="siteorigin-widget-icon-icons" style="height: <?php echo ( $this->rows * 54 ) - 3 ?>px;"></div>
51
+ </div>
52
+ <?php
53
+ }
54
+
55
+ protected function sanitize_field_input( $value, $instance ) {
56
+ $sanitized_value = $value;
57
+ // Alphanumeric characters and hyphens.
58
+ if( preg_match( '/[\w\d]+[\w\d-]*/', $sanitized_value, $sanitized_matches ) ) {
59
+ $sanitized_value = $sanitized_matches[0];
60
+ }
61
+ else {
62
+ $sanitized_value = '';
63
+ }
64
+ list( $value_family, $value_icon ) = ( ! empty( $sanitized_value ) && strpos( $sanitized_value, '-' ) !== false ) ? explode( '-', $sanitized_value, 2 ) : array('', '');
65
+
66
+ $widget_icon_families = $this->get_widget_icon_families();
67
+ if( ! ( isset( $widget_icon_families[$value_family] ) && isset( $widget_icon_families[$value_family]['icons'][$value_icon] ) ) ) {
68
+ $sanitized_value = isset( $this->default ) ? $this->default : '';
69
+ }
70
+
71
+ return $sanitized_value;
72
+ }
73
+
74
+ private function get_widget_icon_families(){
75
+ if( !empty( $this->icons_callback ) ) {
76
+ // We'll get the icons from the callback function
77
+ $widget_icon_families = call_user_func( $this->icons_callback );
78
+ }
79
+ else {
80
+ // We'll get icons from the main filter
81
+ static $widget_icon_families;
82
+ if( empty( $widget_icon_families ) ) $widget_icon_families = apply_filters('siteorigin_widgets_icon_families', array() );
83
+ }
84
+
85
+ return $widget_icon_families;
86
+ }
87
+
88
+ public function enqueue_scripts(){
89
+ wp_enqueue_script( 'so-icon-field', plugin_dir_url( __FILE__ ) . 'js/icon-field' . SOW_BUNDLE_JS_SUFFIX . '.js', array( 'jquery' ), SOW_BUNDLE_VERSION );
90
+ wp_enqueue_style( 'so-icon-field', plugin_dir_url( __FILE__ ) . 'css/icon-field.css', array( ), SOW_BUNDLE_VERSION );
91
+ }
92
+
93
+ }
base/inc/fields/js/autocomplete-field.min.js CHANGED
@@ -1 +1 @@
1
- !function(e){e(document).on("sowsetupformfield",".siteorigin-widget-field-type-autocomplete",function(t){var i=e(this);if(!i.data("initialized")){var n=function(){var e=i.find("input.siteorigin-widget-input").val();return 0===e.length?[]:e.split(",")},a=function(){var t=n();i.find("ul.items > li").each(function(i,n){var a=e(this);t.indexOf(a.data("value"))>-1?a.addClass("selected"):a.removeClass("selected")})},l=null,s=function(){null!==l&&l.abort();var t=i.find(".content-text-search"),n=t.val(),a=t.data("source"),s=t.data("postTypes"),o={action:"so_widgets_search_"+a};"posts"===a?(o.query=n,o.postTypes=s):"terms"===a&&(o.term=n);var d=i.find("ul.items").empty().addClass("loading");return e.get(soWidgets.ajaxurl,o,function(t){t.forEach(function(t){""===t.label&&(t.label="&nbsp;"),d.append(e("<li>").html(t.label+"<span>("+t.type+")</span>").data(t))}),d.removeClass("loading")})};i.find(".siteorigin-widget-autocomplete-input").click(function(){var t=i.find(".existing-content-selector");t.show();var n=new e.Deferred;t.is(":visible")&&0===t.find("ul.items li").length?n=s():n.resolve(),n.done(a)});var o=function(){i.find(".existing-content-selector").hide()};e(window).mousedown(function(e){0===i.find(e.target).length&&o()}),i.find(".button-close").click(o),i.on("click",".items li",function(t){t.preventDefault();var a=e(this),l=n(),s=a.data("value"),o=l.indexOf(s);o>-1?(l.splice(o,1),a.removeClass("selected")):(l.push(s),a.addClass("selected"));var d=i.find("input.siteorigin-widget-input");d.val(l.join(",")),d.change()});var d=null;i.find(".content-text-search").keyup(function(){null!==d&&clearTimeout(d),d=setTimeout(function(){s()},500)}),i.data("initialized",!0)}})}(jQuery);
1
+ !function(d){d(document).on("sowsetupformfield",".siteorigin-widget-field-type-autocomplete",function(e){var l=d(this);if(!l.data("initialized")){var o=function(){var e=l.find("input.siteorigin-widget-input").val();return 0===e.length?[]:e.split(",")},i=function(){var n=o();l.find("ul.items > li").each(function(e,t){var i=d(this);-1<n.indexOf(i.data("value"))?i.addClass("selected"):i.removeClass("selected")})},n=function(){var e=l.find(".content-text-search"),t=e.val(),i=e.data("source"),n=e.data("postTypes"),a={action:"so_widgets_search_"+i};"posts"===i?(a.query=t,a.postTypes=n):"terms"===i&&(a.term=t);var s=l.find("ul.items").empty().addClass("loading");return d.get(soWidgets.ajaxurl,a,function(e){e.forEach(function(e){""===e.label&&(e.label="&nbsp;"),s.append(d("<li>").html(e.label+"<span>("+e.type+")</span>").data(e))}),s.removeClass("loading")})};l.find(".siteorigin-widget-autocomplete-input").click(function(){var e=l.find(".existing-content-selector");e.show();var t=new d.Deferred;e.is(":visible")&&0===e.find("ul.items li").length?t=n():t.resolve(),t.done(i)});var t=function(){l.find(".existing-content-selector").hide()};d(window).mousedown(function(e){0===l.find(e.target).length&&t()}),l.find(".button-close").click(t),l.on("click",".items li",function(e){e.preventDefault();var t=d(this),i=o(),n=t.data("value"),a=i.indexOf(n);-1<a?(i.splice(a,1),t.removeClass("selected")):(i.push(n),t.addClass("selected"));var s=l.find("input.siteorigin-widget-input");s.val(i.join(",")),s.change()});var a=null;l.find(".content-text-search").keyup(function(){null!==a&&clearTimeout(a),a=setTimeout(function(){n()},500)}),l.data("initialized",!0)}})}(jQuery);
base/inc/fields/js/code-field.min.js CHANGED
@@ -1 +1 @@
1
- (function(e){"use strict";var t=t||function(){var e={};return{add:function(t,r){if("object"==typeof t){var n;for(n=0;n<t.length;n++){var a=t[n];e[a]||(e[a]=[]),e[a].push(r)}}else e[t]||(e[t]=[]),e[t].push(r)},get:function(t){if(e[t])return e[t]}}}(),r=r||function(r){"function"!=typeof String.prototype.repeat&&(String.prototype.repeat=function(e){if(e<1)return"";if(e%2)return this.repeat(e-1)+this;var t=this.repeat(e/2);return t+t}),"function"!=typeof Array.prototype.filter&&(Array.prototype.filter=function(e){if(null===this)throw new TypeError;var t=Object(this),r=t.length>>>0;if("function"!=typeof e)throw new TypeError;for(var n=[],a=arguments[1],o=0;o<r;o++)if(o in t){var i=t[o];e.call(a,i,o,t)&&n.push(i)}return n});var n,a,o={textarea:null,replaceTab:!0,softTabs:!0,tabSize:4,autoOpen:!0,overwrite:!0,autoStrip:!0,autoIndent:!0,fence:!1},i={keyMap:[{open:'"',close:'"',canBreak:!1},{open:"'",close:"'",canBreak:!1},{open:"(",close:")",canBreak:!1},{open:"[",close:"]",canBreak:!0},{open:"{",close:"}",canBreak:!0}]},s={_callHook:function(r,n){var a=t.get(r);if(n="boolean"!=typeof n||!1!==n,a)if(n){var i,c=o.textarea,l=c.value,u=s.cursor.get();for(i=0;i<a.length;i++)a[i].call(e,{editor:{element:c,text:l,levelsDeep:s.levelsDeep()},caret:{pos:u},lines:{current:s.cursor.getLine(l,u),total:s.editor.getLines(l)}})}else for(i=0;i<a.length;i++)a[i].call(e)},defineNewLine:function(){var e=document.createElement("textarea");e.value="\n",a=2==e.value.length?"\r\n":"\n"},defineTabSize:function(e){return void 0!==o.textarea.style.OTabSize?void(o.textarea.style.OTabSize=e):void 0!==o.textarea.style.MozTabSize?void(o.textarea.style.MozTabSize=e):void 0!==o.textarea.style.tabSize?void(o.textarea.style.tabSize=e):void 0},cursor:{getLine:function(e,t){return e.substring(0,t).split("\n").length},get:function(){if("number"==typeof document.createElement("textarea").selectionStart)return o.textarea.selectionStart;if(document.selection){var e=0,t=o.textarea.createTextRange(),r=document.selection.createRange().duplicate(),n=r.getBookmark();for(t.moveToBookmark(n);0!==t.moveStart("character",-1);)e++;return e}},set:function(e,t){if(t||(t=e),o.textarea.setSelectionRange)o.textarea.focus(),o.textarea.setSelectionRange(e,t);else if(o.textarea.createTextRange){var r=o.textarea.createTextRange();r.collapse(!0),r.moveEnd("character",t),r.moveStart("character",e),r.select()}},selection:function(){var e,t,r,n,i,c=o.textarea,l=0,u=0;return"number"==typeof c.selectionStart&&"number"==typeof c.selectionEnd?(l=c.selectionStart,u=c.selectionEnd):(t=document.selection.createRange())&&t.parentElement()==c&&(e=s.editor.get(),n=e.length,r=c.createTextRange(),r.moveToBookmark(t.getBookmark()),i=c.createTextRange(),i.collapse(!1),r.compareEndPoints("StartToEnd",i)>-1?l=u=n:(l=-r.moveStart("character",-n),l+=e.slice(0,l).split(a).length-1,r.compareEndPoints("EndToEnd",i)>-1?u=n:(u=-r.moveEnd("character",-n),u+=e.slice(0,u).split(a).length-1))),l!=u&&{start:l,end:u}}},editor:{getLines:function(e){return e.split("\n").length},get:function(){return o.textarea.value.replace(/\r/g,"")},set:function(e){o.textarea.value=e}},fenceRange:function(){if("string"==typeof o.fence){for(var e=s.editor.get(),t=s.cursor.get(),r=0,n=e.indexOf(o.fence),a=0;n>=0&&(a++,!(t<n+r));)r+=n+o.fence.length,e=e.substring(n+o.fence.length),n=e.indexOf(o.fence);return r<t&&n+r>t&&a%2==0}return!0},isEven:function(e,t){return t%2},levelsDeep:function(){var e,t,r=s.cursor.get(),n=s.editor.get(),a=n.substring(0,r),o=0;for(e=0;e<a.length;e++)for(t=0;t<i.keyMap.length;t++)i.keyMap[t].canBreak&&(i.keyMap[t].open==a.charAt(e)&&o++,i.keyMap[t].close==a.charAt(e)&&o--);var c=0,l=["'",'"'];for(e=0;e<i.keyMap.length;e++)if(i.keyMap[e].canBreak)for(t in l)c+=a.split(l[t]).filter(s.isEven).join("").split(i.keyMap[e].open).length-1;var u=o-c;return u>=0?u:0},deepExtend:function(e,t){for(var r in t)t[r]&&t[r].constructor&&t[r].constructor===Object?(e[r]=e[r]||{},s.deepExtend(e[r],t[r])):e[r]=t[r];return e},addEvent:function(e,t,r){e.addEventListener?e.addEventListener(t,r,!1):e.attachEvent&&e.attachEvent("on"+t,r)},removeEvent:function(e,t,r){e.addEventListener?e.removeEventListener(t,r,!1):e.attachEvent&&e.detachEvent("on"+t,r)},preventDefaultEvent:function(e){e.preventDefault?e.preventDefault():e.returnValue=!1}},c={tabKey:function(e){if(s.fenceRange()){if(9==e.keyCode){s.preventDefaultEvent(e);var t=!0;s._callHook("tab:before");var r=s.cursor.selection(),a=s.cursor.get(),o=s.editor.get();if(r){for(var i=r.start;i--;)if("\n"==o.charAt(i)){r.start=i+1;break}var c,l=o.substring(r.start,r.end),u=l.split("\n");if(e.shiftKey){for(c=0;c<u.length;c++)u[c].substring(0,n.length)==n&&(u[c]=u[c].substring(n.length));l=u.join("\n"),s.editor.set(o.substring(0,r.start)+l+o.substring(r.end)),s.cursor.set(r.start,r.start+l.length)}else{for(c in u)u[c]=n+u[c];l=u.join("\n"),s.editor.set(o.substring(0,r.start)+l+o.substring(r.end)),s.cursor.set(r.start,r.start+l.length)}}else{var f=o.substring(0,a),d=o.substring(a),p=f+n+d;e.shiftKey?o.substring(a-n.length,a)==n&&(p=o.substring(0,a-n.length)+d,s.editor.set(p),s.cursor.set(a-n.length)):(s.editor.set(p),s.cursor.set(a+n.length),t=!1)}s._callHook("tab:after")}return t}},enterKey:function(e){if(s.fenceRange()&&13==e.keyCode){s.preventDefaultEvent(e),s._callHook("enter:before");var t,r,o=s.cursor.get(),c=s.editor.get(),l=c.substring(0,o),u=c.substring(o),f=l.charAt(l.length-1),d=u.charAt(0),p=s.levelsDeep(),g="",v="";if(p){for(;p--;)g+=n;for(g=g,t=g.length+1,r=0;r<i.keyMap.length;r++)i.keyMap[r].open==f&&i.keyMap[r].close==d&&(v=a)}else t=1;var h=l+a+g+v+g.substring(0,g.length-n.length)+u;s.editor.set(h),s.cursor.set(o+t),s._callHook("enter:after")}},deleteKey:function(e){if(s.fenceRange()&&8==e.keyCode){s.preventDefaultEvent(e),s._callHook("delete:before");var t,r=s.cursor.get(),n=s.editor.get(),a=n.substring(0,r),o=n.substring(r),c=a.charAt(a.length-1),l=o.charAt(0);if(!1===s.cursor.selection()){for(t=0;t<i.keyMap.length;t++)if(i.keyMap[t].open==c&&i.keyMap[t].close==l){var u=n.substring(0,r-1)+n.substring(r+1);return s.editor.set(u),void s.cursor.set(r-1)}var u=n.substring(0,r-1)+n.substring(r);s.editor.set(u),s.cursor.set(r-1)}else{var f=s.cursor.selection(),u=n.substring(0,f.start)+n.substring(f.end);s.editor.set(u),s.cursor.set(r)}s._callHook("delete:after")}}},l={openedChar:function(e,t){s.preventDefaultEvent(t),s._callHook("openChar:before");var r=s.cursor.get(),n=s.editor.get(),a=n.substring(0,r),i=n.substring(r),c=a+e.open+e.close+i;o.textarea.value=c,s.cursor.set(r+1),s._callHook("openChar:after")},closedChar:function(e,t){var r=s.cursor.get();return s.editor.get().substring(r,r+1)==e.close&&(s.preventDefaultEvent(t),s._callHook("closeChar:before"),s.cursor.set(s.cursor.get()+1),s._callHook("closeChar:after"),!0)}},u={filter:function(e){if(s.fenceRange()){var t=e.which||e.keyCode;if(39!=t&&(40!=t||0!==e.which)){var r,n=String.fromCharCode(t);for(r=0;r<i.keyMap.length;r++)if(i.keyMap[r].close==n){var a=o.overwrite&&l.closedChar(i.keyMap[r],e);!a&&i.keyMap[r].open==n&&o.autoOpen&&l.openedChar(i.keyMap[r],e)}else i.keyMap[r].open==n&&o.autoOpen&&l.openedChar(i.keyMap[r],e)}}},listen:function(){o.replaceTab&&s.addEvent(o.textarea,"keydown",c.tabKey),o.autoIndent&&s.addEvent(o.textarea,"keydown",c.enterKey),o.autoStrip&&s.addEvent(o.textarea,"keydown",c.deleteKey),s.addEvent(o.textarea,"keypress",u.filter),s.addEvent(o.textarea,"keydown",function(){s._callHook("keydown")}),s.addEvent(o.textarea,"keyup",function(){s._callHook("keyup")})}};this.destroy=function(){s.removeEvent(o.textarea,"keydown",c.tabKey),s.removeEvent(o.textarea,"keydown",c.enterKey),s.removeEvent(o.textarea,"keydown",c.deleteKey),s.removeEvent(o.textarea,"keypress",u.filter)},function(e){e.textarea&&(s._callHook("init:before",!1),s.deepExtend(o,e),s.defineNewLine(),o.softTabs?n=" ".repeat(o.tabSize):(n="\t",s.defineTabSize(o.tabSize)),u.listen(),s._callHook("init:after",!1))}(r)};"undefined"!=typeof module&&module.exports&&(module.exports=r),"undefined"==typeof ender&&(this.Behave=r,this.BehaveHooks=t),"function"==typeof define&&define.amd&&define("behave",[],function(){return r})}).call(this),function(e){e(document).on("sowsetupformfield",".siteorigin-widget-field-type-code",function(t){var r=e(this);new Behave({textarea:r.find(".siteorigin-widget-code-input").get(0)})})}(jQuery);
1
+ (function(l){"use strict";var a,u=u||(a={},{add:function(e,t){var r;if("object"==typeof e)for(r=0;r<e.length;r++){var n=e[r];a[n]||(a[n]=[]),a[n].push(t)}else a[e]||(a[e]=[]),a[e].push(t)},get:function(e){if(a[e])return a[e]}}),e=e||function(e){"function"!=typeof String.prototype.repeat&&(String.prototype.repeat=function(e){if(e<1)return"";if(e%2)return this.repeat(e-1)+this;var t=this.repeat(e/2);return t+t}),"function"!=typeof Array.prototype.filter&&(Array.prototype.filter=function(e){if(null===this)throw new TypeError;var t=Object(this),r=t.length>>>0;if("function"!=typeof e)throw new TypeError;for(var n=[],a=arguments[1],o=0;o<r;o++)if(o in t){var i=t[o];e.call(a,i,o,t)&&n.push(i)}return n});var g,p,t,c={textarea:null,replaceTab:!0,softTabs:!0,tabSize:4,autoOpen:!0,overwrite:!0,autoStrip:!0,autoIndent:!0,fence:!1},v={keyMap:[{open:'"',close:'"',canBreak:!1},{open:"'",close:"'",canBreak:!1},{open:"(",close:")",canBreak:!1},{open:"[",close:"]",canBreak:!0},{open:"{",close:"}",canBreak:!0}]},h={_callHook:function(e,t){var r=u.get(e);if(t="boolean"!=typeof t||!1!==t,r)if(t){var n,a=c.textarea,o=a.value,i=h.cursor.get();for(n=0;n<r.length;n++)r[n].call(l,{editor:{element:a,text:o,levelsDeep:h.levelsDeep()},caret:{pos:i},lines:{current:h.cursor.getLine(o,i),total:h.editor.getLines(o)}})}else for(n=0;n<r.length;n++)r[n].call(l)},defineNewLine:function(){var e=document.createElement("textarea");e.value="\n",p=2==e.value.length?"\r\n":"\n"},defineTabSize:function(e){void 0===c.textarea.style.OTabSize?void 0===c.textarea.style.MozTabSize?void 0===c.textarea.style.tabSize||(c.textarea.style.tabSize=e):c.textarea.style.MozTabSize=e:c.textarea.style.OTabSize=e},cursor:{getLine:function(e,t){return e.substring(0,t).split("\n").length},get:function(){if("number"==typeof document.createElement("textarea").selectionStart)return c.textarea.selectionStart;if(document.selection){var e=0,t=c.textarea.createTextRange(),r=document.selection.createRange().duplicate().getBookmark();for(t.moveToBookmark(r);0!==t.moveStart("character",-1);)e++;return e}},set:function(e,t){if(t||(t=e),c.textarea.setSelectionRange)c.textarea.focus(),c.textarea.setSelectionRange(e,t);else if(c.textarea.createTextRange){var r=c.textarea.createTextRange();r.collapse(!0),r.moveEnd("character",t),r.moveStart("character",e),r.select()}},selection:function(){var e,t,r,n,a,o=c.textarea,i=0,s=0;return"number"==typeof o.selectionStart&&"number"==typeof o.selectionEnd?(i=o.selectionStart,s=o.selectionEnd):(t=document.selection.createRange())&&t.parentElement()==o&&(n=(e=h.editor.get()).length,(r=o.createTextRange()).moveToBookmark(t.getBookmark()),(a=o.createTextRange()).collapse(!1),-1<r.compareEndPoints("StartToEnd",a)?i=s=n:(i=-r.moveStart("character",-n),i+=e.slice(0,i).split(p).length-1,-1<r.compareEndPoints("EndToEnd",a)?s=n:(s=-r.moveEnd("character",-n),s+=e.slice(0,s).split(p).length-1))),i!=s&&{start:i,end:s}}},editor:{getLines:function(e){return e.split("\n").length},get:function(){return c.textarea.value.replace(/\r/g,"")},set:function(e){c.textarea.value=e}},fenceRange:function(){if("string"!=typeof c.fence)return!0;for(var e=h.editor.get(),t=h.cursor.get(),r=0,n=e.indexOf(c.fence),a=0;0<=n&&(a++,!(t<n+r));)r+=n+c.fence.length,n=(e=e.substring(n+c.fence.length)).indexOf(c.fence);return r<t&&t<n+r&&a%2==0},isEven:function(e,t){return t%2},levelsDeep:function(){var e,t,r=h.cursor.get(),n=h.editor.get().substring(0,r),a=0;for(e=0;e<n.length;e++)for(t=0;t<v.keyMap.length;t++)v.keyMap[t].canBreak&&(v.keyMap[t].open==n.charAt(e)&&a++,v.keyMap[t].close==n.charAt(e)&&a--);var o=0,i=["'",'"'];for(e=0;e<v.keyMap.length;e++)if(v.keyMap[e].canBreak)for(t in i)o+=n.split(i[t]).filter(h.isEven).join("").split(v.keyMap[e].open).length-1;var s=a-o;return 0<=s?s:0},deepExtend:function(e,t){for(var r in t)t[r]&&t[r].constructor&&t[r].constructor===Object?(e[r]=e[r]||{},h.deepExtend(e[r],t[r])):e[r]=t[r];return e},addEvent:function(e,t,r){e.addEventListener?e.addEventListener(t,r,!1):e.attachEvent&&e.attachEvent("on"+t,r)},removeEvent:function(e,t,r){e.addEventListener?e.removeEventListener(t,r,!1):e.attachEvent&&e.detachEvent("on"+t,r)},preventDefaultEvent:function(e){e.preventDefault?e.preventDefault():e.returnValue=!1}},r=function(e){if(h.fenceRange()){if(9==e.keyCode){h.preventDefaultEvent(e);var t=!0;h._callHook("tab:before");var r=h.cursor.selection(),n=h.cursor.get(),a=h.editor.get();if(r){for(var o=r.start;o--;)if("\n"==a.charAt(o)){r.start=o+1;break}var i,s=a.substring(r.start,r.end),c=s.split("\n");if(e.shiftKey){for(i=0;i<c.length;i++)c[i].substring(0,g.length)==g&&(c[i]=c[i].substring(g.length));s=c.join("\n"),h.editor.set(a.substring(0,r.start)+s+a.substring(r.end)),h.cursor.set(r.start,r.start+s.length)}else{for(i in c)c[i]=g+c[i];s=c.join("\n"),h.editor.set(a.substring(0,r.start)+s+a.substring(r.end)),h.cursor.set(r.start,r.start+s.length)}}else{var l=a.substring(0,n),u=a.substring(n),f=l+g+u;e.shiftKey?a.substring(n-g.length,n)==g&&(f=a.substring(0,n-g.length)+u,h.editor.set(f),h.cursor.set(n-g.length)):(h.editor.set(f),h.cursor.set(n+g.length),t=!1)}h._callHook("tab:after")}return t}},n=function(e){if(h.fenceRange()&&13==e.keyCode){h.preventDefaultEvent(e),h._callHook("enter:before");var t,r,n=h.cursor.get(),a=h.editor.get(),o=a.substring(0,n),i=a.substring(n),s=o.charAt(o.length-1),c=i.charAt(0),l=h.levelsDeep(),u="",f="";if(l){for(;l--;)u+=g;for(t=(u=u).length+1,r=0;r<v.keyMap.length;r++)v.keyMap[r].open==s&&v.keyMap[r].close==c&&(f=p)}else t=1;var d=o+p+u+f+u.substring(0,u.length-g.length)+i;h.editor.set(d),h.cursor.set(n+t),h._callHook("enter:after")}},a=function(e){if(h.fenceRange()&&8==e.keyCode){h.preventDefaultEvent(e),h._callHook("delete:before");var t,r=h.cursor.get(),n=h.editor.get(),a=n.substring(0,r),o=n.substring(r),i=a.charAt(a.length-1),s=o.charAt(0);if(!1===h.cursor.selection()){for(t=0;t<v.keyMap.length;t++)if(v.keyMap[t].open==i&&v.keyMap[t].close==s){var c=n.substring(0,r-1)+n.substring(r+1);return h.editor.set(c),void h.cursor.set(r-1)}c=n.substring(0,r-1)+n.substring(r);h.editor.set(c),h.cursor.set(r-1)}else{var l=h.cursor.selection();c=n.substring(0,l.start)+n.substring(l.end);h.editor.set(c),h.cursor.set(r)}h._callHook("delete:after")}},o=function(e,t){h.preventDefaultEvent(t),h._callHook("openChar:before");var r=h.cursor.get(),n=h.editor.get(),a=n.substring(0,r),o=n.substring(r),i=a+e.open+e.close+o;c.textarea.value=i,h.cursor.set(r+1),h._callHook("openChar:after")},i=function(e,t){var r=h.cursor.get();return h.editor.get().substring(r,r+1)==e.close&&(h.preventDefaultEvent(t),h._callHook("closeChar:before"),h.cursor.set(h.cursor.get()+1),h._callHook("closeChar:after"),!0)},s={filter:function(e){if(h.fenceRange()){var t=e.which||e.keyCode;if(39!=t&&(40!=t||0!==e.which)){var r,n=String.fromCharCode(t);for(r=0;r<v.keyMap.length;r++){if(v.keyMap[r].close==n)!(c.overwrite&&i(v.keyMap[r],e))&&v.keyMap[r].open==n&&c.autoOpen&&o(v.keyMap[r],e);else v.keyMap[r].open==n&&c.autoOpen&&o(v.keyMap[r],e)}}}},listen:function(){c.replaceTab&&h.addEvent(c.textarea,"keydown",r),c.autoIndent&&h.addEvent(c.textarea,"keydown",n),c.autoStrip&&h.addEvent(c.textarea,"keydown",a),h.addEvent(c.textarea,"keypress",s.filter),h.addEvent(c.textarea,"keydown",function(){h._callHook("keydown")}),h.addEvent(c.textarea,"keyup",function(){h._callHook("keyup")})}};this.destroy=function(){h.removeEvent(c.textarea,"keydown",r),h.removeEvent(c.textarea,"keydown",n),h.removeEvent(c.textarea,"keydown",a),h.removeEvent(c.textarea,"keypress",s.filter)},(t=e).textarea&&(h._callHook("init:before",!1),h.deepExtend(c,t),h.defineNewLine(),c.softTabs?g=" ".repeat(c.tabSize):(g="\t",h.defineTabSize(c.tabSize)),s.listen(),h._callHook("init:after",!1))};"undefined"!=typeof module&&module.exports&&(module.exports=e),"undefined"==typeof ender&&(this.Behave=e,this.BehaveHooks=u),"function"==typeof define&&define.amd&&define("behave",[],function(){return e})}).call(this),function(r){r(document).on("sowsetupformfield",".siteorigin-widget-field-type-code",function(e){var t=r(this);new Behave({textarea:t.find(".siteorigin-widget-code-input").get(0)})})}(jQuery);
base/inc/fields/js/date-range-field.min.js CHANGED
@@ -1 +1 @@
1
- !function(e){e(document).on("sowsetupformfield",".siteorigin-widget-field-type-date-range",function(t){var i=e(this),a=i.find('input[type="hidden"][class="siteorigin-widget-input"]');if(!i.data("initialized")){if(i.find('[class*="sowb-specific-date"]').length>0){var n=function(e,t){var n=i.find("."+e+"-picker"),r=function(e,t){if(!isNaN(e.valueOf())){var i=e.getDate();i=i<10?"0"+i.toString():i.toString();var a=e.getMonth()+1;a=a<10?"0"+a.toString():a.toString();return e.getFullYear()+"-"+a+"-"+i}return""},l=function(e,t){var i=e.split("-"),a=parseInt(i[2]),n=parseInt(i[1])-1,r=parseInt(i[0]);return new Date(r,n,a)},s=function(t){var i=""===a.val()?{}:JSON.parse(a.val());i[e]=r(t),n.val(i[e]),a.val(JSON.stringify(i)),a.trigger("change",{silent:!0})},f=new Pikaday({field:n[0],blurFieldOnSelect:!1,toString:r,parse:l,onSelect:s});return n.change(function(e){var t=l(n.val());return s(t),e.preventDefault(),!1}),t&&n.val(t),f}.bind(this),r=""===a.val()?{after:"",before:""}:JSON.parse(a.val()),l=n("after",r.after),s=n("before",r.before);a.change(function(e,t){if(!t||!t.silent){var i=""===a.val()?{after:"",before:""}:JSON.parse(a.val());l.setDate(i.after),s.setDate(i.before)}})}else i.find(".sowb-relative-date").length>0&&i.find(".sowb-relative-date").each(function(){var t=e(this).data("name");e(this).change(function(){var i=""===a.val()?{}:JSON.parse(a.val());i.hasOwnProperty(t)||(i[t]={}),i[t].value=e(this).find("> input").val(),i[t].unit=e(this).find("> select").val(),a.val(JSON.stringify(i)),a.trigger("change",{silent:!0})}.bind(this)),a.change(function(i,n){if(!n||!n.silent){var r=""===a.val()?{from:{},to:{}}:JSON.parse(a.val());r.hasOwnProperty(t)&&(e(this).find("> input").val(r[t].value),e(this).find("> select").val(r[t].unit))}}.bind(this))});i.data("initialized",!0)}})}(jQuery);
1
+ !function(r){r(document).on("sowsetupformfield",".siteorigin-widget-field-type-date-range",function(e){var s=r(this),f=s.find('input[type="hidden"][class="siteorigin-widget-input"]');if(!s.data("initialized")){if(0<s.find('[class*="sowb-specific-date"]').length){var t=function(i,e){var a=s.find("."+i+"-picker"),n=function(e,t){if(isNaN(e.valueOf()))return"";var i=e.getDate();i=i<10?"0"+i.toString():i.toString();var a=e.getMonth()+1;return a=a<10?"0"+a.toString():a.toString(),e.getFullYear()+"-"+a+"-"+i},r=function(e,t){var i=e.split("-"),a=parseInt(i[2]),n=parseInt(i[1])-1,r=parseInt(i[0]);return new Date(r,n,a)},l=function(e){var t=""===f.val()?{}:JSON.parse(f.val());t[i]=n(e),a.val(t[i]),f.val(JSON.stringify(t)),f.trigger("change",{silent:!0})},t=new Pikaday({field:a[0],blurFieldOnSelect:!1,toString:n,parse:r,onSelect:l});return a.change(function(e){var t=r(a.val());return l(t),e.preventDefault(),!1}),e&&a.val(e),t}.bind(this),i=""===f.val()?{after:"",before:""}:JSON.parse(f.val()),a=t("after",i.after),n=t("before",i.before);f.change(function(e,t){if(!t||!t.silent){var i=""===f.val()?{after:"",before:""}:JSON.parse(f.val());a.setDate(i.after),n.setDate(i.before)}})}else 0<s.find(".sowb-relative-date").length&&s.find(".sowb-relative-date").each(function(){var a=r(this).data("name");r(this).change(function(){var e=""===f.val()?{}:JSON.parse(f.val());e.hasOwnProperty(a)||(e[a]={}),e[a].value=r(this).find("> input").val(),e[a].unit=r(this).find("> select").val(),f.val(JSON.stringify(e)),f.trigger("change",{silent:!0})}.bind(this)),f.change(function(e,t){if(!t||!t.silent){var i=""===f.val()?{from:{},to:{}}:JSON.parse(f.val());i.hasOwnProperty(a)&&(r(this).find("> input").val(i[a].value),r(this).find("> select").val(i[a].unit))}}.bind(this))});s.data("initialized",!0)}})}(jQuery);
base/inc/fields/js/icon-field.js CHANGED
@@ -1,183 +1,183 @@
1
- /* global jQuery, soWidgets */
2
-
3
- ( function( $ ) {
4
-
5
- var iconWidgetCache = {};
6
-
7
- $(document).on( 'sowsetupformfield', '.siteorigin-widget-field-type-icon', function(e) {
8
- var $ = $(this),
9
- $is = $.find('.siteorigin-widget-icon-selector'),
10
- $v = $is.find('.siteorigin-widget-icon-icon'),
11
- $b = $.find('.siteorigin-widget-icon-selector-current'),
12
- $remove = $.find( '.so-icon-remove' ),
13
- $search = $.find( '.siteorigin-widget-icon-search' );
14
-
15
- if ( $.data( 'initialized' ) ) {
16
- return;
17
- }
18
-
19
- // Clicking on the button should display the icon selector
20
- $b.click( function(){
21
- $is.slideToggle();
22
- $search.val( '' );
23
- searchIcons();
24
- } );
25
-
26
- // Clicking on the remove button
27
- $remove.click( function( e ){
28
- e.preventDefault();
29
-
30
- // Trigger a click on the existing icon to remove it.
31
- $.find('.siteorigin-widget-active').click();
32
- } );
33
-
34
- var searchIcons = function(){
35
- var q = $search.val().toLowerCase();
36
- if( q === '' ) {
37
- $is.find('.siteorigin-widget-icon-icons-icon').show();
38
- }
39
- else {
40
- $is.find('.siteorigin-widget-icon-icons-icon').each( function(){
41
- var $ = $( this ),
42
- value = $.attr( 'data-value' );
43
-
44
- value = value.replace( /-/, ' ' );
45
- if( value.indexOf( q ) === -1 ) {
46
- $.hide();
47
- }
48
- else {
49
- $.show();
50
- }
51
- } );
52
- }
53
- };
54
-
55
- $search.keyup( searchIcons ).change( searchIcons );
56
-
57
- var rerenderIcons = function() {
58
- var family = $is.find('select.siteorigin-widget-icon-family').val();
59
- var container = $is.find('.siteorigin-widget-icon-icons');
60
-
61
- if(typeof iconWidgetCache[family] === 'undefined') {
62
- return;
63
- }
64
-
65
- container.empty();
66
-
67
- if( $('#'+'siteorigin-widget-font-'+family).length === 0) {
68
-
69
- $("<link rel='stylesheet' type='text/css'>")
70
- .attr('id', 'siteorigin-widget-font-' + family)
71
- .attr('href', iconWidgetCache[family].style_uri)
72
- .appendTo('head');
73
- }
74
-
75
- for ( var i in iconWidgetCache[family].icons ) {
76
-
77
- var icon = $('<div data-sow-icon="' + iconWidgetCache[family].icons[i] + '"/>')
78
- .attr('data-value', family + '-' + i)
79
- .addClass( 'sow-icon-' + family )
80
- .addClass( 'siteorigin-widget-icon-icons-icon' )
81
- .click(function(){
82
- var $ = $(this);
83
-
84
- if( $.hasClass('siteorigin-widget-active') ) {
85
- // This is being unselected
86
- $.removeClass('siteorigin-widget-active');
87
- $v.val( '' );
88
-
89
- // Hide the button icon
90
- $b.find('span').hide();
91
-
92
- $remove.hide();
93
- }
94
- else {
95
- // This is being selected
96
- container.find('.siteorigin-widget-icon-icons-icon').removeClass('siteorigin-widget-active');
97
- $.addClass('siteorigin-widget-active');
98
- $v.val( $.data('value') );
99
-
100
- // Also add this to the button
101
- $b.find('span')
102
- .show()
103
- .attr( 'data-sow-icon', $.attr('data-sow-icon') )
104
- .attr( 'class', '' )
105
- .addClass( 'sow-icon-' + family );
106
-
107
- $remove.show();
108
- }
109
-
110
- $v.trigger( 'change', { isRendering: true });
111
-
112
- // Hide the icon selector
113
- $is.slideUp();
114
- });
115
-
116
- container.append(icon);
117
-
118
- if( $v.val() === family + '-' + i ) {
119
- // Add selected icon to the button.
120
- $b.find('span')
121
- .show()
122
- .attr( 'data-sow-icon', icon.attr('data-sow-icon') )
123
- .attr( 'class', '' )
124
- .addClass( 'sow-icon-' + family );
125
- icon.addClass('siteorigin-widget-active');
126
- }
127
- }
128
-
129
- // Move a selected item to the first position
130
- container.prepend( container.find('.siteorigin-widget-active') );
131
-
132
- searchIcons();
133
- };
134
-
135
- // Create the function for changing the icon family and call it once
136
- var changeIconFamily = function(){
137
- // Fetch the family icons from the server
138
- var family = $is.find('select.siteorigin-widget-icon-family').val();
139
-
140
- var dataIcons = $is.find('select.siteorigin-widget-icon-family option:selected' ).data('icons');
141
- if( dataIcons !== null ) {
142
- iconWidgetCache[family] = dataIcons;
143
- }
144
-
145
-
146
- if(typeof family === 'undefined' || family === '') {
147
- return;
148
- }
149
-
150
- if(typeof iconWidgetCache[family] === 'undefined') {
151
- $.getJSON(
152
- soWidgets.ajaxurl,
153
- {
154
- 'action' : 'siteorigin_widgets_get_icons',
155
- 'family' : $is.find('select.siteorigin-widget-icon-family').val()
156
- },
157
- function(data) {
158
- iconWidgetCache[family] = data;
159
- rerenderIcons();
160
- }
161
- );
162
- }
163
- else {
164
- rerenderIcons();
165
- }
166
- };
167
- changeIconFamily();
168
-
169
- $is.find('select.siteorigin-widget-icon-family').change(function(){
170
- $is.find('.siteorigin-widget-icon-icons').empty();
171
- changeIconFamily();
172
- });
173
-
174
- $v.change( function ( event, data ) {
175
- if ( ! ( data && data.isRendering ) ) {
176
- rerenderIcons();
177
- }
178
- } );
179
-
180
- $.data( 'initialized', true );
181
- } );
182
-
183
- } )( jQuery );
1
+ /* global jQuery, soWidgets */
2
+
3
+ ( function( $ ) {
4
+
5
+ var iconWidgetCache = {};
6
+
7
+ $(document).on( 'sowsetupformfield', '.siteorigin-widget-field-type-icon', function(e) {
8
+ var $ = $(this),
9
+ $is = $.find('.siteorigin-widget-icon-selector'),
10
+ $v = $is.find('.siteorigin-widget-icon-icon'),
11
+ $b = $.find('.siteorigin-widget-icon-selector-current'),
12
+ $remove = $.find( '.so-icon-remove' ),
13
+ $search = $.find( '.siteorigin-widget-icon-search' );
14
+
15
+ if ( $.data( 'initialized' ) ) {
16
+ return;
17
+ }
18
+
19
+ // Clicking on the button should display the icon selector
20
+ $b.click( function(){
21
+ $is.slideToggle();
22
+ $search.val( '' );
23
+ searchIcons();
24
+ } );
25
+
26
+ // Clicking on the remove button
27
+ $remove.click( function( e ){
28
+ e.preventDefault();
29
+
30
+ // Trigger a click on the existing icon to remove it.
31
+ $.find('.siteorigin-widget-active').click();
32
+ } );
33
+
34
+ var searchIcons = function(){
35
+ var q = $search.val().toLowerCase();
36
+ if( q === '' ) {
37
+ $is.find('.siteorigin-widget-icon-icons-icon').show();
38
+ }
39
+ else {
40
+ $is.find('.siteorigin-widget-icon-icons-icon').each( function(){
41
+ var $ = $( this ),
42
+ value = $.attr( 'data-value' );
43
+
44
+ value = value.replace( /-/, ' ' );
45
+ if( value.indexOf( q ) === -1 ) {
46
+ $.hide();
47
+ }
48
+ else {
49
+ $.show();
50
+ }
51
+ } );
52
+ }
53
+ };
54
+
55
+ $search.keyup( searchIcons ).change( searchIcons );
56
+
57
+ var rerenderIcons = function() {
58
+ var family = $is.find('select.siteorigin-widget-icon-family').val();
59
+ var container = $is.find('.siteorigin-widget-icon-icons');
60
+
61
+ if(typeof iconWidgetCache[family] === 'undefined') {
62
+ return;
63
+ }
64
+
65
+ container.empty();
66
+
67
+ if( $('#'+'siteorigin-widget-font-'+family).length === 0) {
68
+
69
+ $("<link rel='stylesheet' type='text/css'>")
70
+ .attr('id', 'siteorigin-widget-font-' + family)
71
+ .attr('href', iconWidgetCache[family].style_uri)
72
+ .appendTo('head');
73
+ }
74
+
75
+ for ( var i in iconWidgetCache[family].icons ) {
76
+
77
+ var icon = $('<div data-sow-icon="' + iconWidgetCache[family].icons[i] + '"/>')
78
+ .attr('data-value', family + '-' + i)
79
+ .addClass( 'sow-icon-' + family )
80
+ .addClass( 'siteorigin-widget-icon-icons-icon' )
81
+ .click(function(){
82
+ var $ = $(this);
83
+
84
+ if( $.hasClass('siteorigin-widget-active') ) {
85
+ // This is being unselected
86
+ $.removeClass('siteorigin-widget-active');
87
+ $v.val( '' );
88
+
89
+ // Hide the button icon
90
+ $b.find('span').hide();
91
+
92
+ $remove.hide();
93
+ }
94
+ else {
95
+ // This is being selected
96
+ container.find('.siteorigin-widget-icon-icons-icon').removeClass('siteorigin-widget-active');
97
+ $.addClass('siteorigin-widget-active');
98
+ $v.val( $.data('value') );
99
+
100
+ // Also add this to the button
101
+ $b.find('span')
102
+ .show()
103
+ .attr( 'data-sow-icon', $.attr('data-sow-icon') )
104
+ .attr( 'class', '' )
105
+ .addClass( 'sow-icon-' + family );
106
+
107
+ $remove.show();
108
+ }
109
+
110
+ $v.trigger( 'change', { isRendering: true });
111
+
112
+ // Hide the icon selector
113
+ $is.slideUp();
114
+ });
115
+
116
+ container.append(icon);
117
+
118
+ if( $v.val() === family + '-' + i ) {
119
+ // Add selected icon to the button.
120
+ $b.find('span')
121
+ .show()
122
+ .attr( 'data-sow-icon', icon.attr('data-sow-icon') )
123
+ .attr( 'class', '' )
124
+ .addClass( 'sow-icon-' + family );
125
+ icon.addClass('siteorigin-widget-active');
126
+ }
127
+ }
128
+
129
+ // Move a selected item to the first position
130
+ container.prepend( container.find('.siteorigin-widget-active') );
131
+
132
+ searchIcons();
133
+ };
134
+
135
+ // Create the function for changing the icon family and call it once
136
+ var changeIconFamily = function(){
137
+ // Fetch the family icons from the server
138
+ var family = $is.find('select.siteorigin-widget-icon-family').val();
139
+
140
+ var dataIcons = $is.find('select.siteorigin-widget-icon-family option:selected' ).data('icons');
141
+ if( dataIcons !== null ) {
142
+ iconWidgetCache[family] = dataIcons;
143
+ }
144
+
145
+
146
+ if(typeof family === 'undefined' || family === '') {
147
+ return;
148
+ }
149
+
150
+ if(typeof iconWidgetCache[family] === 'undefined') {
151
+ $.getJSON(
152
+ soWidgets.ajaxurl,
153
+ {
154
+ 'action' : 'siteorigin_widgets_get_icons',
155
+ 'family' : $is.find('select.siteorigin-widget-icon-family').val()
156
+ },
157
+ function(data) {
158
+ iconWidgetCache[family] = data;
159
+ rerenderIcons();
160
+ }
161
+ );
162
+ }
163
+ else {
164
+ rerenderIcons();
165
+ }
166
+ };
167
+ changeIconFamily();
168
+
169
+ $is.find('select.siteorigin-widget-icon-family').change(function(){
170
+ $is.find('.siteorigin-widget-icon-icons').empty();
171
+ changeIconFamily();
172
+ });
173
+
174
+ $v.change( function ( event, data ) {
175
+ if ( ! ( data && data.isRendering ) ) {
176
+ rerenderIcons();
177
+ }
178
+ } );
179
+
180
+ $.data( 'initialized', true );
181
+ } );
182
+
183
+ } )( jQuery );
base/inc/fields/js/icon-field.min.js CHANGED
@@ -1 +1 @@
1
- !function(i){var e={};i(document).on("sowsetupformfield",".siteorigin-widget-field-type-icon",function(n){var t=i(this),o=t.find(".siteorigin-widget-icon-selector"),a=o.find(".siteorigin-widget-icon-icon"),s=t.find(".siteorigin-widget-icon-selector-current"),d=t.find(".so-icon-remove"),c=t.find(".siteorigin-widget-icon-search");if(!t.data("initialized")){s.click(function(){o.slideToggle(),c.val(""),r()}),d.click(function(i){i.preventDefault(),t.find(".siteorigin-widget-active").click()});var r=function(){var e=c.val().toLowerCase();""===e?o.find(".siteorigin-widget-icon-icons-icon").show():o.find(".siteorigin-widget-icon-icons-icon").each(function(){var n=i(this),t=n.attr("data-value");t=t.replace(/-/," "),-1===t.indexOf(e)?n.hide():n.show()})};c.keyup(r).change(r);var g=function(){var n=o.find("select.siteorigin-widget-icon-family").val(),t=o.find(".siteorigin-widget-icon-icons");if(void 0!==e[n]){t.empty(),0===i("#siteorigin-widget-font-"+n).length&&i("<link rel='stylesheet' type='text/css'>").attr("id","siteorigin-widget-font-"+n).attr("href",e[n].style_uri).appendTo("head");for(var c in e[n].icons){var g=i('<div data-sow-icon="'+e[n].icons[c]+'"/>').attr("data-value",n+"-"+c).addClass("sow-icon-"+n).addClass("siteorigin-widget-icon-icons-icon").click(function(){var e=i(this);e.hasClass("siteorigin-widget-active")?(e.removeClass("siteorigin-widget-active"),a.val(""),s.find("span").hide(),d.hide()):(t.find(".siteorigin-widget-icon-icons-icon").removeClass("siteorigin-widget-active"),e.addClass("siteorigin-widget-active"),a.val(e.data("value")),s.find("span").show().attr("data-sow-icon",e.attr("data-sow-icon")).attr("class","").addClass("sow-icon-"+n),d.show()),a.trigger("change",{isRendering:!0}),o.slideUp()});t.append(g),a.val()===n+"-"+c&&(s.find("span").show().attr("data-sow-icon",g.attr("data-sow-icon")).attr("class","").addClass("sow-icon-"+n),g.addClass("siteorigin-widget-active"))}t.prepend(t.find(".siteorigin-widget-active")),r()}},l=function(){var n=o.find("select.siteorigin-widget-icon-family").val(),t=o.find("select.siteorigin-widget-icon-family option:selected").data("icons");null!==t&&(e[n]=t),void 0!==n&&""!==n&&(void 0===e[n]?i.getJSON(soWidgets.ajaxurl,{action:"siteorigin_widgets_get_icons",family:o.find("select.siteorigin-widget-icon-family").val()},function(i){e[n]=i,g()}):g())};l(),o.find("select.siteorigin-widget-icon-family").change(function(){o.find(".siteorigin-widget-icon-icons").empty(),l()}),a.change(function(i,e){e&&e.isRendering||g()}),t.data("initialized",!0)}})}(jQuery);
1
+ !function(g){var l={};g(document).on("sowsetupformfield",".siteorigin-widget-field-type-icon",function(i){var e=g(this),o=e.find(".siteorigin-widget-icon-selector"),a=o.find(".siteorigin-widget-icon-icon"),s=e.find(".siteorigin-widget-icon-selector-current"),d=e.find(".so-icon-remove"),t=e.find(".siteorigin-widget-icon-search");if(!e.data("initialized")){s.click(function(){o.slideToggle(),t.val(""),c()}),d.click(function(i){i.preventDefault(),e.find(".siteorigin-widget-active").click()});var c=function(){var n=t.val().toLowerCase();""===n?o.find(".siteorigin-widget-icon-icons-icon").show():o.find(".siteorigin-widget-icon-icons-icon").each(function(){var i=g(this),e=i.attr("data-value");-1===(e=e.replace(/-/," ")).indexOf(n)?i.hide():i.show()})};t.keyup(c).change(c);var n=function(){var e=o.find("select.siteorigin-widget-icon-family").val(),n=o.find(".siteorigin-widget-icon-icons");if(void 0!==l[e]){for(var i in n.empty(),0===g("#siteorigin-widget-font-"+e).length&&g("<link rel='stylesheet' type='text/css'>").attr("id","siteorigin-widget-font-"+e).attr("href",l[e].style_uri).appendTo("head"),l[e].icons){var t=g('<div data-sow-icon="'+l[e].icons[i]+'"/>').attr("data-value",e+"-"+i).addClass("sow-icon-"+e).addClass("siteorigin-widget-icon-icons-icon").click(function(){var i=g(this);i.hasClass("siteorigin-widget-active")?(i.removeClass("siteorigin-widget-active"),a.val(""),s.find("span").hide(),d.hide()):(n.find(".siteorigin-widget-icon-icons-icon").removeClass("siteorigin-widget-active"),i.addClass("siteorigin-widget-active"),a.val(i.data("value")),s.find("span").show().attr("data-sow-icon",i.attr("data-sow-icon")).attr("class","").addClass("sow-icon-"+e),d.show()),a.trigger("change",{isRendering:!0}),o.slideUp()});n.append(t),a.val()===e+"-"+i&&(s.find("span").show().attr("data-sow-icon",t.attr("data-sow-icon")).attr("class","").addClass("sow-icon-"+e),t.addClass("siteorigin-widget-active"))}n.prepend(n.find(".siteorigin-widget-active")),c()}},r=function(){var e=o.find("select.siteorigin-widget-icon-family").val(),i=o.find("select.siteorigin-widget-icon-family option:selected").data("icons");null!==i&&(l[e]=i),void 0!==e&&""!==e&&(void 0===l[e]?g.getJSON(soWidgets.ajaxurl,{action:"siteorigin_widgets_get_icons",family:o.find("select.siteorigin-widget-icon-family").val()},function(i){l[e]=i,n()}):n())};r(),o.find("select.siteorigin-widget-icon-family").change(function(){o.find(".siteorigin-widget-icon-icons").empty(),r()}),a.change(function(i,e){e&&e.isRendering||n()}),e.data("initialized",!0)}})}(jQuery);
base/inc/fields/js/media-field.min.js CHANGED
@@ -1 +1 @@
1
- !function(e){e(document).on("sowsetupformfield",".siteorigin-widget-field-type-media",function(t){var i=e(this),a=i.find("> .media-field-wrapper"),s=i.find(".siteorigin-widget-input").not(".media-fallback-external");if(!a.data("initialized")){a.find(".media-upload-button").click(function(t){if(t.preventDefault(),void 0!==wp.media){var a=e(this),n=e(this).data("frame");if(n)return n.open(),!1;n=wp.media({title:a.data("choose"),library:{type:a.data("library").split(",").map(function(e){return e.trim()})},button:{text:a.data("update"),close:!1}}),a.data("frame",n),n.on("select",function(){var e=n.state().get("selection").first().attributes;i.find(".current .title").html(e.title),s.val(e.id),s.trigger("change",{silent:!0});var t=i.find(".current .thumbnail");void 0!==e.sizes?void 0!==e.sizes.thumbnail?t.attr("src",e.sizes.thumbnail.url).fadeIn():t.attr("src",e.sizes.full.url).fadeIn():t.attr("src",e.icon).fadeIn(),i.find(".media-remove-button").removeClass("remove-hide"),n.close()}),n.open()}}),a.find(".current").mouseenter(function(){var t=e(this).find(".title");""!==t.html()&&t.fadeIn("fast")}).mouseleave(function(){e(this).find(".title").clearQueue().fadeOut("fast")}),i.find("a.media-remove-button").click(function(t){t.preventDefault(),i.find(".current .title").html(""),s.val(""),s.trigger("change",{silent:!0}),i.find(".current .thumbnail").fadeOut("fast"),e(this).addClass("remove-hide")});var n,r=function(){if(n){var e=n.find(".so-widgets-image-results");if(0!==e.length){var t=e.width(),i=Math.floor(t/276),a=t-276*i,s=a/i+260;e.find(".so-widgets-result-image").css({width:s,height:s/1.4})}}};e(window).resize(r);var o=function(){if(!n){n=e(e("#so-widgets-bundle-tpl-image-search-dialog").html().trim()).appendTo("body"),n.find(".close").click(function(){n.hide()});var t=n.find(".so-widgets-image-results"),a=function(i,a){n.find(".so-widgets-results-loading").fadeIn("fast"),n.find(".so-widgets-results-loading strong").html(n.find(".so-widgets-results-loading strong").data("loading")),n.find(".so-widgets-results-more").hide(),e.get(ajaxurl,{action:"so_widgets_image_search",q:i,page:a,_sononce:n.find('input[name="_sononce"]').val()},function(s){if(s.error)return void alert(s.message);t.removeClass("so-loading"),e.each(s.items,function(i,a){var s=e(e("#so-widgets-bundle-tpl-image-search-result").html().trim()).appendTo(t).addClass("source-"+a.source),n=s.find(".so-widgets-result-image");n.css("background-image","url("+a.thumbnail+")"),n.data("thumbnail",a.thumbnail),n.data("preview",a.preview),a.url&&n.attr({href:a.url,target:"_blank"}),a.full_url&&(n.data({full_url:a.full_url,import_signature:a.import_signature}),n.attr("href",a.full_url)),"shutterstock"===a.source&&n.append(e("#so-widgets-bundle-tpl-image-search-result-sponsored").html())}),1===a&&(n.find("#so-widgets-image-search-suggestions ul").empty(),e.each(s.keywords,function(t,i){n.find("#so-widgets-image-search-suggestions").show(),n.find("#so-widgets-image-search-suggestions ul").append(e("<li></li>").append(e('<a href="#"></a>').html(i).data("keyword",i)))})),n.find(".so-widgets-results-loading").fadeOut("fast"),r(),n.find(".so-widgets-results-more").show().find("button").data({query:i,page:a+1})})};n.find("#so-widgets-image-search-form").submit(function(e){e.preventDefault();var i=n.find(".so-widgets-search-input").val();t.empty(),""!==i&&a(i,1)}),n.on("click",".so-keywords-list a",function(t){t.preventDefault();var i=e(this).blur();n.find(".so-widgets-search-input").val(i.data("keyword")),n.find("#so-widgets-image-search-form").submit()}),n.find(".so-widgets-results-more button").click(function(){var t=e(this);a(t.data("query"),t.data("page"))});var o;n.on("click",".so-widgets-result-image",function(t){var a=e(this);if(a.data("full_url")&&(t.preventDefault(),confirm(n.data("confirm-import")))){n.addClass("so-widgets-importing");var r=e("#post_ID").val();null===r&&(r=""),e.get(ajaxurl,{action:"so_widgets_image_import",full_url:a.data("full_url"),import_signature:a.data("import_signature"),post_id:r,_sononce:n.find('input[name="_sononce"]').val()},function(e){n.find("#so-widgets-image-search-frame").removeClass("so-widgets-importing"),!1===e.error?(n.hide(),n.find(".so-widgets-results-loading").hide(),s.val(e.attachment_id).trigger("change",{silent:!0}),i.find(".current .thumbnail").attr("src",e.thumb).fadeIn(),i.find(".media-remove-button").removeClass("remove-hide")):(alert(e.message),n.find(".so-widgets-results-loading").hide())}),n.find(".so-widgets-results-loading").fadeIn("fast"),n.find(".so-widgets-results-loading strong").html(n.find(".so-widgets-results-loading strong").data("importing")),n.find(".so-widgets-results-more").hide(),n.find("#so-widgets-image-search-frame").addClass("so-widgets-importing")}});var d=n.find(".so-widgets-preview-window");n.on("mouseenter",".so-widgets-result-image",function(){var t=e(this),i=t.data("preview");clearTimeout(o),o=setTimeout(function(){var a=1,s=1;i[1]>.33*e(window).outerWidth()&&(a=.33*e(window).outerWidth()/i[1]),i[2]>.5*e(window).outerHeight()&&(s=.5*e(window).outerHeight()/i[2]);var r=Math.min(a,s);r>1&&(r=1),d.show().find(".so-widgets-preview-window-inside").css({"background-image":"url("+t.data("thumbnail")+")",width:i[1]*r,height:i[2]*r}).append(e("<img />").attr("src",i[0])),n.trigger("mousemove")},1e3)}).on("mouseleave",".so-widgets-result-image",function(){d.hide().find("img").remove(),clearTimeout(o)});var l,u;n.on("mousemove",function(t){if(t.clientX&&(l=t.clientX),t.clientY&&(u=t.clientY),d.is(":visible")){var i=d.outerHeight(),a=d.outerWidth(),s=e(window).outerHeight(),n=e(window).outerWidth(),r=u-i/2;r=Math.max(r,10),r=Math.min(r,s-10-i);var o=l<n/2?l+15:l-15-a;d.css({top:r,left:o})}})}n.show(),n.find(".so-widgets-search-input").focus()};a.find(".find-image-button").click(function(e){e.preventDefault(),o()}),s.change(function(e,t){if(!t||!t.silent){var a=s.val();if(a){var n=i.find(".current .thumbnail"),r=wp.media.attachment(a);r.fetch().done(function(){if(r.has("sizes")){var e=r.get("sizes");void 0!==e.thumbnail?n.attr("src",e.thumbnail.url).fadeIn():n.attr("src",e.full.url).fadeIn()}else n.attr("src",r.get("icon")).fadeIn();i.find(".media-remove-button").removeClass("remove-hide")})}else i.find("a.media-remove-button").click()}}),a.data("initialized",!0)}})}(jQuery);
1
+ !function(f){f(document).on("sowsetupformfield",".siteorigin-widget-field-type-media",function(e){var n=f(this),t=n.find("> .media-field-wrapper"),r=n.find(".siteorigin-widget-input").not(".media-fallback-external");if(!t.data("initialized")){var u;t.find(".media-upload-button").click(function(e){if(e.preventDefault(),void 0!==wp.media){var t=f(this),i=f(this).data("frame");if(i)return i.open(),!1;i=wp.media({title:t.data("choose"),library:{type:t.data("library").split(",").map(function(e){return e.trim()})},button:{text:t.data("update"),close:!1}}),t.data("frame",i),i.on("select",function(){var e=i.state().get("selection").first().attributes;n.find(".current .title").html(e.title),r.val(e.id),r.trigger("change",{silent:!0});var t=n.find(".current .thumbnail");void 0!==e.sizes?void 0!==e.sizes.thumbnail?t.attr("src",e.sizes.thumbnail.url).fadeIn():t.attr("src",e.sizes.full.url).fadeIn():t.attr("src",e.icon).fadeIn(),n.find(".media-remove-button").removeClass("remove-hide"),i.close()}),i.open()}}),t.find(".current").mouseenter(function(){var e=f(this).find(".title");""!==e.html()&&e.fadeIn("fast")}).mouseleave(function(){f(this).find(".title").clearQueue().fadeOut("fast")}),n.find("a.media-remove-button").click(function(e){e.preventDefault(),n.find(".current .title").html(""),r.val(""),r.trigger("change",{silent:!0}),n.find(".current .thumbnail").fadeOut("fast"),f(this).addClass("remove-hide")});var s=function(){if(u){var e=u.find(".so-widgets-image-results");if(0!==e.length){var t=e.width(),i=Math.floor(t/276),a=(t-276*i)/i+260;e.find(".so-widgets-result-image").css({width:a,height:a/1.4})}}};f(window).resize(s);t.find(".find-image-button").click(function(e){e.preventDefault(),function(){if(!u){(u=f(f("#so-widgets-bundle-tpl-image-search-dialog").html().trim()).appendTo("body")).find(".close").click(function(){u.hide()});var e,a=u.find(".so-widgets-image-results"),i=function(t,i){u.find(".so-widgets-results-loading").fadeIn("fast"),u.find(".so-widgets-results-loading strong").html(u.find(".so-widgets-results-loading strong").data("loading")),u.find(".so-widgets-results-more").hide(),f.get(ajaxurl,{action:"so_widgets_image_search",q:t,page:i,_sononce:u.find('input[name="_sononce"]').val()},function(e){e.error?alert(e.message):(a.removeClass("so-loading"),f.each(e.items,function(e,t){var i=f(f("#so-widgets-bundle-tpl-image-search-result").html().trim()).appendTo(a).addClass("source-"+t.source).find(".so-widgets-result-image");i.css("background-image","url("+t.thumbnail+")"),i.data("thumbnail",t.thumbnail),i.data("preview",t.preview),t.url&&i.attr({href:t.url,target:"_blank"}),t.full_url&&(i.data({full_url:t.full_url,import_signature:t.import_signature}),i.attr("href",t.full_url)),"shutterstock"===t.source&&i.append(f("#so-widgets-bundle-tpl-image-search-result-sponsored").html())}),1===i&&(u.find("#so-widgets-image-search-suggestions ul").empty(),f.each(e.keywords,function(e,t){u.find("#so-widgets-image-search-suggestions").show(),u.find("#so-widgets-image-search-suggestions ul").append(f("<li></li>").append(f('<a href="#"></a>').html(t).data("keyword",t)))})),u.find(".so-widgets-results-loading").fadeOut("fast"),s(),u.find(".so-widgets-results-more").show().find("button").data({query:t,page:i+1}))})};u.find("#so-widgets-image-search-form").submit(function(e){e.preventDefault();var t=u.find(".so-widgets-search-input").val();a.empty(),""!==t&&i(t,1)}),u.on("click",".so-keywords-list a",function(e){e.preventDefault();var t=f(this).blur();u.find(".so-widgets-search-input").val(t.data("keyword")),u.find("#so-widgets-image-search-form").submit()}),u.find(".so-widgets-results-more button").click(function(){var e=f(this);i(e.data("query"),e.data("page"))}),u.on("click",".so-widgets-result-image",function(e){var t=f(this);if(t.data("full_url")&&(e.preventDefault(),confirm(u.data("confirm-import")))){u.addClass("so-widgets-importing");var i=f("#post_ID").val();null===i&&(i=""),f.get(ajaxurl,{action:"so_widgets_image_import",full_url:t.data("full_url"),import_signature:t.data("import_signature"),post_id:i,_sononce:u.find('input[name="_sononce"]').val()},function(e){u.find("#so-widgets-image-search-frame").removeClass("so-widgets-importing"),!1===e.error?(u.hide(),u.find(".so-widgets-results-loading").hide(),r.val(e.attachment_id).trigger("change",{silent:!0}),n.find(".current .thumbnail").attr("src",e.thumb).fadeIn(),n.find(".media-remove-button").removeClass("remove-hide")):(alert(e.message),u.find(".so-widgets-results-loading").hide())}),u.find(".so-widgets-results-loading").fadeIn("fast"),u.find(".so-widgets-results-loading strong").html(u.find(".so-widgets-results-loading strong").data("importing")),u.find(".so-widgets-results-more").hide(),u.find("#so-widgets-image-search-frame").addClass("so-widgets-importing")}});var o,d,l=u.find(".so-widgets-preview-window");u.on("mouseenter",".so-widgets-result-image",function(){var a=f(this),s=a.data("preview");clearTimeout(e),e=setTimeout(function(){var e=1,t=1;s[1]>.33*f(window).outerWidth()&&(e=.33*f(window).outerWidth()/s[1]),s[2]>.5*f(window).outerHeight()&&(t=.5*f(window).outerHeight()/s[2]);var i=Math.min(e,t);1<i&&(i=1),l.show().find(".so-widgets-preview-window-inside").css({"background-image":"url("+a.data("thumbnail")+")",width:s[1]*i,height:s[2]*i}).append(f("<img />").attr("src",s[0])),u.trigger("mousemove")},1e3)}).on("mouseleave",".so-widgets-result-image",function(){l.hide().find("img").remove(),clearTimeout(e)}),u.on("mousemove",function(e){if(e.clientX&&(o=e.clientX),e.clientY&&(d=e.clientY),l.is(":visible")){var t=l.outerHeight(),i=l.outerWidth(),a=f(window).outerHeight(),s=f(window).outerWidth(),n=d-t/2;n=Math.max(n,10),n=Math.min(n,a-10-t);var r=o<s/2?o+15:o-15-i;l.css({top:n,left:r})}})}u.show(),u.find(".so-widgets-search-input").focus()}()}),r.change(function(e,t){if(!t||!t.silent){var i=r.val();if(i){var a=n.find(".current .thumbnail"),s=wp.media.attachment(i);s.fetch().done(function(){if(s.has("sizes")){var e=s.get("sizes");void 0!==e.thumbnail?a.attr("src",e.thumbnail.url).fadeIn():a.attr("src",e.full.url).fadeIn()}else a.attr("src",s.get("icon")).fadeIn();n.find(".media-remove-button").removeClass("remove-hide")})}else n.find("a.media-remove-button").click()}}),t.data("initialized",!0)}})}(jQuery);
base/inc/fields/js/multi-measurement-field.min.js CHANGED
@@ -1 +1 @@
1
- !function(t){t(document).on("sowsetupformfield",".siteorigin-widget-field-type-multi-measurement",function(i){var e=t(this).find('input[type="hidden"][class="siteorigin-widget-input"]'),n=e.data("separator"),a=e.data("autofill"),l=""===e.val()?[]:e.val().split(n),u=t(this).find(".sow-multi-measurement-input"),s=t(this).find(".sow-multi-measurement-input-container"),r=function(t){var i=""===e.val()?[]:e.val().split(n),a=t.find("+ .sow-multi-measurement-select-unit");i[u.index(t)]=t.val()+(""===t.val()?"":a.val()),e.val(i.join(n))};u.each(function(i,e){if(l.length>i){var n=l[i].match(/(\d+\.?\d*)([a-z%]+)*/);if(n&&n.length){var a=n[1],u=n[2];t(e).val(a),t(e).find("+ .sow-multi-measurement-select-unit").val(u)}}else r(t(e))}),s.change(function(i){var e=t(i.currentTarget).find("> .sow-multi-measurement-input"),n=a;a&&u.each(function(i,a){t(a).attr("id")!==e.eq(0).attr("id")&&(n=n&&!t(a).val())}),n?u.each(function(i,n){t(n).val(e.val()),r(t(n))}):r(e)})})}(jQuery);
1
+ !function(r){r(document).on("sowsetupformfield",".siteorigin-widget-field-type-multi-measurement",function(t){var n=r(this).find('input[type="hidden"][class="siteorigin-widget-input"]'),a=n.data("separator"),i=n.data("autofill"),l=""===n.val()?[]:n.val().split(a),u=r(this).find(".sow-multi-measurement-input"),e=r(this).find(".sow-multi-measurement-input-container"),s=function(t){var i=""===n.val()?[]:n.val().split(a),e=t.find("+ .sow-multi-measurement-select-unit");i[u.index(t)]=t.val()+(""===t.val()?"":e.val()),n.val(i.join(a))};u.each(function(t,i){if(l.length>t){var e=l[t].match(/(\d+\.?\d*)([a-z%]+)*/);if(e&&e.length){var n=e[1],a=e[2];r(i).val(n),r(i).find("+ .sow-multi-measurement-select-unit").val(a)}}else s(r(i))}),e.change(function(t){var e=r(t.currentTarget).find("> .sow-multi-measurement-input"),n=i;i&&u.each(function(t,i){r(i).attr("id")!==e.eq(0).attr("id")&&(n=n&&!r(i).val())}),n?u.each(function(t,i){r(i).val(e.val()),s(r(i))}):s(e)})})}(jQuery);
base/inc/fields/js/order-field.min.js CHANGED
@@ -1 +1 @@
1
- !function(i){i(document).on("sowsetupform",function(t){i(t.target).find(".siteorigin-widget-field-type-order").each(function(){var t=i(this),e=t.find(".siteorigin-widget-input"),n=t.find(".siteorigin-widget-order-items");n.sortable({stop:function(){var t=i(this).sortable("toArray",{attribute:"data-value"});e.val(t.join(",")),e.trigger("change",{silent:!0})}}),t.change(function(i,r){if(!r||!r.silent){var a=""===e.val()?[]:e.val().split(",");if(a.length)for(var o=0;o<a.length;o++){var d=a[o],g=t.find(".siteorigin-widget-order-item[data-value="+d+"]");n.append(g)}}})})})}(jQuery);
1
+ !function(t){t(document).on("sowsetupform",function(i){t(i.target).find(".siteorigin-widget-field-type-order").each(function(){var o=t(this),d=o.find(".siteorigin-widget-input"),g=o.find(".siteorigin-widget-order-items");g.sortable({stop:function(){var i=t(this).sortable("toArray",{attribute:"data-value"});d.val(i.join(",")),d.trigger("change",{silent:!0})}}),o.change(function(i,t){if(!t||!t.silent){var e=""===d.val()?[]:d.val().split(",");if(e.length)for(var n=0;n<e.length;n++){var r=e[n],a=o.find(".siteorigin-widget-order-item[data-value="+r+"]");g.append(a)}}})})})}(jQuery);
base/inc/fields/js/posts-field.min.js CHANGED
@@ -1 +1 @@
1
- !function(t){t(document).on("sowsetupform",".siteorigin-widget-field-type-posts",function(o){var s=t(this);s.change(function(o){var n=sowbForms.getWidgetFormValues(s),e=n.hasOwnProperty("posts")?n.posts:null,i="";for(var r in e)""!==i&&(i+="&"),i+=r+"="+e[r];t.post(soWidgets.ajaxurl,{action:"sow_get_posts_count",query:i},function(t){s.find(".sow-current-count").text(t.posts_count)})})})}(jQuery);
1
+ !function(r){r(document).on("sowsetupform",".siteorigin-widget-field-type-posts",function(t){var i=r(this);i.change(function(t){var o=sowbForms.getWidgetFormValues(i),s=o.hasOwnProperty("posts")?o.posts:null,n="";for(var e in s)""!==n&&(n+="&"),n+=e+"="+s[e];r.post(soWidgets.ajaxurl,{action:"sow_get_posts_count",query:n},function(t){i.find(".sow-current-count").text(t.posts_count)})})})}(jQuery);
base/inc/fields/js/presets-field.min.js CHANGED
@@ -1 +1 @@
1
- !function(e){e(document).on("sowsetupformfield",".siteorigin-widget-field-type-presets",function(i){var t=e(this).find('select[class="siteorigin-widget-input"]');if(!t.data("initialized")){var s=t.find("+ .sowb-presets-field-undo");s.hide();var r=t.data("presets");t.change(function(){var e=t.val();if(e&&r.hasOwnProperty(e)){var i=r[e].values,a=t.closest(".siteorigin-widget-form-main"),o=t.data("previousValues");if(!o){var n=JSON.parse(JSON.stringify(i)),u=sowbForms.getWidgetFormValues(a),l=0,d=function(e,i){if(++l>10)return i;for(var t in i)if(e.hasOwnProperty(t)){var s=e[t],r=i[t];null!==s&&null!==r&&"object"==typeof s?d(s,r):i[t]=s}return i};o=d(u,n),t.data("previousValues",o)}s.not(":visible")&&(s.show(),s.click(function(e){e.preventDefault(),s.hide(),sowbForms.setWidgetFormValues(a,o,!0),t.removeData("previousValues"),t.val("")})),sowbForms.setWidgetFormValues(a,i,!0)}}),t.data("initialized",!0)}})}(jQuery);
1
+ !function(i){i(document).on("sowsetupformfield",".siteorigin-widget-field-type-presets",function(e){var u=i(this).find('select[class="siteorigin-widget-input"]');if(!u.data("initialized")){var l=u.find("+ .sowb-presets-field-undo");l.hide();var d=u.data("presets");u.change(function(){var e=u.val();if(e&&d.hasOwnProperty(e)){var i=d[e].values,t=u.closest(".siteorigin-widget-form-main"),s=u.data("previousValues");if(!s){var r=JSON.parse(JSON.stringify(i)),a=sowbForms.getWidgetFormValues(t),o=0,n=function(e,i){if(10<++o)return i;for(var t in i)if(e.hasOwnProperty(t)){var s=e[t],r=i[t];null!==s&&null!==r&&"object"==typeof s?n(s,r):i[t]=s}return i};s=n(a,r),u.data("previousValues",s)}l.not(":visible")&&(l.show(),l.click(function(e){e.preventDefault(),l.hide(),sowbForms.setWidgetFormValues(t,s,!0),u.removeData("previousValues"),u.val("")})),sowbForms.setWidgetFormValues(t,i,!0)}}),u.data("initialized",!0)}})}(jQuery);
base/inc/fields/js/tinymce-field-pre48.min.js CHANGED
@@ -1 +1 @@
1
- !function(e){var t=function(i){"undefined"!=typeof tinyMCEPreInit?(tinyMCEPreInit.mceInit.hasOwnProperty("undefined")&&delete tinyMCEPreInit.mceInit.undefined,tinyMCEPreInit.qtInit.hasOwnProperty("undefined")&&delete tinyMCEPreInit.qtInit.undefined,QTags.instances.hasOwnProperty("undefined")&&delete QTags.instances.undefined,e(i).find("> .siteorigin-widget-field-type-tinymce > .siteorigin-widget-tinymce-container").each(function(t,i){var n=e(i),r=n.find("textarea"),a=r.attr("id");if("undefined"!=typeof tinymce){if(a.indexOf("__i__")>-1)return;var s=n.data("mceSettings"),o=n.data("widgetIdBase"),c=r.attr("name").replace(/\[\d*\]/g,""),d=/[a-zA-Z0-9-]+(?:\[[a-zA-Z0-9]+\])?\[(.*)\]/.exec(c)[1],f=new RegExp("widget-"+o+"-?.*-"+d.replace(/\]\[/g,"-")+"[-d]*");for(var g in tinyMCEPreInit.mceInit)g.match(f)&&(s=e.extend({},tinyMCEPreInit.mceInit[g],s));var l,m=tinymce.get(a);null!==m&&("undefined"==typeof vc&&0===n.closest(".vc_active").length&&(l=m.getContent()),m.remove());var u=function(e){e.on("change",function(){tinymce.get(a).save(),r.trigger("change"),r.val(window.switchEditors.pre_wpautop(e.getContent()))}),e.on("init",function(){l&&e.setContent(l)})};s=e.extend({},s,{selector:"#"+a,setup:u}),tinyMCEPreInit.mceInit[a]=s;if(n.find("div#wp-"+a+"-wrap").hasClass("tmce-active"))if(e("#"+a).is(":visible"))tinymce.init(tinyMCEPreInit.mceInit[a]);else var v=setInterval(function(){e("#"+a).is(":visible")&&(tinymce.init(tinyMCEPreInit.mceInit[a]),clearInterval(v))},500)}var y=n.data("qtSettings");y=e.extend({},tinyMCEPreInit.qtInit["siteorigin-widget-input-tinymce-field"],y,{id:a}),tinyMCEPreInit.qtInit[a]=y,n.find(".quicktags-toolbar").remove(),quicktags(tinyMCEPreInit.qtInit[a]),e(this).on("click",function(t){var i=e(t.target);if(i.hasClass("wp-switch-editor")){var n=i.hasClass("switch-tmce")?"tmce":"html";if("tmce"==n){var s=tinymce.get(a);if(null!=s){var o=r.val();-1!=o.search("<")&&-1==o.search(">")&&(o=o.replace(/</g,""),r.val(o)),s.setContent(window.switchEditors.wpautop(o))}}e(this).find("+ .siteorigin-widget-tinymce-selected-editor").val(n)}})}),QTags._buttonsInit()):setTimeout(function(){t(i)},500)};e(document).on("sowsetupform",function(i){var n=e(i.target);n.is(".siteorigin-widget-field-repeater-item-form")?n.is(":visible")?t(n):n.on("slideToggleOpenComplete",function(){n.is(":visible")&&(t(n),n.off("slideToggleOpenComplete"))}):t(n)}),e(document).on("sortstop",function(i,n){n.item.is(".siteorigin-widget-field-repeater-item")?n.item.find("> .siteorigin-widget-field-repeater-item-form").each(function(){t(e(this))}):t(n.item.find(".siteorigin-widget-form"))})}(jQuery);
1
+ !function(v){var i=function(e){"undefined"!=typeof tinyMCEPreInit?(tinyMCEPreInit.mceInit.hasOwnProperty("undefined")&&delete tinyMCEPreInit.mceInit[void 0],tinyMCEPreInit.qtInit.hasOwnProperty("undefined")&&delete tinyMCEPreInit.qtInit[void 0],QTags.instances.hasOwnProperty("undefined")&&delete QTags.instances[void 0],v(e).find("> .siteorigin-widget-field-type-tinymce > .siteorigin-widget-tinymce-container").each(function(e,t){var i=v(t),a=i.find("textarea"),o=a.attr("id");if("undefined"!=typeof tinymce){if(-1<o.indexOf("__i__"))return;var n,r=i.data("mceSettings"),s=i.data("widgetIdBase"),c=a.attr("name").replace(/\[\d*\]/g,""),d=/[a-zA-Z0-9-]+(?:\[[a-zA-Z0-9]+\])?\[(.*)\]/.exec(c)[1],f=new RegExp("widget-"+s+"-?.*-"+d.replace(/\]\[/g,"-")+"[-d]*");for(var g in tinyMCEPreInit.mceInit)g.match(f)&&(r=v.extend({},tinyMCEPreInit.mceInit[g],r));var l=tinymce.get(o);null!==l&&("undefined"==typeof vc&&0===i.closest(".vc_active").length&&(n=l.getContent()),l.remove());if(r=v.extend({},r,{selector:"#"+o,setup:function(e){e.on("change",function(){tinymce.get(o).save(),a.trigger("change"),a.val(window.switchEditors.pre_wpautop(e.getContent()))}),e.on("init",function(){n&&e.setContent(n)})}}),tinyMCEPreInit.mceInit[o]=r,i.find("div#wp-"+o+"-wrap").hasClass("tmce-active"))if(v("#"+o).is(":visible"))tinymce.init(tinyMCEPreInit.mceInit[o]);else var m=setInterval(function(){v("#"+o).is(":visible")&&(tinymce.init(tinyMCEPreInit.mceInit[o]),clearInterval(m))},500)}var u=i.data("qtSettings");u=v.extend({},tinyMCEPreInit.qtInit["siteorigin-widget-input-tinymce-field"],u,{id:o}),tinyMCEPreInit.qtInit[o]=u,i.find(".quicktags-toolbar").remove(),quicktags(tinyMCEPreInit.qtInit[o]),v(this).on("click",function(e){var t=v(e.target);if(t.hasClass("wp-switch-editor")){var i=t.hasClass("switch-tmce")?"tmce":"html";if("tmce"==i){var n=tinymce.get(o);if(null!=n){var r=a.val();-1!=r.search("<")&&-1==r.search(">")&&(r=r.replace(/</g,""),a.val(r)),n.setContent(window.switchEditors.wpautop(r))}}v(this).find("+ .siteorigin-widget-tinymce-selected-editor").val(i)}})}),QTags._buttonsInit()):setTimeout(function(){i(e)},500)};v(document).on("sowsetupform",function(e){var t=v(e.target);t.is(".siteorigin-widget-field-repeater-item-form")?t.is(":visible")?i(t):t.on("slideToggleOpenComplete",function(){t.is(":visible")&&(i(t),t.off("slideToggleOpenComplete"))}):i(t)}),v(document).on("sortstop",function(e,t){t.item.is(".siteorigin-widget-field-repeater-item")?t.item.find("> .siteorigin-widget-field-repeater-item-form").each(function(){i(v(this))}):i(t.item.find(".siteorigin-widget-form"))})}(jQuery);
base/inc/fields/js/tinymce-field.min.js CHANGED
@@ -1 +1 @@
1
- !function(i){var e=function(e){if(!e.data("initialized")){var t=wp.oldEditor?wp.oldEditor:wp.editor;t&&t.hasOwnProperty("autop")&&(wp.editor.autop=t.autop,wp.editor.removep=t.removep,wp.editor.initialize=t.initialize);var n,o=e.find(".siteorigin-widget-tinymce-container"),r=o.data("editorSettings");if(r.wpautopToggleField){var a=o.closest(".siteorigin-widget-form");n=a.find(r.wpautopToggleField),r.tinymce.wpautop=n.is(":checked")}var d=o.find("textarea"),s=d.attr("id"),c=function(i){i.on("change",function(){window.tinymce.get(s).save(),d.trigger("change")}),n&&(n.off("change"),n.on("change",function(){wp.editor.remove(s),r.tinymce.wpautop=n.is(":checked"),wp.editor.initialize(s,r)}))};if(r.tinymce&&(r.tinymce=i.extend({},r.tinymce,{selector:"#"+s,setup:c})),i(document).on("wp-before-tinymce-init",function(i,t){if(t.selector===r.tinymce.selector){var n=o.data("mediaButtons");0===e.find(".wp-media-buttons").length&&e.find(".wp-editor-tabs").before(n.html)}}),i(document).on("tinymce-editor-setup",function(){e.find(".wp-editor-wrap").hasClass(r.selectedEditor+"-active")||setTimeout(function(){window.switchEditors.go(s)},10)}),t.remove(s),window.tinymce.EditorManager.overrideDefaults({base_url:r.baseURL,suffix:r.suffix}),d.is(":visible"))t.initialize(s,r);else var l=setInterval(function(){d.is(":visible")&&(t.initialize(s,r),clearInterval(l))},500);e.on("click",function(t){var n=i(t.target);if(n.is(".wp-switch-editor")){var o=n.hasClass("switch-tmce")?"tmce":"html";if("tmce"===o){var a=window.tinymce.get(s);if(null!==a){var c=d.val();-1!==c.search("<")&&-1===c.search(">")&&(c=c.replace(/</g,""),d.val(c)),a.setContent(window.switchEditors.wpautop(c))}}r.selectedEditor=o,e.find(".siteorigin-widget-tinymce-selected-editor").val(o)}}),e.data("initialized",!0)}};i(document).on("sowsetupformfield",".siteorigin-widget-field-type-tinymce",function(){var t=i(this),n=t.closest(".siteorigin-widget-field-repeater-item-form");n.length>0?n.is(":visible")?e(t):n.on("slideToggleOpenComplete",function(){n.is(":visible")&&(e(t),n.off("slideToggleOpenComplete"))}):e(t)}),i(document).on("sortstop",function(t,n){var o;o=n.item.is(".siteorigin-widget-field-repeater-item")?n.item.find("> .siteorigin-widget-field-repeater-item-form"):n.item.find(".siteorigin-widget-form"),o.find(".siteorigin-widget-field-type-tinymce").each(function(){i(this).data("initialized",null),e(i(this))})})}(jQuery);
1
+ !function(c){var t=function(r){if(!r.data("initialized")){var i=wp.oldEditor?wp.oldEditor:wp.editor;i&&i.hasOwnProperty("autop")&&(wp.editor.autop=i.autop,wp.editor.removep=i.removep,wp.editor.initialize=i.initialize);var e,n=r.find(".siteorigin-widget-tinymce-container"),d=n.data("editorSettings");if(d.wpautopToggleField){var t=n.closest(".siteorigin-widget-form");e=t.find(d.wpautopToggleField),d.tinymce.wpautop=e.is(":checked")}var a=n.find("textarea"),s=a.attr("id");if(d.tinymce&&(d.tinymce=c.extend({},d.tinymce,{selector:"#"+s,setup:function(i){i.on("change",function(){window.tinymce.get(s).save(),a.trigger("change")}),e&&(e.off("change"),e.on("change",function(){wp.editor.remove(s),d.tinymce.wpautop=e.is(":checked"),wp.editor.initialize(s,d)}))}})),c(document).on("wp-before-tinymce-init",function(i,e){if(e.selector===d.tinymce.selector){var t=n.data("mediaButtons");0===r.find(".wp-media-buttons").length&&r.find(".wp-editor-tabs").before(t.html)}}),c(document).on("tinymce-editor-setup",function(){r.find(".wp-editor-wrap").hasClass(d.selectedEditor+"-active")||setTimeout(function(){window.switchEditors.go(s)},10)}),i.remove(s),window.tinymce.EditorManager.overrideDefaults({base_url:d.baseURL,suffix:d.suffix}),a.is(":visible"))i.initialize(s,d);else var o=setInterval(function(){a.is(":visible")&&(i.initialize(s,d),clearInterval(o))},500);r.on("click",function(i){var e=c(i.target);if(e.is(".wp-switch-editor")){var t=e.hasClass("switch-tmce")?"tmce":"html";if("tmce"===t){var n=window.tinymce.get(s);if(null!==n){var o=a.val();-1!==o.search("<")&&-1===o.search(">")&&(o=o.replace(/</g,""),a.val(o)),n.setContent(window.switchEditors.wpautop(o))}}d.selectedEditor=t,r.find(".siteorigin-widget-tinymce-selected-editor").val(t)}}),r.data("initialized",!0)}};c(document).on("sowsetupformfield",".siteorigin-widget-field-type-tinymce",function(){var i=c(this),e=i.closest(".siteorigin-widget-field-repeater-item-form");0<e.length?e.is(":visible")?t(i):e.on("slideToggleOpenComplete",function(){e.is(":visible")&&(t(i),e.off("slideToggleOpenComplete"))}):t(i)}),c(document).on("sortstop",function(i,e){(e.item.is(".siteorigin-widget-field-repeater-item")?e.item.find("> .siteorigin-widget-field-repeater-item-form"):e.item.find(".siteorigin-widget-form")).find(".siteorigin-widget-field-type-tinymce").each(function(){c(this).data("initialized",null),t(c(this))})})}(jQuery);
base/inc/routes/siteorigin-widgets-resource.class.php CHANGED
@@ -19,15 +19,9 @@ class SiteOrigin_Widgets_Resource extends WP_REST_Controller {
19
$namespace = 'sowb/v' . $version;
20
$resource = 'widgets';
21
22
- register_rest_route( $namespace, '/' . $resource, array(
23
- 'methods' => WP_REST_Server::READABLE,
24
- 'callback' => array( $this, 'get_widgets'),
25
- 'permission_callback' => array( $this, 'permissions_check' ),
26
- ) );
27
-
28
$subresource = 'forms';
29
register_rest_route( $namespace, '/' . $resource . '/' . $subresource, array(
30
- 'methods' => WP_REST_Server::READABLE,
31
'callback' => array( $this, 'get_widget_form'),
32
'args' => array(
33
'widgetClass' => array(
@@ -39,7 +33,7 @@ class SiteOrigin_Widgets_Resource extends WP_REST_Controller {
39
40
$subresource = 'previews';
41
register_rest_route( $namespace, '/' . $resource . '/' . $subresource, array(
42
- 'methods' => WP_REST_Server::READABLE,
43
'callback' => array( $this, 'get_widget_preview'),
44
'args' => array(
45
'widgetClass' => array(
@@ -53,28 +47,6 @@ class SiteOrigin_Widgets_Resource extends WP_REST_Controller {
53
) );
54
}
55
56
- /**
57
- * Get the collection of widgets.
58
- *
59
- * @param WP_REST_Request $request
60
- *
61
- * @return WP_Error|WP_REST_Response
62
- */
63
- public function get_widgets( $request ) {
64
- global $wp_widget_factory;
65
- $so_widgets = array();
66
- foreach ( $wp_widget_factory->widgets as $class => $widget_obj ) {
67
- if ( ! empty( $widget_obj ) && is_object( $widget_obj ) && is_subclass_of( $widget_obj, 'SiteOrigin_Widget' ) ) {
68
- $so_widgets[] = array(
69
- 'name' => preg_replace( '/^SiteOrigin /', '', $widget_obj->name ),
70
- 'class' => $class,
71
- );
72
- }
73
- }
74
-
75
- return rest_ensure_response( $so_widgets );
76
- }
77
-
78
/**
79
*
80
* @param WP_REST_Request $request Request.
19
$namespace = 'sowb/v' . $version;
20
$resource = 'widgets';
21
22
$subresource = 'forms';
23
register_rest_route( $namespace, '/' . $resource . '/' . $subresource, array(
24
+ 'methods' => WP_REST_Server::CREATABLE,
25
'callback' => array( $this, 'get_widget_form'),
26
'args' => array(
27
'widgetClass' => array(
33
34
$subresource = 'previews';
35
register_rest_route( $namespace, '/' . $resource . '/' . $subresource, array(
36
+ 'methods' => WP_REST_Server::CREATABLE,
37
'callback' => array( $this, 'get_widget_preview'),
38
'args' => array(
39
'widgetClass' => array(
47
) );
48
}
49
50
/**
51
*
52
* @param WP_REST_Request $request Request.
base/js/admin.min.js CHANGED
@@ -1 +1 @@
1
- var sowbForms=window.sowbForms||{};!function(e){e.fn.sowSetupForm=function(){return e(this).each(function(i,t){var r,n=e(t),a=!0,s=e("body"),o=n.find("input[name]");if(o.length&&-1!==o.attr("name").indexOf("__i__"))return this;if(n.is(".siteorigin-widget-form-main")){if(!0===n.data("sow-form-setup"))return!0;if(s.hasClass("widgets-php")&&!n.is(":visible")&&0===n.closest(".panel-dialog").length)return!0;n.on("sowstatechange",function(i,t,r){n.find("[data-state-handler]").each(function(){var i=e(this),n=e.extend({},i.data("state-handler"),a?i.data("state-handler-initial"):{});if(0===Object.keys(n).length)return!0;var s,o,d,l,g,f,c={},p=sowbForms.getContainerFieldId(i,"repeater",".siteorigin-widget-field-repeater-item");if(!1!==p){var u={};for(var m in n)u[m.replace("{$repeater}",p)]=n[m];n=u}var w=sowbForms.getContainerFieldId(i,"widget",".siteorigin-widget-widget");if(!1!==w){var v={};for(var h in n){var b=h.match(/_else\[(.*)\]|(.*)\[(.*)\]/),y="";y=b&&b.length&&void 0===b[1]?b[2]+"_"+w+"["+b[3]+"]":"_else["+b[1]+"_"+w+"]",v[y]=n[h]}n=v}for(var F in n)if(g=!1,null!==(s=F.match(/^([a-zA-Z0-9_-]+)(\[([a-zA-Z0-9_\-,]+)\])?(\[\])?#x2F;))){if(o={group:"default",name:"",multi:!1},void 0!==s[2]?(o.group=s[1],o.name=s[3]):o.name=s[0],o.multi=void 0!==s[4],"_else"===o.group)o.group=o.name,o.name="",g=o.group===t&&void 0===c[o.group];else{f=o.name.split(",").map(function(e){return e.trim()});for(var k=0;k<f.length&&!(g=o.group===t&&f[k]===r);k++);}if(g){d=n[F],o.multi||(d=[d]);for(var k=0;k<d.length;k++)l=void 0!==d[k][1]&&Boolean(d[k][1])?i.find(d[k][1]):i,l[d[k][0]].apply(l,void 0!==d[k][2]?d[k][2]:[]);c[o.group]=!0}}})}),n.sowSetupPreview(),r=n;var d=n.find(".siteorigin-widget-teaser");if(d.find(".dashicons-dismiss").click(function(){var i=e(this);e.get(i.data("dismiss-url")),d.slideUp("normal",function(){d.remove()})}),!n.data("backupDisabled")){var l=n.find("> .siteorigin-widgets-form-id").val(),g=n.find("> .siteorigin-widgets-form-timestamp"),f=parseInt(g.val()||0),c=JSON.parse(sessionStorage.getItem(l));if(c)if(c._sow_form_timestamp>f){var p=e('<div class="siteorigin-widget-form-notification"><span>'+soWidgets.backup.newerVersion+'</span><a class="button button-small so-backup-restore">'+soWidgets.backup.restore+'</a><a class="button button-small so-backup-dismiss">'+soWidgets.backup.dismiss+"</a><div><small>"+soWidgets.backup.replaceWarning+"</small></div></div>");n.prepend(p),p.find(".so-backup-restore").click(function(){sowbForms.setWidgetFormValues(r,c),p.slideUp("fast",function(){p.remove()})}),p.find(".so-backup-dismiss").click(function(){p.slideUp("fast",function(){sessionStorage.removeItem(l),p.remove()})})}else sessionStorage.removeItem(l);n.change(function(){g.val((new Date).getTime());var e=sowbForms.getWidgetFormValues(n);sessionStorage.setItem(l,JSON.stringify(e))})}}else r=n.closest(".siteorigin-widget-form-main");r.find("> .siteorigin-widgets-form-id").val();var u=n.find("> .siteorigin-widget-field");u.find("> .siteorigin-widget-section").sowSetupForm();var m=u.find("> .siteorigin-widget-widget");m.find("> .siteorigin-widget-section").sowSetupForm(),m.filter(":not(:has(> .siteorigin-widget-section))").sowSetupForm(),u.find(".siteorigin-widget-input").each(function(i,t){null===e(t).data("original-name")&&e(t).data("original-name",e(t).attr("name"))}),u.find("> .siteorigin-widget-field-repeater").sowSetupRepeater(),n.find(".siteorigin-widget-field-repeater-item").sowSetupRepeaterItems(),u.find("> .siteorigin-widget-input-color").each(function(){var i=e(this),t={change:function(i,t){setTimeout(function(){e(i.target).trigger("change")},100)}};i.data("defaultColor")&&(t.defaultColor=i.data("defaultColor")),i.wpColorPicker(t)});var w=function(){e(this).toggleClass("siteorigin-widget-section-visible"),e(this).parent().find("> .siteorigin-widget-section, > .siteorigin-widget-widget > .siteorigin-widget-section").slideToggle("fast",function(){if(e(window).resize(),e(this).find("> .siteorigin-widget-field-container-state").val(e(this).is(":visible")?"open":"closed"),e(this).is(":visible")){e(this).find("> .siteorigin-widget-field").trigger("sowsetupformfield")}})};u.filter(".siteorigin-widget-field-type-widget, .siteorigin-widget-field-type-section").find("> label").click(w),u.filter(".siteorigin-widget-field-type-posts").find(".posts-container-label-wrapper").click(w),u.filter(".siteorigin-widget-field-type-slider").each(function(){var i=e(this),t=i.find('input[type="number"]'),r=i.find(".siteorigin-widget-value-slider");r.slider({max:parseFloat(t.attr("max")),min:parseFloat(t.attr("min")),step:parseFloat(t.attr("step")),value:parseFloat(t.val()),slide:function(e,i){t.val(parseFloat(i.value)),t.trigger("change")},change:function(e,t){i.find(".siteorigin-widget-slider-value").html(t.value)}}),t.change(function(e,i){i&&i.silent||r.slider("value",parseFloat(t.val()))})}),u.filter(".siteorigin-widget-field-type-link").each(function(){var i=e(this),t=null,r=function(){null!==t&&t.abort();var r=i.find(".content-text-search"),n=r.val(),a=r.data("postTypes"),s=i.find("ul.posts").empty().addClass("loading");e.get(soWidgets.ajaxurl,{action:"so_widgets_search_posts",query:n,postTypes:a},function(i){for(var t=0;t<i.length;t++)""===i[t].label&&(i[t].label="&nbsp;"),s.append(e("<li>").addClass("post").html(i[t].label+"<span>("+i[t].type+")</span>").data(i[t]));s.removeClass("loading")})};i.find(".select-content-button, .button-close").click(function(t){t.preventDefault(),e(this).blur();var n=i.find(".existing-content-selector");n.toggle(),n.is(":visible")&&0===n.find("ul.posts li").length&&r()}),i.on("click",".posts li",function(t){t.preventDefault();var r=e(this);i.find("input.siteorigin-widget-input").val("post: "+r.data("value")),i.change(),i.find(".existing-content-selector").toggle()});var n=null;i.find(".content-text-search").keyup(function(){null!==n&&clearTimeout(n),n=setTimeout(function(){r()},500)})}),void 0!==jQuery.fn.soPanelsSetupBuilderWidget&&u.filter(".siteorigin-widget-field-type-builder").each(function(){e(this).find("> .siteorigin-page-builder-field").each(function(){var i=e(this);i.soPanelsSetupBuilderWidget({builderType:i.data("type")})})});var v=function(){var i=e(this),t=i.closest("[data-state-emitter]").data("state-emitter");if(void 0!==t){var n={default:""};void 0===t.length&&(t=[t]);for(var a=0;a<t.length;a++)n=function(t,r){if(void 0===sowEmitters[t.callback]||"_"===t.callback.substr(0,1))return r;if(i.is('[type="radio"]')&&!i.is(":checked"))return r;var n=sowbForms.getContainerFieldId(i,"repeater",".siteorigin-widget-field-repeater-item");!1!==n&&(t.args=t.args.map(function(e){return e.replace("{$repeater}",n)}));var a=sowbForms.getContainerFieldId(i,"widget",".siteorigin-widget-widget");!1===a||t.hasOwnProperty("widgetFieldId")||(t.widgetFieldId=a,t.args=t.args.map(function(e){return e+"_"+a}));var s=i.is('[type="checkbox"]')?i.is(":checked"):i.val();return e.extend(r,sowEmitters[t.callback](s,t.args))}(t[a],n);var s=r.data("states");void 0===s&&(s={default:""});for(var o in n)void 0!==s[o]&&n[o]===s[o]||(s[o]=n[o],r.trigger("sowstatechange",[o,n[o]]));r.data("states",s)}};u.filter("[data-state-emitter]").each(function(){var i=e(this).find(".siteorigin-widget-input");i.on("keyup change",v),i.each(function(){var i=e(this);i.is(":radio")?i.is(":checked")&&v.call(i[0]):v.call(i[0])})}),n.trigger("sowsetupform",u).data("sow-form-setup",!0),u.trigger("sowsetupformfield"),n.find(".siteorigin-widget-field-repeater-item").trigger("updateFieldPositions"),(s.hasClass("wp-customizer")||s.hasClass("widgets-php"))&&n.closest(".ui-sortable").on("sortstop",function(e,i){i.item.find(".siteorigin-widget-form").find("> .siteorigin-widget-field").trigger("sowsetupformfield")}),a=!1})},e.fn.sowSetupPreview=function(){var i=e(this);i.siblings(".siteorigin-widget-preview").find("> a").click(function(t){t.preventDefault();var r=sowbForms.getWidgetFormValues(i),n=e(e("#so-widgets-bundle-tpl-preview-dialog").html().trim()).appendTo("body");n.find('input[name="data"]').val(JSON.stringify(r)),n.find('input[name="class"]').val(i.data("class")),n.find("iframe").on("load",function(){e(this).css("visibility","visible")}),n.find("form").submit(),n.find(".close").click(function(){n.remove()})})},e.fn.sowSetupRepeater=function(){return e(this).each(function(i,t){var r=e(t),n=r.find(".siteorigin-widget-field-repeater-items"),a=r.data("repeater-name");n.bind("updateFieldPositions",function(){var i=e(this),t=i.find("> .siteorigin-widget-field-repeater-item");t.each(function(i,t){e(t).find(".siteorigin-widget-input").each(function(t,r){var n=e(r).data("repeater-positions");void 0===n&&(n={}),n[a]=i,e(r).data("repeater-positions",n)})}),i.find(".siteorigin-widget-input").each(function(i,t){var r=e(t),n=r.data("repeater-positions");if(void 0!==n){var a=r.attr("data-original-name");if(a||(r.attr("data-original-name",r.attr("name")),a=r.attr("name")),!a)return;if(n)for(var s in n)a=a.replace("#"+s+"#",n[s]);r.attr("name",a)}}),i.data("initialSetup")||(i.find(".siteorigin-widget-input").each(function(i,t){var r=e(t);r.prop("checked",r.prop("defaultChecked"))}),i.data("initialSetup",!0));var n=r.data("scroll-count")?parseInt(r.data("scroll-count")):0;if(n>0&&t.length>n){var s=t.first().outerHeight();i.css("max-height",s*n).css("overflow","auto")}else i.css("max-height","").css("overflow","")}),n.sortable({handle:".siteorigin-widget-field-repeater-item-top",items:"> .siteorigin-widget-field-repeater-item",update:function(){n.find('input[type="radio"].siteorigin-widget-input').attr("name",""),n.trigger("updateFieldPositions"),r.trigger("change")},sortstop:function(i,t){if(t.item.is(".siteorigin-widget-field-repeater-item"))t.item.find("> .siteorigin-widget-field-repeater-item-form").each(function(){e(this).find("> .siteorigin-widget-field").trigger("sowsetupformfield")});else{t.item.find(".siteorigin-widget-form").find("> .siteorigin-widget-field").trigger("sowsetupformfield")}r.trigger("change")}}),n.trigger("updateFieldPositions"),r.find("> .siteorigin-widget-field-repeater-add").disableSelection().click(function(i){i.preventDefault(),r.closest(".siteorigin-widget-field-repeater").sowAddRepeaterItem().find("> .siteorigin-widget-field-repeater-items").slideDown("fast",function(){e(window).resize()})}),r.find("> .siteorigin-widget-field-repeater-top > .siteorigin-widget-field-repeater-expand").click(function(i){i.preventDefault(),r.closest(".siteorigin-widget-field-repeater").find("> .siteorigin-widget-field-repeateritems-").slideToggle("fast",function(){e(window).resize()})})})},e.fn.sowAddRepeaterItem=function(){return e(this).each(function(i,t){var r=e(t),n=r.find("> .siteorigin-widget-field-repeater-items").children().length+1,a=e("<div>"+r.find("> .siteorigin-widget-field-repeater-item-html").html()+"</div>");a.find(".siteorigin-widget-input[data-name]").each(function(){var i=e(this);0===i.closest(".siteorigin-widget-field-repeater-item-html").length&&i.attr("name",e(this).data("name"))});var s="";a.find("> .siteorigin-widget-field").each(function(i,t){var r=t.outerHTML;e(t).is(".siteorigin-widget-field-type-repeater")||(r=r.replace(/_id_/g,n)),s+=r});var o=void 0!==r.attr("readonly"),d=e('<div class="siteorigin-widget-field-repeater-item ui-draggable" />').append(e('<div class="siteorigin-widget-field-repeater-item-top" />').append(e('<div class="siteorigin-widget-field-expand" />')).append(o?"":e('<div class="siteorigin-widget-field-copy" />')).append(o?"":e('<div class="siteorigin-widget-field-remove" />')).append(e("<h4 />").html(r.data("item-name")))).append(e('<div class="siteorigin-widget-field-repeater-item-form" />').html(s));r.find("> .siteorigin-widget-field-repeater-items").append(d).sortable("refresh").trigger("updateFieldPositions"),d.sowSetupRepeaterItems(),d.hide().slideDown("fast",function(){e(window).resize()}),r.trigger("change")})},e.fn.sowRemoveRepeaterItem=function(){return e(this).each(function(i,t){var r=e(this).closest(".siteorigin-widget-field-repeater-items");e(this).remove(),r.sortable("refresh").trigger("updateFieldPositions"),e(t).trigger("change")})},e.fn.sowSetupRepeaterItems=function(){return e(this).each(function(i,t){var r=e(t);if(void 0===r.data("sowrepeater-actions-setup")){var n=r.closest(".siteorigin-widget-field-repeater"),a=r.find("> .siteorigin-widget-field-repeater-item-top"),s=n.data("item-label");if(s&&s.selector){var o=function(){var e=s.hasOwnProperty("valueMethod")&&s.valueMethod?s.valueMethod:"val",i=r.find(s.selector)[e]();i&&(i.length>80&&(i=i.substr(0,79)+"..."),a.find("h4").text(i))};o();var d=s.hasOwnProperty("updateEvent")&&s.updateEvent?s.updateEvent:"change";r.bind(d,o)}a.click(function(i){"siteorigin-widget-field-remove"!==i.target.className&&"siteorigin-widget-field-copy"!==i.target.className&&(i.preventDefault(),e(this).closest(".siteorigin-widget-field-repeater-item").find(".siteorigin-widget-field-repeater-item-form").eq(0).slideToggle("fast",function(){if(e(window).resize(),e(this).is(":visible")){e(this).trigger("slideToggleOpenComplete");e(this).find("> .siteorigin-widget-field").trigger("sowsetupformfield")}else e(this).trigger("slideToggleCloseComplete")}))}),a.find(".siteorigin-widget-field-remove").click(function(i,t){i.preventDefault();var n=e(this).closest(".siteorigin-widget-field-repeater-items"),a=e(this).closest(".siteorigin-widget-field-repeater-item"),s=function(){a.remove(),n.sortable("refresh").trigger("updateFieldPositions"),e(window).resize()};t&&t.silent?s():confirm(soWidgets.sure)&&a.slideUp("fast",s),r.trigger("change")}),a.find(".siteorigin-widget-field-copy").click(function(i){i.preventDefault();var t=e(this).closest(".siteorigin-widget-form-main"),n=e(this).closest(".siteorigin-widget-field-repeater-item"),a=n.clone(),s=n.closest(".siteorigin-widget-field-repeater-items"),o=s.children().length,d={};a.find("*[name]").each(function(){var i=e(this),s=i.attr("id"),l=i.attr("name");if(i.is("textarea")&&i.parent().is(".wp-editor-container")&&"undefined"!=typeof tinymce){i.parent().empty().append(i),i.css("display","");var g=tinymce.get(s);g&&i.val(g.getContent())}else if(i.is(".wp-color-picker")){var f=i.closest(".wp-picker-container"),c=i.closest(".siteorigin-widget-field");f.remove(),c.append(i.remove())}else{var p=s?n.find("#"+s):n.find('[name="'+l+'"]');p.length&&null!=p.val()&&i.val(p.val())}if(s){var u,m,w;if(i.is('[type="radio"]')){m=s.replace(/-\d+-\d+#x2F;,"");var v=s.replace(/-\d+#x2F;,"");if(!d[m]){var h={};d[m]=t.find(".siteorigin-widget-input[id^="+m+"]").not("[id*=_id_]").filter(function(i,t){var r=e(t).attr("name");return!h[r]&&(h[r]=!0,!0)}).length+1}var b=m+"-"+d[m];w=b+s.match(/-\d+#x2F;)[0],a.find("label[for="+v+"]").attr("for",b)}else u=new RegExp("-\\d+quot;),m=s.replace(u,""),d[m]||(d[m]=t.find(".siteorigin-widget-input[id^="+m+"]").not("[id*=_id_]").length+1),w=m+"-"+d[m]++;if(i.attr("id",w),i.is(".wp-editor-area")){var y=i.closest(".siteorigin-widget-tinymce-container"),F=y.data("media-buttons");if(F&&F.html){var u=new RegExp(s,"g");F.html=F.html.replace(u,w),y.data("media-buttons",F)}}a.find("label[for="+s+"]").attr("for",w),a.find("[id*="+s+"]").each(function(){var i=e(this).attr("id"),t=i.replace(s,w);e(this).attr("id",t)}),"undefined"!=typeof tinymce&&tinymce.get(w)&&tinymce.get(w).remove()}var k=n.parents(".siteorigin-widget-field-repeater").length,_=e("body");(_.hasClass("wp-customizer")||_.hasClass("widgets-php"))&&0===r.closest(".panel-dialog").length&&(k+=1);var C=l.replace(new RegExp("((?:.*?\\[\\d+\\]){"+(k-1).toString()+"})?(.*?\\[)\\d+(\\])"),"$1$2"+o.toString()+"$3");i.attr("name",C),i.data("original-name",C)}),s.append(a).sortable("refresh").trigger("updateFieldPositions"),a.sowSetupRepeaterItems(),a.hide().slideDown("fast",function(){e(window).resize()}),r.trigger("change")}),r.find("> .siteorigin-widget-field-repeater-item-form").sowSetupForm(),r.data("sowrepeater-actions-setup",!0)}})},sowbForms.getContainerFieldId=function(e,i,t){var r=i+"FieldId";this.hasOwnProperty(r)||(this[r]=1);var n=e.closest(t);if(n.length){var a=n.data("field-id");return void 0===a&&(a=this[r]++),n.data("field-id",a),a}return!1},sowbForms.getWidgetFieldVariable=function(e,i,t){var r=window.sow_field_javascript_variables[e];i=i.replace(/\[#.*?#\]/g,"");for(var n=/[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(i)[1],a=n.split("]["),s=a.length?r:null;a.length;)s=s[a.shift()];return s[t]},sowbForms.fetchWidgetVariable=function(i,t,r){window.sowVars=window.sowVars||{},void 0===window.sowVars[t]?e.post(soWidgets.ajaxurl,{action:"sow_get_javascript_variables",widget:t,key:i},function(e){window.sowVars[t]=e,r(window.sowVars[t][i])}):r(window.sowVars[t][i])},sowbForms.getWidgetFormValues=function(i){if(_.isUndefined(i))return null;var t={};return i.find("*[name]").each(function(){var i=e(this);try{var r=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(i.attr("name"));if(_.isEmpty(r))return!0;r=r[1];var n=r.split("][");n=n.map(function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e});var a=t,s=null,o=_.isString(i.attr("type"))?i.attr("type").toLowerCase():null;if("checkbox"===o)s=!!i.is(":checked")&&(""===i.val()||i.val());else if("radio"===o){if(!i.is(":checked"))return;s=i.val()}else if("TEXTAREA"===i.prop("tagName")&&i.hasClass("wp-editor-area")){var d=null;"undefined"!=typeof tinyMCE&&(d=tinyMCE.get(i.attr("id"))),s=null===d||"function"!=typeof d.getContent||d.isHidden()?i.val():d.getContent()}else if("SELECT"===i.prop("tagName")){var l=i.find("option:selected");1===l.length?s=i.find("option:selected").val():l.length>1&&(s=_.map(i.find("option:selected"),function(i,t){return e(i).val()}))}else s=i.val();for(var g=0;g<n.length;g++)g===n.length-1?""===n[g]?a.push(s):a[n[g]]=s:(_.isUndefined(a[n[g]])&&(_.isNumber(n[g+1])||""===n[g+1]?a[n[g]]=[]:a[n[g]]={}),a=a[n[g]])}catch(e){console.error("Field ["+i.attr("name")+"] could not be processed and was skipped - "+e.message)}}),t},sowbForms.setWidgetFormValues=function(i,t,r,n){r=r||!1,n=void 0!==n&&n||void 0===n;var a=0,s=function(i,t){if(10==++a)return void--a;i.find("> .siteorigin-widget-field-type-repeater,> .siteorigin-widget-field-type-section > .siteorigin-widget-section > .siteorigin-widget-field-type-repeater").each(function(i,n){var a=e(this),o=a.find("> .siteorigin-widget-field-repeater"),d=o.data("repeaterName"),l=t.hasOwnProperty(d)?t[d]:null;if(a.parent().is(".siteorigin-widget-section")){var g=o.data("element-name");g=g.replace(/\[#.*?#\]/g,"");for(var f=/[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(g)[1],c=f.split("]["),p=c.length?t:null;c.length;){var u=c.shift();p=p.hasOwnProperty(u)?p[u]:p}l=p}if(l&&Array.isArray(l)){var m=o.find("> .siteorigin-widget-field-repeater-items > .siteorigin-widget-field-repeater-item"),w=l.length,v=m.length;if(w>v)for(var h=0;h<w-v;h++)o.find("> .siteorigin-widget-field-repeater-add").click();else if(!r&&w<v)for(var b=w;b<v;b++){var y=e(m.eq(b));y.find("> .siteorigin-widget-field-repeater-item-top").find(".siteorigin-widget-field-remove").trigger("click",{silent:!0})}m=o.find("> .siteorigin-widget-field-repeater-items > .siteorigin-widget-field-repeater-item");for(var F=0;F<m.length;F++)m.eq(F).find("> .siteorigin-widget-field-repeater-item-form"),s(m.eq(F).find("> .siteorigin-widget-field-repeater-item-form"),l[F])}}),--a};s(i,t),i.find("*[name]").each(function(){var i=e(this),a=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(i.attr("name"));if(void 0===a||null===a)return!0;a=a[1];var s=a.split("][");s=s.map(function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e});for(var o,d=t,l=0;l<s.length;l++){if(!d.hasOwnProperty(s[l])){if(r)return!0;break}l===s.length-1?o=d[s[l]]:d=d[s[l]]}if("checkbox"===i.attr("type"))i.prop("checked",o);else if("radio"===i.attr("type"))i.prop("checked",o===i.val());else if("TEXTAREA"===i.prop("tagName")&&i.hasClass("wp-editor-area")){var g=null;"undefined"!=typeof tinyMCE&&(g=tinyMCE.get(i.attr("id"))),null!==g&&"function"==typeof g.setContent&&!g.isHidden()&&i.parent().is(":visible")?g.initialized?g.setContent(o):g.on("init",function(){g.setContent(o)}):i.val(o)}else if(i.is(".panels-data")){i.val(o);var f=i.data("builder");f&&f.setDataField(i)}else i.val(o);n&&i.trigger("change")})},e(".widgets-holder-wrap").on("click",".widget:has(.siteorigin-widget-form-main) .widget-top",function(){var i=e(this).closest(".widget").find(".siteorigin-widget-form-main");setTimeout(function(){i.sowSetupForm()},200)});var i=e("body");i.hasClass("wp-customizer")&&e(document).on("widget-added",function(e,i){i.find(".siteorigin-widget-form").sowSetupForm()}),i.hasClass("block-editor-page")&&e(document).on("panels_setup_preview",function(){e(sowb).trigger("setup_widgets")}),e(document).on("open_dialog",function(e,i){if(i.$el.find(".so-panels-dialog").is(".so-panels-dialog-edit-widget")){i.$el.find(".siteorigin-widget-form-main").find("> .siteorigin-widget-field").trigger("sowsetupformfield")}}),e(function(){e(document).trigger("sowadminloaded")})}(jQuery);var sowEmitters={_match:function(e,i){void 0===i&&(i=".*");var t=new RegExp("^([a-zA-Z0-9_-]+)(\\[([a-zA-Z0-9_-]+)\\])? *: *("+i+") *quot;),r=t.exec(e);if(null===r)return!1;var n="",a="default";return void 0!==r[3]?(a=r[1],n=r[3]):n=r[1],{match:r[4].trim(),group:a,state:n}},_checker:function(e,i,t,r){var n={};void 0===i.length&&(i=[i]);for(var a,s=0;s<i.length;s++)!1!==(a=sowEmitters._match(i[s],t))&&("_true"===a.match||r(e,i,a.match))&&(n[a.group]=a.state);return n},select:function(e,i){void 0===i.length&&(i=[i]);for(var t={},r=0;r<i.length;r++)""===i[r]&&(i[r]="default"),t[i[r]]=e;return t},conditional:function(val,args){return sowEmitters._checker(val,args,"[^;{}]*",function(val,args,match){return eval(match)})},in:function(e,i){return sowEmitters._checker(e,i,"[^;{}]*",function(e,i,t){return-1!==t.split(",").map(function(e){return e.trim()}).indexOf(e)})}};window.sowbForms=sowbForms;
1
+ var sowbForms=window.sowbForms||{};!function(C){C.fn.sowSetupForm=function(){return C(this).each(function(e,i){var o,t=C(i),y=!0,r=C("body"),n=t.find("input[name]");if(n.length&&-1!==n.attr("name").indexOf("__i__"))return this;if(t.is(".siteorigin-widget-form-main")){if(!0===t.data("sow-form-setup"))return!0;if(r.hasClass("widgets-php")&&!t.is(":visible")&&0===t.closest(".panel-dialog").length)return!0;t.on("sowstatechange",function(e,h,b){t.find("[data-state-handler]").each(function(){var e,i,t,r,n,a,s=C(this),o=C.extend({},s.data("state-handler"),y?s.data("state-handler-initial"):{});if(0===Object.keys(o).length)return!0;var d={},l=sowbForms.getContainerFieldId(s,"repeater",".siteorigin-widget-field-repeater-item");if(!1!==l){var g={};for(var f in o)g[f.replace("{$repeater}",l)]=o[f];o=g}var c=sowbForms.getContainerFieldId(s,"widget",".siteorigin-widget-widget");if(!1!==c){var p={};for(var u in o){var m=u.match(/_else\[(.*)\]|(.*)\[(.*)\]/);p[m&&m.length&&void 0===m[1]?m[2]+"_"+c+"["+m[3]+"]":"_else["+m[1]+"_"+c+"]"]=o[u]}o=p}for(var w in o)if(n=!1,null!==(e=w.match(/^([a-zA-Z0-9_-]+)(\[([a-zA-Z0-9_\-,]+)\])?(\[\])?#x2F;))){if(i={group:"default",name:"",multi:!1},void 0!==e[2]?(i.group=e[1],i.name=e[3]):i.name=e[0],i.multi=void 0!==e[4],"_else"===i.group)i.group=i.name,i.name="",n=i.group===h&&void 0===d[i.group];else{a=i.name.split(",").map(function(e){return e.trim()});for(var v=0;v<a.length&&!(n=i.group===h&&a[v]===b);v++);}if(n){t=o[w],i.multi||(t=[t]);for(v=0;v<t.length;v++)(r=void 0!==t[v][1]&&Boolean(t[v][1])?s.find(t[v][1]):s)[t[v][0]].apply(r,void 0!==t[v][2]?t[v][2]:[]);d[i.group]=!0}}})}),t.sowSetupPreview();var a=(o=t).find(".siteorigin-widget-teaser");if(a.find(".dashicons-dismiss").click(function(){var e=C(this);C.get(e.data("dismiss-url")),a.slideUp("normal",function(){a.remove()})}),!t.data("backupDisabled")){var s=t.find("> .siteorigin-widgets-form-id").val(),d=t.find("> .siteorigin-widgets-form-timestamp"),l=parseInt(d.val()||0),g=JSON.parse(sessionStorage.getItem(s));if(g)if(g._sow_form_timestamp>l){var f=C('<div class="siteorigin-widget-form-notification"><span>'+soWidgets.backup.newerVersion+'</span><a class="button button-small so-backup-restore">'+soWidgets.backup.restore+'</a><a class="button button-small so-backup-dismiss">'+soWidgets.backup.dismiss+"</a><div><small>"+soWidgets.backup.replaceWarning+"</small></div></div>");t.prepend(f),f.find(".so-backup-restore").click(function(){sowbForms.setWidgetFormValues(o,g),f.slideUp("fast",function(){f.remove()})}),f.find(".so-backup-dismiss").click(function(){f.slideUp("fast",function(){sessionStorage.removeItem(s),f.remove()})})}else sessionStorage.removeItem(s);t.change(function(){d.val((new Date).getTime());var e=sowbForms.getWidgetFormValues(t);sessionStorage.setItem(s,JSON.stringify(e))})}}else o=t.closest(".siteorigin-widget-form-main");o.find("> .siteorigin-widgets-form-id").val();var c=t.find("> .siteorigin-widget-field");c.find("> .siteorigin-widget-section").sowSetupForm();var p=c.find("> .siteorigin-widget-widget");p.find("> .siteorigin-widget-section").sowSetupForm(),p.filter(":not(:has(> .siteorigin-widget-section))").sowSetupForm(),c.find(".siteorigin-widget-input").each(function(e,i){null===C(i).data("original-name")&&C(i).data("original-name",C(i).attr("name"))}),c.find("> .siteorigin-widget-field-repeater").sowSetupRepeater(),t.find(".siteorigin-widget-field-repeater-item").sowSetupRepeaterItems(),c.find("> .siteorigin-widget-input-color").each(function(){var e=C(this),i={change:function(e,i){setTimeout(function(){C(e.target).trigger("change")},100)}};e.data("defaultColor")&&(i.defaultColor=e.data("defaultColor")),e.wpColorPicker(i)});var u=function(){C(this).toggleClass("siteorigin-widget-section-visible"),C(this).parent().find("> .siteorigin-widget-section, > .siteorigin-widget-widget > .siteorigin-widget-section").slideToggle("fast",function(){(C(window).resize(),C(this).find("> .siteorigin-widget-field-container-state").val(C(this).is(":visible")?"open":"closed"),C(this).is(":visible"))&&C(this).find("> .siteorigin-widget-field").trigger("sowsetupformfield")})};c.filter(".siteorigin-widget-field-type-widget, .siteorigin-widget-field-type-section").find("> label").click(u),c.filter(".siteorigin-widget-field-type-posts").find(".posts-container-label-wrapper").click(u),c.filter(".siteorigin-widget-field-type-slider").each(function(){var t=C(this),r=t.find('input[type="number"]'),n=t.find(".siteorigin-widget-value-slider");n.slider({max:parseFloat(r.attr("max")),min:parseFloat(r.attr("min")),step:parseFloat(r.attr("step")),value:parseFloat(r.val()),slide:function(e,i){r.val(parseFloat(i.value)),r.trigger("change")},change:function(e,i){t.find(".siteorigin-widget-slider-value").html(i.value)}}),r.change(function(e,i){i&&i.silent||n.slider("value",parseFloat(r.val()))})}),c.filter(".siteorigin-widget-field-type-link").each(function(){var n=C(this),t=function(){var e=n.find(".content-text-search"),i=e.val(),t=e.data("postTypes"),r=n.find("ul.posts").empty().addClass("loading");C.get(soWidgets.ajaxurl,{action:"so_widgets_search_posts",query:i,postTypes:t},function(e){for(var i=0;i<e.length;i++)""===e[i].label&&(e[i].label="&nbsp;"),r.append(C("<li>").addClass("post").html(e[i].label+"<span>("+e[i].type+")</span>").data(e[i]));r.removeClass("loading")})};n.find(".select-content-button, .button-close").click(function(e){e.preventDefault(),C(this).blur();var i=n.find(".existing-content-selector");i.toggle(),i.is(":visible")&&0===i.find("ul.posts li").length&&t()}),n.on("click",".posts li",function(e){e.preventDefault();var i=C(this);n.find("input.siteorigin-widget-input").val("post: "+i.data("value")),n.change(),n.find(".existing-content-selector").toggle()});var e=null;n.find(".content-text-search").keyup(function(){null!==e&&clearTimeout(e),e=setTimeout(function(){t()},500)})}),void 0!==jQuery.fn.soPanelsSetupBuilderWidget&&c.filter(".siteorigin-widget-field-type-builder").each(function(){C(this).find("> .siteorigin-page-builder-field").each(function(){var e=C(this);e.soPanelsSetupBuilderWidget({builderType:e.data("type")})})});var m=function(){var a=C(this),e=a.closest("[data-state-emitter]").data("state-emitter");if(void 0!==e){var i=function(e,i){if(void 0===sowEmitters[e.callback]||"_"===e.callback.substr(0,1))return i;if(a.is('[type="radio"]')&&!a.is(":checked"))return i;var t=sowbForms.getContainerFieldId(a,"repeater",".siteorigin-widget-field-repeater-item");!1!==t&&(e.args=e.args.map(function(e){return e.replace("{$repeater}",t)}));var r=sowbForms.getContainerFieldId(a,"widget",".siteorigin-widget-widget");!1===r||e.hasOwnProperty("widgetFieldId")||(e.widgetFieldId=r,e.args=e.args.map(function(e){return e+"_"+r}));var n=a.is('[type="checkbox"]')?a.is(":checked"):a.val();return C.extend(i,sowEmitters[e.callback](n,e.args))},t={default:""};void 0===e.length&&(e=[e]);for(var r=0;r<e.length;r++)t=i(e[r],t);var n=o.data("states");for(var s in void 0===n&&(n={default:""}),t)void 0!==n[s]&&t[s]===n[s]||(n[s]=t[s],o.trigger("sowstatechange",[s,t[s]]));o.data("states",n)}};c.filter("[data-state-emitter]").each(function(){var e=C(this).find(".siteorigin-widget-input");e.on("keyup change",m),e.each(function(){var e=C(this);e.is(":radio")?e.is(":checked")&&m.call(e[0]):m.call(e[0])})}),t.trigger("sowsetupform",c).data("sow-form-setup",!0),c.trigger("sowsetupformfield"),t.find(".siteorigin-widget-field-repeater-item").trigger("updateFieldPositions"),(r.hasClass("wp-customizer")||r.hasClass("widgets-php"))&&t.closest(".ui-sortable").on("sortstop",function(e,i){i.item.find(".siteorigin-widget-form").find("> .siteorigin-widget-field").trigger("sowsetupformfield")}),y=!1})},C.fn.sowSetupPreview=function(){var r=C(this);r.siblings(".siteorigin-widget-preview").find("> a").click(function(e){e.preventDefault();var i=sowbForms.getWidgetFormValues(r),t=C(C("#so-widgets-bundle-tpl-preview-dialog").html().trim()).appendTo("body");t.find('input[name="data"]').val(JSON.stringify(i)),t.find('input[name="class"]').val(r.data("class")),t.find("iframe").on("load",function(){C(this).css("visibility","visible")}),t.find("form").submit(),t.find(".close").click(function(){t.remove()})})},C.fn.sowSetupRepeater=function(){return C(this).each(function(e,i){var n=C(i),t=n.find(".siteorigin-widget-field-repeater-items"),a=n.data("repeater-name");t.bind("updateFieldPositions",function(){var e=C(this),i=e.find("> .siteorigin-widget-field-repeater-item");i.each(function(r,e){C(e).find(".siteorigin-widget-input").each(function(e,i){var t=C(i).data("repeater-positions");void 0===t&&(t={}),t[a]=r,C(i).data("repeater-positions",t)})}),e.find(".siteorigin-widget-input").each(function(e,i){var t=C(i),r=t.data("repeater-positions");if(void 0!==r){var n=t.attr("data-original-name");if(n||(t.attr("data-original-name",t.attr("name")),n=t.attr("name")),!n)return;if(r)for(var a in r)n=n.replace("#"+a+"#",r[a]);t.attr("name",n)}}),e.data("initialSetup")||(e.find(".siteorigin-widget-input").each(function(e,i){var t=C(i);t.prop("checked",t.prop("defaultChecked"))}),e.data("initialSetup",!0));var t=n.data("scroll-count")?parseInt(n.data("scroll-count")):0;if(0<t&&i.length>t){var r=i.first().outerHeight();e.css("max-height",r*t).css("overflow","auto")}else e.css("max-height","").css("overflow","")}),t.sortable({handle:".siteorigin-widget-field-repeater-item-top",items:"> .siteorigin-widget-field-repeater-item",update:function(){t.find('input[type="radio"].siteorigin-widget-input').attr("name",""),t.trigger("updateFieldPositions"),n.trigger("change")},sortstop:function(e,i){i.item.is(".siteorigin-widget-field-repeater-item")?i.item.find("> .siteorigin-widget-field-repeater-item-form").each(function(){C(this).find("> .siteorigin-widget-field").trigger("sowsetupformfield")}):i.item.find(".siteorigin-widget-form").find("> .siteorigin-widget-field").trigger("sowsetupformfield");n.trigger("change")}}),t.trigger("updateFieldPositions"),n.find("> .siteorigin-widget-field-repeater-add").disableSelection().click(function(e){e.preventDefault(),n.closest(".siteorigin-widget-field-repeater").sowAddRepeaterItem().find("> .siteorigin-widget-field-repeater-items").slideDown("fast",function(){C(window).resize()})}),n.find("> .siteorigin-widget-field-repeater-top > .siteorigin-widget-field-repeater-expand").click(function(e){e.preventDefault(),n.closest(".siteorigin-widget-field-repeater").find("> .siteorigin-widget-field-repeateritems-").slideToggle("fast",function(){C(window).resize()})})})},C.fn.sowAddRepeaterItem=function(){return C(this).each(function(e,i){var t=C(i),r=t.find("> .siteorigin-widget-field-repeater-items").children().length+1,n=C("<div>"+t.find("> .siteorigin-widget-field-repeater-item-html").html()+"</div>");n.find(".siteorigin-widget-input[data-name]").each(function(){var e=C(this);0===e.closest(".siteorigin-widget-field-repeater-item-html").length&&e.attr("name",C(this).data("name"))});var a="";n.find("> .siteorigin-widget-field").each(function(e,i){var t=i.outerHTML;C(i).is(".siteorigin-widget-field-type-repeater")||(t=t.replace(/_id_/g,r)),a+=t});var s=void 0!==t.attr("readonly"),o=C('<div class="siteorigin-widget-field-repeater-item ui-draggable" />').append(C('<div class="siteorigin-widget-field-repeater-item-top" />').append(C('<div class="siteorigin-widget-field-expand" />')).append(s?"":C('<div class="siteorigin-widget-field-copy" />')).append(s?"":C('<div class="siteorigin-widget-field-remove" />')).append(C("<h4 />").html(t.data("item-name")))).append(C('<div class="siteorigin-widget-field-repeater-item-form" />').html(a));t.find("> .siteorigin-widget-field-repeater-items").append(o).sortable("refresh").trigger("updateFieldPositions"),o.sowSetupRepeaterItems(),o.hide().slideDown("fast",function(){C(window).resize()}),t.trigger("change")})},C.fn.sowRemoveRepeaterItem=function(){return C(this).each(function(e,i){var t=C(this).closest(".siteorigin-widget-field-repeater-items");C(this).remove(),t.sortable("refresh").trigger("updateFieldPositions"),C(i).trigger("change")})},C.fn.sowSetupRepeaterItems=function(){return C(this).each(function(e,i){var _=C(i);if(void 0===_.data("sowrepeater-actions-setup")){var t=_.closest(".siteorigin-widget-field-repeater"),r=_.find("> .siteorigin-widget-field-repeater-item-top"),n=t.data("item-label");if(n&&n.selector){var a=function(){var e=n.hasOwnProperty("valueMethod")&&n.valueMethod?n.valueMethod:"val",i=_.find(n.selector)[e]();i&&(80<i.length&&(i=i.substr(0,79)+"..."),r.find("h4").text(i))};a();var s=n.hasOwnProperty("updateEvent")&&n.updateEvent?n.updateEvent:"change";_.bind(s,a)}r.click(function(e){"siteorigin-widget-field-remove"!==e.target.className&&"siteorigin-widget-field-copy"!==e.target.className&&(e.preventDefault(),C(this).closest(".siteorigin-widget-field-repeater-item").find(".siteorigin-widget-field-repeater-item-form").eq(0).slideToggle("fast",function(){(C(window).resize(),C(this).is(":visible"))?(C(this).trigger("slideToggleOpenComplete"),C(this).find("> .siteorigin-widget-field").trigger("sowsetupformfield")):C(this).trigger("slideToggleCloseComplete")}))}),r.find(".siteorigin-widget-field-remove").click(function(e,i){e.preventDefault();var t=C(this).closest(".siteorigin-widget-field-repeater-items"),r=C(this).closest(".siteorigin-widget-field-repeater-item"),n=function(){r.remove(),t.sortable("refresh").trigger("updateFieldPositions"),C(window).resize()};i&&i.silent?n():confirm(soWidgets.sure)&&r.slideUp("fast",n),_.trigger("change")}),r.find(".siteorigin-widget-field-copy").click(function(e){e.preventDefault();var h=C(this).closest(".siteorigin-widget-form-main"),b=C(this).closest(".siteorigin-widget-field-repeater-item"),y=b.clone(),i=b.closest(".siteorigin-widget-field-repeater-items"),F=i.children().length,k={};y.find("*[name]").each(function(){var e=C(this),i=e.attr("id"),t=e.attr("name");if(e.is("textarea")&&e.parent().is(".wp-editor-container")&&"undefined"!=typeof tinymce){e.parent().empty().append(e),e.css("display","");var r=tinymce.get(i);r&&e.val(r.getContent())}else if(e.is(".wp-color-picker")){var n=e.closest(".wp-picker-container"),a=e.closest(".siteorigin-widget-field");n.remove(),a.append(e.remove())}else{var s=i?b.find("#"+i):b.find('[name="'+t+'"]');s.length&&null!=s.val()&&e.val(s.val())}if(i){var o,d;if(e.is('[type="radio"]')){o=i.replace(/-\d+-\d+#x2F;,"");var l=i.replace(/-\d+#x2F;,"");if(!k[o]){var g={};k[o]=h.find(".siteorigin-widget-input[id^="+o+"]").not("[id*=_id_]").filter(function(e,i){var t=C(i).attr("name");return!g[t]&&(g[t]=!0)}).length+1}var f=o+"-"+k[o];d=f+i.match(/-\d+#x2F;)[0],y.find("label[for="+l+"]").attr("for",f)}else u=new RegExp("-\\d+quot;),o=i.replace(u,""),k[o]||(k[o]=h.find(".siteorigin-widget-input[id^="+o+"]").not("[id*=_id_]").length+1),d=o+"-"+k[o]++;if(e.attr("id",d),e.is(".wp-editor-area")){var c=e.closest(".siteorigin-widget-tinymce-container"),p=c.data("media-buttons");if(p&&p.html){var u=new RegExp(i,"g");p.html=p.html.replace(u,d),c.data("media-buttons",p)}}y.find("label[for="+i+"]").attr("for",d),y.find("[id*="+i+"]").each(function(){var e=C(this).attr("id").replace(i,d);C(this).attr("id",e)}),"undefined"!=typeof tinymce&&tinymce.get(d)&&tinymce.get(d).remove()}var m=b.parents(".siteorigin-widget-field-repeater").length,w=C("body");(w.hasClass("wp-customizer")||w.hasClass("widgets-php"))&&0===_.closest(".panel-dialog").length&&(m+=1);var v=t.replace(new RegExp("((?:.*?\\[\\d+\\]){"+(m-1).toString()+"})?(.*?\\[)\\d+(\\])"),"$1$2"+F.toString()+"$3");e.attr("name",v),e.data("original-name",v)}),i.append(y).sortable("refresh").trigger("updateFieldPositions"),y.sowSetupRepeaterItems(),y.hide().slideDown("fast",function(){C(window).resize()}),_.trigger("change")}),_.find("> .siteorigin-widget-field-repeater-item-form").sowSetupForm(),_.data("sowrepeater-actions-setup",!0)}})},sowbForms.getContainerFieldId=function(e,i,t){var r=i+"FieldId";this.hasOwnProperty(r)||(this[r]=1);var n=e.closest(t);if(n.length){var a=n.data("field-id");return void 0===a&&(a=this[r]++),n.data("field-id",a),a}return!1},sowbForms.getWidgetFieldVariable=function(e,i,t){var r=window.sow_field_javascript_variables[e];i=i.replace(/\[#.*?#\]/g,"");for(var n=/[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(i)[1].split("]["),a=n.length?r:null;n.length;)a=a[n.shift()];return a[t]},sowbForms.fetchWidgetVariable=function(i,t,r){window.sowVars=window.sowVars||{},void 0===window.sowVars[t]?C.post(soWidgets.ajaxurl,{action:"sow_get_javascript_variables",widget:t,key:i},function(e){window.sowVars[t]=e,r(window.sowVars[t][i])}):r(window.sowVars[t][i])},sowbForms.getWidgetFormValues=function(e){if(_.isUndefined(e))return null;var l={};return e.find("*[name]").each(function(){var i=C(this);try{var e=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(i.attr("name"));if(_.isEmpty(e))return!0;var t=(e=e[1]).split("][");t=t.map(function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e});var r=l,n=null,a=_.isString(i.attr("type"))?i.attr("type").toLowerCase():null;if("checkbox"===a)n=!!i.is(":checked")&&(""===i.val()||i.val());else if("radio"===a){if(!i.is(":checked"))return;n=i.val()}else if("TEXTAREA"===i.prop("tagName")&&i.hasClass("wp-editor-area")){var s=null;"undefined"!=typeof tinyMCE&&(s=tinyMCE.get(i.attr("id"))),n=null===s||"function"!=typeof s.getContent||s.isHidden()?i.val():s.getContent()}else if("SELECT"===i.prop("tagName")){var o=i.find("option:selected");1===o.length?n=i.find("option:selected").val():1<o.length&&(n=_.map(i.find("option:selected"),function(e,i){return C(e).val()}))}else n=i.val();for(var d=0;d<t.length;d++)d===t.length-1?""===t[d]?r.push(n):r[t[d]]=n:(_.isUndefined(r[t[d]])&&(_.isNumber(t[d+1])||""===t[d+1]?r[t[d]]=[]:r[t[d]]={}),r=r[t[d]])}catch(e){console.error("Field ["+i.attr("name")+"] could not be processed and was skipped - "+e.message)}}),l},sowbForms.setWidgetFormValues=function(e,d,v,l){v=v||!1,l=void 0!==l&&l||void 0===l;var i=0,h=function(e,w){10!=++i&&e.find("> .siteorigin-widget-field-type-repeater,> .siteorigin-widget-field-type-section > .siteorigin-widget-section > .siteorigin-widget-field-type-repeater").each(function(e,i){var t=C(this),r=t.find("> .siteorigin-widget-field-repeater"),n=r.data("repeaterName"),a=w.hasOwnProperty(n)?w[n]:null;if(t.parent().is(".siteorigin-widget-section")){var s=r.data("element-name");s=s.replace(/\[#.*?#\]/g,"");for(var o=/[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(s)[1].split("]["),d=o.length?w:null;o.length;){var l=o.shift();d=d.hasOwnProperty(l)?d[l]:d}a=d}if(a&&Array.isArray(a)){var g=r.find("> .siteorigin-widget-field-repeater-items > .siteorigin-widget-field-repeater-item"),f=a.length,c=g.length;if(c<f)for(var p=0;p<f-c;p++)r.find("> .siteorigin-widget-field-repeater-add").click();else if(!v&&f<c)for(var u=f;u<c;u++){C(g.eq(u)).find("> .siteorigin-widget-field-repeater-item-top").find(".siteorigin-widget-field-remove").trigger("click",{silent:!0})}g=r.find("> .siteorigin-widget-field-repeater-items > .siteorigin-widget-field-repeater-item");for(var m=0;m<g.length;m++)g.eq(m).find("> .siteorigin-widget-field-repeater-item-form"),h(g.eq(m).find("> .siteorigin-widget-field-repeater-item-form"),a[m])}}),--i};h(e,d),e.find("*[name]").each(function(){var e=C(this),i=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(e.attr("name"));if(null==i)return!0;var t=(i=i[1]).split("][");t=t.map(function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e});for(var r,n=d,a=0;a<t.length;a++){if(!n.hasOwnProperty(t[a])){if(v)return!0;break}a===t.length-1?r=n[t[a]]:n=n[t[a]]}if("checkbox"===e.attr("type"))e.prop("checked",r);else if("radio"===e.attr("type"))e.prop("checked",r===e.val());else if("TEXTAREA"===e.prop("tagName")&&e.hasClass("wp-editor-area")){var s=null;"undefined"!=typeof tinyMCE&&(s=tinyMCE.get(e.attr("id"))),null!==s&&"function"==typeof s.setContent&&!s.isHidden()&&e.parent().is(":visible")?s.initialized?s.setContent(r):s.on("init",function(){s.setContent(r)}):e.val(r)}else if(e.is(".panels-data")){e.val(r);var o=e.data("builder");o&&o.setDataField(e)}else e.val(r);l&&e.trigger("change")})},C(".widgets-holder-wrap").on("click",".widget:has(.siteorigin-widget-form-main) .widget-top",function(){var e=C(this).closest(".widget").find(".siteorigin-widget-form-main");setTimeout(function(){e.sowSetupForm()},200)});var e=C("body");e.hasClass("wp-customizer")&&C(document).on("widget-added",function(e,i){i.find(".siteorigin-widget-form").sowSetupForm()}),e.hasClass("block-editor-page")&&C(document).on("panels_setup_preview",function(){C(sowb).trigger("setup_widgets")}),C(document).on("open_dialog",function(e,i){i.$el.find(".so-panels-dialog").is(".so-panels-dialog-edit-widget")&&i.$el.find(".siteorigin-widget-form-main").find("> .siteorigin-widget-field").trigger("sowsetupformfield")}),C(function(){C(document).trigger("sowadminloaded")})}(jQuery);var sowEmitters={_match:function(e,i){void 0===i&&(i=".*");var t=new RegExp("^([a-zA-Z0-9_-]+)(\\[([a-zA-Z0-9_-]+)\\])? *: *("+i+") *quot;).exec(e);if(null===t)return!1;var r="",n="default";return r=void 0!==t[3]?(n=t[1],t[3]):t[1],{match:t[4].trim(),group:n,state:r}},_checker:function(e,i,t,r){var n,a={};void 0===i.length&&(i=[i]);for(var s=0;s<i.length;s++)!1!==(n=sowEmitters._match(i[s],t))&&("_true"===n.match||r(e,i,n.match))&&(a[n.group]=n.state);return a},select:function(e,i){void 0===i.length&&(i=[i]);for(var t={},r=0;r<i.length;r++)""===i[r]&&(i[r]="default"),t[i[r]]=e;return t},conditional:function(val,args){return sowEmitters._checker(val,args,"[^;{}]*",function(val,args,match){return eval(match)})},in:function(e,i){return sowEmitters._checker(e,i,"[^;{}]*",function(e,i,t){return-1!==t.split(",").map(function(e){return e.trim()}).indexOf(e)})}};window.sowbForms=sowbForms;
base/js/meta-box-manager.min.js CHANGED
@@ -1 +1 @@
1
- !function(t){t("#post").on("submit",function(i){var e=t("#siteorigin-widgets-meta-box"),n=sowbForms.getWidgetFormValues(e);e.find('input[name="widget_post_meta"]').val(JSON.stringify(n))})}(jQuery);
1
+ !function(n){n("#post").on("submit",function(t){var i=n("#siteorigin-widgets-meta-box"),e=sowbForms.getWidgetFormValues(i);i.find('input[name="widget_post_meta"]').val(JSON.stringify(e))})}(jQuery);
compat/beaver-builder/sowb-beaver-builder.min.js CHANGED
@@ -1 +1 @@
1
- var sowb=window.sowb||{};!function(e){"undefined"!=typeof FLBuilder&&(sowb.orig_FLBuilder_initJQueryReadyFix=FLBuilder._initJQueryReadyFix,FLBuilder._initJQueryReadyFix=function(){},sowb.orig_FLBuilder_getSettings=FLBuilder._getSettings,FLBuilder._getSettings=function(i){FLBuilder._updateEditorFields();var r=i.serializeArray(),t=0,n=0,l="",d="",o="",u=[],s=[],a={};for(t=0;t<r.length;t++)if(l=r[t].value.replace(/\r/gm,""),!(r[t].name.indexOf("flrich")>-1))if(r[t].name.indexOf("[")>-1){for(d=r[t].name.replace(/\[(.*)\]/,""),o=r[t].name.replace(d,""),u=[],s=o.match(/\[[^\]]*\]/g),n=0;n<s.length;n++)"[]"!==s[n]&&u.push(s[n].replace(/\[|\]/g,""));var g=function(e,i,r,t){0===t.length?e[r]=i:(void 0===e[r]&&(e[r]={}),g(e[r],i,t.shift(),t))};if(u.length>0){var f=u.slice();void 0===a[d]&&(a[d]={}),g(a[d],l,f.shift(),f)}else void 0===a[d]&&(a[d]=[]),a[d].push(l)}else a[r[t].name]=l;for(o in a)if(void 0!==a["as_values_"+o]){a[o]=e.grep(a["as_values_"+o].split(","),function(e){return""!==e}).join(",");try{delete a["as_values_"+o]}catch(e){}}"function"==typeof FLBuilder._getOriginalSettings&&(a=e.extend({},FLBuilder._getOriginalSettings(i),a));var c=i.find(".siteorigin-widget-form");return c.length&&(a[d]=sowbForms.getWidgetFormValues(c)),a}),e(document).on("fl-builder.preview-rendered fl-builder.layout-rendered",".fl-builder-content",function(){e(sowb).trigger("setup_widgets")})}(jQuery),window.sowb=sowb;
1
+ var sowb=window.sowb||{};!function(c){"undefined"!=typeof FLBuilder&&(sowb.orig_FLBuilder_initJQueryReadyFix=FLBuilder._initJQueryReadyFix,FLBuilder._initJQueryReadyFix=function(){},sowb.orig_FLBuilder_getSettings=FLBuilder._getSettings,FLBuilder._getSettings=function(e){FLBuilder._updateEditorFields();var i=e.serializeArray(),r=0,t=0,n="",l="",d="",o=[],u=[],s={};for(r=0;r<i.length;r++)if(n=i[r].value.replace(/\r/gm,""),!(-1<i[r].name.indexOf("flrich")))if(-1<i[r].name.indexOf("[")){for(l=i[r].name.replace(/\[(.*)\]/,""),o=[],u=(d=i[r].name.replace(l,"")).match(/\[[^\]]*\]/g),t=0;t<u.length;t++)"[]"!==u[t]&&o.push(u[t].replace(/\[|\]/g,""));var a=function(e,i,r,t){0===t.length?e[r]=i:(void 0===e[r]&&(e[r]={}),a(e[r],i,t.shift(),t))};if(0<o.length){var g=o.slice();void 0===s[l]&&(s[l]={}),a(s[l],n,g.shift(),g)}else void 0===s[l]&&(s[l]=[]),s[l].push(n)}else s[i[r].name]=n;for(d in s)if(void 0!==s["as_values_"+d]){s[d]=c.grep(s["as_values_"+d].split(","),function(e){return""!==e}).join(",");try{delete s["as_values_"+d]}catch(e){}}"function"==typeof FLBuilder._getOriginalSettings&&(s=c.extend({},FLBuilder._getOriginalSettings(e),s));var f=e.find(".siteorigin-widget-form");return f.length&&(s[l]=sowbForms.getWidgetFormValues(f)),s}),c(document).on("fl-builder.preview-rendered fl-builder.layout-rendered",".fl-builder-content",function(){c(sowb).trigger("setup_widgets")})}(jQuery),window.sowb=sowb;
compat/block-editor/widget-block.js CHANGED
@@ -12,9 +12,9 @@
12
var __ = i18n.__;
13
14
registerBlockType( 'sowb/widget-block', {
15
- title: __( 'SiteOrigin Widget' ),
16
17
- description: __( 'Select a SiteOrigin widget from the dropdown.' ),
18
19
icon: function() {
20
return el(
@@ -41,32 +41,14 @@
41
},
42
43
edit: withState( {
44
- loadingWidgets: true,
45
editing: false,
46
formInitialized: false,
47
previewInitialized: false,
48
- widgets: null,
49
widgetFormHtml: '',
50
widgetSettingsChanged: false,
51
widgetPreviewHtml: '',
52
} )( function ( props ) {
53
54
- if ( props.loadingWidgets ) {
55
- $.get( {
56
- url: sowbBlockEditorAdmin.restUrl + 'sowb/v1/widgets',
57
- beforeSend: function ( xhr ) {
58
- xhr.setRequestHeader( 'X-WP-Nonce', sowbBlockEditorAdmin.nonce );
59
- }
60
- } )
61
- .then( function( widgets ) {
62
- var newState = { widgets: widgets, loadingWidgets: false };
63
- if ( !props.attributes.widgetClass ) {
64
- newState.editing = true;
65
- }
66
- props.setState( newState );
67
- } );
68
- }
69
-
70
function onWidgetClassChange( newWidgetClass ) {
71
if ( newWidgetClass !== '' ) {
72
if ( props.widgetSettingsChanged && ! confirm( sowbBlockEditorAdmin.confirmChangeWidget ) ) {
@@ -74,6 +56,7 @@
74
}
75
props.setAttributes( { widgetClass: newWidgetClass, widgetData: null } );
76
props.setState( {
77
widgetFormHtml: null,
78
formInitialized: false,
79
widgetSettingsChanged: false,
@@ -127,10 +110,10 @@
127
}
128
}
129
130
- if ( props.editing ) {
131
var widgetsOptions = [];
132
- if ( props.widgets ) {
133
- props.widgets.sort( function ( a, b ) {
134
if ( a.name < b.name ) {
135
return -1;
136
} else if ( a.name > b.name ) {
@@ -138,15 +121,15 @@
138
}
139
return 0;
140
} );
141
- widgetsOptions = props.widgets.map( function ( widget ) {
142
return { value: widget.class, label: widget.name };
143
} );
144
- widgetsOptions.unshift( { value: '', label: __( 'Select widget type' ) } );
145
}
146
147
- var loadingWidgetForm = props.attributes.widgetClass && !props.widgetFormHtml;
148
- if ( loadingWidgetForm ) {
149
- $.get( {
150
url: sowbBlockEditorAdmin.restUrl + 'sowb/v1/widgets/forms',
151
beforeSend: function ( xhr ) {
152
xhr.setRequestHeader( 'X-WP-Nonce', sowbBlockEditorAdmin.nonce );
@@ -173,7 +156,7 @@
173
IconButton,
174
{
175
className: 'components-icon-button components-toolbar__control',
176
- label: __( 'Preview widget.' ),
177
onClick: switchToPreview,
178
icon: 'visibility'
179
}
@@ -185,10 +168,10 @@
185
{
186
key: 'placeholder',
187
className: 'so-widget-placeholder',
188
- label: __( 'SiteOrigin Widget' ),
189
- instructions: __( 'Select the type of widget you want to use:' )
190
},
191
- ( props.loadingWidgets || loadingWidgetForm ?
192
el( Spinner ) :
193
el(
194
'div',
@@ -212,9 +195,9 @@
212
];
213
} else {
214
215
- var loadingWidgetPreview = !props.editing && !props.widgetPreviewHtml;
216
- if ( loadingWidgetPreview ) {
217
- $.get( {
218
url: sowbBlockEditorAdmin.restUrl + 'sowb/v1/widgets/previews',
219
beforeSend: function ( xhr ) {
220
xhr.setRequestHeader( 'X-WP-Nonce', sowbBlockEditorAdmin.nonce );
@@ -225,7 +208,10 @@
225
}
226
} )
227
.then( function( widgetPreview ) {
228
- props.setState( { widgetPreviewHtml: widgetPreview } );
229
} );
230
}
231
var widgetPreview = props.widgetPreviewHtml ? props.widgetPreviewHtml : '';
@@ -240,7 +226,7 @@
240
IconButton,
241
{
242
className: 'components-icon-button components-toolbar__control',
243
- label: __( 'Edit widget.' ),
244
onClick: switchToEditing,
245
icon: 'edit'
246
}
@@ -253,7 +239,7 @@
253
key: 'preview',
254
className: 'so-widget-preview-container'
255
},
256
- ( loadingWidgetPreview ?
257
el( 'div', {
258
className: 'so-widgets-spinner-container'
259
},
12
var __ = i18n.__;
13
14
registerBlockType( 'sowb/widget-block', {
15
+ title: __( 'SiteOrigin Widget (in beta)', 'so-widgets-bundle' ),
16
17
+ description: __( 'Select a SiteOrigin widget from the dropdown.', 'so-widgets-bundle' ),
18
19
icon: function() {
20
return el(
41
},
42
43
edit: withState( {
44
editing: false,
45
formInitialized: false,
46
previewInitialized: false,
47
widgetFormHtml: '',
48
widgetSettingsChanged: false,
49
widgetPreviewHtml: '',
50
} )( function ( props ) {
51
52
function onWidgetClassChange( newWidgetClass ) {
53
if ( newWidgetClass !== '' ) {
54
if ( props.widgetSettingsChanged && ! confirm( sowbBlockEditorAdmin.confirmChangeWidget ) ) {
56
}
57
props.setAttributes( { widgetClass: newWidgetClass, widgetData: null } );
58
props.setState( {
59
+ editing: true,
60
widgetFormHtml: null,
61
formInitialized: false,
62
widgetSettingsChanged: false,
110
}
111
}
112
113
+ if ( props.editing || ! props.attributes.widgetClass ) {
114
var widgetsOptions = [];
115
+ if ( sowbBlockEditorAdmin.widgets ) {
116
+ sowbBlockEditorAdmin.widgets.sort( function ( a, b ) {
117
if ( a.name < b.name ) {
118
return -1;
119
} else if ( a.name > b.name ) {
121
}
122
return 0;
123
} );
124
+ widgetsOptions = sowbBlockEditorAdmin.widgets.map( function ( widget ) {
125
return { value: widget.class, label: widget.name };
126
} );
127
+ widgetsOptions.unshift( { value: '', label: __( 'Select widget type', 'so-widgets-bundle' ) } );
128
}
129
130
+ var loadWidgetForm = props.attributes.widgetClass && ! props.widgetFormHtml;
131
+ if ( loadWidgetForm ) {
132
+ $.post( {
133
url: sowbBlockEditorAdmin.restUrl + 'sowb/v1/widgets/forms',
134
beforeSend: function ( xhr ) {
135
xhr.setRequestHeader( 'X-WP-Nonce', sowbBlockEditorAdmin.nonce );
156
IconButton,
157
{
158
className: 'components-icon-button components-toolbar__control',
159
+ label: __( 'Preview widget.', 'so-widgets-bundle' ),
160
onClick: switchToPreview,
161
icon: 'visibility'
162
}
168
{
169
key: 'placeholder',
170
className: 'so-widget-placeholder',
171
+ label: __( 'SiteOrigin Widget', 'so-widgets-bundle' ),
172
+ instructions: __( 'Select the type of widget you want to use:', 'so-widgets-bundle' )
173
},
174
+ ( props.loadingWidgets || loadWidgetForm ?
175
el( Spinner ) :
176
el(
177
'div',
195
];
196
} else {
197
198
+ var loadWidgetPreview = ! props.loadingWidgets && ! props.editing && ! props.widgetPreviewHtml && props.attributes.widgetClass;
199
+ if ( loadWidgetPreview ) {
200
+ $.post( {
201
url: sowbBlockEditorAdmin.restUrl + 'sowb/v1/widgets/previews',
202
beforeSend: function ( xhr ) {
203
xhr.setRequestHeader( 'X-WP-Nonce', sowbBlockEditorAdmin.nonce );
208
}
209
} )
210
.then( function( widgetPreview ) {
211
+ props.setState( {
212
+ widgetPreviewHtml: widgetPreview,
213
+ previewInitialized: false,
214
+ } );
215
} );
216
}
217
var widgetPreview = props.widgetPreviewHtml ? props.widgetPreviewHtml : '';
226
IconButton,
227
{
228
className: 'components-icon-button components-toolbar__control',
229
+ label: __( 'Edit widget.', 'so-widgets-bundle' ),
230
onClick: switchToEditing,
231
icon: 'edit'
232
}
239
key: 'preview',
240
className: 'so-widget-preview-container'
241
},
242
+ ( loadWidgetPreview ?
243
el( 'div', {
244
className: 'so-widgets-spinner-container'
245
},
compat/block-editor/widget-block.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,t,i,n,o,s){var d=n.createElement,a=t.registerBlockType,r=e.BlockControls,l=o.SelectControl,w=s.withState,g=o.Toolbar,c=o.IconButton,m=o.Placeholder,u=o.Spinner,b=i.__;a("sowb/widget-block",{title:b("SiteOrigin Widget"),description:b("Select a SiteOrigin widget from the dropdown."),icon:function(){return d("span",{className:"widget-icon so-widget-icon so-block-editor-icon"})},category:"widgets",supports:{html:!1},attributes:{widgetClass:{type:"string"},widgetData:{type:"object"}},edit:w({loadingWidgets:!0,editing:!1,formInitialized:!1,previewInitialized:!1,widgets:null,widgetFormHtml:"",widgetSettingsChanged:!1,widgetPreviewHtml:""})(function(e){function t(t){if(""!==t){if(e.widgetSettingsChanged&&!confirm(sowbBlockEditorAdmin.confirmChangeWidget))return!1;e.setAttributes({widgetClass:t,widgetData:null}),e.setState({widgetFormHtml:null,formInitialized:!1,widgetSettingsChanged:!1,widgetPreviewHtml:null,previewInitialized:!1})}}function i(){e.setState({editing:!0,formInitialized:!1})}function n(){e.setState({editing:!1,previewInitialized:!1})}function o(t){var i=$(t).find(".siteorigin-widget-form-main");if(i.length>0&&!e.formInitialized){i.siblings(".siteorigin-widget-preview").find("> a").on("click",function(e){e.stopImmediatePropagation(),n()}),i.data("backupDisabled",!0),i.sowSetupForm(),e.attributes.widgetData?sowbForms.setWidgetFormValues(i,e.attributes.widgetData):e.setAttributes({widgetData:sowbForms.getWidgetFormValues(i)}),i.on("change",function(){e.setAttributes({widgetData:sowbForms.getWidgetFormValues(i)}),e.setState({widgetSettingsChanged:!0,widgetPreviewHtml:null,previewInitialized:!1})}),e.setState({formInitialized:!0})}}function s(){e.previewInitialized||($(window.sowb).trigger("setup_widgets"),e.setState({previewInitialized:!0}))}if(e.loadingWidgets&&$.get({url:sowbBlockEditorAdmin.restUrl+"sowb/v1/widgets",beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",sowbBlockEditorAdmin.nonce)}}).then(function(t){var i={widgets:t,loadingWidgets:!1};e.attributes.widgetClass||(i.editing=!0),e.setState(i)}),e.editing){var a=[];e.widgets&&(e.widgets.sort(function(e,t){return e.name<t.name?-1:e.name>t.name?1:0}),a=e.widgets.map(function(e){return{value:e.class,label:e.name}}),a.unshift({value:"",label:b("Select widget type")}));var w=e.attributes.widgetClass&&!e.widgetFormHtml;w&&$.get({url:sowbBlockEditorAdmin.restUrl+"sowb/v1/widgets/forms",beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",sowbBlockEditorAdmin.nonce)},data:{widgetClass:e.attributes.widgetClass}}).then(function(t){e.setState({widgetFormHtml:t})});var p=e.widgetFormHtml?e.widgetFormHtml:"";return[!!p&&d(r,{key:"controls"},d(g,null,d(c,{className:"components-icon-button components-toolbar__control",label:b("Preview widget."),onClick:n,icon:"visibility"}))),d(m,{key:"placeholder",className:"so-widget-placeholder",label:b("SiteOrigin Widget"),instructions:b("Select the type of widget you want to use:")},e.loadingWidgets||w?d(u):d("div",{className:"so-widget-block-container"},d(l,{options:a,value:e.attributes.widgetClass,onChange:t}),d("div",{className:"so-widget-block-form-container",dangerouslySetInnerHTML:{__html:p},ref:o})))]}var f=!e.editing&&!e.widgetPreviewHtml;f&&$.get({url:sowbBlockEditorAdmin.restUrl+"sowb/v1/widgets/previews",beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",sowbBlockEditorAdmin.nonce)},data:{widgetClass:e.attributes.widgetClass,widgetData:e.attributes.widgetData||{}}}).then(function(t){e.setState({widgetPreviewHtml:t})});var v=e.widgetPreviewHtml?e.widgetPreviewHtml:"";return[d(r,{key:"controls"},d(g,null,d(c,{className:"components-icon-button components-toolbar__control",label:b("Edit widget."),onClick:i,icon:"edit"}))),d("div",{key:"preview",className:"so-widget-preview-container"},f?d("div",{className:"so-widgets-spinner-container"},d("span",null,d(u))):d("div",{dangerouslySetInnerHTML:{__html:v},ref:s}))]}),save:function(){return null}})}(window.wp.editor,window.wp.blocks,window.wp.i18n,window.wp.element,window.wp.components,window.wp.compose);
1
+ !function(e,t,i,n,o,s){var a=n.createElement,d=t.registerBlockType,r=e.BlockControls,l=o.SelectControl,w=s.withState,g=o.Toolbar,c=o.IconButton,u=o.Placeholder,m=o.Spinner,b=i.__;d("sowb/widget-block",{title:b("SiteOrigin Widget (in beta)","so-widgets-bundle"),description:b("Select a SiteOrigin widget from the dropdown.","so-widgets-bundle"),icon:function(){return a("span",{className:"widget-icon so-widget-icon so-block-editor-icon"})},category:"widgets",supports:{html:!1},attributes:{widgetClass:{type:"string"},widgetData:{type:"object"}},edit:w({editing:!1,formInitialized:!1,previewInitialized:!1,widgetFormHtml:"",widgetSettingsChanged:!1,widgetPreviewHtml:""})(function(i){function n(){i.setState({editing:!1,previewInitialized:!1})}if(i.editing||!i.attributes.widgetClass){var e=[];sowbBlockEditorAdmin.widgets&&(sowbBlockEditorAdmin.widgets.sort(function(e,t){return e.name<t.name?-1:e.name>t.name?1:0}),(e=sowbBlockEditorAdmin.widgets.map(function(e){return{value:e.class,label:e.name}})).unshift({value:"",label:b("Select widget type","so-widgets-bundle")}));var t=i.attributes.widgetClass&&!i.widgetFormHtml;t&&$.post({url:sowbBlockEditorAdmin.restUrl+"sowb/v1/widgets/forms",beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",sowbBlockEditorAdmin.nonce)},data:{widgetClass:i.attributes.widgetClass}}).then(function(e){i.setState({widgetFormHtml:e})});var o=i.widgetFormHtml?i.widgetFormHtml:"";return[!!o&&a(r,{key:"controls"},a(g,null,a(c,{className:"components-icon-button components-toolbar__control",label:b("Preview widget.","so-widgets-bundle"),onClick:n,icon:"visibility"}))),a(u,{key:"placeholder",className:"so-widget-placeholder",label:b("SiteOrigin Widget","so-widgets-bundle"),instructions:b("Select the type of widget you want to use:","so-widgets-bundle")},i.loadingWidgets||t?a(m):a("div",{className:"so-widget-block-container"},a(l,{options:e,value:i.attributes.widgetClass,onChange:function(e){if(""!==e){if(i.widgetSettingsChanged&&!confirm(sowbBlockEditorAdmin.confirmChangeWidget))return!1;i.setAttributes({widgetClass:e,widgetData:null}),i.setState({editing:!0,widgetFormHtml:null,formInitialized:!1,widgetSettingsChanged:!1,widgetPreviewHtml:null,previewInitialized:!1})}}}),a("div",{className:"so-widget-block-form-container",dangerouslySetInnerHTML:{__html:o},ref:function(e){var t=$(e).find(".siteorigin-widget-form-main");0<t.length&&!i.formInitialized&&(t.siblings(".siteorigin-widget-preview").find("> a").on("click",function(e){e.stopImmediatePropagation(),n()}),t.data("backupDisabled",!0),t.sowSetupForm(),i.attributes.widgetData?sowbForms.setWidgetFormValues(t,i.attributes.widgetData):i.setAttributes({widgetData:sowbForms.getWidgetFormValues(t)}),t.on("change",function(){i.setAttributes({widgetData:sowbForms.getWidgetFormValues(t)}),i.setState({widgetSettingsChanged:!0,widgetPreviewHtml:null,previewInitialized:!1})}),i.setState({formInitialized:!0}))}})))]}var s=!i.loadingWidgets&&!i.editing&&!i.widgetPreviewHtml&&i.attributes.widgetClass;s&&$.post({url:sowbBlockEditorAdmin.restUrl+"sowb/v1/widgets/previews",beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",sowbBlockEditorAdmin.nonce)},data:{widgetClass:i.attributes.widgetClass,widgetData:i.attributes.widgetData||{}}}).then(function(e){i.setState({widgetPreviewHtml:e,previewInitialized:!1})});var d=i.widgetPreviewHtml?i.widgetPreviewHtml:"";return[a(r,{key:"controls"},a(g,null,a(c,{className:"components-icon-button components-toolbar__control",label:b("Edit widget.","so-widgets-bundle"),onClick:function(){i.setState({editing:!0,formInitialized:!1})},icon:"edit"}))),a("div",{key:"preview",className:"so-widget-preview-container"},s?a("div",{className:"so-widgets-spinner-container"},a("span",null,a(m))):a("div",{dangerouslySetInnerHTML:{__html:d},ref:function(){i.previewInitialized||($(window.sowb).trigger("setup_widgets"),i.setState({previewInitialized:!0}))}}))]}),save:function(){return null}})}(window.wp.editor,window.wp.blocks,window.wp.i18n,window.wp.element,window.wp.components,window.wp.compose);
compat/block-editor/widget-block.php CHANGED
@@ -30,15 +30,31 @@ class SiteOrigin_Widgets_Bundle_Widget_Block {
30
array( 'wp-editor', 'wp-blocks', 'wp-i18n', 'wp-element', 'wp-components', 'wp-compose' ),
31
SOW_BUNDLE_VERSION
32
);
33
wp_localize_script(
34
'sowb-widget-block',
35
'sowbBlockEditorAdmin',
36
array(
37
'restUrl' => esc_url_raw( rest_url() ),
38
'nonce' => wp_create_nonce( 'wp_rest' ),
39
'confirmChangeWidget' => __( 'Selecting a different widget will revert any changes. Continue?', 'so-widgets-bundle' ),
40
)
41
);
42
43
$so_widgets_bundle = SiteOrigin_Widgets_Bundle::single();
44
// This is to ensure necessary scripts can be enqueued for previews.
@@ -62,11 +78,13 @@ class SiteOrigin_Widgets_Bundle_Widget_Block {
62
$instance = $attributes['widgetData'];
63
64
if ( ! empty( $widget ) && is_object( $widget ) && is_subclass_of( $widget, 'SiteOrigin_Widget' ) ) {
65
ob_start();
66
/* @var $widget SiteOrigin_Widget */
67
$instance = $widget->update( $instance, $instance );
68
$widget->widget( array(), $instance );
69
$rendered_widget = ob_get_clean();
70
} else {
71
return '<div>'.
72
sprintf(
30
array( 'wp-editor', 'wp-blocks', 'wp-i18n', 'wp-element', 'wp-components', 'wp-compose' ),
31
SOW_BUNDLE_VERSION
32
);
33
+
34
+ global $wp_widget_factory;
35
+ $so_widgets = array();
36
+ foreach ( $wp_widget_factory->widgets as $class => $widget_obj ) {
37
+ if ( ! empty( $widget_obj ) && is_object( $widget_obj ) && is_subclass_of( $widget_obj, 'SiteOrigin_Widget' ) ) {
38
+ $so_widgets[] = array(
39
+ 'name' => preg_replace( '/^SiteOrigin /', '', $widget_obj->name ),
40
+ 'class' => $class,
41
+ );
42
+ }
43
+ }
44
+
45
wp_localize_script(
46
'sowb-widget-block',
47
'sowbBlockEditorAdmin',
48
array(
49
+ 'widgets' => $so_widgets,
50
'restUrl' => esc_url_raw( rest_url() ),
51
'nonce' => wp_create_nonce( 'wp_rest' ),
52
'confirmChangeWidget' => __( 'Selecting a different widget will revert any changes. Continue?', 'so-widgets-bundle' ),
53
)
54
);
55
+ if ( function_exists( 'wp_set_script_translations' ) ) {
56
+ wp_set_script_translations( 'sowb-widget-block', 'so-widgets-bundle' );
57
+ }
58
59
$so_widgets_bundle = SiteOrigin_Widgets_Bundle::single();
60
// This is to ensure necessary scripts can be enqueued for previews.
78
$instance = $attributes['widgetData'];
79
80
if ( ! empty( $widget ) && is_object( $widget ) && is_subclass_of( $widget, 'SiteOrigin_Widget' ) ) {
81
+ $GLOBALS['SITEORIGIN_WIDGET_BLOCK_RENDER'] = true;
82
ob_start();
83
/* @var $widget SiteOrigin_Widget */
84
$instance = $widget->update( $instance, $instance );
85
$widget->widget( array(), $instance );
86
$rendered_widget = ob_get_clean();
87
+ unset( $GLOBALS['SITEORIGIN_WIDGET_BLOCK_RENDER'] );
88
} else {
89
return '<div>'.
90
sprintf(
compat/elementor/sowb-elementor.min.js CHANGED
@@ -1 +1 @@
1
- var sowb=window.sowb||{};!function(e){e(window).on("elementor:init",function(){elementor.on("preview:loaded",function(){var e,n=elementor.$preview.get(0).contentWindow,o=n.jQuery(n.sowb);elementorFrontend.hooks.addAction("frontend/element_ready/widget",function(){e&&clearTimeout(e),e=setTimeout(function(){o.trigger("setup_widgets"),e=null},300)})})})}(jQuery);
1
+ var sowb=window.sowb||{};jQuery(window).on("elementor:init",function(){elementor.on("preview:loaded",function(){var e,n=elementor.$preview.get(0).contentWindow,o=n.jQuery(n.sowb);elementorFrontend.hooks.addAction("frontend/element_ready/widget",function(){e&&clearTimeout(e),e=setTimeout(function(){o.trigger("setup_widgets"),e=null},300)})})});
compat/visual-composer/sowb-vc-widget.min.js CHANGED
@@ -1 +1 @@
1
- var sowbForms=window.sowbForms||{};sowbForms.setupVcWidgetForm=function(){var e=jQuery,o=e('[name="so_widget_class"]'),i=e(".siteorigin_widget_form_container"),n=!1;i.on("change",".siteorigin-widget-field",function(){n=!0;var t=sowbForms.getWidgetFormValues(i),r=o.val(),a=JSON.stringify({widget_class:r,widget_data:t});a=a.replace(/\\/g,"\\\\"),e('[name="so_widget_data"]').val(a)});var t;o.mousedown(function(){t=o.find("option:selected")}),o.on("change",function(r){if(n&&!confirm(soWidgetsVC.confirmChangeWidget))return void t.attr("selected",!0);n=!1;var a=o.val(),s={action:"sowb_vc_widget_render_form",widget:a};e.post(soWidgetsVC.ajaxUrl,s,function(e){i.html(e),i.trigger("change")},"html")}),vc.atts.sowb_json_escaped={parse:function(e){var o=this.content().find(".wpb_vc_param_value[name="+e.param_name+"]");return _.escape(_.escape(o.val().toString()).replace(/\[/g,"&#91;").replace(/\]/g,"&#93;"))},render:function(e,o){return _.unescape(_.unescape(o)).replace(/&#91;/g,"[").replace(/&#93;/g,"]")}},vc.events.on("shortcodeView:updated:siteorigin_widget_vc",function(){if(void 0!==vc.frame_window&&void 0!==vc.frame_window.sowb){(0,vc.frame_window.jQuery)(vc.frame_window.sowb).trigger("setup_widgets")}})},jQuery(function(e){sowbForms.setupVcWidgetForm()}),window.sowbForms=sowbForms;
1
+ var sowbForms=window.sowbForms||{};sowbForms.setupVcWidgetForm=function(){var n,t=jQuery,i=t('[name="so_widget_class"]'),r=t(".siteorigin_widget_form_container"),s=!1;r.on("change",".siteorigin-widget-field",function(){s=!0;var e=sowbForms.getWidgetFormValues(r),o=i.val(),n=JSON.stringify({widget_class:o,widget_data:e});n=n.replace(/\\/g,"\\\\"),t('[name="so_widget_data"]').val(n)}),i.mousedown(function(){n=i.find("option:selected")}),i.on("change",function(e){if(!s||confirm(soWidgetsVC.confirmChangeWidget)){s=!1;var o={action:"sowb_vc_widget_render_form",widget:i.val()};t.post(soWidgetsVC.ajaxUrl,o,function(e){r.html(e),r.trigger("change")},"html")}else n.attr("selected",!0)}),vc.atts.sowb_json_escaped={parse:function(e){var o=this.content().find(".wpb_vc_param_value[name="+e.param_name+"]");return _.escape(_.escape(o.val().toString()).replace(/\[/g,"&#91;").replace(/\]/g,"&#93;"))},render:function(e,o){return _.unescape(_.unescape(o)).replace(/&#91;/g,"[").replace(/&#93;/g,"]")}},vc.events.on("shortcodeView:updated:siteorigin_widget_vc",function(){void 0!==vc.frame_window&&void 0!==vc.frame_window.sowb&&(0,vc.frame_window.jQuery)(vc.frame_window.sowb).trigger("setup_widgets")})},jQuery(function(e){sowbForms.setupVcWidgetForm()}),window.sowbForms=sowbForms;
icons/fontawesome/filter.php CHANGED
@@ -1,793 +1,793 @@
1
- <?php
2
-
3
- function siteorigin_widgets_icons_fontawesome_filter( $icons ){
4
- return array_merge($icons, array(
5
- '500px' => '&#xf26e;',
6
- 'address-book' => '&#xf2b9;',
7
- 'address-book-o' => '&#xf2ba;',
8
- 'address-card' => '&#xf2bb;',
9
- 'address-card-o' => '&#xf2bc;',
10
- 'adjust' => '&#xf042;',
11
- 'adn' => '&#xf170;',
12
- 'align-center' => '&#xf037;',
13
- 'align-justify' => '&#xf039;',
14
- 'align-left' => '&#xf036;',
15
- 'align-right' => '&#xf038;',
16
- 'amazon' => '&#xf270;',
17
- 'ambulance' => '&#xf0f9;',
18
- 'american-sign-language-interpreting' => '&#xf2a3;',
19
- 'anchor' => '&#xf13d;',
20
- 'android' => '&#xf17b;',
21
- 'angellist' => '&#xf209;',
22
- 'angle-double-down' => '&#xf103;',
23
- 'angle-double-left' => '&#xf100;',
24
- 'angle-double-right' => '&#xf101;',
25
- 'angle-double-up' => '&#xf102;',
26
- 'angle-down' => '&#xf107;',
27
- 'angle-left' => '&#xf104;',
28
- 'angle-right' => '&#xf105;',
29
- 'angle-up' => '&#xf106;',
30
- 'apple' => '&#xf179;',
31
- 'archive' => '&#xf187;',
32
- 'area-chart' => '&#xf1fe;',
33
- 'arrow-circle-down' => '&#xf0ab;',
34
- 'arrow-circle-left' => '&#xf0a8;',
35
- 'arrow-circle-o-down' => '&#xf01a;',
36
- 'arrow-circle-o-left' => '&#xf190;',
37
- 'arrow-circle-o-right' => '&#xf18e;',
38
- 'arrow-circle-o-up' => '&#xf01b;',
39
- 'arrow-circle-right' => '&#xf0a9;',
40
- 'arrow-circle-up' => '&#xf0aa;',
41
- 'arrow-down' => '&#xf063;',
42
- 'arrow-left' => '&#xf060;',
43
- 'arrow-right' => '&#xf061;',
44
- 'arrow-up' => '&#xf062;',
45
- 'arrows' => '&#xf047;',
46
- 'arrows-alt' => '&#xf0b2;',
47
- 'arrows-h' => '&#xf07e;',
48
- 'arrows-v' => '&#xf07d;',
49
- 'asl-interpreting' => '&#xf2a3;',
50
- 'assistive-listening-systems' => '&#xf2a2;',
51
- 'asterisk' => '&#xf069;',
52
- 'at' => '&#xf1fa;',
53
- 'audio-description' => '&#xf29e;',
54
- 'automobile' => '&#xf1b9;',
55
- 'backward' => '&#xf04a;',
56
- 'balance-scale' => '&#xf24e;',
57
- 'ban' => '&#xf05e;',
58
- 'bandcamp' => '&#xf2d5;',
59
- 'bank' => '&#xf19c;',
60
- 'bar-chart' => '&#xf080;',
61
- 'bar-chart-o' => '&#xf080;',
62
- 'barcode' => '&#xf02a;',
63
- 'bars' => '&#xf0c9;',
64
- 'bath' => '&#xf2cd;',
65
- 'bathtub' => '&#xf2cd;',
66
- 'battery' => '&#xf240;',
67
- 'battery-0' => '&#xf244;',
68
- 'battery-1' => '&#xf243;',
69
- 'battery-2' => '&#xf242;',
70
- 'battery-3' => '&#xf241;',
71
- 'battery-4' => '&#xf240;',
72
- 'battery-empty' => '&#xf244;',
73
- 'battery-full' => '&#xf240;',
74
- 'battery-half' => '&#xf242;',
75
- 'battery-quarter' => '&#xf243;',
76
- 'battery-three-quarters' => '&#xf241;',
77
- 'bed' => '&#xf236;',
78
- 'beer' => '&#xf0fc;',
79
- 'behance' => '&#xf1b4;',
80
- 'behance-square' => '&#xf1b5;',
81
- 'bell' => '&#xf0f3;',
82
- 'bell-o' => '&#xf0a2;',
83
- 'bell-slash' => '&#xf1f6;',
84
- 'bell-slash-o' => '&#xf1f7;',
85
- 'bicycle' => '&#xf206;',
86
- 'binoculars' => '&#xf1e5;',
87
- 'birthday-cake' => '&#xf1fd;',
88
- 'bitbucket' => '&#xf171;',
89
- 'bitbucket-square' => '&#xf172;',
90
- 'bitcoin' => '&#xf15a;',
91
- 'black-tie' => '&#xf27e;',
92
- 'blind' => '&#xf29d;',
93
- 'bluetooth' => '&#xf293;',
94
- 'bluetooth-b' => '&#xf294;',
95
- 'bold' => '&#xf032;',
96
- 'bolt' => '&#xf0e7;',
97
- 'bomb' => '&#xf1e2;',
98
- 'book' => '&#xf02d;',
99
- 'bookmark' => '&#xf02e;',
100
- 'bookmark-o' => '&#xf097;',
101
- 'braille' => '&#xf2a1;',
102
- 'briefcase' => '&#xf0b1;',
103
- 'btc' => '&#xf15a;',
104
- 'bug' => '&#xf188;',
105
- 'building' => '&#xf1ad;',
106
- 'building-o' => '&#xf0f7;',
107
- 'bullhorn' => '&#xf0a1;',
108
- 'bullseye' => '&#xf140;',
109
- 'bus' => '&#xf207;',
110
- 'buysellads' => '&#xf20d;',
111
- 'cab' => '&#xf1ba;',
112
- 'calculator' => '&#xf1ec;',
113
- 'calendar' => '&#xf073;',
114
- 'calendar-check-o' => '&#xf274;',
115
- 'calendar-minus-o' => '&#xf272;',
116
- 'calendar-o' => '&#xf133;',
117
- 'calendar-plus-o' => '&#xf271;',
118
- 'calendar-times-o' => '&#xf273;',
119
- 'camera' => '&#xf030;',
120
- 'camera-retro' => '&#xf083;',
121
- 'car' => '&#xf1b9;',
122
- 'caret-down' => '&#xf0d7;',
123
- 'caret-left' => '&#xf0d9;',
124
- 'caret-right' => '&#xf0da;',
125
- 'caret-square-o-down' => '&#xf150;',
126
- 'caret-square-o-left' => '&#xf191;',
127
- 'caret-square-o-right' => '&#xf152;',
128
- 'caret-square-o-up' => '&#xf151;',
129
- 'caret-up' => '&#xf0d8;',
130
- 'cart-arrow-down' => '&#xf218;',
131
- 'cart-plus' => '&#xf217;',
132
- 'cc' => '&#xf20a;',
133
- 'cc-amex' => '&#xf1f3;',
134
- 'cc-diners-club' => '&#xf24c;',
135
- 'cc-discover' => '&#xf1f2;',
136
- 'cc-jcb' => '&#xf24b;',
137
- 'cc-mastercard' => '&#xf1f1;',
138
- 'cc-paypal' => '&#xf1f4;',
139
- 'cc-stripe' => '&#xf1f5;',
140
- 'cc-visa' => '&#xf1f0;',
141
- 'certificate' => '&#xf0a3;',
142
- 'chain' => '&#xf0c1;',
143
- 'chain-broken' => '&#xf127;',
144
- 'check' => '&#xf00c;',
145
- 'check-circle' => '&#xf058;',
146
- 'check-circle-o' => '&#xf05d;',
147
- 'check-square' => '&#xf14a;',
148
- 'check-square-o' => '&#xf046;',
149
- 'chevron-circle-down' => '&#xf13a;',
150
- 'chevron-circle-left' => '&#xf137;',
151
- 'chevron-circle-right' => '&#xf138;',
152
- 'chevron-circle-up' => '&#xf139;',
153
- 'chevron-down' => '&#xf078;',
154
- 'chevron-left' => '&#xf053;',
155
- 'chevron-right' => '&#xf054;',
156
- 'chevron-up' => '&#xf077;',
157
- 'child' => '&#xf1ae;',
158
- 'chrome' => '&#xf268;',
159
- 'circle' => '&#xf111;',
160
- 'circle-o' => '&#xf10c;',
161
- 'circle-o-notch' => '&#xf1ce;',
162
- 'circle-thin' => '&#xf1db;',
163
- 'clipboard' => '&#xf0ea;',
164
- 'clock-o' => '&#xf017;',
165
- 'clone' => '&#xf24d;',
166
- 'close' => '&#xf00d;',
167
- 'cloud' => '&#xf0c2;',
168
- 'cloud-download' => '&#xf0ed;',
169
- 'cloud-upload' => '&#xf0ee;',
170
- 'cny' => '&#xf157;',
171
- 'code' => '&#xf121;',
172
- 'code-fork' => '&#xf126;',
173
- 'codepen' => '&#xf1cb;',
174
- 'codiepie' => '&#xf284;',
175
- 'coffee' => '&#xf0f4;',
176
- 'cog' => '&#xf013;',
177
- 'cogs' => '&#xf085;',
178
- 'columns' => '&#xf0db;',
179
- 'comment' => '&#xf075;',
180
- 'comment-o' => '&#xf0e5;',
181
- 'commenting' => '&#xf27a;',
182
- 'commenting-o' => '&#xf27b;',
183
- 'comments' => '&#xf086;',
184
- 'comments-o' => '&#xf0e6;',
185
- 'compass' => '&#xf14e;',
186
- 'compress' => '&#xf066;',
187
- 'connectdevelop' => '&#xf20e;',
188
- 'contao' => '&#xf26d;',
189
- 'copy' => '&#xf0c5;',
190
- 'copyright' => '&#xf1f9;',
191
- 'creative-commons' => '&#xf25e;',
192
- 'credit-card' => '&#xf09d;',
193
- 'credit-card-alt' => '&#xf283;',
194
- 'crop' => '&#xf125;',
195
- 'crosshairs' => '&#xf05b;',
196
- 'css3' => '&#xf13c;',
197
- 'cube' => '&#xf1b2;',
198
- 'cubes' => '&#xf1b3;',
199
- 'cut' => '&#xf0c4;',
200
- 'cutlery' => '&#xf0f5;',
201
- 'dashboard' => '&#xf0e4;',
202
- 'dashcube' => '&#xf210;',
203
- 'database' => '&#xf1c0;',
204
- 'deaf' => '&#xf2a4;',
205
- 'deafness' => '&#xf2a4;',
206
- 'dedent' => '&#xf03b;',
207
- 'delicious' => '&#xf1a5;',
208
- 'desktop' => '&#xf108;',
209
- 'deviantart' => '&#xf1bd;',
210
- 'diamond' => '&#xf219;',
211
- 'digg' => '&#xf1a6;',
212
- 'dollar' => '&#xf155;',
213
- 'dot-circle-o' => '&#xf192;',
214
- 'download' => '&#xf019;',
215
- 'dribbble' => '&#xf17d;',
216
- 'drivers-license' => '&#xf2c2;',
217
- 'drivers-license-o' => '&#xf2c3;',
218
- 'dropbox' => '&#xf16b;',
219
- 'drupal' => '&#xf1a9;',
220
- 'edge' => '&#xf282;',
221
- 'edit' => '&#xf044;',
222
- 'eercast' => '&#xf2da;',
223
- 'eject' => '&#xf052;',
224
- 'ellipsis-h' => '&#xf141;',
225
- 'ellipsis-v' => '&#xf142;',
226
- 'empire' => '&#xf1d1;',
227
- 'envelope' => '&#xf0e0;',
228
- 'envelope-o' => '&#xf003;',
229
- 'envelope-open' => '&#xf2b6;',
230
- 'envelope-open-o' => '&#xf2b7;',
231
- 'envelope-square' => '&#xf199;',
232
- 'envira' => '&#xf299;',
233
- 'eraser' => '&#xf12d;',
234
- 'etsy' => '&#xf2d7;',
235
- 'eur' => '&#xf153;',
236
- 'euro' => '&#xf153;',
237
- 'exchange' => '&#xf0ec;',
238
- 'exclamation' => '&#xf12a;',
239
- 'exclamation-circle' => '&#xf06a;',
240
- 'exclamation-triangle' => '&#xf071;',
241
- 'expand' => '&#xf065;',
242
- 'expeditedssl' => '&#xf23e;',
243
- 'external-link' => '&#xf08e;',
244
- 'external-link-square' => '&#xf14c;',
245
- 'eye' => '&#xf06e;',
246
- 'eye-slash' => '&#xf070;',
247
- 'eyedropper' => '&#xf1fb;',
248
- 'fa' => '&#xf2b4;',
249
- 'facebook' => '&#xf09a;',
250
- 'facebook-f' => '&#xf09a;',
251
- 'facebook-official' => '&#xf230;',
252
- 'facebook-square' => '&#xf082;',
253
- 'fast-backward' => '&#xf049;',
254
- 'fast-forward' => '&#xf050;',
255
- 'fax' => '&#xf1ac;',
256
- 'feed' => '&#xf09e;',
257
- 'female' => '&#xf182;',
258
- 'fighter-jet' => '&#xf0fb;',
259
- 'file' => '&#xf15b;',
260
- 'file-archive-o' => '&#xf1c6;',
261
- 'file-audio-o' => '&#xf1c7;',
262
- 'file-code-o' => '&#xf1c9;',
263
- 'file-excel-o' => '&#xf1c3;',
264
- 'file-image-o' => '&#xf1c5;',
265
- 'file-movie-o' => '&#xf1c8;',
266
- 'file-o' => '&#xf016;',
267
- 'file-pdf-o' => '&#xf1c1;',
268
- 'file-photo-o' => '&#xf1c5;',
269
- 'file-picture-o' => '&#xf1c5;',
270
- 'file-powerpoint-o' => '&#xf1c4;',
271
- 'file-sound-o' => '&#xf1c7;',
272
- 'file-text' => '&#xf15c;',
273
- 'file-text-o' => '&#xf0f6;',
274
- 'file-video-o' => '&#xf1c8;',
275
- 'file-word-o' => '&#xf1c2;',
276
- 'file-zip-o' => '&#xf1c6;',
277
- 'files-o' => '&#xf0c5;',
278
- 'film' => '&#xf008;',
279
- 'filter' => '&#xf0b0;',
280
- 'fire' => '&#xf06d;',
281
- 'fire-extinguisher' => '&#xf134;',
282
- 'firefox' => '&#xf269;',
283
- 'first-order' => '&#xf2b0;',
284
- 'flag' => '&#xf024;',
285
- 'flag-checkered' => '&#xf11e;',
286
- 'flag-o' => '&#xf11d;',
287
- 'flash' => '&#xf0e7;',
288
- 'flask' => '&#xf0c3;',
289
- 'flickr' => '&#xf16e;',
290
- 'floppy-o' => '&#xf0c7;',
291
- 'folder' => '&#xf07b;',
292
- 'folder-o' => '&#xf114;',
293
- 'folder-open' => '&#xf07c;',
294
- 'folder-open-o' => '&#xf115;',
295
- 'font' => '&#xf031;',
296
- 'font-awesome' => '&#xf2b4;',
297
- 'fonticons' => '&#xf280;',
298
- 'fort-awesome' => '&#xf286;',
299
- 'forumbee' => '&#xf211;',
300
- 'forward' => '&#xf04e;',
301
- 'foursquare' => '&#xf180;',
302
- 'free-code-camp' => '&#xf2c5;',
303
- 'frown-o' => '&#xf119;',
304
- 'futbol-o' => '&#xf1e3;',
305
- 'gamepad' => '&#xf11b;',
306
- 'gavel' => '&#xf0e3;',
307
- 'gbp' => '&#xf154;',
308
- 'ge' => '&#xf1d1;',
309
- 'gear' => '&#xf013;',
310
- 'gears' => '&#xf085;',
311
- 'genderless' => '&#xf22d;',
312
- 'get-pocket' => '&#xf265;',
313
- 'gg' => '&#xf260;',
314
- 'gg-circle' => '&#xf261;',
315
- 'gift' => '&#xf06b;',
316
- 'git' => '&#xf1d3;',
317
- 'git-square' => '&#xf1d2;',
318
- 'github' => '&#xf09b;',
319
- 'github-alt' => '&#xf113;',
320
- 'github-square' => '&#xf092;',
321
- 'gitlab' => '&#xf296;',
322
- 'gittip' => '&#xf184;',
323
- 'glass' => '&#xf000;',
324
- 'glide' => '&#xf2a5;',
325
- 'glide-g' => '&#xf2a6;',
326
- 'globe' => '&#xf0ac;',
327
- 'google' => '&#xf1a0;',
328
- 'google-plus' => '&#xf0d5;',
329
- 'google-plus-circle' => '&#xf2b3;',
330
- 'google-plus-official' => '&#xf2b3;',
331
- 'google-plus-square' => '&#xf0d4;',
332
- 'google-wallet' => '&#xf1ee;',
333
- 'graduation-cap' => '&#xf19d;',
334
- 'gratipay' => '&#xf184;',
335
- 'grav' => '&#xf2d6;',
336
- 'group' => '&#xf0c0;',
337
- 'h-square' => '&#xf0fd;',
338
- 'hacker-news' => '&#xf1d4;',
339
- 'hand-grab-o' => '&#xf255;',
340
- 'hand-lizard-o' => '&#xf258;',
341
- 'hand-o-down' => '&#xf0a7;',
342
- 'hand-o-left' => '&#xf0a5;',
343
- 'hand-o-right' => '&#xf0a4;',
344
- 'hand-o-up' => '&#xf0a6;',
345
- 'hand-paper-o' => '&#xf256;',
346
- 'hand-peace-o' => '&#xf25b;',
347
- 'hand-pointer-o' => '&#xf25a;',
348
- 'hand-rock-o' => '&#xf255;',
349
- 'hand-scissors-o' => '&#xf257;',
350
- 'hand-spock-o' => '&#xf259;',
351
- 'hand-stop-o' => '&#xf256;',
352
- 'handshake-o' => '&#xf2b5;',
353
- 'hard-of-hearing' => '&#xf2a4;',
354
- 'hashtag' => '&#xf292;',
355
- 'hdd-o' => '&#xf0a0;',
356
- 'header' => '&#xf1dc;',
357
- 'headphones' => '&#xf025;',
358
- 'heart' => '&#xf004;',
359
- 'heart-o' => '&#xf08a;',
360
- 'heartbeat' => '&#xf21e;',
361
- 'history' => '&#xf1da;',
362
- 'home' => '&#xf015;',
363
- 'hospital-o' => '&#xf0f8;',
364
- 'hotel' => '&#xf236;',
365
- 'hourglass' => '&#xf254;',
366
- 'hourglass-1' => '&#xf251;',
367
- 'hourglass-2' => '&#xf252;',
368
- 'hourglass-3' => '&#xf253;',
369
- 'hourglass-end' => '&#xf253;',
370
- 'hourglass-half' => '&#xf252;',
371
- 'hourglass-o' => '&#xf250;',
372
- 'hourglass-start' => '&#xf251;',
373
- 'houzz' => '&#xf27c;',
374
- 'html5' => '&#xf13b;',
375
- 'i-cursor' => '&#xf246;',
376
- 'id-badge' => '&#xf2c1;',
377
- 'id-card' => '&#xf2c2;',
378
- 'id-card-o' => '&#xf2c3;',
379
- 'ils' => '&#xf20b;',
380
- 'image' => '&#xf03e;',
381
- 'imdb' => '&#xf2d8;',
382
- 'inbox' => '&#xf01c;',
383
- 'indent' => '&#xf03c;',
384
- 'industry' => '&#xf275;',
385
- 'info' => '&#xf129;',
386
- 'info-circle' => '&#xf05a;',
387
- 'inr' => '&#xf156;',
388
- 'instagram' => '&#xf16d;',
389
- 'institution' => '&#xf19c;',
390
- 'internet-explorer' => '&#xf26b;',
391
- 'intersex' => '&#xf224;',
392
- 'ioxhost' => '&#xf208;',
393
- 'italic' => '&#xf033;',
394
- 'joomla' => '&#xf1aa;',
395
- 'jpy' => '&#xf157;',
396
- 'jsfiddle' => '&#xf1cc;',
397
- 'key' => '&#xf084;',
398
- 'keyboard-o' => '&#xf11c;',
399
- 'krw' => '&#xf159;',
400
- 'language' => '&#xf1ab;',
401
- 'laptop' => '&#xf109;',
402
- 'lastfm' => '&#xf202;',
403
- 'lastfm-square' => '&#xf203;',
404
- 'leaf' => '&#xf06c;',
405
- 'leanpub' => '&#xf212;',
406
- 'legal' => '&#xf0e3;',
407
- 'lemon-o' => '&#xf094;',
408
- 'level-down' => '&#xf149;',
409
- 'level-up' => '&#xf148;',
410
- 'life-bouy' => '&#xf1cd;',
411
- 'life-buoy' => '&#xf1cd;',
412
- 'life-ring' => '&#xf1cd;',
413
- 'life-saver' => '&#xf1cd;',
414
- 'lightbulb-o' => '&#xf0eb;',
415
- 'line-chart' => '&#xf201;',
416
- 'link' => '&#xf0c1;',
417
- 'linkedin' => '&#xf0e1;',
418
- 'linkedin-square' => '&#xf08c;',
419
- 'linode' => '&#xf2b8;',
420
- 'linux' => '&#xf17c;',
421
- 'list' => '&#xf03a;',
422
- 'list-alt' => '&#xf022;',
423
- 'list-ol' => '&#xf0cb;',
424
- 'list-ul' => '&#xf0ca;',
425
- 'location-arrow' => '&#xf124;',
426
- 'lock' => '&#xf023;',
427
- 'long-arrow-down' => '&#xf175;',
428
- 'long-arrow-left' => '&#xf177;',
429
- 'long-arrow-right' => '&#xf178;',
430
- 'long-arrow-up' => '&#xf176;',
431
- 'low-vision' => '&#xf2a8;',
432
- 'magic' => '&#xf0d0;',
433
- 'magnet' => '&#xf076;',
434
- 'mail-forward' => '&#xf064;',
435
- 'mail-reply' => '&#xf112;',
436
- 'mail-reply-all' => '&#xf122;',
437
- 'male' => '&#xf183;',
438
- 'map' => '&#xf279;',
439
- 'map-marker' => '&#xf041;',
440
- 'map-o' => '&#xf278;',
441
- 'map-pin' => '&#xf276;',
442
- 'map-signs' => '&#xf277;',
443
- 'mars' => '&#xf222;',
444
- 'mars-double' => '&#xf227;',
445
- 'mars-stroke' => '&#xf229;',
446
- 'mars-stroke-h' => '&#xf22b;',
447
- 'mars-stroke-v' => '&#xf22a;',
448
- 'maxcdn' => '&#xf136;',
449
- 'meanpath' => '&#xf20c;',
450
- 'medium' => '&#xf23a;',
451
- 'medkit' => '&#xf0fa;',
452
- 'meetup' => '&#xf2e0;',
453
- 'meh-o' => '&#xf11a;',
454
- 'mercury' => '&#xf223;',
455
- 'microchip' => '&#xf2db;',
456
- 'microphone' => '&#xf130;',
457
- 'microphone-slash' => '&#xf131;',
458
- 'minus' => '&#xf068;',
459
- 'minus-circle' => '&#xf056;',
460
- 'minus-square' => '&#xf146;',
461
- 'minus-square-o' => '&#xf147;',
462
- 'mixcloud' => '&#xf289;',
463
- 'mobile' => '&#xf10b;',
464
- 'mobile-phone' => '&#xf10b;',
465
- 'modx' => '&#xf285;',
466
- 'money' => '&#xf0d6;',
467
- 'moon-o' => '&#xf186;',
468
- 'mortar-board' => '&#xf19d;',
469
- 'motorcycle' => '&#xf21c;',
470
- 'mouse-pointer' => '&#xf245;',
471
- 'music' => '&#xf001;',
472
- 'navicon' => '&#xf0c9;',
473
- 'neuter' => '&#xf22c;',
474
- 'newspaper-o' => '&#xf1ea;',
475
- 'object-group' => '&#xf247;',
476
- 'object-ungroup' => '&#xf248;',
477
- 'odnoklassniki' => '&#xf263;',
478
- 'odnoklassniki-square' => '&#xf264;',
479
- 'opencart' => '&#xf23d;',
480
- 'openid' => '&#xf19b;',
481
- 'opera' => '&#xf26a;',
482
- 'optin-monster' => '&#xf23c;',
483
- 'outdent' => '&#xf03b;',
484
- 'pagelines' => '&#xf18c;',
485
- 'paint-brush' => '&#xf1fc;',
486
- 'paper-plane' => '&#xf1d8;',
487
- 'paper-plane-o' => '&#xf1d9;',
488
- 'paperclip' => '&#xf0c6;',
489
- 'paragraph' => '&#xf1dd;',
490
- 'paste' => '&#xf0ea;',
491
- 'pause' => '&#xf04c;',
492
- 'pause-circle' => '&#xf28b;',
493
- 'pause-circle-o' => '&#xf28c;',
494
- 'paw' => '&#xf1b0;',
495
- 'paypal' => '&#xf1ed;',
496
- 'pencil' => '&#xf040;',
497
- 'pencil-square' => '&#xf14b;',
498
- 'pencil-square-o' => '&#xf044;',
499
- 'percent' => '&#xf295;',
500
- 'phone' => '&#xf095;',
501
- 'phone-square' => '&#xf098;',
502
- 'photo' => '&#xf03e;',
503
- 'picture-o' => '&#xf03e;',
504
- 'pie-chart' => '&#xf200;',
505
- 'pied-piper' => '&#xf2ae;',
506
- 'pied-piper-alt' => '&#xf1a8;',
507
- 'pied-piper-pp' => '&#xf1a7;',
508
- 'pinterest' => '&#xf0d2;',
509
- 'pinterest-p' => '&#xf231;',
510
- 'pinterest-square' => '&#xf0d3;',
511
- 'plane' => '&#xf072;',
512
- 'play' => '&#xf04b;',
513
- 'play-circle' => '&#xf144;',
514
- 'play-circle-o' => '&#xf01d;',
515
- 'plug' => '&#xf1e6;',
516
- 'plus' => '&#xf067;',
517
- 'plus-circle' => '&#xf055;',
518
- 'plus-square' => '&#xf0fe;',
519
- 'plus-square-o' => '&#xf196;',
520
- 'podcast' => '&#xf2ce;',
521
- 'power-off' => '&#xf011;',
522
- 'print' => '&#xf02f;',
523
- 'product-hunt' => '&#xf288;',
524
- 'puzzle-piece' => '&#xf12e;',
525
- 'qq' => '&#xf1d6;',
526
- 'qrcode' => '&#xf029;',
527
- 'question' => '&#xf128;',
528
- 'question-circle' => '&#xf059;',
529
- 'question-circle-o' => '&#xf29c;',
530
- 'quora' => '&#xf2c4;',
531
- 'quote-left' => '&#xf10d;',
532
- 'quote-right' => '&#xf10e;',
533
- 'ra' => '&#xf1d0;',
534
- 'random' => '&#xf074;',
535
- 'ravelry' => '&#xf2d9;',
536
- 'rebel' => '&#xf1d0;',
537
- 'recycle' => '&#xf1b8;',
538
- 'reddit' => '&#xf1a1;',
539
- 'reddit-alien' => '&#xf281;',
540
- 'reddit-square' => '&#xf1a2;',
541
- 'refresh' => '&#xf021;',
542
- 'registered' => '&#xf25d;',
543
- 'remove' => '&#xf00d;',
544
- 'renren' => '&#xf18b;',
545
- 'reorder' => '&#xf0c9;',
546
- 'repeat' => '&#xf01e;',
547
- 'reply' => '&#xf112;',
548
- 'reply-all' => '&#xf122;',
549
- 'resistance' => '&#xf1d0;',
550
- 'retweet' => '&#xf079;',
551
- 'rmb' => '&#xf157;',
552
- 'road' => '&#xf018;',
553
- 'rocket' => '&#xf135;',
554
- 'rotate-left' => '&#xf0e2;',
555
- 'rotate-right' => '&#xf01e;',
556
- 'rouble' => '&#xf158;',
557
- 'rss' => '&#xf09e;',
558
- 'rss-square' => '&#xf143;',
559
- 'rub' => '&#xf158;',
560
- 'ruble' => '&#xf158;',
561
- 'rupee' => '&#xf156;',
562
- 's15' => '&#xf2cd;',
563
- 'safari' => '&#xf267;',
564
- 'save' => '&#xf0c7;',
565
- 'scissors' => '&#xf0c4;',
566
- 'scribd' => '&#xf28a;',
567
- 'search' => '&#xf002;',
568
- 'search-minus' => '&#xf010;',
569
- 'search-plus' => '&#xf00e;',
570
- 'sellsy' => '&#xf213;',
571
- 'send' => '&#xf1d8;',
572
- 'send-o' => '&#xf1d9;',
573
- 'server' => '&#xf233;',
574
- 'share' => '&#xf064;',
575
- 'share-alt' => '&#xf1e0;',
576
- 'share-alt-square' => '&#xf1e1;',
577
- 'share-square' => '&#xf14d;',
578
- 'share-square-o' => '&#xf045;',
579
- 'shekel' => '&#xf20b;',
580
- 'sheqel' => '&#xf20b;',
581
- 'shield' => '&#xf132;',
582
- 'ship' => '&#xf21a;',
583
- 'shirtsinbulk' => '&#xf214;',
584
- 'shopping-bag' => '&#xf290;',
585
- 'shopping-basket' => '&#xf291;',
586
- 'shopping-cart' => '&#xf07a;',
587
- 'shower' => '&#xf2cc;',
588
- 'sign-in' => '&#xf090;',
589
- 'sign-language' => '&#xf2a7;',
590
- 'sign-out' => '&#xf08b;',
591
- 'signal' => '&#xf012;',
592
- 'signing' => '&#xf2a7;',
593
- 'simplybuilt' => '&#xf215;',
594
- 'sitemap' => '&#xf0e8;',
595
- 'skyatlas' => '&#xf216;',
596
- 'skype' => '&#xf17e;',
597
- 'slack' => '&#xf198;',
598
- 'sliders' => '&#xf1de;',
599
- 'slideshare' => '&#xf1e7;',
600
- 'smile-o' => '&#xf118;',
601
- 'snapchat' => '&#xf2ab;',
602
- 'snapchat-ghost' => '&#xf2ac;',
603
- 'snapchat-square' => '&#xf2ad;',
604
- 'snowflake-o' => '&#xf2dc;',
605
- 'soccer-ball-o' => '&#xf1e3;',
606
- 'sort' => '&#xf0dc;',
607
- 'sort-alpha-asc' => '&#xf15d;',
608
- 'sort-alpha-desc' => '&#xf15e;',
609
- 'sort-amount-asc' => '&#xf160;',
610
- 'sort-amount-desc' => '&#xf161;',
611
- 'sort-asc' => '&#xf0de;',
612
- 'sort-desc' => '&#xf0dd;',
613
- 'sort-down' => '&#xf0dd;',
614
- 'sort-numeric-asc' => '&#xf162;',
615
- 'sort-numeric-desc' => '&#xf163;',
616
- 'sort-up' => '&#xf0de;',
617
- 'soundcloud' => '&#xf1be;',
618
- 'space-shuttle' => '&#xf197;',
619
- 'spinner' => '&#xf110;',
620
- 'spoon' => '&#xf1b1;',
621
- 'spotify' => '&#xf1bc;',
622
- 'square' => '&#xf0c8;',
623
- 'square-o' => '&#xf096;',
624
- 'stack-exchange' => '&#xf18d;',
625
- 'stack-overflow' => '&#xf16c;',
626
- 'star' => '&#xf005;',
627
- 'star-half' => '&#xf089;',
628
- 'star-half-empty' => '&#xf123;',
629
- 'star-half-full' => '&#xf123;',
630
- 'star-half-o' => '&#xf123;',
631
- 'star-o' => '&#xf006;',
632
- 'steam' => '&#xf1b6;',
633
- 'steam-square' => '&#xf1b7;',
634
- 'step-backward' => '&#xf048;',
635
- 'step-forward' => '&#xf051;',
636
- 'stethoscope' => '&#xf0f1;',
637
- 'sticky-note' => '&#xf249;',
638
- 'sticky-note-o' => '&#xf24a;',
639
- 'stop' => '&#xf04d;',
640
- 'stop-circle' => '&#xf28d;',
641
- 'stop-circle-o' => '&#xf28e;',
642
- 'street-view' => '&#xf21d;',
643
- 'strikethrough' => '&#xf0cc;',
644
- 'stumbleupon' => '&#xf1a4;',
645
- 'stumbleupon-circle' => '&#xf1a3;',
646
- 'subscript' => '&#xf12c;',
647
- 'subway' => '&#xf239;',
648
- 'suitcase' => '&#xf0f2;',
649
- 'sun-o' => '&#xf185;',
650
- 'superpowers' => '&#xf2dd;',
651
- 'superscript' => '&#xf12b;',
652
- 'support' => '&#xf1cd;',
653
- 'table' => '&#xf0ce;',
654
- 'tablet' => '&#xf10a;',
655
- 'tachometer' => '&#xf0e4;',
656
- 'tag' => '&#xf02b;',
657
- 'tags' => '&#xf02c;',
658
- 'tasks' => '&#xf0ae;',
659
- 'taxi' => '&#xf1ba;',
660
- 'telegram' => '&#xf2c6;',
661
- 'television' => '&#xf26c;',
662
- 'tencent-weibo' => '&#xf1d5;',
663
- 'terminal' => '&#xf120;',
664
- 'text-height' => '&#xf034;',
665
- 'text-width' => '&#xf035;',
666
- 'th' => '&#xf00a;',
667
- 'th-large' => '&#xf009;',
668
- 'th-list' => '&#xf00b;',
669
- 'themeisle' => '&#xf2b2;',
670
- 'thermometer' => '&#xf2c7;',
671
- 'thermometer-0' => '&#xf2cb;',
672
- 'thermometer-1' => '&#xf2ca;',
673
- 'thermometer-2' => '&#xf2c9;',
674
- 'thermometer-3' => '&#xf2c8;',
675
- 'thermometer-4' => '&#xf2c7;',
676
- 'thermometer-empty' => '&#xf2cb;',
677
- 'thermometer-full' => '&#xf2c7;',
678
- 'thermometer-half' => '&#xf2c9;',
679
- 'thermometer-quarter' => '&#xf2ca;',
680
- 'thermometer-three-quarters' => '&#xf2c8;',
681
- 'thumb-tack' => '&#xf08d;',
682
- 'thumbs-down' => '&#xf165;',
683
- 'thumbs-o-down' => '&#xf088;',
684
- 'thumbs-o-up' => '&#xf087;',
685
- 'thumbs-up' => '&#xf164;',
686
- 'ticket' => '&#xf145;',
687
- 'times' => '&#xf00d;',
688
- 'times-circle' => '&#xf057;',
689
- 'times-circle-o' => '&#xf05c;',
690
- 'times-rectangle' => '&#xf2d3;',
691
- 'times-rectangle-o' => '&#xf2d4;',
692
- 'tint' => '&#xf043;',
693
- 'toggle-down' => '&#xf150;',
694
- 'toggle-left' => '&#xf191;',
695
- 'toggle-off' => '&#xf204;',
696
- 'toggle-on' => '&#xf205;',
697
- 'toggle-right' => '&#xf152;',
698
- 'toggle-up' => '&#xf151;',
699
- 'trademark' => '&#xf25c;',
700
- 'train' => '&#xf238;',
701
- 'transgender' => '&#xf224;',
702
- 'transgender-alt' => '&#xf225;',
703
- 'trash' => '&#xf1f8;',
704
- 'trash-o' => '&#xf014;',
705
- 'tree' => '&#xf1bb;',
706
- 'trello' => '&#xf181;',
707
- 'tripadvisor' => '&#xf262;',
708
- 'trophy' => '&#xf091;',
709
- 'truck' => '&#xf0d1;',
710
- 'try' => '&#xf195;',
711
- 'tty' => '&#xf1e4;',
712
- 'tumblr' => '&#xf173;',
713
- 'tumblr-square' => '&#xf174;',
714
- 'turkish-lira' => '&#xf195;',
715
- 'tv' => '&#xf26c;',
716
- 'twitch' => '&#xf1e8;',
717
- 'twitter' => '&#xf099;',
718
- 'twitter-square' => '&#xf081;',
719
- 'umbrella' => '&#xf0e9;',
720
- 'underline' => '&#xf0cd;',
721
- 'undo' => '&#xf0e2;',
722
- 'universal-access' => '&#xf29a;',
723
- 'university' => '&#xf19c;',
724
- 'unlink' => '&#xf127;',
725
- 'unlock' => '&#xf09c;',
726
- 'unlock-alt' => '&#xf13e;',
727
- 'unsorted' => '&#xf0dc;',
728
- 'upload' => '&#xf093;',
729
- 'usb' => '&#xf287;',
730
- 'usd' => '&#xf155;',
731
- 'user' => '&#xf007;',
732
- 'user-circle' => '&#xf2bd;',
733
- 'user-circle-o' => '&#xf2be;',
734
- 'user-md' => '&#xf0f0;',
735
- 'user-o' => '&#xf2c0;',
736
- 'user-plus' => '&#xf234;',
737
- 'user-secret' => '&#xf21b;',
738
- 'user-times' => '&#xf235;',
739
- 'users' => '&#xf0c0;',
740
- 'vcard' => '&#xf2bb;',
741
- 'vcard-o' => '&#xf2bc;',
742
- 'venus' => '&#xf221;',
743
- 'venus-double' => '&#xf226;',
744
- 'venus-mars' => '&#xf228;',
745
- 'viacoin' => '&#xf237;',
746
- 'viadeo' => '&#xf2a9;',
747
- 'viadeo-square' => '&#xf2aa;',
748
- 'video-camera' => '&#xf03d;',
749
- 'vimeo' => '&#xf27d;',
750
- 'vimeo-square' => '&#xf194;',
751
- 'vine' => '&#xf1ca;',
752
- 'vk' => '&#xf189;',
753
- 'volume-control-phone' => '&#xf2a0;',
754
- 'volume-down' => '&#xf027;',
755
- 'volume-off' => '&#xf026;',
756
- 'volume-up' => '&#xf028;',
757
- 'warning' => '&#xf071;',
758
- 'wechat' => '&#xf1d7;',
759
- 'weibo' => '&#xf18a;',
760
- 'weixin' => '&#xf1d7;',
761
- 'whatsapp' => '&#xf232;',
762
- 'wheelchair' => '&#xf193;',
763
- 'wheelchair-alt' => '&#xf29b;',
764
- 'wifi' => '&#xf1eb;',
765
- 'wikipedia-w' => '&#xf266;',
766
- 'window-close' => '&#xf2d3;',
767
- 'window-close-o' => '&#xf2d4;',
768
- 'window-maximize' => '&#xf2d0;',
769
- 'window-minimize' => '&#xf2d1;',
770
- 'window-restore' => '&#xf2d2;',
771
- 'windows' => '&#xf17a;',
772
- 'won' => '&#xf159;',
773
- 'wordpress' => '&#xf19a;',
774
- 'wpbeginner' => '&#xf297;',
775
- 'wpexplorer' => '&#xf2de;',
776
- 'wpforms' => '&#xf298;',
777
- 'wrench' => '&#xf0ad;',
778
- 'xing' => '&#xf168;',
779
- 'xing-square' => '&#xf169;',
780
- 'y-combinator' => '&#xf23b;',
781
- 'y-combinator-square' => '&#xf1d4;',
782
- 'yahoo' => '&#xf19e;',
783
- 'yc' => '&#xf23b;',
784
- 'yc-square' => '&#xf1d4;',
785
- 'yelp' => '&#xf1e9;',
786
- 'yen' => '&#xf157;',
787
- 'yoast' => '&#xf2b1;',
788
- 'youtube' => '&#xf167;',
789
- 'youtube-play' => '&#xf16a;',
790
- 'youtube-square' => '&#xf166;',
791
- ));
792
- }
793
- add_filter('siteorigin_widgets_icons_fontawesome', 'siteorigin_widgets_icons_fontawesome_filter');
1
+ <?php
2
+
3
+ function siteorigin_widgets_icons_fontawesome_filter( $icons ){
4
+ return array_merge($icons, array(
5
+ '500px' => '&#xf26e;',
6
+ 'address-book' => '&#xf2b9;',
7
+ 'address-book-o' => '&#xf2ba;',
8
+ 'address-card' => '&#xf2bb;',
9
+ 'address-card-o' => '&#xf2bc;',
10
+ 'adjust' => '&#xf042;',
11
+ 'adn' => '&#xf170;',
12
+ 'align-center' => '&#xf037;',
13
+ 'align-justify' => '&#xf039;',
14
+ 'align-left' => '&#xf036;',
15
+ 'align-right' => '&#xf038;',
16
+ 'amazon' => '&#xf270;',
17
+ 'ambulance' => '&#xf0f9;',
18
+ 'american-sign-language-interpreting' => '&#xf2a3;',
19
+ 'anchor' => '&#xf13d;',
20
+ 'android' => '&#xf17b;',
21
+ 'angellist' => '&#xf209;',
22
+ 'angle-double-down' => '&#xf103;',
23
+ 'angle-double-left' => '&#xf100;',
24
+ 'angle-double-right' => '&#xf101;',
25
+ 'angle-double-up' => '&#xf102;',
26
+ 'angle-down' => '&#xf107;',
27
+ 'angle-left' => '&#xf104;',
28
+ 'angle-right' => '&#xf105;',
29
+ 'angle-up' => '&#xf106;',
30
+ 'apple' => '&#xf179;',
31
+ 'archive' => '&#xf187;',
32
+ 'area-chart' => '&#xf1fe;',
33
+ 'arrow-circle-down' => '&#xf0ab;',
34
+ 'arrow-circle-left' => '&#xf0a8;',
35
+ 'arrow-circle-o-down' => '&#xf01a;',
36
+ 'arrow-circle-o-left' => '&#xf190;',
37
+ 'arrow-circle-o-right' => '&#xf18e;',
38
+ 'arrow-circle-o-up' => '&#xf01b;',
39
+ 'arrow-circle-right' => '&#xf0a9;',
40
+ 'arrow-circle-up' => '&#xf0aa;',
41
+ 'arrow-down' => '&#xf063;',
42
+ 'arrow-left' => '&#xf060;',
43
+ 'arrow-right' => '&#xf061;',
44
+ 'arrow-up' => '&#xf062;',
45
+ 'arrows' => '&#xf047;',
46
+ 'arrows-alt' => '&#xf0b2;',
47
+ 'arrows-h' => '&#xf07e;',
48
+ 'arrows-v' => '&#xf07d;',
49
+ 'asl-interpreting' => '&#xf2a3;',
50
+ 'assistive-listening-systems' => '&#xf2a2;',
51
+ 'asterisk' => '&#xf069;',
52
+ 'at' => '&#xf1fa;',
53
+ 'audio-description' => '&#xf29e;',
54
+ 'automobile' => '&#xf1b9;',
55
+ 'backward' => '&#xf04a;',
56
+ 'balance-scale' => '&#xf24e;',
57
+ 'ban' => '&#xf05e;',
58
+ 'bandcamp' => '&#xf2d5;',
59
+ 'bank' => '&#xf19c;',
60
+ 'bar-chart' => '&#xf080;',
61
+ 'bar-chart-o' => '&#xf080;',
62
+ 'barcode' => '&#xf02a;',
63
+ 'bars' => '&#xf0c9;',
64
+ 'bath' => '&#xf2cd;',
65
+ 'bathtub' => '&#xf2cd;',
66
+ 'battery' => '&#xf240;',
67
+ 'battery-0' => '&#xf244;',
68
+ 'battery-1' => '&#xf243;',
69
+ 'battery-2' => '&#xf242;',
70
+ 'battery-3' => '&#xf241;',
71
+ 'battery-4' => '&#xf240;',
72
+ 'battery-empty' => '&#xf244;',
73
+ 'battery-full' => '&#xf240;',
74
+ 'battery-half' => '&#xf242;',
75
+ 'battery-quarter' => '&#xf243;',
76
+ 'battery-three-quarters' => '&#xf241;',
77
+ 'bed' => '&#xf236;',
78
+ 'beer' => '&#xf0fc;',
79
+ 'behance' => '&#xf1b4;',
80
+ 'behance-square' => '&#xf1b5;',
81
+ 'bell' => '&#xf0f3;',
82
+ 'bell-o' => '&#xf0a2;',
83
+ 'bell-slash' => '&#xf1f6;',
84
+ 'bell-slash-o' => '&#xf1f7;',
85
+ 'bicycle' => '&#xf206;',
86
+ 'binoculars' => '&#xf1e5;',
87
+ 'birthday-cake' => '&#xf1fd;',
88
+ 'bitbucket' => '&#xf171;',
89
+ 'bitbucket-square' => '&#xf172;',
90
+ 'bitcoin' => '&#xf15a;',
91
+ 'black-tie' => '&#xf27e;',
92
+ 'blind' => '&#xf29d;',
93
+ 'bluetooth' => '&#xf293;',
94
+ 'bluetooth-b' => '&#xf294;',
95
+ 'bold' => '&#xf032;',
96
+ 'bolt' => '&#xf0e7;',
97
+ 'bomb' => '&#xf1e2;',
98
+ 'book' => '&#xf02d;',
99
+ 'bookmark' => '&#xf02e;',
100
+ 'bookmark-o' => '&#xf097;',
101
+ 'braille' => '&#xf2a1;',
102
+ 'briefcase' => '&#xf0b1;',
103
+ 'btc' => '&#xf15a;',
104
+ 'bug' => '&#xf188;',
105
+ 'building' => '&#xf1ad;',
106
+ 'building-o' => '&#xf0f7;',
107
+ 'bullhorn' => '&#xf0a1;',
108
+ 'bullseye' => '&#xf140;',
109
+ 'bus' => '&#xf207;',
110
+ 'buysellads' => '&#xf20d;',
111
+ 'cab' => '&#xf1ba;',
112
+ 'calculator' => '&#xf1ec;',
113
+ 'calendar' => '&#xf073;',
114
+ 'calendar-check-o' => '&#xf274;',
115
+ 'calendar-minus-o' => '&#xf272;',
116
+ 'calendar-o' => '&#xf133;',
117
+ 'calendar-plus-o' => '&#xf271;',
118
+ 'calendar-times-o' => '&#xf273;',
119
+ 'camera' => '&#xf030;',
120
+ 'camera-retro' => '&#xf083;',
121
+ 'car' => '&#xf1b9;',
122
+ 'caret-down' => '&#xf0d7;',
123
+ 'caret-left' => '&#xf0d9;',
124
+ 'caret-right' => '&#xf0da;',
125
+ 'caret-square-o-down' => '&#xf150;',
126
+ 'caret-square-o-left' => '&#xf191;',
127
+ 'caret-square-o-right' => '&#xf152;',
128
+ 'caret-square-o-up' => '&#xf151;',
129
+ 'caret-up' => '&#xf0d8;',
130
+ 'cart-arrow-down' => '&#xf218;',
131
+ 'cart-plus' => '&#xf217;',
132
+ 'cc' => '&#xf20a;',
133
+ 'cc-amex' => '&#xf1f3;',
134
+ 'cc-diners-club' => '&#xf24c;',
135
+ 'cc-discover' => '&#xf1f2;',
136
+ 'cc-jcb' => '&#xf24b;',
137
+ 'cc-mastercard' => '&#xf1f1;',
138
+ 'cc-paypal' => '&#xf1f4;',
139
+ 'cc-stripe' => '&#xf1f5;',
140
+ 'cc-visa' => '&#xf1f0;',
141
+ 'certificate' => '&#xf0a3;',
142
+ 'chain' => '&#xf0c1;',
143
+ 'chain-broken' => '&#xf127;',
144
+ 'check' => '&#xf00c;',
145
+ 'check-circle' => '&#xf058;',
146
+ 'check-circle-o' => '&#xf05d;',
147
+ 'check-square' => '&#xf14a;',
148
+ 'check-square-o' => '&#xf046;',
149
+ 'chevron-circle-down' => '&#xf13a;',
150
+ 'chevron-circle-left' => '&#xf137;',
151
+ 'chevron-circle-right' => '&#xf138;',
152
+ 'chevron-circle-up' => '&#xf139;',
153
+ 'chevron-down' => '&#xf078;',
154
+ 'chevron-left' => '&#xf053;',
155
+ 'chevron-right' => '&#xf054;',
156
+ 'chevron-up' => '&#xf077;',
157
+ 'child' => '&#xf1ae;',
158
+ 'chrome' => '&#xf268;',
159
+ 'circle' => '&#xf111;',
160
+ 'circle-o' => '&#xf10c;',
161
+ 'circle-o-notch' => '&#xf1ce;',
162
+ 'circle-thin' => '&#xf1db;',
163
+ 'clipboard' => '&#xf0ea;',
164
+ 'clock-o' => '&#xf017;',
165
+ 'clone' => '&#xf24d;',
166
+ 'close' => '&#xf00d;',
167
+ 'cloud' => '&#xf0c2;',
168
+ 'cloud-download' => '&#xf0ed;',
169
+ 'cloud-upload' => '&#xf0ee;',
170
+ 'cny' => '&#xf157;',
171
+ 'code' => '&#xf121;',
172
+ 'code-fork' => '&#xf126;',
173
+ 'codepen' => '&#xf1cb;',
174
+ 'codiepie' => '&#xf284;',
175
+ 'coffee' => '&#xf0f4;',
176
+ 'cog' => '&#xf013;',
177
+ 'cogs' => '&#xf085;',
178
+ 'columns' => '&#xf0db;',
179
+ 'comment' => '&#xf075;',
180
+ 'comment-o' => '&#xf0e5;',
181
+ 'commenting' => '&#xf27a;',
182
+ 'commenting-o' => '&#xf27b;',
183
+ 'comments' => '&#xf086;',
184
+ 'comments-o' => '&#xf0e6;',
185
+ 'compass' => '&#xf14e;',
186
+ 'compress' => '&#xf066;',
187
+ 'connectdevelop' => '&#xf20e;',
188
+ 'contao' => '&#xf26d;',
189
+ 'copy' => '&#xf0c5;',
190
+ 'copyright' => '&#xf1f9;',
191
+ 'creative-commons' => '&#xf25e;',
192
+ 'credit-card' => '&#xf09d;',
193
+ 'credit-card-alt' => '&#xf283;',
194
+ 'crop' => '&#xf125;',
195
+ 'crosshairs' => '&#xf05b;',
196
+ 'css3' => '&#xf13c;',
197
+ 'cube' => '&#xf1b2;',
198
+ 'cubes' => '&#xf1b3;',
199
+ 'cut' => '&#xf0c4;',
200
+ 'cutlery' => '&#xf0f5;',
201
+ 'dashboard' => '&#xf0e4;',
202
+ 'dashcube' => '&#xf210;',
203
+ 'database' => '&#xf1c0;',
204
+ 'deaf' => '&#xf2a4;',
205
+ 'deafness' => '&#xf2a4;',
206
+ 'dedent' => '&#xf03b;',
207
+ 'delicious' => '&#xf1a5;',
208
+ 'desktop' => '&#xf108;',
209
+ 'deviantart' => '&#xf1bd;',
210
+ 'diamond' => '&#xf219;',
211
+ 'digg' => '&#xf1a6;',
212
+ 'dollar' => '&#xf155;',
213
+ 'dot-circle-o' => '&#xf192;',
214
+ 'download' => '&#xf019;',
215
+ 'dribbble' => '&#xf17d;',
216
+ 'drivers-license' => '&#xf2c2;',
217
+ 'drivers-license-o' => '&#xf2c3;',
218
+ 'dropbox' => '&#xf16b;',
219
+ 'drupal' => '&#xf1a9;',
220
+ 'edge' => '&#xf282;',
221
+ 'edit' => '&#xf044;',
222
+ 'eercast' => '&#xf2da;',
223
+ 'eject' => '&#xf052;',
224
+ 'ellipsis-h' => '&#xf141;',
225
+ 'ellipsis-v' => '&#xf142;',
226
+ 'empire' => '&#xf1d1;',
227
+ 'envelope' => '&#xf0e0;',
228
+ 'envelope-o' => '&#xf003;',
229
+ 'envelope-open' => '&#xf2b6;',
230
+ 'envelope-open-o' => '&#xf2b7;',
231
+ 'envelope-square' => '&#xf199;',
232
+ 'envira' => '&#xf299;',
233
+ 'eraser' => '&#xf12d;',
234
+ 'etsy' => '&#xf2d7;',
235
+ 'eur' => '&#xf153;',
236
+ 'euro' => '&#xf153;',
237
+ 'exchange' => '&#xf0ec;',
238
+ 'exclamation' => '&#xf12a;',
239
+ 'exclamation-circle' => '&#xf06a;',
240
+ 'exclamation-triangle' => '&#xf071;',
241
+ 'expand' => '&#xf065;',
242
+ 'expeditedssl' => '&#xf23e;',
243
+ 'external-link' => '&#xf08e;',
244
+ 'external-link-square' => '&#xf14c;',
245
+ 'eye' => '&#xf06e;',
246
+ 'eye-slash' => '&#xf070;',
247
+ 'eyedropper' => '&#xf1fb;',
248
+ 'fa' => '&#xf2b4;',
249
+ 'facebook' => '&#xf09a;',
250
+ 'facebook-f' => '&#xf09a;',
251
+ 'facebook-official' => '&#xf230;',
252
+ 'facebook-square' => '&#xf082;',
253
+ 'fast-backward' => '&#xf049;',
254
+ 'fast-forward' => '&#xf050;',
255
+ 'fax' => '&#xf1ac;',
256
+ 'feed' => '&#xf09e;',
257
+ 'female' => '&#xf182;',
258
+ 'fighter-jet' => '&#xf0fb;',
259
+ 'file' => '&#xf15b;',
260
+ 'file-archive-o' => '&#xf1c6;',
261
+ 'file-audio-o' => '&#xf1c7;',
262
+ 'file-code-o' => '&#xf1c9;',
263
+ 'file-excel-o' => '&#xf1c3;',
264
+ 'file-image-o' => '&#xf1c5;',
265
+ 'file-movie-o' => '&#xf1c8;',
266
+ 'file-o' => '&#xf016;',
267
+ 'file-pdf-o' => '&#xf1c1;',
268
+ 'file-photo-o' => '&#xf1c5;',
269
+ 'file-picture-o' => '&#xf1c5;',
270
+ 'file-powerpoint-o' => '&#xf1c4;',
271
+ 'file-sound-o' => '&#xf1c7;',
272
+ 'file-text' => '&#xf15c;',
273
+ 'file-text-o' => '&#xf0f6;',
274
+ 'file-video-o' => '&#xf1c8;',