cherrypy-foundation 1.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. cherrypy_foundation/__init__.py +0 -0
  2. cherrypy_foundation/components/ColorModes.jinja +70 -0
  3. cherrypy_foundation/components/Datatable.css +47 -0
  4. cherrypy_foundation/components/Datatable.jinja +63 -0
  5. cherrypy_foundation/components/Datatable.js +358 -0
  6. cherrypy_foundation/components/Field.css +10 -0
  7. cherrypy_foundation/components/Field.jinja +66 -0
  8. cherrypy_foundation/components/Field.js +56 -0
  9. cherrypy_foundation/components/Fields.jinja +4 -0
  10. cherrypy_foundation/components/Flash.jinja +13 -0
  11. cherrypy_foundation/components/Icon.jinja +3 -0
  12. cherrypy_foundation/components/LocaleSelection.jinja +13 -0
  13. cherrypy_foundation/components/LocaleSelection.js +26 -0
  14. cherrypy_foundation/components/SideBySideMultiSelect.css +25 -0
  15. cherrypy_foundation/components/SideBySideMultiSelect.jinja +9 -0
  16. cherrypy_foundation/components/SideBySideMultiSelect.js +9 -0
  17. cherrypy_foundation/components/Typeahead.css +55 -0
  18. cherrypy_foundation/components/Typeahead.jinja +106 -0
  19. cherrypy_foundation/components/Typeahead.js +8 -0
  20. cherrypy_foundation/components/__init__.py +51 -0
  21. cherrypy_foundation/components/tests/__init__.py +0 -0
  22. cherrypy_foundation/components/tests/test_static.py +90 -0
  23. cherrypy_foundation/components/vendor/bootstrap-icons/bootstrap-icons.css +2106 -0
  24. cherrypy_foundation/components/vendor/bootstrap-icons/bootstrap-icons.min.css +5 -0
  25. cherrypy_foundation/components/vendor/bootstrap-icons/fonts/bootstrap-icons.woff +0 -0
  26. cherrypy_foundation/components/vendor/bootstrap-icons/fonts/bootstrap-icons.woff2 +0 -0
  27. cherrypy_foundation/components/vendor/bootstrap5/css/bootstrap.css +9262 -0
  28. cherrypy_foundation/components/vendor/bootstrap5/css/bootstrap.css.map +95 -0
  29. cherrypy_foundation/components/vendor/bootstrap5/css/bootstrap.min.css +6 -0
  30. cherrypy_foundation/components/vendor/bootstrap5/css/bootstrap.min.css.map +7 -0
  31. cherrypy_foundation/components/vendor/bootstrap5/js/bootstrap.js +4846 -0
  32. cherrypy_foundation/components/vendor/bootstrap5/js/bootstrap.js.map +1 -0
  33. cherrypy_foundation/components/vendor/bootstrap5/js/bootstrap.min.js +7 -0
  34. cherrypy_foundation/components/vendor/bootstrap5/js/bootstrap.min.js.map +7 -0
  35. cherrypy_foundation/components/vendor/bootstrap5/js/color-modes.js +80 -0
  36. cherrypy_foundation/components/vendor/datatables/css/dataTables.dataTables.css +849 -0
  37. cherrypy_foundation/components/vendor/datatables/css/dataTables.dataTables.min.css +1 -0
  38. cherrypy_foundation/components/vendor/datatables/images/sort_asc.png +0 -0
  39. cherrypy_foundation/components/vendor/datatables/images/sort_asc_disabled.png +0 -0
  40. cherrypy_foundation/components/vendor/datatables/images/sort_both.png +0 -0
  41. cherrypy_foundation/components/vendor/datatables/images/sort_desc.png +0 -0
  42. cherrypy_foundation/components/vendor/datatables/images/sort_desc_disabled.png +0 -0
  43. cherrypy_foundation/components/vendor/datatables/js/dataTables.js +14073 -0
  44. cherrypy_foundation/components/vendor/datatables/js/dataTables.min.js +4 -0
  45. cherrypy_foundation/components/vendor/datatables-extensions/Buttons/css/buttons.dataTables.css +556 -0
  46. cherrypy_foundation/components/vendor/datatables-extensions/Buttons/css/buttons.dataTables.min.css +1 -0
  47. cherrypy_foundation/components/vendor/datatables-extensions/Buttons/js/buttons.html5.js +1700 -0
  48. cherrypy_foundation/components/vendor/datatables-extensions/Buttons/js/buttons.html5.min.js +8 -0
  49. cherrypy_foundation/components/vendor/datatables-extensions/Buttons/js/dataTables.buttons.js +2944 -0
  50. cherrypy_foundation/components/vendor/datatables-extensions/Buttons/js/dataTables.buttons.min.js +4 -0
  51. cherrypy_foundation/components/vendor/datatables-extensions/FixedHeader/css/fixedHeader.dataTables.css +13 -0
  52. cherrypy_foundation/components/vendor/datatables-extensions/FixedHeader/css/fixedHeader.dataTables.min.css +1 -0
  53. cherrypy_foundation/components/vendor/datatables-extensions/FixedHeader/js/dataTables.fixedHeader.js +1202 -0
  54. cherrypy_foundation/components/vendor/datatables-extensions/FixedHeader/js/dataTables.fixedHeader.min.js +4 -0
  55. cherrypy_foundation/components/vendor/datatables-extensions/JSZip/jszip.js +11577 -0
  56. cherrypy_foundation/components/vendor/datatables-extensions/JSZip/jszip.min.js +13 -0
  57. cherrypy_foundation/components/vendor/datatables-extensions/Responsive/css/responsive.dataTables.css +194 -0
  58. cherrypy_foundation/components/vendor/datatables-extensions/Responsive/css/responsive.dataTables.min.css +1 -0
  59. cherrypy_foundation/components/vendor/datatables-extensions/Responsive/js/dataTables.responsive.js +1861 -0
  60. cherrypy_foundation/components/vendor/datatables-extensions/Responsive/js/dataTables.responsive.min.js +4 -0
  61. cherrypy_foundation/components/vendor/datatables-extensions/pdfmake/build/pdfmake.js +75023 -0
  62. cherrypy_foundation/components/vendor/datatables-extensions/pdfmake/build/pdfmake.min.js +3 -0
  63. cherrypy_foundation/components/vendor/datatables-extensions/pdfmake/build/vfs_fonts.js +6 -0
  64. cherrypy_foundation/components/vendor/datatables-extensions/rowgroup/css/rowGroup.dataTables.css +53 -0
  65. cherrypy_foundation/components/vendor/datatables-extensions/rowgroup/css/rowGroup.dataTables.min.css +1 -0
  66. cherrypy_foundation/components/vendor/datatables-extensions/rowgroup/js/dataTables.rowGroup.js +485 -0
  67. cherrypy_foundation/components/vendor/datatables-extensions/rowgroup/js/dataTables.rowGroup.min.js +4 -0
  68. cherrypy_foundation/components/vendor/jquery/jquery.min.js +2 -0
  69. cherrypy_foundation/components/vendor/multi/LICENSE +7 -0
  70. cherrypy_foundation/components/vendor/multi/README.md +109 -0
  71. cherrypy_foundation/components/vendor/multi/multi.css +95 -0
  72. cherrypy_foundation/components/vendor/multi/multi.js +328 -0
  73. cherrypy_foundation/components/vendor/popper/popper.js +1825 -0
  74. cherrypy_foundation/components/vendor/popper/popper.min.js +6 -0
  75. cherrypy_foundation/components/vendor/typeahead/jquery.typeahead.min.css +1 -0
  76. cherrypy_foundation/components/vendor/typeahead/jquery.typeahead.min.js +10 -0
  77. cherrypy_foundation/error_page.py +94 -0
  78. cherrypy_foundation/flash.py +50 -0
  79. cherrypy_foundation/form.py +119 -0
  80. cherrypy_foundation/logging.py +103 -0
  81. cherrypy_foundation/passwd.py +65 -0
  82. cherrypy_foundation/plugins/__init__.py +0 -0
  83. cherrypy_foundation/plugins/db.py +286 -0
  84. cherrypy_foundation/plugins/ldap.py +257 -0
  85. cherrypy_foundation/plugins/restapi.py +74 -0
  86. cherrypy_foundation/plugins/scheduler.py +287 -0
  87. cherrypy_foundation/plugins/smtp.py +223 -0
  88. cherrypy_foundation/plugins/tests/__init__.py +0 -0
  89. cherrypy_foundation/plugins/tests/test_db.py +118 -0
  90. cherrypy_foundation/plugins/tests/test_ldap.py +451 -0
  91. cherrypy_foundation/plugins/tests/test_scheduler.py +100 -0
  92. cherrypy_foundation/plugins/tests/test_scheduler_db.py +107 -0
  93. cherrypy_foundation/plugins/tests/test_smtp.py +140 -0
  94. cherrypy_foundation/sessions.py +93 -0
  95. cherrypy_foundation/tests/__init__.py +72 -0
  96. cherrypy_foundation/tests/templates/test_flash.html +9 -0
  97. cherrypy_foundation/tests/templates/test_form.html +16 -0
  98. cherrypy_foundation/tests/templates/test_url.html +15 -0
  99. cherrypy_foundation/tests/test_error_page.py +78 -0
  100. cherrypy_foundation/tests/test_flash.py +61 -0
  101. cherrypy_foundation/tests/test_form.py +148 -0
  102. cherrypy_foundation/tests/test_logging.py +78 -0
  103. cherrypy_foundation/tests/test_passwd.py +51 -0
  104. cherrypy_foundation/tests/test_sessions.py +89 -0
  105. cherrypy_foundation/tests/test_url.py +161 -0
  106. cherrypy_foundation/tools/__init__.py +0 -0
  107. cherrypy_foundation/tools/auth.py +263 -0
  108. cherrypy_foundation/tools/auth_mfa.py +249 -0
  109. cherrypy_foundation/tools/i18n.py +529 -0
  110. cherrypy_foundation/tools/jinja2.py +158 -0
  111. cherrypy_foundation/tools/ratelimit.py +265 -0
  112. cherrypy_foundation/tools/secure_headers.py +119 -0
  113. cherrypy_foundation/tools/sessions_timeout.py +167 -0
  114. cherrypy_foundation/tools/tests/__init__.py +0 -0
  115. cherrypy_foundation/tools/tests/components/Button.jinja +2 -0
  116. cherrypy_foundation/tools/tests/locales/de/LC_MESSAGES/messages.mo +0 -0
  117. cherrypy_foundation/tools/tests/locales/de/LC_MESSAGES/messages.po +15 -0
  118. cherrypy_foundation/tools/tests/locales/fr/LC_MESSAGES/messages.mo +0 -0
  119. cherrypy_foundation/tools/tests/locales/fr/LC_MESSAGES/messages.po +15 -0
  120. cherrypy_foundation/tools/tests/locales/messages.pot +2 -0
  121. cherrypy_foundation/tools/tests/templates/test_jinja2.html +11 -0
  122. cherrypy_foundation/tools/tests/templates/test_jinjax.html +9 -0
  123. cherrypy_foundation/tools/tests/templates/test_jinjax_i18n.html +22 -0
  124. cherrypy_foundation/tools/tests/test_auth.py +110 -0
  125. cherrypy_foundation/tools/tests/test_auth_mfa.py +369 -0
  126. cherrypy_foundation/tools/tests/test_i18n.py +247 -0
  127. cherrypy_foundation/tools/tests/test_jinja2.py +153 -0
  128. cherrypy_foundation/tools/tests/test_ratelimit.py +109 -0
  129. cherrypy_foundation/tools/tests/test_secure_headers.py +200 -0
  130. cherrypy_foundation/url.py +66 -0
  131. cherrypy_foundation/widgets.py +48 -0
  132. cherrypy_foundation-1.0.0.dist-info/METADATA +71 -0
  133. cherrypy_foundation-1.0.0.dist-info/RECORD +136 -0
  134. cherrypy_foundation-1.0.0.dist-info/WHEEL +5 -0
  135. cherrypy_foundation-1.0.0.dist-info/licenses/LICENSE.md +674 -0
  136. cherrypy_foundation-1.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @popperjs/core v2.11.8 - MIT License
