/**
 * Highcharts JS v12.5.0 (2026-01-12)
 * @module highcharts/modules/pictorial
 * @requires highcharts
 *
 * Pictorial graph series type for Highcharts
 *
 * (c) 2010-2026 Highsoft AS
 * Author: Torstein Honsi, Magdalena Gut
 *
 * A commercial license may be required depending on use.
 * See www.highcharts.com/license
 */import*as t from"../highcharts.js";var e={};e.n=t=>{var i=t&&t.__esModule?()=>t.default:()=>t;return e.d(i,{a:i}),i},e.d=(t,i)=>{for(var r in i)e.o(i,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:i[r]})},e.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);let i=t.default;var r=e.n(i);e.d({},{});let{animObject:a}=r(),{getOptions:s}=r(),{addEvent:o,defined:n,erase:h,extend:l,merge:d,pick:p,removeEvent:c,wrap:f}=r(),g=function(){let t=[],e=s().colors,i=0;for(let r of["M 0 0 L 5 5 M 4.5 -0.5 L 5.5 0.5 M -0.5 4.5 L 0.5 5.5","M 0 5 L 5 0 M -0.5 0.5 L 0.5 -0.5 M 4.5 5.5 L 5.5 4.5","M 2 0 L 2 5 M 4 0 L 4 5","M 0 2 L 5 2 M 0 4 L 5 4","M 0 1.5 L 2.5 1.5 L 2.5 0 M 2.5 5 L 2.5 3.5 L 5 3.5"])t.push({path:r,color:e[i++],width:5,height:5,patternTransform:"scale(1.4 1.4)"});for(let r of(i=5,["M 0 0 L 5 10 L 10 0","M 3 3 L 8 3 L 8 8 L 3 8 Z","M 5 5 m -4 0 a 4 4 0 1 1 8 0 a 4 4 0 1 1 -8 0","M 0 0 L 10 10 M 9 -1 L 11 1 M -1 9 L 1 11","M 0 10 L 10 0 M -1 1 L 1 -1 M 9 11 L 11 9"]))t.push({path:r,color:e[i++],width:10,height:10});return t}();function u(t,e){let i=JSON.stringify(t),r=i.length||0,a=0,s=0,o;if(e){o=Math.max(Math.floor(r/500),1);for(let t=0;t<r;t+=o)a+=i.charCodeAt(t);a&=a}for(;s<r;++s)a=(a<<5)-a+i.charCodeAt(s),a&=a;return a.toString(16).replace("-","1")}function m(){if(this.renderer&&(this.renderer.defIds||[]).filter(t=>t&&t.indexOf&&0===t.indexOf("highcharts-pattern-")).length){for(let t of this.series)if(t.visible)for(let e of t.points){let t=e.options&&e.options.color;t&&t.pattern&&(t.pattern._width="defer",t.pattern._height="defer")}this.redraw(!1)}}function x(){let t={},e=this.renderer,i=(e.defIds||[]).filter(t=>t.indexOf&&0===t.indexOf("highcharts-pattern-"));if(i.length)for(let r of([].forEach.call(this.renderTo.querySelectorAll('[color^="url("], [fill^="url("], [stroke^="url("]'),i=>{let r=i.getAttribute("fill")||i.getAttribute("color")||i.getAttribute("stroke");r&&(t[r.replace(e.url,"").replace("url(#","").replace(")","")]=!0)}),i))!t[r]&&(h(e.defIds,r),e.patternElements[r]&&(e.patternElements[r].destroy(),delete e.patternElements[r]))}function w(){let t=this.options.color;t&&t.pattern&&("string"==typeof t.pattern.path&&(t.pattern.path={d:t.pattern.path}),this.color=this.options.color=d(this.series.options.color,t))}function y(t){let e=t.args[0],i=t.args[1],r=t.args[2],a=this.chartIndex||0,s=e.pattern,o="#333333";if(void 0!==e.patternIndex&&g&&(s=g[e.patternIndex]),!s)return!0;if(s.image||"string"==typeof s.path||s.path&&s.path.d){let t=r.parentNode&&r.parentNode.getAttribute("class");t=t&&t.indexOf("highcharts-legend")>-1,("defer"===s._width||"defer"===s._height)&&A.call({graphic:{element:r}},s),(t||!s.id)&&((s=d({},s)).id="highcharts-pattern-"+a+"-"+u(s)+u(s,!0)),this.addPattern(s,!this.forExport&&p(s.animation,this.globalAnimation,{duration:100})),o=`url(${this.url}#${s.id+(this.forExport?"-export":"")})`}else o=s.color||o;return r.setAttribute(i,o),e.toString=function(){return o},!1}function b(){let t=this.chart.isResizing;if(this.isDirtyData||t||!this.chart.hasRendered)for(let e of this.points){let i=e.options&&e.options.color;i&&i.pattern&&(t&&!(e.shapeArgs&&e.shapeArgs.width&&e.shapeArgs.height)?(i.pattern._width="defer",i.pattern._height="defer"):e.calculatePatternDimensions(i.pattern))}}function A(t){if(t.width&&t.height)return;let e=this.graphic&&(this.graphic.getBBox&&this.graphic.getBBox(!0)||this.graphic.element&&this.graphic.element.getBBox())||{},i=this.shapeArgs;if(i&&(e.width=i.width||e.width,e.height=i.height||e.height,e.x=i.x||e.x,e.y=i.y||e.y),t.image){if(!e.width||!e.height){t._width="defer",t._height="defer";let e=this.series.chart.mapView&&this.series.chart.mapView.getSVGTransform().scaleY;n(e)&&e<0&&(t._inverted=!0);return}t.aspectRatio&&(e.aspectRatio=e.width/e.height,t.aspectRatio>e.aspectRatio?e.aspectWidth=e.height*t.aspectRatio:e.aspectHeight=e.width/t.aspectRatio),t._width=t.width||Math.ceil(e.aspectWidth||e.width),t._height=t.height||Math.ceil(e.aspectHeight||e.height)}t.width||(t._x=t.x||0,t._x+=e.x-Math.round(e.aspectWidth?Math.abs(e.aspectWidth-e.width)/2:0)),t.height||(t._y=t.y||0,t._y+=e.y-Math.round(e.aspectHeight?Math.abs(e.aspectHeight-e.height)/2:0))}function M(t,e){let i=p(e,!0),s=a(i),o=t.color||"#333333",n=t.height||("number"==typeof t._height?t._height:0)||32,h=t=>this.rect(0,0,l,n).attr({fill:t}).add(m),l=t.width||("number"==typeof t._width?t._width:0)||32,d,f=t.id,g;if(!f&&(this.idCounter=this.idCounter||0,f="highcharts-pattern-"+this.idCounter+"-"+(this.chartIndex||0),++this.idCounter),this.forExport&&(f+="-export"),this.defIds=this.defIds||[],this.defIds.indexOf(f)>-1)return;this.defIds.push(f);let u={id:f,patternUnits:"userSpaceOnUse",patternContentUnits:t.patternContentUnits||"userSpaceOnUse",width:l,height:n,x:t._x||t.x||0,y:t._y||t.y||0};t._inverted&&(u.patternTransform="scale(1, -1)",t.patternTransform&&(t.patternTransform+=" scale(1, -1)")),t.patternTransform&&(u.patternTransform=t.patternTransform);let m=this.createElement("pattern").attr(u).add(this.defs);return m.id=f,t.path?(g=r().isObject(t.path)?t.path:{d:t.path},t.backgroundColor&&h(t.backgroundColor),d={d:g.d},this.styledMode||(d.stroke=g.stroke||o,d["stroke-width"]=p(g.strokeWidth,2),d.fill=g.fill||"none"),g.transform&&(d.transform=g.transform),this.createElement("path").attr(d).add(m),m.color=o):t.image&&(i?this.image(t.image,0,0,l,n,function(){this.animate({opacity:p(t.opacity,1)},s),c(this.element,"load")}).attr({opacity:0}).add(m):this.image(t.image,0,0,l,n).add(m)),t.image&&i||void 0===t.opacity||[].forEach.call(m.element.childNodes,e=>{e.setAttribute("opacity",t.opacity)}),this.patternElements=this.patternElements||{},this.patternElements[f]=m,m}function C(t){let e=this.options.color;e&&e.pattern&&!e.pattern.color?(delete this.options.color,t.apply(this,[].slice.call(arguments,1)),e.pattern.color=this.color,this.color=this.options.color=e):t.apply(this,[].slice.call(arguments,1))}function k(){if(!this.chart?.mapView)return;let t=this.chart.renderer,e=t.patternElements;t.defIds?.length&&e&&this.points.filter(function(t){return!!t.graphic&&(t.graphic.element.hasAttribute("fill")||t.graphic.element.hasAttribute("color")||t.graphic.element.hasAttribute("stroke"))&&!t.options.color?.pattern?.image&&!!t.group?.scaleX&&!!t.group?.scaleY}).map(function(e){return{id:(e.graphic?.element.getAttribute("fill")||e.graphic?.element.getAttribute("color")||e.graphic?.element.getAttribute("stroke")||"").replace(t.url,"").replace("url(#","").replace(")",""),x:e.group?.scaleX||1,y:e.group?.scaleY||1}}).filter(function(t,e,i){return""!==t.id&&-1!==t.id.indexOf("highcharts-pattern-")&&!i.some(function(i,r){return i.id===t.id&&r<e})}).forEach(function(t){let i=t.id;e[i].scaleX=1/t.x,e[i].scaleY=1/t.y,e[i].updateTransform("patternTransform")})}let v=t.default.Chart;var E=e.n(v);let L=t.default.SeriesRegistry;var _=e.n(L);let{defined:O}=r(),S={rescalePatternFill:function(t,e,i,r,a=1){let s=t&&t.attr("fill"),o=s&&s.match(/url\(([^)]+)\)/);if(o){let s=document.querySelector(`${o[1]} path`);if(s){let o=s.getBBox();if(0===o.width){let e=s.parentElement;t.renderer.box.appendChild(s),o=s.getBBox(),e.appendChild(s)}let n=1/(o.width+a),h=e/r/o.height,l=o.width/o.height,d=i/e,p=-o.width/2;l<d&&(n=n*l/d),s.setAttribute("stroke-width",a/(i*n)),s.setAttribute("transform",`translate(0.5, 0)scale(${n} ${h}) translate(${p+a*n/2}, ${-o.y})`)}}},invertShadowGroup:function(t,e){let i=e.chart.inverted;i&&t.attr({rotation:90*!!i,scaleX:i?-1:1})},getStackMetrics:function(t,e){let i=t.len,r=0;return e&&O(e.max)&&(r=t.toPixels(e.max,!0),i=t.len-r),{height:i,y:r}}},G=_().seriesTypes.column.prototype.pointClass,{rescalePatternFill:B,getStackMetrics:W}=S,D=class extends G{setState(){super.setState.apply(this,arguments);let t=this.series,e=t.options.paths;if(this.graphic&&this.shapeArgs&&e){let i=e[this.index%e.length];B(this.graphic,W(t.yAxis,i).height,this.shapeArgs.width||0,this.shapeArgs.height||1/0,this.series.options.borderWidth||0)}}},I=t.default.Series;var R=e.n(I);let T=t.default.StackItem;var P=e.n(T);let j=t.default.SVGRenderer;var U=e.n(j);let X=_().seriesTypes.column;({compose:function(t,e,i){let r=e.prototype.pointClass,a=r.prototype;a.calculatePatternDimensions||(o(t,"endResize",m),o(t,"redraw",x),l(a,{calculatePatternDimensions:A}),o(r,"afterInit",w),o(e,"render",b),f(e.prototype,"getColor",C),o(e,"afterRender",k),o(e,"mapZoomComplete",k),l(i.prototype,{addPattern:M}),o(i,"complexColor",y))},patterns:g}).compose(E(),R(),U());let{animObject:$}=r(),{getStackMetrics:Y,invertShadowGroup:F,rescalePatternFill:V}=S,{addEvent:H,defined:N,merge:q,objectEach:z,pick:Z}=r();class J extends X{animate(t){let{chart:e,group:i}=this,r=$(this.options.animation),a=[this.getSharedClipKey(),r.duration,r.easing,r.defer].join(","),s=e.sharedClips[a];if(t&&i){let t=e.getClipBox(this);s||(t.y=t.height,t.height=0,s=e.renderer.clipRect(t),e.sharedClips[a]=s),i.clip(s)}else if(s&&!s.hasClass("highcharts-animating")){let t=e.getClipBox(this);s.addClass("highcharts-animating").animate(t,r)}}animateDrilldown(){}animateDrillupFrom(){}pointAttribs(t){let e=super.pointAttribs.apply(this,arguments),i=this.options.paths;if(t&&t.shapeArgs&&i){let r=i[t.index%i.length],{y:a,height:s}=Y(this.yAxis,r),o=r.definition;o!==t.pathDef?(t.pathDef=o,e.fill={pattern:{path:{d:o,fill:e.fill,strokeWidth:e["stroke-width"],stroke:e.stroke},x:t.shapeArgs.x,y:a,width:t.shapeArgs.width||0,height:s,patternContentUnits:"objectBoundingBox",backgroundColor:"none",color:"#ff0000"}}):t.pathDef&&t.graphic&&delete e.fill}return delete e.stroke,delete e.strokeWidth,e}getExtremes(){let t=super.getExtremes.apply(this,arguments),e=this.options.paths;return e&&e.forEach(function(e){N(e.max)&&N(t.dataMax)&&e.max>t.dataMax&&(t.dataMax=e.max)}),t}}function K(t){let e=Object.keys(t.points).filter(t=>t.split(",").length>1),i=t.axis.chart.series,r=e.map(t=>parseFloat(t.split(",")[0])),a=-1;r.forEach(t=>{i[t]&&i[t].visible&&(a=t)});let s=t.axis.chart.series[a];if(s&&s.is("pictorial")&&t.axis.hasData()&&s.xAxis.hasData()){let e=s.xAxis,i=t.axis.options,r=t.axis.chart,a=t.shadow,o=e.toPixels(t.x,!0),n=r.inverted?e.len-o:o,h=s.options.paths||[],l=t.x%h.length,d=h[l],p=s.getColumnMetrics&&s.getColumnMetrics().width,{height:c,y:f}=Y(s.yAxis,d),g=i.stackShadow,u=Z(g&&g.borderWidth,s.options.borderWidth,1);if(!a&&g&&g.enabled&&d)t.shadowGroup||(t.shadowGroup=r.renderer.g("shadow-group").add()),t.shadowGroup.attr({translateX:r.inverted?t.axis.pos:e.pos,translateY:r.inverted?e.pos:t.axis.pos}),t.shadow=r.renderer.rect(n,f,p,c).attr({fill:{pattern:{path:{d:d.definition,fill:g.color||"#dedede",strokeWidth:u,stroke:g.borderColor||"transparent"},x:n,y:f,width:p,height:c,patternContentUnits:"objectBoundingBox",backgroundColor:"none",color:"#dedede"}}}).add(t.shadowGroup),F(t.shadowGroup,t.axis),V(t.shadow,c,p,c,u),t.setOffset(s.pointXOffset||0,s.barW||0);else if(a&&t.shadowGroup){a.animate({x:n,y:f,width:p,height:c});let i=a.attr("fill"),o=i&&i.match(/url\(([^)]+)\)/);o&&r.renderer.patternElements&&r.renderer.patternElements[o[1].slice(1)].animate({x:n,y:f,width:p,height:c}),t.shadowGroup.animate({translateX:r.inverted?t.axis.pos:e.pos,translateY:r.inverted?e.pos:t.axis.pos}),F(t.shadowGroup,t.axis),V(a,c,p,c,u),t.setOffset(s.pointXOffset||0,s.barW||0)}}else t.shadow&&t.shadowGroup&&(t.shadow.destroy(),t.shadow=void 0,t.shadowGroup.destroy(),t.shadowGroup=void 0)}function Q(t,e){t.axes&&t.axes.forEach(function(t){t.stacking&&z(t.stacking.stacks,function(t){z(t,function(t){e(t)})})})}function tt(t){Q(t,function(t){t.shadow&&t.shadowGroup&&(t.shadow.destroy(),t.shadowGroup.destroy(),delete t.shadow,delete t.shadowGroup)})}J.defaultOptions=q(X.defaultOptions,{borderWidth:0}),H(J,"afterRender",function(){let t=this,e=t.options.paths,i=/url\(([^)]+)\)/;t.points.forEach(function(r){if(r.graphic&&r.shapeArgs&&e){let a=e[r.index%e.length],s=r.graphic.attr("fill"),o=s&&s.match(i),{y:n,height:h}=Y(t.yAxis,a);if(o&&t.chart.renderer.patternElements){let e=t.chart.renderer.patternElements[o[1].slice(1)];e&&e.animate({x:r.shapeArgs.x,y:n,width:r.shapeArgs.width||0,height:h})}V(r.graphic,Y(t.yAxis,a).height,r.shapeArgs.width||0,r.shapeArgs.height||1/0,t.options.borderWidth||0)}})}),H(E(),"render",function(){Q(this,K)}),H(P(),"afterSetOffset",function(t){if(this.shadow){let{chart:e,len:i}=this.axis,{xOffset:r,width:a}=t,s=e.inverted?r-e.xAxis[0].len:r,o=e.inverted?-i:0;this.shadow.attr({translateX:s,translateY:o}),this.shadow.animate({width:a})}}),H(E(),"afterDrilldown",function(){tt(this)}),H(E(),"afterDrillUp",function(){tt(this)}),J.prototype.pointClass=D,_().registerSeriesType("pictorial",J);let te=r();export{te as default};