3
+ */
4
+
5
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Popper={})}(this,(function(e){"use strict";function t(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function n(e){return e instanceof t(e).Element||e instanceof Element}function r(e){return e instanceof t(e).HTMLElement||e instanceof HTMLElement}function o(e){return"undefined"!=typeof ShadowRoot&&(e instanceof t(e).ShadowRoot||e instanceof ShadowRoot)}var i=Math.max,a=Math.min,s=Math.round;function f(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function c(){return!/^((?!chrome|android).)*safari/i.test(f())}function p(e,o,i){void 0===o&&(o=!1),void 0===i&&(i=!1);var a=e.getBoundingClientRect(),f=1,p=1;o&&r(e)&&(f=e.offsetWidth>0&&s(a.width)/e.offsetWidth||1,p=e.offsetHeight>0&&s(a.height)/e.offsetHeight||1);var u=(n(e)?t(e):window).visualViewport,l=!c()&&i,d=(a.left+(l&&u?u.offsetLeft:0))/f,h=(a.top+(l&&u?u.offsetTop:0))/p,m=a.width/f,v=a.height/p;return{width:m,height:v,top:h,right:d+m,bottom:h+v,left:d,x:d,y:h}}function u(e){var n=t(e);return{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function l(e){return e?(e.nodeName||"").toLowerCase():null}function d(e){return((n(e)?e.ownerDocument:e.document)||window.document).documentElement}function h(e){return p(d(e)).left+u(e).scrollLeft}function m(e){return t(e).getComputedStyle(e)}function v(e){var t=m(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function y(e,n,o){void 0===o&&(o=!1);var i,a,f=r(n),c=r(n)&&function(e){var t=e.getBoundingClientRect(),n=s(t.width)/e.offsetWidth||1,r=s(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(n),m=d(n),y=p(e,c,o),g={scrollLeft:0,scrollTop:0},b={x:0,y:0};return(f||!f&&!o)&&(("body"!==l(n)||v(m))&&(g=(i=n)!==t(i)&&r(i)?{scrollLeft:(a=i).scrollLeft,scrollTop:a.scrollTop}:u(i)),r(n)?((b=p(n,!0)).x+=n.clientLeft,b.y+=n.clientTop):m&&(b.x=h(m))),{x:y.left+g.scrollLeft-b.x,y:y.top+g.scrollTop-b.y,width:y.width,height:y.height}}function g(e){var t=p(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function b(e){return"html"===l(e)?e:e.assignedSlot||e.parentNode||(o(e)?e.host:null)||d(e)}function x(e){return["html","body","#document"].indexOf(l(e))>=0?e.ownerDocument.body:r(e)&&v(e)?e:x(b(e))}function w(e,n){var r;void 0===n&&(n=[]);var o=x(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=t(o),s=i?[a].concat(a.visualViewport||[],v(o)?o:[]):o,f=n.concat(s);return i?f:f.concat(w(b(s)))}function O(e){return["table","td","th"].indexOf(l(e))>=0}function j(e){return r(e)&&"fixed"!==m(e).position?e.offsetParent:null}function E(e){for(var n=t(e),i=j(e);i&&O(i)&&"static"===m(i).position;)i=j(i);return i&&("html"===l(i)||"body"===l(i)&&"static"===m(i).position)?n:i||function(e){var t=/firefox/i.test(f());if(/Trident/i.test(f())&&r(e)&&"fixed"===m(e).position)return null;var n=b(e);for(o(n)&&(n=n.host);r(n)&&["html","body"].indexOf(l(n))<0;){var i=m(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||t&&"filter"===i.willChange||t&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(e)||n}var D="top",A="bottom",L="right",P="left",M="auto",k=[D,A,L,P],W="start",B="end",H="viewport",T="popper",R=k.reduce((function(e,t){return e.concat([t+"-"+W,t+"-"+B])}),[]),S=[].concat(k,[M]).reduce((function(e,t){return e.concat([t,t+"-"+W,t+"-"+B])}),[]),V=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function q(e){var t=new Map,n=new Set,r=[];function o(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&o(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||o(e)})),r}function C(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&o(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function N(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function I(e,r,o){return r===H?N(function(e,n){var r=t(e),o=d(e),i=r.visualViewport,a=o.clientWidth,s=o.clientHeight,f=0,p=0;if(i){a=i.width,s=i.height;var u=c();(u||!u&&"fixed"===n)&&(f=i.offsetLeft,p=i.offsetTop)}return{width:a,height:s,x:f+h(e),y:p}}(e,o)):n(r)?function(e,t){var n=p(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(r,o):N(function(e){var t,n=d(e),r=u(e),o=null==(t=e.ownerDocument)?void 0:t.body,a=i(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=i(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),f=-r.scrollLeft+h(e),c=-r.scrollTop;return"rtl"===m(o||n).direction&&(f+=i(n.clientWidth,o?o.clientWidth:0)-a),{width:a,height:s,x:f,y:c}}(d(e)))}function _(e,t,o,s){var f="clippingParents"===t?function(e){var t=w(b(e)),o=["absolute","fixed"].indexOf(m(e).position)>=0&&r(e)?E(e):e;return n(o)?t.filter((function(e){return n(e)&&C(e,o)&&"body"!==l(e)})):[]}(e):[].concat(t),c=[].concat(f,[o]),p=c[0],u=c.reduce((function(t,n){var r=I(e,n,s);return t.top=i(r.top,t.top),t.right=a(r.right,t.right),t.bottom=a(r.bottom,t.bottom),t.left=i(r.left,t.left),t}),I(e,p,s));return u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}function F(e){return e.split("-")[0]}function U(e){return e.split("-")[1]}function z(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function X(e){var t,n=e.reference,r=e.element,o=e.placement,i=o?F(o):null,a=o?U(o):null,s=n.x+n.width/2-r.width/2,f=n.y+n.height/2-r.height/2;switch(i){case D:t={x:s,y:n.y-r.height};break;case A:t={x:s,y:n.y+n.height};break;case L:t={x:n.x+n.width,y:f};break;case P:t={x:n.x-r.width,y:f};break;default:t={x:n.x,y:n.y}}var c=i?z(i):null;if(null!=c){var p="y"===c?"height":"width";switch(a){case W:t[c]=t[c]-(n[p]/2-r[p]/2);break;case B:t[c]=t[c]+(n[p]/2-r[p]/2)}}return t}function Y(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function G(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function J(e,t){void 0===t&&(t={});var r=t,o=r.placement,i=void 0===o?e.placement:o,a=r.strategy,s=void 0===a?e.strategy:a,f=r.boundary,c=void 0===f?"clippingParents":f,u=r.rootBoundary,l=void 0===u?H:u,h=r.elementContext,m=void 0===h?T:h,v=r.altBoundary,y=void 0!==v&&v,g=r.padding,b=void 0===g?0:g,x=Y("number"!=typeof b?b:G(b,k)),w=m===T?"reference":T,O=e.rects.popper,j=e.elements[y?w:m],E=_(n(j)?j:j.contextElement||d(e.elements.popper),c,l,s),P=p(e.elements.reference),M=X({reference:P,element:O,strategy:"absolute",placement:i}),W=N(Object.assign({},O,M)),B=m===T?W:P,R={top:E.top-B.top+x.top,bottom:B.bottom-E.bottom+x.bottom,left:E.left-B.left+x.left,right:B.right-E.right+x.right},S=e.modifiersData.offset;if(m===T&&S){var V=S[i];Object.keys(R).forEach((function(e){var t=[L,A].indexOf(e)>=0?1:-1,n=[D,A].indexOf(e)>=0?"y":"x";R[e]+=V[n]*t}))}return R}var K={placement:"bottom",modifiers:[],strategy:"absolute"};function Q(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function Z(e){void 0===e&&(e={});var t=e,r=t.defaultModifiers,o=void 0===r?[]:r,i=t.defaultOptions,a=void 0===i?K:i;return function(e,t,r){void 0===r&&(r=a);var i,s,f={placement:"bottom",orderedModifiers:[],options:Object.assign({},K,a),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},c=[],p=!1,u={state:f,setOptions:function(r){var i="function"==typeof r?r(f.options):r;l(),f.options=Object.assign({},a,f.options,i),f.scrollParents={reference:n(e)?w(e):e.contextElement?w(e.contextElement):[],popper:w(t)};var s,p,d=function(e){var t=q(e);return V.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}((s=[].concat(o,f.options.modifiers),p=s.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{}),Object.keys(p).map((function(e){return p[e]}))));return f.orderedModifiers=d.filter((function(e){return e.enabled})),f.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,r=void 0===n?{}:n,o=e.effect;if("function"==typeof o){var i=o({state:f,name:t,instance:u,options:r}),a=function(){};c.push(i||a)}})),u.update()},forceUpdate:function(){if(!p){var e=f.elements,t=e.reference,n=e.popper;if(Q(t,n)){f.rects={reference:y(t,E(n),"fixed"===f.options.strategy),popper:g(n)},f.reset=!1,f.placement=f.options.placement,f.orderedModifiers.forEach((function(e){return f.modifiersData[e.name]=Object.assign({},e.data)}));for(var r=0;r<f.orderedModifiers.length;r++)if(!0!==f.reset){var o=f.orderedModifiers[r],i=o.fn,a=o.options,s=void 0===a?{}:a,c=o.name;"function"==typeof i&&(f=i({state:f,options:s,name:c,instance:u})||f)}else f.reset=!1,r=-1}}},update:(i=function(){return new Promise((function(e){u.forceUpdate(),e(f)}))},function(){return s||(s=new Promise((function(e){Promise.resolve().then((function(){s=void 0,e(i())}))}))),s}),destroy:function(){l(),p=!0}};if(!Q(e,t))return u;function l(){c.forEach((function(e){return e()})),c=[]}return u.setOptions(r).then((function(e){!p&&r.onFirstUpdate&&r.onFirstUpdate(e)})),u}}var $={passive:!0};var ee={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var n=e.state,r=e.instance,o=e.options,i=o.scroll,a=void 0===i||i,s=o.resize,f=void 0===s||s,c=t(n.elements.popper),p=[].concat(n.scrollParents.reference,n.scrollParents.popper);return a&&p.forEach((function(e){e.addEventListener("scroll",r.update,$)})),f&&c.addEventListener("resize",r.update,$),function(){a&&p.forEach((function(e){e.removeEventListener("scroll",r.update,$)})),f&&c.removeEventListener("resize",r.update,$)}},data:{}};var te={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=X({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},ne={top:"auto",right:"auto",bottom:"auto",left:"auto"};function re(e){var n,r=e.popper,o=e.popperRect,i=e.placement,a=e.variation,f=e.offsets,c=e.position,p=e.gpuAcceleration,u=e.adaptive,l=e.roundOffsets,h=e.isFixed,v=f.x,y=void 0===v?0:v,g=f.y,b=void 0===g?0:g,x="function"==typeof l?l({x:y,y:b}):{x:y,y:b};y=x.x,b=x.y;var w=f.hasOwnProperty("x"),O=f.hasOwnProperty("y"),j=P,M=D,k=window;if(u){var W=E(r),H="clientHeight",T="clientWidth";if(W===t(r)&&"static"!==m(W=d(r)).position&&"absolute"===c&&(H="scrollHeight",T="scrollWidth"),W=W,i===D||(i===P||i===L)&&a===B)M=A,b-=(h&&W===k&&k.visualViewport?k.visualViewport.height:W[H])-o.height,b*=p?1:-1;if(i===P||(i===D||i===A)&&a===B)j=L,y-=(h&&W===k&&k.visualViewport?k.visualViewport.width:W[T])-o.width,y*=p?1:-1}var R,S=Object.assign({position:c},u&&ne),V=!0===l?function(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:s(n*o)/o||0,y:s(r*o)/o||0}}({x:y,y:b},t(r)):{x:y,y:b};return y=V.x,b=V.y,p?Object.assign({},S,((R={})[M]=O?"0":"",R[j]=w?"0":"",R.transform=(k.devicePixelRatio||1)<=1?"translate("+y+"px, "+b+"px)":"translate3d("+y+"px, "+b+"px, 0)",R)):Object.assign({},S,((n={})[M]=O?b+"px":"",n[j]=w?y+"px":"",n.transform="",n))}var oe={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=void 0===r||r,i=n.adaptive,a=void 0===i||i,s=n.roundOffsets,f=void 0===s||s,c={placement:F(t.placement),variation:U(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,re(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:f})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,re(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:f})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}};var ie={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},o=t.attributes[e]||{},i=t.elements[e];r(i)&&l(i)&&(Object.assign(i.style,n),Object.keys(o).forEach((function(e){var t=o[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var o=t.elements[e],i=t.attributes[e]||{},a=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});r(o)&&l(o)&&(Object.assign(o.style,a),Object.keys(i).forEach((function(e){o.removeAttribute(e)})))}))}},requires:["computeStyles"]};var ae={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=void 0===o?[0,0]:o,a=S.reduce((function(e,n){return e[n]=function(e,t,n){var r=F(e),o=[P,D].indexOf(r)>=0?-1:1,i="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[P,L].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,i),e}),{}),s=a[t.placement],f=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=f,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=a}},se={left:"right",right:"left",bottom:"top",top:"bottom"};function fe(e){return e.replace(/left|right|bottom|top/g,(function(e){return se[e]}))}var ce={start:"end",end:"start"};function pe(e){return e.replace(/start|end/g,(function(e){return ce[e]}))}function ue(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,f=n.allowedAutoPlacements,c=void 0===f?S:f,p=U(r),u=p?s?R:R.filter((function(e){return U(e)===p})):k,l=u.filter((function(e){return c.indexOf(e)>=0}));0===l.length&&(l=u);var d=l.reduce((function(t,n){return t[n]=J(e,{placement:n,boundary:o,rootBoundary:i,padding:a})[F(n)],t}),{});return Object.keys(d).sort((function(e,t){return d[e]-d[t]}))}var le={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0===a||a,f=n.fallbackPlacements,c=n.padding,p=n.boundary,u=n.rootBoundary,l=n.altBoundary,d=n.flipVariations,h=void 0===d||d,m=n.allowedAutoPlacements,v=t.options.placement,y=F(v),g=f||(y===v||!h?[fe(v)]:function(e){if(F(e)===M)return[];var t=fe(e);return[pe(e),t,pe(t)]}(v)),b=[v].concat(g).reduce((function(e,n){return e.concat(F(n)===M?ue(t,{placement:n,boundary:p,rootBoundary:u,padding:c,flipVariations:h,allowedAutoPlacements:m}):n)}),[]),x=t.rects.reference,w=t.rects.popper,O=new Map,j=!0,E=b[0],k=0;k<b.length;k++){var B=b[k],H=F(B),T=U(B)===W,R=[D,A].indexOf(H)>=0,S=R?"width":"height",V=J(t,{placement:B,boundary:p,rootBoundary:u,altBoundary:l,padding:c}),q=R?T?L:P:T?A:D;x[S]>w[S]&&(q=fe(q));var C=fe(q),N=[];if(i&&N.push(V[H]<=0),s&&N.push(V[q]<=0,V[C]<=0),N.every((function(e){return e}))){E=B,j=!1;break}O.set(B,N)}if(j)for(var I=function(e){var t=b.find((function(t){var n=O.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return E=t,"break"},_=h?3:1;_>0;_--){if("break"===I(_))break}t.placement!==E&&(t.modifiersData[r]._skip=!0,t.placement=E,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function de(e,t,n){return i(e,a(t,n))}var he={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,s=void 0===o||o,f=n.altAxis,c=void 0!==f&&f,p=n.boundary,u=n.rootBoundary,l=n.altBoundary,d=n.padding,h=n.tether,m=void 0===h||h,v=n.tetherOffset,y=void 0===v?0:v,b=J(t,{boundary:p,rootBoundary:u,padding:d,altBoundary:l}),x=F(t.placement),w=U(t.placement),O=!w,j=z(x),M="x"===j?"y":"x",k=t.modifiersData.popperOffsets,B=t.rects.reference,H=t.rects.popper,T="function"==typeof y?y(Object.assign({},t.rects,{placement:t.placement})):y,R="number"==typeof T?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),S=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,V={x:0,y:0};if(k){if(s){var q,C="y"===j?D:P,N="y"===j?A:L,I="y"===j?"height":"width",_=k[j],X=_+b[C],Y=_-b[N],G=m?-H[I]/2:0,K=w===W?B[I]:H[I],Q=w===W?-H[I]:-B[I],Z=t.elements.arrow,$=m&&Z?g(Z):{width:0,height:0},ee=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},te=ee[C],ne=ee[N],re=de(0,B[I],$[I]),oe=O?B[I]/2-G-re-te-R.mainAxis:K-re-te-R.mainAxis,ie=O?-B[I]/2+G+re+ne+R.mainAxis:Q+re+ne+R.mainAxis,ae=t.elements.arrow&&E(t.elements.arrow),se=ae?"y"===j?ae.clientTop||0:ae.clientLeft||0:0,fe=null!=(q=null==S?void 0:S[j])?q:0,ce=_+ie-fe,pe=de(m?a(X,_+oe-fe-se):X,_,m?i(Y,ce):Y);k[j]=pe,V[j]=pe-_}if(c){var ue,le="x"===j?D:P,he="x"===j?A:L,me=k[M],ve="y"===M?"height":"width",ye=me+b[le],ge=me-b[he],be=-1!==[D,P].indexOf(x),xe=null!=(ue=null==S?void 0:S[M])?ue:0,we=be?ye:me-B[ve]-H[ve]-xe+R.altAxis,Oe=be?me+B[ve]+H[ve]-xe-R.altAxis:ge,je=m&&be?function(e,t,n){var r=de(e,t,n);return r>n?n:r}(we,me,Oe):de(m?we:ye,me,m?Oe:ge);k[M]=je,V[M]=je-me}t.modifiersData[r]=V}},requiresIfExists:["offset"]};var me={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=F(n.placement),f=z(s),c=[P,L].indexOf(s)>=0?"height":"width";if(i&&a){var p=function(e,t){return Y("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:G(e,k))}(o.padding,n),u=g(i),l="y"===f?D:P,d="y"===f?A:L,h=n.rects.reference[c]+n.rects.reference[f]-a[f]-n.rects.popper[c],m=a[f]-n.rects.reference[f],v=E(i),y=v?"y"===f?v.clientHeight||0:v.clientWidth||0:0,b=h/2-m/2,x=p[l],w=y-u[c]-p[d],O=y/2-u[c]/2+b,j=de(x,O,w),M=f;n.modifiersData[r]=((t={})[M]=j,t.centerOffset=j-O,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&C(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ve(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function ye(e){return[D,L,A,P].some((function(t){return e[t]>=0}))}var ge={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=J(t,{elementContext:"reference"}),s=J(t,{altBoundary:!0}),f=ve(a,r),c=ve(s,o,i),p=ye(f),u=ye(c);t.modifiersData[n]={referenceClippingOffsets:f,popperEscapeOffsets:c,isReferenceHidden:p,hasPopperEscaped:u},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":u})}},be=Z({defaultModifiers:[ee,te,oe,ie]}),xe=[ee,te,oe,ie,ae,le,he,me,ge],we=Z({defaultModifiers:xe});e.applyStyles=ie,e.arrow=me,e.computeStyles=oe,e.createPopper=we,e.createPopperLite=be,e.defaultModifiers=xe,e.detectOverflow=J,e.eventListeners=ee,e.flip=le,e.hide=ge,e.offset=ae,e.popperGenerator=Z,e.popperOffsets=te,e.preventOverflow=he,Object.defineProperty(e,"__esModule",{value:!0})}));
6
+ //# sourceMappingURL=popper.min.js.map
@@ -0,0 +1 @@
1
+ .typeahead__container button,.typeahead__container input,.typeahead__container optgroup,.typeahead__container select,.typeahead__container textarea{font:inherit;margin:0}.typeahead__container optgroup{font-weight:700}.typeahead__container button,.typeahead__container input{overflow:visible}.typeahead__container button,.typeahead__container select{text-transform:none}.typeahead__container [type=reset],.typeahead__container [type=submit],.typeahead__container button,.typeahead__container html [type=button]{-webkit-appearance:button}.typeahead__container [type=button]::-moz-focus-inner,.typeahead__container [type=reset]::-moz-focus-inner,.typeahead__container [type=submit]::-moz-focus-inner,.typeahead__container button::-moz-focus-inner{border-style:none;padding:0}.typeahead__container [type=button]:-moz-focusring,.typeahead__container [type=reset]:-moz-focusring,.typeahead__container [type=submit]:-moz-focusring,.typeahead__container button:-moz-focusring{outline:1px dotted ButtonText}.typeahead__container fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}.typeahead__container legend{-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}.typeahead__container textarea{overflow:auto}.typeahead__container [type=checkbox],.typeahead__container [type=radio]{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0}.typeahead__container [type=number]::-webkit-inner-spin-button,.typeahead__container [type=number]::-webkit-outer-spin-button{height:auto}.typeahead__container ::-webkit-input-placeholder{color:inherit;opacity:.54}.typeahead__container ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}.typeahead__container{position:relative;font:1rem Lato,"Helvetica Neue",Arial,Helvetica,sans-serif}.typeahead__container *{-webkit-box-sizing:border-box;box-sizing:border-box;outline:0}.typeahead__query{position:relative;z-index:2;width:100%}.typeahead__filter{position:relative}.typeahead__filter button{min-width:100%;white-space:nowrap}.typeahead__filter button:after{display:inline-block;margin-left:4px;width:0;height:0;vertical-align:-2px;content:"";border:4px solid;border-right-color:transparent;border-bottom-color:transparent;border-left-color:transparent}.typeahead__field{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;position:relative;width:100%}.typeahead__button button{border-top-right-radius:2px;border-bottom-right-radius:2px}.typeahead__field{color:#555}.typeahead__field .typeahead__hint,.typeahead__field [contenteditable],.typeahead__field input,.typeahead__field textarea{display:block;width:100%;line-height:1.25;min-height:calc(.5rem * 2 + 1.25rem + 2px);padding:.5rem .75rem;background:#fff;border:1px solid #ccc;border-radius:2px 0 0 2px;-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-box-sizing:border-box;box-sizing:border-box}.typeahead__field .typeahead__hint:active,.typeahead__field .typeahead__hint:focus,.typeahead__field [contenteditable]:active,.typeahead__field [contenteditable]:focus,.typeahead__field input:active,.typeahead__field input:focus,.typeahead__field textarea:active,.typeahead__field textarea:focus{border-color:#66afe9}.typeahead__container.hint .typeahead__field [contenteditable],.typeahead__container.hint .typeahead__field input,.typeahead__container.hint .typeahead__field textarea{background:0 0}.typeahead__container.hint .typeahead__query>:last-child,.typeahead__hint{background:#fff}.typeahead__container button{display:inline-block;margin-bottom:0;text-align:center;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;background-color:#fff;border:1px solid #ccc;line-height:1.25;padding:.5rem .75rem;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;color:#555}.typeahead__container button:focus,.typeahead__container button:hover{color:#3c3c3c;background-color:#f5f5f5;border-color:#b3b3b3}.typeahead__container button.active,.typeahead__container button:active{background-image:none}.typeahead__container button:active,.typeahead__container button:focus{border-color:#66afe9}.typeahead__container button.disabled,.typeahead__container button[disabled],.typeahead__container input.disabled,.typeahead__container input[disabled]{cursor:not-allowed;pointer-events:none;opacity:.65;-webkit-box-shadow:none;box-shadow:none;background-color:#fff;border-color:#ccc}.typeahead__container .typeahead__field .typeahead__hint,.typeahead__container .typeahead__field .typeahead__label-container,.typeahead__container .typeahead__field [contenteditable],.typeahead__container .typeahead__field input,.typeahead__container .typeahead__field textarea{padding-right:32px}.typeahead__button,.typeahead__filter{z-index:1}.typeahead__button button,.typeahead__filter button{margin-left:-1px;border-bottom-left-radius:0;border-top-left-radius:0}.typeahead__button:active,.typeahead__button:focus,.typeahead__button:hover,.typeahead__filter:active,.typeahead__filter:focus,.typeahead__filter:hover{z-index:1001}.typeahead__button:active button:active,.typeahead__button:active button:focus,.typeahead__button:focus button:active,.typeahead__button:focus button:focus,.typeahead__button:hover button:active,.typeahead__button:hover button:focus,.typeahead__filter:active button:active,.typeahead__filter:active button:focus,.typeahead__filter:focus button:active,.typeahead__filter:focus button:focus,.typeahead__filter:hover button:active,.typeahead__filter:hover button:focus{z-index:1001}.typeahead__filter+.typeahead__button button{margin-left:-2px}.typeahead__container.filter .typeahead__filter{z-index:1001}.typeahead__dropdown,.typeahead__list{position:absolute;left:0;z-index:1000;width:100%;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;text-align:left;background-color:#fff;border:1px solid #ccc;border-radius:2px;background-clip:padding-box}.typeahead__result.detached .typeahead__list{position:relative;z-index:1041;top:initial;left:initial}.typeahead__dropdown{right:0;left:initial;z-index:1001}.typeahead__list>li{position:relative;border-top:solid 1px #ccc}.typeahead__list>li:first-child{border-top:none}.typeahead__dropdown .typeahead__dropdown-item[disabled]>a,.typeahead__list .typeahead__item[disabled]>a{cursor:not-allowed;color:#bababa;background-color:#fafafa}.typeahead__dropdown .typeahead__dropdown-item>a,.typeahead__list .typeahead__item>a{display:block;padding:.5rem .75rem;clear:both;color:#333;text-decoration:none}.typeahead__dropdown .typeahead__dropdown-item:not([disabled]).active>a,.typeahead__dropdown .typeahead__dropdown-item:not([disabled])>a:focus,.typeahead__dropdown .typeahead__dropdown-item:not([disabled])>a:hover,.typeahead__list .typeahead__item:not([disabled]).active>a,.typeahead__list .typeahead__item:not([disabled])>a:focus,.typeahead__list .typeahead__item:not([disabled])>a:hover{background-color:#f5f5f5;color:#3c3c3c}.typeahead__list.empty>li{padding:.5rem .75rem;color:#333}.typeahead__list>.typeahead__group{border-color:#bfdef6;font-weight:700}.typeahead__list>.typeahead__group:first-child{border-top:solid 1px #bfdef6}.typeahead__list>.typeahead__group.active>a,.typeahead__list>.typeahead__group>a,.typeahead__list>.typeahead__group>a:focus,.typeahead__list>.typeahead__group>a:hover{cursor:default;color:#17639f;background:#ecf5fc;display:block;padding:.5rem .75rem;clear:both;text-decoration:none}.typeahead__list>li.typeahead__group+li.typeahead__item{border-color:#bfdef6}.typeahead__container.backdrop+.typeahead__backdrop,.typeahead__container.filter .typeahead__dropdown,.typeahead__container.hint .typeahead__hint,.typeahead__container.result .typeahead__list{display:block!important}.typeahead__container .typeahead__dropdown,.typeahead__container .typeahead__hint,.typeahead__container .typeahead__list,.typeahead__container+.typeahead__backdrop{display:none!important}.typeahead__dropdown li:last-child{margin-top:5px;padding-top:5px;border-top:solid 1px #ccc}.typeahead__cancel-button{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:absolute;right:0;cursor:pointer;line-height:1.25;padding:.5rem .75rem;visibility:hidden}.typeahead__label .typeahead__cancel-button{visibility:visible;right:4px}.typeahead__container.cancel:not(.loading) .typeahead__cancel-button,.typeahead__label .typeahead__cancel-button{visibility:visible}.typeahead__container.cancel:not(.loading) .typeahead__cancel-button:hover,.typeahead__label .typeahead__cancel-button:hover{color:#d0021b}.typeahead__search-icon{padding:0 1.25rem;width:16px;height:16px;background:url(data:image/svg+xml;charset=utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTguMS4xLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgdmlld0JveD0iMCAwIDI1MC4zMTMgMjUwLjMxMyIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMjUwLjMxMyAyNTAuMzEzOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgd2lkdGg9IjE2cHgiIGhlaWdodD0iMTZweCI+CjxnIGlkPSJTZWFyY2giPgoJPHBhdGggc3R5bGU9ImZpbGwtcnVsZTpldmVub2RkO2NsaXAtcnVsZTpldmVub2RkOyIgZD0iTTI0NC4xODYsMjE0LjYwNGwtNTQuMzc5LTU0LjM3OGMtMC4yODktMC4yODktMC42MjgtMC40OTEtMC45My0wLjc2ICAgYzEwLjctMTYuMjMxLDE2Ljk0NS0zNS42NiwxNi45NDUtNTYuNTU0QzIwNS44MjIsNDYuMDc1LDE1OS43NDcsMCwxMDIuOTExLDBTMCw0Ni4wNzUsMCwxMDIuOTExICAgYzAsNTYuODM1LDQ2LjA3NCwxMDIuOTExLDEwMi45MSwxMDIuOTExYzIwLjg5NSwwLDQwLjMyMy02LjI0NSw1Ni41NTQtMTYuOTQ1YzAuMjY5LDAuMzAxLDAuNDcsMC42NCwwLjc1OSwwLjkyOWw1NC4zOCw1NC4zOCAgIGM4LjE2OSw4LjE2OCwyMS40MTMsOC4xNjgsMjkuNTgzLDBDMjUyLjM1NCwyMzYuMDE3LDI1Mi4zNTQsMjIyLjc3MywyNDQuMTg2LDIxNC42MDR6IE0xMDIuOTExLDE3MC4xNDYgICBjLTM3LjEzNCwwLTY3LjIzNi0zMC4xMDItNjcuMjM2LTY3LjIzNWMwLTM3LjEzNCwzMC4xMDMtNjcuMjM2LDY3LjIzNi02Ny4yMzZjMzcuMTMyLDAsNjcuMjM1LDMwLjEwMyw2Ny4yMzUsNjcuMjM2ICAgQzE3MC4xNDYsMTQwLjA0NCwxNDAuMDQzLDE3MC4xNDYsMTAyLjkxMSwxNzAuMTQ2eiIgZmlsbD0iIzU1NTU1NSIvPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+Cjwvc3ZnPgo=) no-repeat scroll center center transparent}.typeahead__container.loading .typeahead__query:after,.typeahead__container.loading .typeahead__query:before{-webkit-transition:all 0s linear,opacity .2s ease;-o-transition:all 0s linear,opacity .2s ease;transition:all 0s linear,opacity .2s ease;position:absolute;z-index:3;content:"";top:50%;right:.55em;margin-top:calc(-$typeahead-loading-size / 2);width:1.35rem;height:1.35rem;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:500rem;border-style:solid;border-width:.1em}.typeahead__container.loading .typeahead__query:before{border-color:rgba(0,0,0,.35)}.typeahead__container.loading .typeahead__query:after{-webkit-animation:button-spin .6s linear;animation:button-spin .6s linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;border-color:#fff transparent transparent;-webkit-box-shadow:0 0 0 1px transparent;box-shadow:0 0 0 1px transparent}@-webkit-keyframes button-spin{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes button-spin{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.typeahead__label-container{list-style:none;position:absolute;padding-top:calc(1rem * .375);padding-left:6px;width:100%;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.typeahead__label{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;font-size:calc(1rem * .875);position:relative;background:#ecf5fc;border:solid 1px #c2e0ff;padding-left:4px;border-radius:2px;margin-right:4px;margin-bottom:calc(1rem * .375)}.typeahead__label>*{-webkit-align-self:center;-ms-flex-item-align:center;align-self:center}.typeahead__label .typeahead__cancel-button{line-height:normal;height:auto;position:static;padding-top:calc(1rem * .25 - 1px);padding-bottom:calc(1rem * .25 + 1px);padding-left:6px;padding-right:6px;margin-left:4px;font-size:calc(1rem * .875);border-left:solid 1px #c2e0ff}.typeahead__label .typeahead__cancel-button:hover{background-color:#d5e9f9}
@@ -0,0 +1,10 @@
1
+ /*!
2
+ * jQuery Typeahead
3
+ * Copyright (C) 2022 RunningCoder.org
4
+ * Licensed under the MIT license
5
+ *
6
+ * @author Tom Bertrand
7
+ * @version 2.11.2 (2022-9-16)
8
+ * @link http://www.runningcoder.org/jquerytypeahead/
9
+ */
10
+ !function(t){var e;"function"==typeof define&&define.amd?define("jquery-typeahead",["jquery"],t):"object"==typeof module&&module.exports?module.exports=(void 0===e&&(e="undefined"!=typeof window?require("jquery"):require("jquery")(void 0)),t(e)):t(jQuery)}(function(L){"use strict";function r(t,e){this.rawQuery=t.val()||"",this.query=t.val()||"",this.selector=t[0].selector,this.deferred=null,this.tmpSource={},this.source={},this.dynamicGroups=[],this.hasDynamicGroups=!1,this.generatedGroupCount=0,this.groupBy="group",this.groups=[],this.searchGroups=[],this.generateGroups=[],this.requestGroups=[],this.result=[],this.tmpResult={},this.groupTemplate="",this.resultHtml=null,this.resultCount=0,this.resultCountPerGroup={},this.options=e,this.node=t,this.namespace="."+this.helper.slugify.call(this,this.selector)+".typeahead",this.isContentEditable=void 0!==this.node.attr("contenteditable")&&"false"!==this.node.attr("contenteditable"),this.container=null,this.resultContainer=null,this.item=null,this.items=null,this.comparedItems=null,this.xhr={},this.hintIndex=null,this.filters={dropdown:{},dynamic:{}},this.dropdownFilter={static:[],dynamic:[]},this.dropdownFilterAll=null,this.isDropdownEvent=!1,this.requests={},this.backdrop={},this.hint={},this.label={},this.hasDragged=!1,this.focusOnly=!1,this.displayEmptyTemplate,this.__construct()}var i,s={input:null,minLength:2,maxLength:!(window.Typeahead={version:"2.11.2"}),maxItem:8,dynamic:!1,delay:300,order:null,offset:!1,hint:!1,accent:!1,highlight:!0,multiselect:null,group:!1,groupOrder:null,maxItemPerGroup:null,dropdownFilter:!1,dynamicFilter:null,backdrop:!1,backdropOnFocus:!1,cache:!1,ttl:36e5,compression:!1,searchOnFocus:!1,blurOnTab:!0,resultContainer:null,generateOnLoad:null,mustSelectItem:!1,href:null,display:["display"],template:null,templateValue:null,groupTemplate:null,correlativeTemplate:!1,emptyTemplate:!1,cancelButton:!0,loadingAnimation:!0,asyncResult:!1,filter:!0,matcher:null,source:null,callback:{onInit:null,onReady:null,onShowLayout:null,onHideLayout:null,onSearch:null,onResult:null,onLayoutBuiltBefore:null,onLayoutBuiltAfter:null,onNavigateBefore:null,onNavigateAfter:null,onEnter:null,onLeave:null,onClickBefore:null,onClickAfter:null,onDropdownFilter:null,onSendRequest:null,onReceiveRequest:null,onPopulateSource:null,onCacheSave:null,onSubmit:null,onCancel:null},selector:{container:"typeahead__container",result:"typeahead__result",list:"typeahead__list",group:"typeahead__group",item:"typeahead__item",empty:"typeahead__empty",display:"typeahead__display",query:"typeahead__query",filter:"typeahead__filter",filterButton:"typeahead__filter-button",dropdown:"typeahead__dropdown",dropdownItem:"typeahead__dropdown-item",labelContainer:"typeahead__label-container",label:"typeahead__label",button:"typeahead__button",backdrop:"typeahead__backdrop",hint:"typeahead__hint",cancelButton:"typeahead__cancel-button"},debug:!1},o={from:"ãàáäâẽèéëêìíïîõòóöôùúüûñç",to:"aaaaaeeeeeiiiiooooouuuunc"},n=~window.navigator.appVersion.indexOf("MSIE 9."),a=~window.navigator.appVersion.indexOf("MSIE 10"),l=!!~window.navigator.userAgent.indexOf("Trident")&&~window.navigator.userAgent.indexOf("rv:11"),e=(r.prototype={_validateCacheMethod:function(t){var e;if(!0===t)t="localStorage";else if("string"==typeof t&&!~["localStorage","sessionStorage"].indexOf(t))return!1;e=void 0!==window[t];try{window[t].setItem("typeahead","typeahead"),window[t].removeItem("typeahead")}catch(t){e=!1}return e&&t||!1},extendOptions:function(){if(this.options.cache=this._validateCacheMethod(this.options.cache),!this.options.compression||"object"==typeof LZString&&this.options.cache||(this.options.compression=!1),this.options.maxLength&&!isNaN(this.options.maxLength)||(this.options.maxLength=1/0),void 0!==this.options.maxItem&&~[0,!1].indexOf(this.options.maxItem)&&(this.options.maxItem=1/0),this.options.maxItemPerGroup&&!/^\d+$/.test(this.options.maxItemPerGroup)&&(this.options.maxItemPerGroup=null),this.options.display&&!Array.isArray(this.options.display)&&(this.options.display=[this.options.display]),this.options.multiselect&&(this.items=[],this.comparedItems=[],"string"==typeof this.options.multiselect.matchOn&&(this.options.multiselect.matchOn=[this.options.multiselect.matchOn])),!this.options.group||Array.isArray(this.options.group)||("string"==typeof this.options.group?this.options.group={key:this.options.group}:"boolean"==typeof this.options.group&&(this.options.group={key:"group"}),this.options.group.key=this.options.group.key||"group"),this.options.highlight&&!~["any",!0].indexOf(this.options.highlight)&&(this.options.highlight=!1),this.options.dropdownFilter&&this.options.dropdownFilter instanceof Object){Array.isArray(this.options.dropdownFilter)||(this.options.dropdownFilter=[this.options.dropdownFilter]);for(var t=0,e=this.options.dropdownFilter.length;t<e;++t)this.dropdownFilter[this.options.dropdownFilter[t].value?"static":"dynamic"].push(this.options.dropdownFilter[t])}this.options.dynamicFilter&&!Array.isArray(this.options.dynamicFilter)&&(this.options.dynamicFilter=[this.options.dynamicFilter]),this.options.accent&&("object"==typeof this.options.accent?this.options.accent.from&&this.options.accent.to&&(this.options.accent.from.length,this.options.accent.to.length):this.options.accent=o),this.options.groupTemplate&&(this.groupTemplate=this.options.groupTemplate),this.options.resultContainer&&("string"==typeof this.options.resultContainer&&(this.options.resultContainer=L(this.options.resultContainer)),this.options.resultContainer instanceof L&&this.options.resultContainer[0]&&(this.resultContainer=this.options.resultContainer)),this.options.group&&this.options.group.key&&(this.groupBy=this.options.group.key),this.options.callback&&this.options.callback.onClick&&(this.options.callback.onClickBefore=this.options.callback.onClick,delete this.options.callback.onClick),this.options.callback&&this.options.callback.onNavigate&&(this.options.callback.onNavigateBefore=this.options.callback.onNavigate,delete this.options.callback.onNavigate),this.options=L.extend(!0,{},s,this.options)},unifySourceFormat:function(){var t,e,i;for(t in this.dynamicGroups=[],Array.isArray(this.options.source)&&(this.options.source={group:{data:this.options.source}}),"string"==typeof this.options.source&&(this.options.source={group:{ajax:{url:this.options.source}}}),this.options.source.ajax&&(this.options.source={group:{ajax:this.options.source.ajax}}),(this.options.source.url||this.options.source.data)&&(this.options.source={group:this.options.source}),this.options.source)if(this.options.source.hasOwnProperty(t)){if(i=(e="string"==typeof(e=this.options.source[t])?{ajax:{url:e}}:e).url||e.ajax,Array.isArray(i)?(e.ajax="string"==typeof i[0]?{url:i[0]}:i[0],e.ajax.path=e.ajax.path||i[1]||null):"object"==typeof e.url?e.ajax=e.url:"string"==typeof e.url&&(e.ajax={url:e.url}),delete e.url,!e.data&&!e.ajax)return!1;e.display&&!Array.isArray(e.display)&&(e.display=[e.display]),e.minLength=("number"==typeof e.minLength?e:this.options).minLength,e.maxLength=("number"==typeof e.maxLength?e:this.options).maxLength,e.dynamic="boolean"==typeof e.dynamic||this.options.dynamic,e.minLength>e.maxLength&&(e.minLength=e.maxLength),this.options.source[t]=e,this.options.source[t].dynamic&&this.dynamicGroups.push(t),e.cache=void 0!==e.cache?this._validateCacheMethod(e.cache):this.options.cache,!e.compression||"object"==typeof LZString&&e.cache||(e.compression=!1)}return this.hasDynamicGroups=this.options.dynamic||!!this.dynamicGroups.length,!0},init:function(){this.helper.executeCallback.call(this,this.options.callback.onInit,[this.node]),this.container=this.node.closest("."+this.options.selector.container)},delegateEvents:function(){var e,i=this,t=["focus"+this.namespace,"input"+this.namespace,"propertychange"+this.namespace,"keydown"+this.namespace,"keyup"+this.namespace,"search"+this.namespace,"generate"+this.namespace],s=(L("html").on("touchmove",function(){i.hasDragged=!0}).on("touchstart",function(){i.hasDragged=!1}),this.node.closest("form").on("submit",function(t){if(!i.options.mustSelectItem||!i.helper.isEmpty(i.item))return i.options.backdropOnFocus||i.hideLayout(),i.options.callback.onSubmit?i.helper.executeCallback.call(i,i.options.callback.onSubmit,[i.node,this,i.item||i.items,t]):void 0;t.preventDefault()}).on("reset",function(){setTimeout(function(){i.node.trigger("input"+i.namespace),i.hideLayout()})}),!1);this.node.attr("placeholder")&&(a||l)&&(e=!0,this.node.on("focusin focusout",function(){e=!(this.value||!this.placeholder)}),this.node.on("input",function(t){e&&(t.stopImmediatePropagation(),e=!1)})),this.node.off(this.namespace).on(t.join(" "),function(t,e){switch(t.type){case"generate":i.generateSource(Object.keys(i.options.source));break;case"focus":i.focusOnly?i.focusOnly=!1:(i.options.backdropOnFocus&&(i.buildBackdropLayout(),i.showLayout()),i.options.searchOnFocus&&!i.item&&(i.deferred=L.Deferred(),i.assignQuery(),i.generateSource()));break;case"keydown":8===t.keyCode&&i.options.multiselect&&i.options.multiselect.cancelOnBackspace&&""===i.query&&i.items.length?i.cancelMultiselectItem(i.items.length-1,null,t):t.keyCode&&~[9,13,27,38,39,40].indexOf(t.keyCode)&&(s=!0,i.navigate(t));break;case"keyup":n&&i.node[0].value.replace(/^\s+/,"").toString().length<i.query.length&&i.node.trigger("input"+i.namespace);break;case"propertychange":if(s){s=!1;break}case"input":i.deferred=L.Deferred(),i.assignQuery(),""===i.rawQuery&&""===i.query&&(t.originalEvent=e||{},i.helper.executeCallback.call(i,i.options.callback.onCancel,[i.node,i.item,t]),i.item=null),i.options.cancelButton&&i.toggleCancelButtonVisibility(),i.options.hint&&i.hint.container&&""!==i.hint.container.val()&&0!==i.hint.container.val().indexOf(i.rawQuery)&&(i.hint.container.val(""),i.isContentEditable&&i.hint.container.text("")),i.hasDynamicGroups?i.helper.typeWatch(function(){i.generateSource()},i.options.delay):i.generateSource();break;case"search":i.searchResult(),i.buildLayout(),i.result.length||i.searchGroups.length&&i.displayEmptyTemplate?i.showLayout():i.hideLayout(),i.deferred&&i.deferred.resolve()}return i.deferred&&i.deferred.promise()}),this.options.generateOnLoad&&this.node.trigger("generate"+this.namespace)},assignQuery:function(){this.isContentEditable?this.rawQuery=this.node.text():this.rawQuery=this.node.val().toString(),this.rawQuery=this.rawQuery.replace(/^\s+/,""),this.rawQuery!==this.query&&(this.query=this.rawQuery)},filterGenerateSource:function(){if(this.searchGroups=[],this.generateGroups=[],!this.focusOnly||this.options.multiselect)for(var t in this.options.source)this.options.source.hasOwnProperty(t)&&this.query.length>=this.options.source[t].minLength&&this.query.length<=this.options.source[t].maxLength&&(this.filters.dropdown&&"group"===this.filters.dropdown.key&&this.filters.dropdown.value!==t||(this.searchGroups.push(t),!this.options.source[t].dynamic&&this.source[t]||this.generateGroups.push(t)))},generateSource:function(t){if(this.filterGenerateSource(),this.generatedGroupCount=0,Array.isArray(t)&&t.length)this.generateGroups=t;else if(!this.generateGroups.length)return void this.node.trigger("search"+this.namespace);if(this.requestGroups=[],this.options.loadingAnimation&&this.container.addClass("loading"),!this.helper.isEmpty(this.xhr)){for(var e in this.xhr)this.xhr.hasOwnProperty(e)&&this.xhr[e].abort();this.xhr={}}for(var i,s,o,n,r,a,l=this,e=0,h=this.generateGroups.length;e<h;++e){if(i=this.generateGroups[e],n=(o=this.options.source[i]).cache,a=o.compression,this.options.asyncResult&&delete this.source[i],n&&(r=window[n].getItem("TYPEAHEAD_"+this.selector+":"+i))){a&&(r=LZString.decompressFromUTF16(r)),a=!1;try{(r=JSON.parse(r+"")).data&&r.ttl>(new Date).getTime()?(this.populateSource(r.data,i),a=!0):window[n].removeItem("TYPEAHEAD_"+this.selector+":"+i)}catch(t){}if(a)continue}o.data&&!o.ajax?"function"==typeof o.data?(s=o.data.call(this),Array.isArray(s)?l.populateSource(s,i):"function"==typeof s.promise&&function(e){L.when(s).then(function(t){t&&Array.isArray(t)&&l.populateSource(t,e)})}(i)):this.populateSource(L.extend(!0,[],o.data),i):o.ajax&&(this.requests[i]||(this.requests[i]=this.generateRequestObject(i)),this.requestGroups.push(i))}return this.requestGroups.length&&this.handleRequests(),this.options.asyncResult&&this.searchGroups.length!==this.generateGroups&&this.node.trigger("search"+this.namespace),!!this.generateGroups.length},generateRequestObject:function(i){var s=this,o=this.options.source[i],t={request:{url:o.ajax.url||null,dataType:"json",beforeSend:function(t,e){s.xhr[i]=t;t=s.requests[i].callback.beforeSend||o.ajax.beforeSend;"function"==typeof t&&t.apply(null,arguments)}},callback:{beforeSend:null,done:null,fail:null,then:null,always:null},extra:{path:o.ajax.path||null,group:i},validForGroup:[i]};if("function"!=typeof o.ajax&&(o.ajax instanceof Object&&(t=this.extendXhrObject(t,o.ajax)),1<Object.keys(this.options.source).length))for(var e in this.requests)!this.requests.hasOwnProperty(e)||this.requests[e].isDuplicated||t.request.url&&t.request.url===this.requests[e].request.url&&(this.requests[e].validForGroup.push(i),t.isDuplicated=!0,delete t.validForGroup);return t},extendXhrObject:function(t,e){return"object"==typeof e.callback&&(t.callback=e.callback,delete e.callback),"function"==typeof e.beforeSend&&(t.callback.beforeSend=e.beforeSend,delete e.beforeSend),t.request=L.extend(!0,t.request,e),"jsonp"!==t.request.dataType.toLowerCase()||t.request.jsonpCallback||(t.request.jsonpCallback="callback_"+t.extra.group),t},handleRequests:function(){var t,h=this,c=this.requestGroups.length;if(!1!==this.helper.executeCallback.call(this,this.options.callback.onSendRequest,[this.node,this.query]))for(var e=0,i=this.requestGroups.length;e<i;++e)t=this.requestGroups[e],this.requests[t].isDuplicated||!function(t,r){if("function"==typeof h.options.source[t].ajax){var e=h.options.source[t].ajax.call(h,h.query);if("object"!=typeof(r=h.extendXhrObject(h.generateRequestObject(t),"object"==typeof e?e:{})).request||!r.request.url)return h.populateSource([],t);h.requests[t]=r}var a,i=!1,l={};if(~r.request.url.indexOf("{{query}}")&&(i||(r=L.extend(!0,{},r),i=!0),r.request.url=r.request.url.replace("{{query}}",encodeURIComponent(h.query))),r.request.data)for(var s in r.request.data)if(r.request.data.hasOwnProperty(s)&&~String(r.request.data[s]).indexOf("{{query}}")){i||(r=L.extend(!0,{},r),i=!0),r.request.data[s]=r.request.data[s].replace("{{query}}",h.query);break}L.ajax(r.request).done(function(t,e,i){for(var s,o=0,n=r.validForGroup.length;o<n;o++)s=r.validForGroup[o],"function"==typeof(a=h.requests[s]).callback.done&&(l[s]=a.callback.done.call(h,t,e,i))}).fail(function(t,e,i){for(var s=0,o=r.validForGroup.length;s<o;s++)(a=h.requests[r.validForGroup[s]]).callback.fail instanceof Function&&a.callback.fail.call(h,t,e,i)}).always(function(t,e,i){for(var s,o=0,n=r.validForGroup.length;o<n;o++){if(s=r.validForGroup[o],(a=h.requests[s]).callback.always instanceof Function&&a.callback.always.call(h,t,e,i),"abort"===e)return;h.populateSource((null!==t&&"function"==typeof t.promise?[]:l[s])||t,a.extra.group,a.extra.path||a.request.path),0===--c&&h.helper.executeCallback.call(h,h.options.callback.onReceiveRequest,[h.node,h.query])}}).then(function(t,e){for(var i=0,s=r.validForGroup.length;i<s;i++)(a=h.requests[r.validForGroup[i]]).callback.then instanceof Function&&a.callback.then.call(h,t,e)})}(t,this.requests[t])},populateSource:function(i,t,e){var s=this,o=this.options.source[t],n=o.ajax&&o.data;e&&"string"==typeof e&&(i=this.helper.namespace.call(this,e,i)),Array.isArray(i)||(i=[]),n&&("function"==typeof n&&(n=n()),Array.isArray(n)&&(i=i.concat(n)));for(var r,a=o.display?"compiled"===o.display[0]?o.display[1]:o.display[0]:"compiled"===this.options.display[0]?this.options.display[1]:this.options.display[0],l=0,h=i.length;l<h;l++)null!==i[l]&&"boolean"!=typeof i[l]&&("string"==typeof i[l]&&((r={})[a]=i[l],i[l]=r),i[l].group=t);if(!this.hasDynamicGroups&&this.dropdownFilter.dynamic.length)for(var c,p,u={},l=0,h=i.length;l<h;l++)for(var d=0,f=this.dropdownFilter.dynamic.length;d<f;d++)c=this.dropdownFilter.dynamic[d].key,(p=i[l][c])&&(this.dropdownFilter.dynamic[d].value||(this.dropdownFilter.dynamic[d].value=[]),u[c]||(u[c]=[]),~u[c].indexOf(p.toLowerCase())||(u[c].push(p.toLowerCase()),this.dropdownFilter.dynamic[d].value.push(p)));if(this.options.correlativeTemplate){var n=o.template||this.options.template,m="";if(n="function"==typeof n?n.call(this,"",{}):n){if(Array.isArray(this.options.correlativeTemplate))for(l=0,h=this.options.correlativeTemplate.length;l<h;l++)m+="{{"+this.options.correlativeTemplate[l]+"}} ";else m=n.replace(/<.+?>/g," ").replace(/\s{2,}/," ").trim();for(l=0,h=i.length;l<h;l++)i[l].compiled=L("<textarea />").html(m.replace(/\{\{([\w\-\.]+)(?:\|(\w+))?}}/g,function(t,e){return s.helper.namespace.call(s,e,i[l],"get","")}).trim()).text();o.display?~o.display.indexOf("compiled")||o.display.unshift("compiled"):~this.options.display.indexOf("compiled")||this.options.display.unshift("compiled")}}this.options.callback.onPopulateSource&&(i=this.helper.executeCallback.call(this,this.options.callback.onPopulateSource,[this.node,i,t,e])),this.tmpSource[t]=Array.isArray(i)&&i||[];var n=this.options.source[t].cache,o=this.options.source[t].compression,g=this.options.source[t].ttl||this.options.ttl;n&&!window[n].getItem("TYPEAHEAD_"+this.selector+":"+t)&&(this.options.callback.onCacheSave&&(i=this.helper.executeCallback.call(this,this.options.callback.onCacheSave,[this.node,i,t,e])),e=JSON.stringify({data:i,ttl:(new Date).getTime()+g}),o&&(e=LZString.compressToUTF16(e)),window[n].setItem("TYPEAHEAD_"+this.selector+":"+t,e)),this.incrementGeneratedGroup(t)},incrementGeneratedGroup:function(t){if(this.generatedGroupCount++,this.generatedGroupCount===this.generateGroups.length||this.options.asyncResult){this.xhr&&this.xhr[t]&&delete this.xhr[t];for(var e=0,i=this.generateGroups.length;e<i;e++)this.source[this.generateGroups[e]]=this.tmpSource[this.generateGroups[e]];this.hasDynamicGroups||this.buildDropdownItemLayout("dynamic"),this.generatedGroupCount===this.generateGroups.length&&(this.xhr={},this.options.loadingAnimation&&this.container.removeClass("loading")),this.node.trigger("search"+this.namespace)}},navigate:function(t){var e,i,s,o,n,r;this.helper.executeCallback.call(this,this.options.callback.onNavigateBefore,[this.node,this.query,t]),27===t.keyCode?(t.preventDefault(),this.query.length?(this.resetInput(),this.node.trigger("input"+this.namespace,[t])):(this.node.blur(),this.hideLayout())):this.result.length&&(s=(i=(e=this.resultContainer.find("."+this.options.selector.item).not("[disabled]")).filter(".active"))[0]?e.index(i):null,r=i[0]?i.attr("data-index"):null,n=o=null,this.clearActiveItem(),this.helper.executeCallback.call(this,this.options.callback.onLeave,[this.node,null!==s&&e.eq(s)||void 0,null!==r&&this.result[r]||void 0,t]),13===t.keyCode?(t.preventDefault(),0<i.length?"javascript:;"===i.find("a:first")[0].href?i.find("a:first").trigger("click",t):i.find("a:first")[0].click():this.node.closest("form").trigger("submit")):39===t.keyCode?null!==s?e.eq(s).find("a:first")[0].click():this.options.hint&&""!==this.hint.container.val()&&this.helper.getCaret(this.node[0])>=this.query.length&&e.filter('[data-index="'+this.hintIndex+'"]').find("a:first")[0].click():(9===t.keyCode?this.options.blurOnTab?this.hideLayout():0<i.length?s+1<e.length?(t.preventDefault(),this.addActiveItem(e.eq(o=s+1))):this.hideLayout():e.length?(t.preventDefault(),o=0,this.addActiveItem(e.first())):this.hideLayout():38===t.keyCode?(t.preventDefault(),0<i.length?0<=s-1&&this.addActiveItem(e.eq(o=s-1)):e.length&&(o=e.length-1,this.addActiveItem(e.last()))):40===t.keyCode&&(t.preventDefault(),0<i.length?s+1<e.length&&this.addActiveItem(e.eq(o=s+1)):e.length&&(o=0,this.addActiveItem(e.first()))),n=null!==o?e.eq(o).attr("data-index"):null,this.helper.executeCallback.call(this,this.options.callback.onEnter,[this.node,null!==o&&e.eq(o)||void 0,null!==n&&this.result[n]||void 0,t]),t.preventInputChange&&~[38,40].indexOf(t.keyCode)&&this.buildHintLayout(null!==n&&n<this.result.length?[this.result[n]]:null),this.options.hint&&this.hint.container&&this.hint.container.css("color",t.preventInputChange?this.hint.css.color:null===n&&this.hint.css.color||this.hint.container.css("background-color")||"fff"),r=null===n||t.preventInputChange?this.rawQuery:this.getTemplateValue.call(this,this.result[n]),this.node.val(r),this.isContentEditable&&this.node.text(r),this.helper.executeCallback.call(this,this.options.callback.onNavigateAfter,[this.node,e,null!==o&&e.eq(o).find("a:first")||void 0,null!==n&&this.result[n]||void 0,this.query,t])))},getTemplateValue:function(i){var t,s;if(i)return(t="function"==typeof(t=i.group&&this.options.source[i.group].templateValue||this.options.templateValue)?t.call(this):t)?(s=this,t.replace(/\{\{([\w\-.]+)}}/gi,function(t,e){return s.helper.namespace.call(s,e,i,"get","")})):this.helper.namespace.call(this,i.matchedKey,i).toString()},clearActiveItem:function(){this.resultContainer.find("."+this.options.selector.item).removeClass("active")},addActiveItem:function(t){t.addClass("active")},searchResult:function(){this.resetLayout(),!1!==this.helper.executeCallback.call(this,this.options.callback.onSearch,[this.node,this.query])&&(!this.searchGroups.length||this.options.multiselect&&this.options.multiselect.limit&&this.items.length>=this.options.multiselect.limit||this.searchResultData(),this.helper.executeCallback.call(this,this.options.callback.onResult,[this.node,this.query,this.result,this.resultCount,this.resultCountPerGroup]),this.isDropdownEvent&&(this.helper.executeCallback.call(this,this.options.callback.onDropdownFilter,[this.node,this.query,this.filters.dropdown,this.result]),this.isDropdownEvent=!1))},searchResultData:function(){var t,e,i,s,o,n,r,a=this.groupBy,l=this.query.toLowerCase(),h=this.options.maxItem,c=this.options.maxItemPerGroup,p=this.filters.dynamic&&!this.helper.isEmpty(this.filters.dynamic),u="function"==typeof this.options.matcher&&this.options.matcher;this.options.accent&&(l=this.helper.removeAccent.call(this,l));for(var d=0,f=this.searchGroups.length;d<f;++d)if(A=this.searchGroups[d],(!this.filters.dropdown||"group"!==this.filters.dropdown.key||this.filters.dropdown.value===A)&&(s=(void 0!==this.options.source[A].filter?this.options.source[A]:this.options).filter,n="function"==typeof this.options.source[A].matcher&&this.options.source[A].matcher||u,this.source[A]))for(var m=0,g=this.source[A].length;m<g&&(!(this.resultItemCount>=h)||this.options.callback.onResult);m++)if((!p||this.dynamicFilter.validate.apply(this,[this.source[A][m]]))&&null!==(e=this.source[A][m])&&"boolean"!=typeof e&&(!this.options.multiselect||this.isMultiselectUniqueData(e))&&(!this.filters.dropdown||(e[this.filters.dropdown.key]||"").toLowerCase()===(this.filters.dropdown.value||"").toLowerCase())){if((t="group"===a?A:e[a]||e.group)&&!this.tmpResult[t]&&(this.tmpResult[t]=[],this.resultCountPerGroup[t]=0),c&&"group"===a&&this.tmpResult[t].length>=c&&!this.options.callback.onResult)break;for(var y=0,b=(O=this.options.source[A].display||this.options.display).length;y<b;++y){if(!1!==s){if(void 0===(i=/\./.test(O[y])?this.helper.namespace.call(this,O[y],e):e[O[y]])||""===i)continue;i=this.helper.cleanStringFromScript(i)}if("function"==typeof s){if(void 0===(o=s.call(this,e,i)))break;if(!o)continue;"object"==typeof o&&(e=o)}if(~[void 0,!0].indexOf(s)){if(null===i)continue;if(o=(o=i).toString().toLowerCase(),r=(o=this.options.accent?this.helper.removeAccent.call(this,o):o).indexOf(l),this.options.correlativeTemplate&&"compiled"===O[y]&&r<0&&/\s/.test(l))for(var v,k=!0,w=o,x=0,C=(v=l.split(" ")).length;x<C;x++)if(""!==v[x]){if(!~w.indexOf(v[x])){k=!1;break}w=w.replace(v[x],"")}if(r<0&&!k)continue;if(this.options.offset&&0!==r)continue;if(n){if(void 0===(r=n.call(this,e,i)))break;if(!r)continue;"object"==typeof r&&(e=r)}}if(this.resultCount++,this.resultCountPerGroup[t]++,this.resultItemCount<h){if(c&&this.tmpResult[t].length>=c)break;this.tmpResult[t].push(L.extend(!0,{matchedKey:O[y]},e)),this.resultItemCount++}break}if(!this.options.callback.onResult){if(this.resultItemCount>=h)break;if(c&&this.tmpResult[t].length>=c&&"group"===a)break}}if(this.options.order){var q,A,O=[];for(A in this.tmpResult)if(this.tmpResult.hasOwnProperty(A)){for(d=0,f=this.tmpResult[A].length;d<f;d++)q=this.options.source[this.tmpResult[A][d].group].display||this.options.display,~O.indexOf(q[0])||O.push(q[0]);this.tmpResult[A].sort(this.helper.sort(O,"asc"===this.options.order,function(t){return t?t.toString().toUpperCase():""}))}}for(var S=[],F=[],d=0,f=(F="function"==typeof this.options.groupOrder?this.options.groupOrder.apply(this,[this.node,this.query,this.tmpResult,this.resultCount,this.resultCountPerGroup]):Array.isArray(this.options.groupOrder)?this.options.groupOrder:"string"==typeof this.options.groupOrder&&~["asc","desc"].indexOf(this.options.groupOrder)?Object.keys(this.tmpResult).sort(this.helper.sort([],"asc"===this.options.groupOrder,function(t){return t.toString().toUpperCase()})):Object.keys(this.tmpResult)).length;d<f;d++)S=S.concat(this.tmpResult[F[d]]||[]);this.groups=JSON.parse(JSON.stringify(F)),this.result=S},buildLayout:function(){this.buildHtmlLayout(),this.buildBackdropLayout(),this.buildHintLayout(),this.options.callback.onLayoutBuiltBefore&&(this.tmpResultHtml=this.helper.executeCallback.call(this,this.options.callback.onLayoutBuiltBefore,[this.node,this.query,this.result,this.resultHtml])),this.tmpResultHtml instanceof L?this.resultContainer.html(this.tmpResultHtml):this.resultHtml instanceof L&&this.resultContainer.html(this.resultHtml),this.options.callback.onLayoutBuiltAfter&&this.helper.executeCallback.call(this,this.options.callback.onLayoutBuiltAfter,[this.node,this.query,this.result])},buildHtmlLayout:function(){if(!1!==this.options.resultContainer){var h;if(this.resultContainer||(this.resultContainer=L("<div/>",{class:this.options.selector.result}),this.container.append(this.resultContainer)),!this.result.length&&this.generatedGroupCount===this.generateGroups.length)if(this.options.multiselect&&this.options.multiselect.limit&&this.items.length>=this.options.multiselect.limit)h=this.options.multiselect.limitTemplate?"function"==typeof this.options.multiselect.limitTemplate?this.options.multiselect.limitTemplate.call(this,this.query):this.options.multiselect.limitTemplate.replace(/\{\{query}}/gi,L("<div>").text(this.helper.cleanStringFromScript(this.query)).html()):"Can't select more than "+this.items.length+" items.";else{if(!this.options.emptyTemplate||""===this.query)return;h="function"==typeof this.options.emptyTemplate?this.options.emptyTemplate.call(this,this.query):this.options.emptyTemplate.replace(/\{\{query}}/gi,L("<div>").text(this.helper.cleanStringFromScript(this.query)).html())}this.displayEmptyTemplate=!!h;var o=this.query.toLowerCase(),c=(this.options.accent&&(o=this.helper.removeAccent.call(this,o)),this),t=this.groupTemplate||"<ul></ul>",p=!1;this.groupTemplate?t=L(t.replace(/<([^>]+)>\{\{(.+?)}}<\/[^>]+>/g,function(t,e,i,s,o){var n="",r="group"===i?c.groups:[i];if(!c.result.length)return!0===p?"":(p=!0,"<"+e+' class="'+c.options.selector.empty+'">'+h+"</"+e+">");for(var a=0,l=r.length;a<l;++a)n+="<"+e+' data-group-template="'+r[a]+'"><ul></ul></'+e+">";return n})):(t=L(t),this.result.length||t.append(h instanceof L?h:'<li class="'+c.options.selector.empty+'">'+h+"</li>")),t.addClass(this.options.selector.list+(this.helper.isEmpty(this.result)?" empty":""));for(var e,i,n,s,r,a,l,u,d,f,m=this.groupTemplate&&this.result.length&&c.groups||[],g=0,y=this.result.length;g<y;++g)e=(n=this.result[g]).group,s=!this.options.multiselect&&this.options.source[n.group].href||this.options.href,l=[],u=this.options.source[n.group].display||this.options.display,this.options.group&&(e=n[this.options.group.key],this.options.group.template&&("function"==typeof this.options.group.template?i=this.options.group.template.call(this,n):"string"==typeof this.options.group.template&&(i=this.options.group.template.replace(/\{\{([\w\-\.]+)}}/gi,function(t,e){return c.helper.namespace.call(c,e,n,"get","")}))),t.find('[data-search-group="'+e+'"]')[0]||(this.groupTemplate?t.find('[data-group-template="'+e+'"] ul'):t).append(L("<li/>",{class:c.options.selector.group,html:L("<a/>",{href:"javascript:;",html:i||e,tabindex:-1}),"data-search-group":e}))),this.groupTemplate&&m.length&&~(f=m.indexOf(e||n.group))&&m.splice(f,1),f=L("<li/>",{class:c.options.selector.item+" "+c.options.selector.group+"-"+this.helper.slugify.call(this,e),disabled:!!n.disabled,"data-group":e,"data-index":g,html:L("<a/>",{href:s&&!n.disabled?n.href=c.generateHref.call(c,s,n):"javascript:;",html:function(){if(r=n.group&&c.options.source[n.group].template||c.options.template)"function"==typeof r&&(r=r.call(c,c.query,n)),a=r.replace(/\{\{([^\|}]+)(?:\|([^}]+))*}}/gi,function(t,e,i){var s=c.helper.cleanStringFromScript(String(c.helper.namespace.call(c,e,n,"get","")));return~(i=i&&i.split("|")||[]).indexOf("slugify")&&(s=c.helper.slugify.call(c,s)),~i.indexOf("raw")||!0===c.options.highlight&&o&&~u.indexOf(e)&&(s=c.helper.highlight.call(c,s,o.split(" "),c.options.accent)),s});else{for(var t=0,e=u.length;t<e;t++)void 0!==(d=/\./.test(u[t])?c.helper.namespace.call(c,u[t],n,"get",""):n[u[t]])&&""!==d&&l.push(d);a='<span class="'+c.options.selector.display+'">'+c.helper.cleanStringFromScript(String(l.join(" ")))+"</span>"}(!0===c.options.highlight&&o&&!r||"any"===c.options.highlight)&&(a=c.helper.highlight.call(c,a,o.split(" "),c.options.accent)),L(this).append(a)}})}),function(i,t){t.on("click",function(t,e){i.disabled||(e&&"object"==typeof e&&(t.originalEvent=e),c.options.mustSelectItem&&c.helper.isEmpty(i))?t.preventDefault():(c.options.multiselect||(c.item=i),!1===c.helper.executeCallback.call(c,c.options.callback.onClickBefore,[c.node,L(this),i,t])||t.originalEvent&&t.originalEvent.defaultPrevented||t.isDefaultPrevented()||(c.options.multiselect?(c.query=c.rawQuery="",c.addMultiselectItemLayout(i)):(c.focusOnly=!0,c.query=c.rawQuery=c.getTemplateValue.call(c,i),c.isContentEditable&&(c.node.text(c.query),c.helper.setCaretAtEnd(c.node[0]))),c.hideLayout(),c.node.val(c.query).focus(),c.options.cancelButton&&c.toggleCancelButtonVisibility(),c.helper.executeCallback.call(c,c.options.callback.onClickAfter,[c.node,L(this),i,t])))}),t.on("mouseenter",function(t){i.disabled||(c.clearActiveItem(),c.addActiveItem(L(this))),c.helper.executeCallback.call(c,c.options.callback.onEnter,[c.node,L(this),i,t])}),t.on("mouseleave",function(t){i.disabled||c.clearActiveItem(),c.helper.executeCallback.call(c,c.options.callback.onLeave,[c.node,L(this),i,t])})}(n,f),(this.groupTemplate?t.find('[data-group-template="'+e+'"] ul'):t).append(f);if(this.result.length&&m.length)for(g=0,y=m.length;g<y;++g)t.find('[data-group-template="'+m[g]+'"]').remove();this.resultHtml=t}},generateHref:function(t,s){var o=this;return"string"==typeof t?t=t.replace(/\{\{([^\|}]+)(?:\|([^}]+))*}}/gi,function(t,e,i){e=o.helper.namespace.call(o,e,s,"get","");return e=~(i=i&&i.split("|")||[]).indexOf("slugify")?o.helper.slugify.call(o,e):e}):"function"==typeof t&&(t=t.call(this,s)),t},getMultiselectComparedData:function(t){var e="";if(Array.isArray(this.options.multiselect.matchOn))for(var i=0,s=this.options.multiselect.matchOn.length;i<s;++i)e+=void 0!==t[this.options.multiselect.matchOn[i]]?t[this.options.multiselect.matchOn[i]]:"";else{for(var o=JSON.parse(JSON.stringify(t)),n=["group","matchedKey","compiled","href"],i=0,s=n.length;i<s;++i)delete o[n[i]];e=JSON.stringify(o)}return e},buildBackdropLayout:function(){this.options.backdrop&&(this.backdrop.container||(this.backdrop.css=L.extend({opacity:.6,filter:"alpha(opacity=60)",position:"fixed",top:0,right:0,bottom:0,left:0,"z-index":1040,"background-color":"#000"},this.options.backdrop),this.backdrop.container=L("<div/>",{class:this.options.selector.backdrop,css:this.backdrop.css}).insertAfter(this.container)),this.container.addClass("backdrop").css({"z-index":this.backdrop.css["z-index"]+1,position:"relative"}))},buildHintLayout:function(t){if(this.options.hint)if(this.node[0].scrollWidth>Math.ceil(this.node.innerWidth()))this.hint.container&&this.hint.container.val("");else{var e=this,i="",t=t||this.result,s=this.query.toLowerCase();if(this.options.accent&&(s=this.helper.removeAccent.call(this,s)),this.hintIndex=null,this.searchGroups.length){if(this.hint.container||(this.hint.css=L.extend({"border-color":"transparent",position:"absolute",top:0,display:"inline","z-index":-1,float:"none",color:"silver","box-shadow":"none",cursor:"default","-webkit-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none"},this.options.hint),this.hint.container=L("<"+this.node[0].nodeName+"/>",{type:this.node.attr("type"),class:this.node.attr("class"),readonly:!0,unselectable:"on","aria-hidden":"true",tabindex:-1,click:function(){e.node.focus()}}).addClass(this.options.selector.hint).css(this.hint.css).insertAfter(this.node),this.node.parent().css({position:"relative"})),this.hint.container.css("color",this.hint.css.color),s)for(var o,n=0,r=t.length;n<r;n++)if(!t[n].disabled){for(var a,l=t[n].group,h=0,c=(a=this.options.source[l].display||this.options.display).length;h<c;h++)if(o=String(t[n][a[h]]).toLowerCase(),0===(o=this.options.accent?this.helper.removeAccent.call(this,o):o).indexOf(s)){i=String(t[n][a[h]]),this.hintIndex=n;break}if(null!==this.hintIndex)break}var p=0<i.length&&this.rawQuery+i.substring(this.query.length)||"";this.hint.container.val(p),this.isContentEditable&&this.hint.container.text(p)}}},buildDropdownLayout:function(){var i;this.options.dropdownFilter&&L("<span/>",{class:(i=this).options.selector.filter,html:function(){L(this).append(L("<button/>",{type:"button",class:i.options.selector.filterButton,style:"display: none;",click:function(){i.container.toggleClass("filter");var e=i.namespace+"-dropdown-filter";L("html").off(e),i.container.hasClass("filter")&&L("html").on("click"+e+" touchend"+e,function(t){L(t.target).closest("."+i.options.selector.filter)[0]&&L(t.target).closest(i.container)[0]||i.hasDragged||(i.container.removeClass("filter"),L("html").off(e))})}})),L(this).append(L("<ul/>",{class:i.options.selector.dropdown}))}}).insertAfter(i.container.find("."+i.options.selector.query))},buildDropdownItemLayout:function(t){if(this.options.dropdownFilter){var e,i,o=this,n="string"==typeof this.options.dropdownFilter&&this.options.dropdownFilter||"All",r=this.container.find("."+this.options.selector.dropdown);"static"!==t||!0!==this.options.dropdownFilter&&"string"!=typeof this.options.dropdownFilter||this.dropdownFilter.static.push({key:"group",template:"{{group}}",all:n,value:Object.keys(this.options.source)});for(var s=0,a=this.dropdownFilter[t].length;s<a;s++){i=this.dropdownFilter[t][s],Array.isArray(i.value)||(i.value=[i.value]),i.all&&(this.dropdownFilterAll=i.all);for(var l=0,h=i.value.length;l<=h;l++)l===h&&s!==a-1||l===h&&s===a-1&&"static"===t&&this.dropdownFilter.dynamic.length||(e=this.dropdownFilterAll||n,i.value[l]?e=i.template?i.template.replace(new RegExp("{{"+i.key+"}}","gi"),i.value[l]):i.value[l]:this.container.find("."+o.options.selector.filterButton).html(e),function(e,i,s){r.append(L("<li/>",{class:o.options.selector.dropdownItem+" "+o.helper.slugify.call(o,i.key+"-"+(i.value[e]||n)),html:L("<a/>",{href:"javascript:;",html:s,click:function(t){t.preventDefault(),c.call(o,{key:i.key,value:i.value[e]||"*",template:s})}})}))}(l,i,e))}this.dropdownFilter[t].length&&this.container.find("."+o.options.selector.filterButton).removeAttr("style")}function c(t){"*"===t.value?delete this.filters.dropdown:this.filters.dropdown=t,this.container.removeClass("filter").find("."+this.options.selector.filterButton).html(t.template),this.isDropdownEvent=!0,this.node.trigger("input"+this.namespace),this.options.multiselect&&this.adjustInputSize(),this.node.focus()}},dynamicFilter:{init:function(){this.options.dynamicFilter&&(this.dynamicFilter.bind.call(this),this.isDynamicFilterEnabled=!0)},validate:function(t){var e,i,s,o=null,n=null;for(s in this.filters.dynamic)if(this.filters.dynamic.hasOwnProperty(s)&&(i=~s.indexOf(".")?this.helper.namespace.call(this,s,t,"get"):t[s],"|"!==this.filters.dynamic[s].modifier||o||(o=i==this.filters.dynamic[s].value||!1),"&"===this.filters.dynamic[s].modifier)){if(i!=this.filters.dynamic[s].value){n=!1;break}n=!0}return e=o,!!(e=null!==n&&!0===(e=n)&&null!==o?o:e)},set:function(t,e){t=t.match(/^([|&])?(.+)/);e?this.filters.dynamic[t[2]]={modifier:t[1]||"|",value:e}:delete this.filters.dynamic[t[2]],this.isDynamicFilterEnabled&&this.generateSource()},bind:function(){for(var t,e=this,i=0,s=this.options.dynamicFilter.length;i<s;i++)"string"==typeof(t=this.options.dynamicFilter[i]).selector&&(t.selector=L(t.selector)),t.selector instanceof L&&t.selector[0]&&t.key&&!function(t){t.selector.off(e.namespace).on("change"+e.namespace,function(){e.dynamicFilter.set.apply(e,[t.key,e.dynamicFilter.getValue(this)])}).trigger("change"+e.namespace)}(t)},getValue:function(t){var e;return"SELECT"===t.tagName?e=t.value:"INPUT"===t.tagName&&("checkbox"===t.type?e=t.checked&&t.getAttribute("value")||t.checked||null:"radio"===t.type&&t.checked&&(e=t.value)),e}},buildMultiselectLayout:function(){var e,t;this.options.multiselect&&((e=this).label.container=L("<span/>",{class:this.options.selector.labelContainer,"data-padding-left":parseFloat(this.node.css("padding-left"))||0,"data-padding-right":parseFloat(this.node.css("padding-right"))||0,"data-padding-top":parseFloat(this.node.css("padding-top"))||0,click:function(t){L(t.target).hasClass(e.options.selector.labelContainer)&&e.node.focus()}}),this.node.closest("."+this.options.selector.query).prepend(this.label.container),this.options.multiselect.data&&(Array.isArray(this.options.multiselect.data)?this.populateMultiselectData(this.options.multiselect.data):"function"==typeof this.options.multiselect.data&&(t=this.options.multiselect.data.call(this),Array.isArray(t)?this.populateMultiselectData(t):"function"==typeof t.promise&&L.when(t).then(function(t){t&&Array.isArray(t)&&e.populateMultiselectData(t)}))))},isMultiselectUniqueData:function(t){for(var e=!0,i=0,s=this.comparedItems.length;i<s;++i)if(this.comparedItems[i]===this.getMultiselectComparedData(t)){e=!1;break}return e},populateMultiselectData:function(t){for(var e=0,i=t.length;e<i;++e)this.addMultiselectItemLayout(t[e]);this.node.trigger("search"+this.namespace,{origin:"populateMultiselectData"})},addMultiselectItemLayout:function(t){var s,e;if(this.isMultiselectUniqueData(t))return this.items.push(t),this.comparedItems.push(this.getMultiselectComparedData(t)),t=this.getTemplateValue(t),e=(s=this).options.multiselect.href?"a":"span",(t=L("<span/>",{class:this.options.selector.label,html:L("<"+e+"/>",{text:t,click:function(t){var e=L(this).closest("."+s.options.selector.label),e=s.label.container.find("."+s.options.selector.label).index(e);s.options.multiselect.callback&&s.helper.executeCallback.call(s,s.options.multiselect.callback.onClick,[s.node,s.items[e],t])},href:this.options.multiselect.href?(e=s.items[s.items.length-1],s.generateHref.call(s,s.options.multiselect.href,e)):null})})).append(L("<span/>",{class:this.options.selector.cancelButton,html:"×",click:function(t){var e=L(this).closest("."+s.options.selector.label),i=s.label.container.find("."+s.options.selector.label).index(e);s.cancelMultiselectItem(i,e,t)}})),this.label.container.append(t),this.adjustInputSize(),!0},cancelMultiselectItem:function(t,e,i){var s=this.items[t];(e=e||this.label.container.find("."+this.options.selector.label).eq(t)).remove(),this.items.splice(t,1),this.comparedItems.splice(t,1),this.options.multiselect.callback&&this.helper.executeCallback.call(this,this.options.multiselect.callback.onCancel,[this.node,s,i]),this.adjustInputSize(),this.focusOnly=!0,this.node.focus().trigger("input"+this.namespace,{origin:"cancelMultiselectItem"})},adjustInputSize:function(){var i,s=this.node[0].getBoundingClientRect().width-(parseFloat(this.label.container.data("padding-right"))||0)-(parseFloat(this.label.container.css("padding-left"))||0),o=0,n=0,r=!1,a=0,t=(this.label.container.find("."+this.options.selector.label).filter(function(t,e){0===t&&(a=L(e)[0].getBoundingClientRect().height+parseFloat(L(e).css("margin-bottom")||0)),i=L(e)[0].getBoundingClientRect().width+parseFloat(L(e).css("margin-right")||0),.7*s<n+i&&!r&&(o++,r=!0),n+i<s?n+=i:(r=!1,n=i)}),parseFloat(this.label.container.data("padding-left")||0)+(r?0:n)),e=o*a+parseFloat(this.label.container.data("padding-top")||0);this.container.find("."+this.options.selector.query).find("input, textarea, [contenteditable], .typeahead__hint").css({paddingLeft:t,paddingTop:e})},showLayout:function(){!this.container.hasClass("result")&&(this.result.length||this.displayEmptyTemplate||this.options.backdropOnFocus)&&(!function(){var e=this;L("html").off("keydown"+this.namespace).on("keydown"+this.namespace,function(t){t.keyCode&&9===t.keyCode&&setTimeout(function(){L(":focus").closest(e.container).find(e.node)[0]||e.hideLayout()},0)}),L("html").off("click"+this.namespace+" touchend"+this.namespace).on("click"+this.namespace+" touchend"+this.namespace,function(t){L(t.target).closest(e.container)[0]||L(t.target).closest("."+e.options.selector.item)[0]||t.target.className===e.options.selector.cancelButton||e.hasDragged||e.hideLayout()})}.call(this),this.container.addClass([this.result.length||this.searchGroups.length&&this.displayEmptyTemplate?"result ":"",this.options.hint&&this.searchGroups.length?"hint":"",this.options.backdrop||this.options.backdropOnFocus?"backdrop":""].join(" ")),this.helper.executeCallback.call(this,this.options.callback.onShowLayout,[this.node,this.query]))},hideLayout:function(){(this.container.hasClass("result")||this.container.hasClass("backdrop"))&&(this.container.removeClass("result hint filter"+(this.options.backdropOnFocus&&L(this.node).is(":focus")?"":" backdrop")),this.options.backdropOnFocus&&this.container.hasClass("backdrop")||(L("html").off(this.namespace),this.helper.executeCallback.call(this,this.options.callback.onHideLayout,[this.node,this.query])))},resetLayout:function(){this.result=[],this.tmpResult={},this.groups=[],this.resultCount=0,this.resultCountPerGroup={},this.resultItemCount=0,this.resultHtml=null,this.options.hint&&this.hint.container&&(this.hint.container.val(""),this.isContentEditable&&this.hint.container.text(""))},resetInput:function(){this.node.val(""),this.isContentEditable&&this.node.text(""),this.query="",this.rawQuery=""},buildCancelButtonLayout:function(){var e;this.options.cancelButton&&L("<span/>",{class:(e=this).options.selector.cancelButton,html:"×",mousedown:function(t){t.stopImmediatePropagation(),t.preventDefault(),e.resetInput(),e.node.trigger("input"+e.namespace,[t])}}).insertBefore(this.node)},toggleCancelButtonVisibility:function(){this.container.toggleClass("cancel",!!this.query.length)},__construct:function(){this.extendOptions(),this.unifySourceFormat()&&(this.dynamicFilter.init.apply(this),this.init(),this.buildDropdownLayout(),this.buildDropdownItemLayout("static"),this.buildMultiselectLayout(),this.delegateEvents(),this.buildCancelButtonLayout(),this.helper.executeCallback.call(this,this.options.callback.onReady,[this.node]))},helper:{isEmpty:function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0},removeAccent:function(t){var e;if("string"==typeof t)return e=o,"object"==typeof this.options.accent&&(e=this.options.accent),t.toLowerCase().replace(new RegExp("["+e.from+"]","g"),function(t){return e.to[e.from.indexOf(t)]})},slugify:function(t){return t=""!==(t=String(t))?(t=this.helper.removeAccent.call(this,t)).replace(/[^-a-z0-9]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""):t},sort:function(s,i,o){function n(t){for(var e=0,i=s.length;e<i;e++)if(void 0!==t[s[e]])return o(t[s[e]]);return t}return i=[-1,1][+!!i],function(t,e){return t=n(t),e=n(e),i*((e<t)-(t<e))}},replaceAt:function(t,e,i,s){return t.substring(0,e)+s+t.substring(e+i)},highlight:function(t,e,i){t=String(t);var i=i&&this.helper.removeAccent.call(this,t)||t,s=[];(e=Array.isArray(e)?e:[e]).sort(function(t,e){return e.length-t.length});for(var o=e.length-1;0<=o;o--)""===e[o].trim()?e.splice(o,1):e[o]=e[o].replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");i.replace(new RegExp("(?:"+e.join("|")+")(?!([^<]+)?>)","gi"),function(t,e,i){s.push({offset:i,length:t.length})});for(o=s.length-1;0<=o;o--)t=this.helper.replaceAt(t,s[o].offset,s[o].length,"<strong>"+t.substr(s[o].offset,s[o].length)+"</strong>");return t},getCaret:function(t){var e=0;if(t.selectionStart)return t.selectionStart;if(document.selection){var i=document.selection.createRange();if(null===i)return e;var s=t.createTextRange(),o=s.duplicate();s.moveToBookmark(i.getBookmark()),o.setEndPoint("EndToStart",s),e=o.text.length}else window.getSelection&&(i=window.getSelection()).rangeCount&&(s=i.getRangeAt(0)).commonAncestorContainer.parentNode==t&&(e=s.endOffset);return e},setCaretAtEnd:function(t){var e,i;void 0!==window.getSelection&&void 0!==document.createRange?((e=document.createRange()).selectNodeContents(t),e.collapse(!1),(i=window.getSelection()).removeAllRanges(),i.addRange(e)):void 0!==document.body.createTextRange&&((i=document.body.createTextRange()).moveToElementText(t),i.collapse(!1),i.select())},cleanStringFromScript:function(t){return"string"==typeof t&&t.replace(/<\/?(?:script|iframe)\b[^>]*>/gm,"")||t},executeCallback:function(t,e){if(t){var i;if("function"==typeof t)i=t;else if(("string"==typeof t||Array.isArray(t))&&"function"!=typeof(i=this.helper.namespace.call(this,(t="string"==typeof t?[t,[]]:t)[0],window)))return;return i.apply(this,(t[1]||[]).concat(e||[]))}},namespace:function(t,e,i,s){if("string"!=typeof t||""===t)return!1;var o=void 0!==s?s:void 0;if(!~t.indexOf("."))return e[t]||o;for(var n,r=t.split("."),a=e||window,i=i||"get",l=0,h=r.length;l<h;l++){if(void 0===a[n=r[l]]){if(~["get","delete"].indexOf(i))return void 0!==s?s:void 0;a[n]={}}if(~["set","create","delete"].indexOf(i)&&l===h-1){if("set"!==i&&"create"!==i)return delete a[n],!0;a[n]=o}a=a[n]}return a},typeWatch:(i=0,function(t,e){clearTimeout(i),i=setTimeout(t,e)})}},L.fn.typeahead=L.typeahead=function(t){return e.typeahead(this,t)},{typeahead:function(t,e){if(e&&e.source&&"object"==typeof e.source){if("function"==typeof t){if(!e.input)return;t=L(e.input)}if(t.length){if(void 0===t[0].value&&(t[0].value=t.text()),1===t.length)return t[0].selector=t.selector||e.input||t[0].nodeName.toLowerCase(),window.Typeahead[t[0].selector]=new r(t,e);for(var i,s={},o=0,n=t.length;o<n;++o)void 0!==s[i=t[o].nodeName.toLowerCase()]&&(i+=o),t[o].selector=i,window.Typeahead[i]=s[i]=new r(t.eq(o),e);return s}}}});return window.console=window.console||{log:function(){}},Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),"trim"in String.prototype||(String.prototype.trim=function(){return this.replace(/^\s+/,"").replace(/\s+$/,"")}),"indexOf"in Array.prototype||(Array.prototype.indexOf=function(t,e){(e=void 0===e?0:e)<0&&(e+=this.length),e<0&&(e=0);for(var i=this.length;e<i;e++)if(e in this&&this[e]===t)return e;return-1}),Object.keys||(Object.keys=function(t){var e,i=[];for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&i.push(e);return i}),r});
@@ -0,0 +1,94 @@
1
+ # Cherrypy-foundation
2
+ # Copyright (C) 2020-2026 IKUS Software
3
+ #
4
+ # This program is free software: you can redistribute it and/or modify
5
+ # it under the terms of the GNU General Public License as published by
6
+ # the Free Software Foundation, either version 3 of the License, or
7
+ # (at your option) any later version.
8
+ #
9
+ # This program is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ # GNU General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU General Public License
15
+ # along with this program. If not, see <https://www.gnu.org/licenses/>.
16
+
17
+ import json
18
+ import logging
19
+
20
+ import cherrypy
21
+
22
+ HTML_ERROR_TEMPLATE = '''<!DOCTYPE html>
23
+ <html>
24
+ <head>
25
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
26
+ <title>%(status)s</title>
27
+ <style type="text/css">
28
+ #powered_by {
29
+ margin-top: 20px;
30
+ border-top: 2px solid black;
31
+ font-style: italic;
32
+ }
33
+
34
+ #traceback {
35
+ color: red;
36
+ }
37
+ </style>
38
+ </head>
39
+ <body>
40
+ <h2>%(status)s</h2>
41
+ <p>%(message)s</p>
42
+ <pre id="traceback">%(traceback)s</pre>
43
+ <div id="powered_by">
44
+ <span>
45
+ Powered by <a href="http://www.cherrypy.dev">CherryPy %(version)s</a>
46
+ </span>
47
+ </div>
48
+ </body>
49
+ </html>
50
+ '''
51
+
52
+
53
+ def error_page(status='', message='', traceback='', version=''):
54
+ """
55
+ Error page handler to handle Plain Text (text/plain), Json (application/json) or HTML (text/html) output.
56
+
57
+ If available, uses Jina2 environment to generate error page using `error_page.html`.
58
+ """
59
+ # Log server error exception
60
+ if status.startswith('500'):
61
+ cherrypy.log(
62
+ f'error page status={status} message={message}\n{traceback}', context='ERROR-PAGE', severity=logging.WARNING
63
+ )
64
+
65
+ # Replace message by generic one for 404. Default implementation leak path info.
66
+ if status == '404 Not Found' and cherrypy.serving.request.path_info in message:
67
+ message = 'Nothing matches the given URI'
68
+
69
+ # Check expected response type.
70
+ mtype = cherrypy.serving.response.headers.get('Content-Type') or cherrypy.tools.accept.callable(
71
+ ['text/html', 'text/plain', 'application/json']
72
+ )
73
+ if mtype == 'text/plain':
74
+ return message
75
+ elif mtype == 'application/json':
76
+ return json.dumps({'message': message, 'status': status})
77
+ elif mtype == 'text/html':
78
+ context = {'status': status, 'message': message, 'traceback': traceback, 'version': version}
79
+ if hasattr(cherrypy.tools, 'jinja2'):
80
+ # Try to build a nice error page with Jinja2 env
81
+ try:
82
+ return cherrypy.tools.jinja2.render_request(template='error_page.html', context=context)
83
+ except Exception:
84
+ cherrypy.log(
85
+ 'fail to render error page with jinja2',
86
+ context='ERROR-PAGE',
87
+ severity=logging.ERROR,
88
+ traceback=True,
89
+ )
90
+ # Fallback to built-int HTML error page
91
+ return HTML_ERROR_TEMPLATE % context
92
+
93
+ # Fallback to raw error message.
94
+ return message
@@ -0,0 +1,50 @@
1
+ # Cherrypy-foundation
2
+ # Copyright (C) 2020-2026 IKUS Software
3
+ #
4
+ # This program is free software: you can redistribute it and/or modify
5
+ # it under the terms of the GNU General Public License as published by
6
+ # the Free Software Foundation, either version 3 of the License, or
7
+ # (at your option) any later version.
8
+ #
9
+ # This program is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ # GNU General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU General Public License
15
+ # along with this program. If not, see <https://www.gnu.org/licenses/>.
16
+
17
+ from collections import namedtuple
18
+
19
+ from cherrypy_foundation.sessions import session_lock
20
+
21
+ FlashMessage = namedtuple('FlashMessage', ['message', 'level'])
22
+
23
+
24
+ def flash(message, level='info'):
25
+ """
26
+ Add a flash message to the session.
27
+ """
28
+ assert message
29
+ assert level in ['info', 'error', 'warning', 'success']
30
+ with session_lock() as session:
31
+ if 'flash' not in session:
32
+ session['flash'] = []
33
+ # Support Markup and string
34
+ if hasattr(message, '__html__'):
35
+ flash_message = FlashMessage(message, level)
36
+ else:
37
+ flash_message = FlashMessage(str(message), level)
38
+ session['flash'].append(flash_message)
39
+
40
+
41
+ def get_flashed_messages():
42
+ """
43
+ Return all flash message.
44
+ """
45
+ with session_lock() as session:
46
+ if 'flash' in session:
47
+ messages = session['flash']
48
+ del session['flash']
49
+ return messages
50
+ return []
@@ -0,0 +1,119 @@
1
+ # Cherrypy-foundation
2
+ # Copyright (C) 2020-2026 IKUS Software
3
+ #
4
+ # This program is free software: you can redistribute it and/or modify
5
+ # it under the terms of the GNU General Public License as published by
6
+ # the Free Software Foundation, either version 3 of the License, or
7
+ # (at your option) any later version.
8
+ #
9
+ # This program is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ # GNU General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU General Public License
15
+ # along with this program. If not, see <https://www.gnu.org/licenses/>.
16
+
17
+ import cherrypy
18
+ from markupsafe import Markup
19
+ from wtforms.form import Form
20
+
21
+
22
+ class _ProxyFormdata:
23
+ """
24
+ Custom class to proxy default form data into WTForm from cherrypy variables.
25
+ """
26
+
27
+ def __contains__(self, key):
28
+ return key in cherrypy.request.params
29
+
30
+ def getlist(self, key):
31
+ # Default to use cherrypy params.
32
+ params = cherrypy.request.params
33
+ if key in params:
34
+ if isinstance(params[key], list):
35
+ return params[key]
36
+ else:
37
+ return [params[key]]
38
+ # Return default empty list.
39
+ return []
40
+
41
+ def __iter__(self):
42
+ return iter(cherrypy.request.params)
43
+
44
+
45
+ _AUTO = _ProxyFormdata()
46
+
47
+
48
+ class CherryForm(Form):
49
+ """
50
+ Custom implementation of WTForm for cherrypy to support kwargs parms.
51
+
52
+ If ``formdata`` is not specified, this will use cherrypy.request.params
53
+ Explicitly pass ``formdata=None`` to prevent this.
54
+ """
55
+
56
+ def __init__(self, **kwargs):
57
+ # Seamlessly support Json input if available.
58
+ if 'json' in kwargs and kwargs.pop('json'):
59
+ cherrypy.request.params = getattr(cherrypy.request, 'json', cherrypy.request.params)
60
+ # Support explicit formdata
61
+ if 'formdata' in kwargs:
62
+ formdata = kwargs.pop('formdata')
63
+ else:
64
+ formdata = _AUTO if CherryForm.is_submitted(self) else None
65
+ super().__init__(formdata=formdata, **kwargs)
66
+
67
+ def is_submitted(self):
68
+ """
69
+ Consider the form submitted if there is an active request and
70
+ the method is ``POST``.
71
+ """
72
+ return cherrypy.request.method == 'POST'
73
+
74
+ def strict_validate(self):
75
+ """
76
+ Special validation to verify if all the field submited exists in this form.
77
+ Raise an error if some fields are unknown.
78
+ """
79
+ form_errors = self.form_errors if hasattr(self, 'form_errors') else self.errors.setdefault(None, [])
80
+ for key in cherrypy.request.params.keys():
81
+ if key not in self:
82
+ form_errors.append("unsuported field: %s" % key)
83
+ return False
84
+ return self.validate()
85
+
86
+ def validate_on_submit(self):
87
+ """
88
+ Call `validate` only if the form is submitted.
89
+ This is a shortcut for ``form.is_submitted() and form.validate()``.
90
+ """
91
+ return self.is_submitted() and self.validate()
92
+
93
+ @property
94
+ def error_message(self):
95
+ """
96
+ Return all error message in a single string.
97
+ """
98
+ if self.errors:
99
+ msg = Markup("")
100
+ for field, messages in self.errors.items():
101
+ if msg:
102
+ msg += Markup('<br/>')
103
+ # Field name
104
+ if field in self:
105
+ msg += "%s: " % self[field].label.text
106
+ elif field:
107
+ msg += "%s: " % field
108
+ for m in messages:
109
+ msg += m
110
+ return msg
111
+
112
+ def populate_obj(self, obj):
113
+ """
114
+ Override default implementation to take acount of readonly fields.
115
+ """
116
+ for name, field in self._fields.items():
117
+ if field.render_kw and field.render_kw.get('readonly'):
118
+ continue
119
+ field.populate_obj(obj, name)
@@ -0,0 +1,103 @@
1
+ # Cherrypy-foundation
2
+ # Copyright (C) 2026 IKUS Software
3
+ #
4
+ # This program is free software: you can redistribute it and/or modify
5
+ # it under the terms of the GNU General Public License as published by
6
+ # the Free Software Foundation, either version 3 of the License, or
7
+ # (at your option) any later version.
8
+ #
9
+ # This program is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ # GNU General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU General Public License
15
+ # along with this program. If not, see <https://www.gnu.org/licenses/>.
16
+
17
+ import logging
18
+ import logging.handlers
19
+ import sys
20
+
21
+ import cherrypy
22
+
23
+
24
+ def _coerce_level(level):
25
+ if isinstance(level, int):
26
+ return level
27
+ if isinstance(level, str):
28
+ lvl = logging._nameToLevel.get(level.upper())
29
+ if isinstance(lvl, int):
30
+ return lvl
31
+ raise ValueError(f"Invalid log level: {level!r}")
32
+
33
+
34
+ def _remove_cherrypy_date(record):
35
+ """Remove the leading date for cherrypy error."""
36
+ if record.name.startswith('cherrypy.error'):
37
+ record.msg = record.msg[23:].strip()
38
+ return True
39
+
40
+
41
+ def _add_ip(record):
42
+ """Add request IP to record."""
43
+ # Check if we are serving a real request
44
+ if cherrypy.request and cherrypy.request.request_line:
45
+ remote = cherrypy.request.remote
46
+ record.ip = remote.name or remote.ip
47
+ else:
48
+ record.ip = "-"
49
+ return True
50
+
51
+
52
+ def _add_username(record):
53
+ """Add current username to record."""
54
+ # Check if we are serving a real request
55
+ if cherrypy.request and cherrypy.request.request_line:
56
+ if cherrypy.request.login:
57
+ record.user = cherrypy.request.login
58
+ else:
59
+ record.user = "anonymous"
60
+ else:
61
+ record.user = "-"
62
+ return True
63
+
64
+
65
+ def setup_logging(log_file, log_access_file, level):
66
+ """
67
+ Configure the logging system for CherryPy.
68
+ Safe to call multiple times.
69
+ """
70
+ lvl = _coerce_level(level)
71
+
72
+ cherrypy.config.update({'log.screen': False, 'log.access_file': '', 'log.error_file': ''})
73
+ cherrypy.engine.unsubscribe('graceful', cherrypy.log.reopen_files)
74
+
75
+ # Configure root logger
76
+ logger = logging.getLogger('')
77
+ logger.level = lvl
78
+ # Capture warnings
79
+ logging.captureWarnings(True)
80
+ if log_file:
81
+ print("continue logging to %s" % log_file)
82
+ default_handler = logging.handlers.RotatingFileHandler(log_file, maxBytes=10485760, backupCount=20)
83
+ else:
84
+ default_handler = logging.StreamHandler(sys.stdout)
85
+ default_handler.addFilter(_remove_cherrypy_date)
86
+ default_handler.addFilter(_add_ip)
87
+ default_handler.addFilter(_add_username)
88
+ default_handler.setFormatter(
89
+ logging.Formatter("[%(asctime)s][%(levelname)-7s][%(ip)s][%(user)s][%(threadName)s][%(name)s] %(message)s")
90
+ )
91
+ logger.addHandler(default_handler)
92
+
93
+ # Configure cherrypy access logger
94
+ cherrypy_access = logging.getLogger('cherrypy.access')
95
+ cherrypy_access.propagate = False
96
+ if log_access_file:
97
+ handler = logging.handlers.RotatingFileHandler(log_access_file, maxBytes=10485760, backupCount=20)
98
+ cherrypy_access.addHandler(handler)
99
+
100
+ # Configure cherrypy error logger
101
+ cherrypy_error = logging.getLogger('cherrypy.error')
102
+ cherrypy_error.propagate = False
103
+ cherrypy_error.addHandler(default_handler)